From 062a6c410258ca2e66f377e54ee229c937504e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 1 Apr 2020 13:03:45 +0200 Subject: staging: wfx: drop useless sta_asleep_mask MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, the driver tracks power save state of the stations with the variable sta_asleep_mask. Then, it takes care to not sent data to asleep stations. However, this work is already done by mac80211. Normally, there are no frames for asleep stations in our queues. So, driver do not have to filter frames in its queues (apart the frames marked "AFTER_DTIM"). Notice that there is a risk of race between state of the station and data send to the firmware. However, this risk is limited since the number of frame in queues are small. In add, this race also exists with the current code. Anyway, the firmware is able to detect the problem and driver will receive a 'REQUEUE' status (translated in TX_STAT_TX_FILTERED for mac80211). Reviewed-by: Dan Carpenter Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200401110405.80282-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/queue.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/staging/wfx/queue.c') diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c602496580f7..e66debd60e3f 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -388,13 +388,8 @@ static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, int idx; u32 tx_allowed_mask; - /* Search for unicast traffic */ - tx_allowed_mask = ~wvif->sta_asleep_mask; - tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); - if (wvif->sta_asleep_mask) - tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - else - tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); + tx_allowed_mask = BIT(WFX_LINK_ID_MAX) - 1; + tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); idx = wfx_get_prio_queue(wvif, tx_allowed_mask); if (idx < 0) return NULL; @@ -464,13 +459,8 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - spin_lock_bh(&wvif->ps_state_lock); - vif_queue = wfx_tx_queue_mask_get(wvif, &vif_tx_allowed_mask); - - spin_unlock_bh(&wvif->ps_state_lock); - if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); -- cgit v1.2.3