staging: wfx: simplify handling of beacon filter during join process
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 15 Apr 2020 16:11:31 +0000 (18:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Apr 2020 10:29:40 +0000 (12:29 +0200)
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 <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200415161147.69738-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_rx.c
drivers/staging/wfx/sta.c

index c5b83fedeb55cef78c2a932577fd42b6cf328ef7..c3b3edae342029a18e7aac06b3bba5c4b618cc04 100644 (file)
@@ -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;
index ec949ce0b2564e95fdaa4ef4e6391ad30f36eb28..b01467f7606a6d0dd7d2497a9f0ed0270424a020 100644 (file)
@@ -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) {