diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-04-15 18:11:44 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-16 12:29:46 +0200 |
commit | 2c69b2da37824307b4c73cbf7ad98ae82a6a52fe (patch) | |
tree | 4c9c92a493804d085fb5bf65a384e6577372280e /drivers/staging/wfx/sta.c | |
parent | a558395d4ce328d39772ffd88422aaad5d572449 (diff) |
staging: wfx: split out wfx_filter_beacon()
Currently, wfx_update_filtering() is sometime called only to apply the
value of wvif->filter_beacon to the hardware. It is nicer to have a
specific function for beacon filtering.
In add, an attentive reader would note that wfx_update_filtering() is
always called after change of wvif->filter_beacon. Thus, it not
necessary to store filter_beacon in the struct wfx_vif. We can just pass
it as parameter.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-18-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/sta.c')
-rw-r--r-- | drivers/staging/wfx/sta.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a9261ef4b4c5..1ccd40a3322f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -113,9 +113,8 @@ end: mutex_unlock(&wvif->bss_loss_lock); } -void wfx_update_filtering(struct wfx_vif *wvif) +static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon) { - int i; const struct hif_ie_table_entry filter_ies[] = { { .ie_id = WLAN_EID_VENDOR_SPECIFIC, @@ -136,13 +135,18 @@ void wfx_update_filtering(struct wfx_vif *wvif) } }; - if (!wvif->filter_beacon) { + if (!filter_beacon) { hif_set_beacon_filter_table(wvif, 0, NULL); hif_beacon_filter_control(wvif, 0, 1); } else { hif_set_beacon_filter_table(wvif, 3, filter_ies); hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0); } +} + +void wfx_update_filtering(struct wfx_vif *wvif) +{ + int i; // Temporary workaround for filters hif_set_data_filtering(wvif, false, true); @@ -194,7 +198,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, { struct wfx_vif *wvif = NULL; struct wfx_dev *wdev = hw->priv; - bool filter_bssid, filter_prbreq; + bool filter_bssid, filter_prbreq, filter_beacon; // Notes: // - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered @@ -213,9 +217,10 @@ void wfx_configure_filter(struct ieee80211_hw *hw, // Note: FIF_BCN_PRBRESP_PROMISC covers probe response and // beacons from other BSS if (*total_flags & FIF_BCN_PRBRESP_PROMISC) - wvif->filter_beacon = false; + filter_beacon = false; else - wvif->filter_beacon = true; + filter_beacon = true; + wfx_filter_beacon(wvif, filter_beacon); if (*total_flags & FIF_ALLMULTI) { wvif->filter_mcast = false; @@ -501,8 +506,7 @@ static void wfx_do_join(struct wfx_vif *wvif) * Disable filtering temporary to make sure the stack * receives at least one */ - wvif->filter_beacon = false; - wfx_update_filtering(wvif); + wfx_filter_beacon(wvif, false); } wfx_tx_unlock(wvif->wdev); } @@ -703,8 +707,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, info->dtim_period); // We temporary forwarded beacon for join process. It is now no // more necessary. - wvif->filter_beacon = true; - wfx_update_filtering(wvif); + wfx_filter_beacon(wvif, true); } /* assoc/disassoc, or maybe AID changed */ |