diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-04-01 13:03:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-13 08:55:35 +0200 |
commit | 6c262beb41e6d3bd93f0b055c0b20ebda7dfed51 (patch) | |
tree | 5cef0f593b3a616286bce71806f6ac6f3ecd260d /drivers/staging/wfx/queue.c | |
parent | af72697196dcb9d23484ae32ea096955f715c1d1 (diff) |
staging: wfx: do not use link_map_cache to track CAB
Since we do not track power save status of the stations anymore,
link_map_cache is now only used to track "Content After (DTIM) Beacon".
We prefer to rely on flags from tx_info. So we will be able to drop
link_map_cache.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200401110405.80282-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/queue.c')
-rw-r--r-- | drivers/staging/wfx/queue.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cecf9aa7b3ca..6fa8f4e083d3 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -146,13 +146,16 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { - int ret, i; + struct ieee80211_tx_info *tx_info; + struct sk_buff *skb; + int ret = 0; - ret = 0; spin_lock_bh(&queue->queue.lock); - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (i != WFX_LINK_ID_AFTER_DTIM) - ret += queue->link_map_cache[i]; + skb_queue_walk(&queue->queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + if (!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) + ret++; + } spin_unlock_bh(&queue->queue.lock); return ret; } |