summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-05-15 11:33:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-15 17:00:52 +0300
commit5a48a4a3efb45fb18970c05e3a6b6bf5d72dbb7a (patch)
tree25f9153c936e7b0d2523f22bb913ccfb24fc64f6 /drivers
parent13839ef377124956dac8a58887abfd7d8d9414ca (diff)
downloadlinux-5a48a4a3efb45fb18970c05e3a6b6bf5d72dbb7a.tar.xz
staging: wfx: rename wfx_do_unjoin() into wfx_reset()
In fact, wfx_do_unjoin() resets the interface. This mechanism can be used in more cases than just disassociating from a BSS. So, rename it to reflect that fact. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200515083325.378539-12-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wfx/sta.c32
-rw-r--r--drivers/staging/wfx/sta.h1
2 files changed, 16 insertions, 17 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 1a876a0faaf5..e077f42b62dc 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -315,20 +315,6 @@ void wfx_set_default_unicast_key(struct ieee80211_hw *hw,
hif_wep_default_key_id(wvif, idx);
}
-// Call it with wdev->conf_mutex locked
-static void wfx_do_unjoin(struct wfx_vif *wvif)
-{
- /* Unjoin is a reset. */
- wfx_tx_lock_flush(wvif->wdev);
- hif_reset(wvif, false);
- wfx_tx_policy_init(wvif);
- if (wvif_count(wvif->wdev) <= 1)
- hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
- wfx_tx_unlock(wvif->wdev);
- wvif->bss_not_support_ps_poll = false;
- cancel_delayed_work_sync(&wvif->beacon_loss_work);
-}
-
static void wfx_set_mfp(struct wfx_vif *wvif,
struct cfg80211_bss *bss)
{
@@ -359,6 +345,18 @@ static void wfx_set_mfp(struct wfx_vif *wvif,
hif_set_mfp(wvif, mfpc, mfpr);
}
+void wfx_reset(struct wfx_vif *wvif)
+{
+ wfx_tx_lock_flush(wvif->wdev);
+ hif_reset(wvif, false);
+ wfx_tx_policy_init(wvif);
+ if (wvif_count(wvif->wdev) <= 1)
+ hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
+ wfx_tx_unlock(wvif->wdev);
+ wvif->bss_not_support_ps_poll = false;
+ cancel_delayed_work_sync(&wvif->beacon_loss_work);
+}
+
static void wfx_do_join(struct wfx_vif *wvif)
{
int ret;
@@ -395,7 +393,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen);
if (ret) {
ieee80211_connection_loss(wvif->vif);
- wfx_do_unjoin(wvif);
+ wfx_reset(wvif);
} else {
/* Due to beacon filtering it is possible that the
* AP's beacon is not known for the mac80211 stack.
@@ -513,7 +511,7 @@ void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
- wfx_do_unjoin(wvif);
+ wfx_reset(wvif);
}
static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
@@ -580,7 +578,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (info->assoc || info->ibss_joined)
wfx_join_finalize(wvif, info);
else if (!info->assoc && vif->type == NL80211_IFTYPE_STATION)
- wfx_do_unjoin(wvif);
+ wfx_reset(wvif);
else
dev_warn(wdev->dev, "%s: misunderstood change: ASSOC\n",
__func__);
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index c84c3749ec4f..8a20ad9ae017 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -71,6 +71,7 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd);
void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi);
// Other Helpers
+void wfx_reset(struct wfx_vif *wvif);
u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates);
#endif /* WFX_STA_H */