Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352215
b: refs/heads/master
c: f1626fd
h: refs/heads/master
i:
  352213: d81a03a
  352211: 094acfd
  352207: f7bfd2b
v: v3
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Dec 11, 2012
1 parent fd7e0c5 commit 00d09a6
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c91ec5f3ada86807ea4857fc5793a4efe99c9de3
refs/heads/master: f1626fd8983a5bc68ce2879865cce297eb96c0b4
22 changes: 22 additions & 0 deletions trunk/drivers/net/wireless/ti/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,26 @@ static int wl12xx_set_peer_cap(struct wl1271 *wl,
hlid);
}

static bool wl12xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
u8 thold;

if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
thold = wl->conf.tx.fast_link_thold;
else
thold = wl->conf.tx.slow_link_thold;

return lnk->allocated_pkts < thold;
}

static bool wl12xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
/* any link is good for low priority */
return true;
}

static int wl12xx_setup(struct wl1271 *wl);

static struct wlcore_ops wl12xx_ops = {
Expand Down Expand Up @@ -1663,6 +1683,8 @@ static struct wlcore_ops wl12xx_ops = {
.channel_switch = wl12xx_cmd_channel_switch,
.pre_pkt_send = NULL,
.set_peer_cap = wl12xx_set_peer_cap,
.lnk_high_prio = wl12xx_lnk_high_prio,
.lnk_low_prio = wl12xx_lnk_low_prio,
};

static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
Expand Down
41 changes: 41 additions & 0 deletions trunk/drivers/net/wireless/ti/wl18xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,45 @@ static int wl18xx_set_peer_cap(struct wl1271 *wl,
rate_set, hlid);
}

static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
u8 thold;
struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status_2->priv;
u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);

/* suspended links are never high priority */
if (test_bit(hlid, (unsigned long *)&suspend_bitmap))
return false;

/* the priority thresholds are taken from FW */
if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
thold = status_priv->tx_fast_link_prio_threshold;
else
thold = status_priv->tx_slow_link_prio_threshold;

return lnk->allocated_pkts < thold;
}

static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
u8 thold;
struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status_2->priv;
u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);

if (test_bit(hlid, (unsigned long *)&suspend_bitmap))
thold = status_priv->tx_suspend_threshold;
else if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
thold = status_priv->tx_fast_stop_threshold;
else
thold = status_priv->tx_slow_stop_threshold;

return lnk->allocated_pkts < thold;
}

static int wl18xx_setup(struct wl1271 *wl);

static struct wlcore_ops wl18xx_ops = {
Expand Down Expand Up @@ -1434,6 +1473,8 @@ static struct wlcore_ops wl18xx_ops = {
.pre_pkt_send = wl18xx_pre_pkt_send,
.sta_rc_update = wl18xx_sta_rc_update,
.set_peer_cap = wl18xx_set_peer_cap,
.lnk_high_prio = wl18xx_lnk_high_prio,
.lnk_low_prio = wl18xx_lnk_low_prio,
};

/* HT cap appropriate for wide channels in 2Ghz */
Expand Down
38 changes: 37 additions & 1 deletion trunk/drivers/net/wireless/ti/wl18xx/wl18xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,43 @@ struct wl18xx_fw_status_priv {
*/
u8 released_tx_desc[WL18XX_FW_MAX_TX_STATUS_DESC];

u8 padding[2];
/* A bitmap representing the currently suspended links. The suspend
* is short lived, for multi-channel Tx requirements.
*/
__le32 link_suspend_bitmap;

/* packet threshold for an "almost empty" AC,
* for Tx schedulng purposes
*/
u8 tx_ac_threshold;

/* number of packets to queue up for a link in PS */
u8 tx_ps_threshold;

/* number of packet to queue up for a suspended link */
u8 tx_suspend_threshold;

/* Should have less than this number of packets in queue of a slow
* link to qualify as high priority link
*/
u8 tx_slow_link_prio_threshold;

/* Should have less than this number of packets in queue of a fast
* link to qualify as high priority link
*/
u8 tx_fast_link_prio_threshold;

/* Should have less than this number of packets in queue of a slow
* link before we stop queuing up packets for it.
*/
u8 tx_slow_stop_threshold;

/* Should have less than this number of packets in queue of a fast
* link before we stop queuing up packets for it.
*/
u8 tx_fast_stop_threshold;

u8 padding[3];
};

#define WL18XX_PHY_VERSION_MAX_LEN 20
Expand Down
20 changes: 20 additions & 0 deletions trunk/drivers/net/wireless/ti/wlcore/hw_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,24 @@ wlcore_hw_set_peer_cap(struct wl1271 *wl,
return 0;
}

static inline bool
wlcore_hw_lnk_high_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
if (!wl->ops->lnk_high_prio)
BUG_ON(1);

return wl->ops->lnk_high_prio(wl, hlid, lnk);
}

static inline bool
wlcore_hw_lnk_low_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
if (!wl->ops->lnk_low_prio)
BUG_ON(1);

return wl->ops->lnk_low_prio(wl, hlid, lnk);
}

#endif
18 changes: 3 additions & 15 deletions trunk/drivers/net/wireless/ti/wlcore/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,28 +509,16 @@ static struct sk_buff *wlcore_lnk_dequeue(struct wl1271 *wl,
return skb;
}

static bool wlcore_lnk_high_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
u8 thold;

if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
thold = wl->conf.tx.fast_link_thold;
else
thold = wl->conf.tx.slow_link_thold;

return lnk->allocated_pkts < thold;
}

static struct sk_buff *wlcore_lnk_dequeue_high_prio(struct wl1271 *wl,
u8 hlid, u8 ac,
u8 *low_prio_hlid)
{
struct wl1271_link *lnk = &wl->links[hlid];

if (!wlcore_lnk_high_prio(wl, hlid, lnk)) {
if (!wlcore_hw_lnk_high_prio(wl, hlid, lnk)) {
if (*low_prio_hlid == WL12XX_INVALID_LINK_ID &&
!skb_queue_empty(&lnk->tx_queue[ac]))
!skb_queue_empty(&lnk->tx_queue[ac]) &&
wlcore_hw_lnk_low_prio(wl, hlid, lnk))
/* we found the first non-empty low priority queue */
*low_prio_hlid = hlid;

Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/wireless/ti/wlcore/wlcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ struct wlcore_ops {
struct ieee80211_sta_ht_cap *ht_cap,
bool allow_ht_operation,
u32 rate_set, u8 hlid);

bool (*lnk_high_prio)(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk);
bool (*lnk_low_prio)(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk);
};

enum wlcore_partitions {
Expand Down

0 comments on commit 00d09a6

Please sign in to comment.