From 7bc71e80bdaf623712352f25fba97a80716d7644 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 15 Jan 2020 13:55:31 +0000 Subject: [PATCH] staging: wfx: remove check for interface state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Obviously, the value of wvif->state as no reason to be wrong. At least, if it the case, dropping the frame is probably not the bast thing to do. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200115135338.14374-62-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/queue.c | 50 +++++++++++---------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c87d64fbb88f..e0c609c35a7b 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -365,52 +365,26 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, struct ieee80211_hdr *frame = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); enum { - do_drop, do_wep, do_tx, } action = do_tx; - switch (wvif->vif->type) { - case NL80211_IFTYPE_STATION: - if (wvif->state < WFX_STATE_PRE_STA) - action = do_drop; - break; - case NL80211_IFTYPE_AP: - if (!wvif->state) - action = do_drop; - break; - case NL80211_IFTYPE_ADHOC: - if (wvif->state != WFX_STATE_IBSS) - action = do_drop; - break; - case NL80211_IFTYPE_MONITOR: - default: - action = do_drop; - break; - } - - if (action == do_tx) { - if (ieee80211_is_nullfunc(frame->frame_control)) { - mutex_lock(&wvif->bss_loss_lock); - if (wvif->bss_loss_state) { - wvif->bss_loss_confirm_id = req->packet_id; - req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; - } - mutex_unlock(&wvif->bss_loss_lock); - } else if (ieee80211_has_protected(frame->frame_control) && - tx_priv->hw_key && - tx_priv->hw_key->keyidx != wvif->wep_default_key_id && - (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || - tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { - action = do_wep; + if (ieee80211_is_nullfunc(frame->frame_control)) { + mutex_lock(&wvif->bss_loss_lock); + if (wvif->bss_loss_state) { + wvif->bss_loss_confirm_id = req->packet_id; + req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; } + mutex_unlock(&wvif->bss_loss_lock); + } else if (ieee80211_has_protected(frame->frame_control) && + tx_priv->hw_key && + tx_priv->hw_key->keyidx != wvif->wep_default_key_id && + (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || + tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { + action = do_wep; } switch (action) { - case do_drop: - wfx_pending_remove(wvif->wdev, skb); - handled = true; - break; case do_wep: wfx_tx_lock(wvif->wdev); WARN_ON(wvif->wep_pending_skb); -- 2.11.0