Commit 7bc71e80 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: remove check for interface state



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: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-62-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b72dee6
Loading
Loading
Loading
Loading
+12 −38
Original line number Diff line number Diff line
@@ -365,31 +365,10 @@ 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) {
@@ -404,13 +383,8 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb,
		    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);