aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Pouiller <[email protected]>2020-04-20 18:03:09 +0200
committerGreg Kroah-Hartman <[email protected]>2020-04-23 13:26:05 +0200
commitcf24a82bd265d5ffff92faeda030eba7af2b2a59 (patch)
treeb134781c9f8f2f48102f57c6d57fc903afa95fb5
parent06efad5808aa0db3528eca4b8faee4013ffd787b (diff)
staging: wfx: simplify wfx_remove_interface()
In wfx_remove_interface(), the current code differentiate AP and Station cases. However, it is not necessary. In all cases, the only important thing is the call to hif_reset(). We can use the same code to support all cases. Signed-off-by: Jérôme Pouiller <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/wfx/sta.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index bc891b6e4392..1732f3d0a1e5 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -785,24 +785,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&wdev->conf_mutex);
WARN(wvif->link_id_map != 1, "corrupted state");
- switch (wvif->state) {
- case WFX_STATE_PRE_STA:
- case WFX_STATE_STA:
- case WFX_STATE_IBSS:
- wfx_do_unjoin(wvif);
- break;
- case WFX_STATE_AP:
- /* reset.link_id = 0; */
- hif_reset(wvif, false);
- break;
- default:
- break;
- }
+ hif_reset(wvif, false);
wvif->state = WFX_STATE_PASSIVE;
-
- /* FIXME: In add to reset MAC address, try to reset interface */
hif_set_macaddr(wvif, NULL);
+ wfx_tx_policy_init(wvif);
cancel_delayed_work_sync(&wvif->beacon_loss_work);
wdev->vif[wvif->id] = NULL;