Commit cf24a82b authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

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: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200420160311.57323-15-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 06efad58
...@@ -785,24 +785,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw, ...@@ -785,24 +785,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&wdev->conf_mutex); mutex_lock(&wdev->conf_mutex);
WARN(wvif->link_id_map != 1, "corrupted state"); 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; wvif->state = WFX_STATE_PASSIVE;
/* FIXME: In add to reset MAC address, try to reset interface */
hif_set_macaddr(wvif, NULL); hif_set_macaddr(wvif, NULL);
wfx_tx_policy_init(wvif);
cancel_delayed_work_sync(&wvif->beacon_loss_work); cancel_delayed_work_sync(&wvif->beacon_loss_work);
wdev->vif[wvif->id] = NULL; wdev->vif[wvif->id] = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment