From e269060e79ed834c5519a037facc5944ea52f739 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Wed, 15 Apr 2020 18:11:31 +0200 Subject: [PATCH] staging: wfx: simplify handling of beacon filter during join process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When the device joins an AP, beacon are forwarded to the host. Once has retrieved all necessary parameters, we can start to filter the beacon (and only beacon with changed/new data will be forwarded). Currently, the driver detect beacons in data Rx process. It is far more easier to just wait for the BSS_CHANGED_BEACON_INFO event. Signed-off-by: Jérôme Pouiller Link: https://lore.kernel.org/r/20200415161147.69738-5-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wfx/data_rx.c | 12 ------------ drivers/staging/wfx/sta.c | 10 +++++++++- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index c5b83fedeb55..c3b3edae3420 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -118,18 +118,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, arg->rx_flags.match_uc_addr && mgmt->u.action.category == WLAN_CATEGORY_BACK) goto drop; - if (ieee80211_is_beacon(frame->frame_control) && - !arg->status && wvif->vif && - ether_addr_equal(ieee80211_get_SA(frame), - wvif->vif->bss_conf.bssid)) { - /* Disable beacon filter once we're associated... */ - if (wvif->disable_beacon_filter && - (wvif->vif->bss_conf.assoc || - wvif->vif->bss_conf.ibss_joined)) { - wvif->disable_beacon_filter = false; - schedule_work(&wvif->update_filtering_work); - } - } ieee80211_rx_irqsafe(wvif->wdev->hw, skb); return; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ec949ce0b256..b01467f7606a 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -712,9 +712,17 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BEACON_ENABLED) wfx_enable_beacon(wvif, info->enable_beacon); - if (changed & BSS_CHANGED_BEACON_INFO) + if (changed & BSS_CHANGED_BEACON_INFO) { + if (vif->type != NL80211_IFTYPE_STATION) + dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", + __func__); hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period); + // We temporary forwarded beacon for join process. It is now no + // more necessary. + wvif->disable_beacon_filter = false; + wfx_update_filtering(wvif); + } /* assoc/disassoc, or maybe AID changed */ if (changed & BSS_CHANGED_ASSOC) { -- 2.50.1