lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  1 Apr 2020 13:03:47 +0200
From:   Jerome Pouiller <Jerome.Pouiller@...abs.com>
To:     devel@...verdev.osuosl.org, linux-wireless@...r.kernel.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jérôme Pouiller 
        <jerome.pouiller@...abs.com>
Subject: [PATCH 14/32] staging: wfx: do not use link_map_cache to track CAB

From: Jérôme Pouiller <jerome.pouiller@...abs.com>

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.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
 drivers/staging/wfx/queue.c | 13 ++++++++-----
 1 file 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;
 }
-- 
2.25.1

Powered by blists - more mailing lists