]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ath6kl: Update BSS information after connection
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 19 Sep 2011 16:15:06 +0000 (19:15 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 22 Sep 2011 07:07:59 +0000 (10:07 +0300)
Since we may end up using a dummy BSS entry when roaming, allow one Beacon
frame -based bssinfo from the current BSS to be processed prior to starting
to filter all bssinfo events. This allows cfg80211 BSS table to be filled
with proper data in the roaming case where the full Beacon data may not
have been present at the time of roamed event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/core.h
drivers/net/wireless/ath/ath6kl/main.c
drivers/net/wireless/ath/ath6kl/wmi.c

index b32843779c5fb262cf4b501f6fdd35ba69433ffb..0bdd837d6121b3b1b500c15fb440ac36c94bc95f 100644 (file)
@@ -360,6 +360,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
        }
 
        if (!ar->usr_bss_filter) {
+               clear_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag);
                if (ath6kl_wmi_bssfilter_cmd(ar->wmi, ALL_BSS_FILTER, 0) != 0) {
                        ath6kl_err("couldn't set bss filtering\n");
                        up(&ar->sem);
@@ -638,6 +639,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
                return -EIO;
 
        if (!ar->usr_bss_filter) {
+               clear_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag);
                ret = ath6kl_wmi_bssfilter_cmd(
                        ar->wmi,
                        (test_bit(CONNECTED, &ar->flag) ?
index 9e6abb85fc507b7307d979e1c7002ad7699a8c9a..c14bb75d3614fc44358f17ebba44012351901e1d 100644 (file)
@@ -394,6 +394,7 @@ struct ath6kl_req_key {
 #define SKIP_SCAN           11
 #define WLAN_ENABLED        12
 #define TESTMODE            13
+#define CLEAR_BSSFILTER_ON_BEACON 14
 
 struct ath6kl {
        struct device *dev;
index 55d3331bed8557045dd0d28bdd3c73f3d51478ac..30b5a53db9ed061dd6ba60a790a7ccde0ba8fc23 100644 (file)
@@ -1011,8 +1011,10 @@ void ath6kl_scan_complete_evt(struct ath6kl *ar, int status)
 {
        ath6kl_cfg80211_scan_complete_event(ar, status);
 
-       if (!ar->usr_bss_filter)
+       if (!ar->usr_bss_filter) {
+               clear_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag);
                ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0);
+       }
 
        ath6kl_dbg(ATH6KL_DBG_WLAN_SCAN, "scan complete: %d\n", status);
 }
@@ -1056,8 +1058,10 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
                ar->next_ep_id = ENDPOINT_2;
        }
 
-       if (!ar->usr_bss_filter)
-               ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0);
+       if (!ar->usr_bss_filter) {
+               set_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag);
+               ath6kl_wmi_bssfilter_cmd(ar->wmi, CURRENT_BSS_FILTER, 0);
+       }
 }
 
 void ath6kl_tkip_micerr_event(struct ath6kl *ar, u8 keyid, bool ismcast)
index 72cf78c1ca6a97bc56a7add74c41f40575dce379..f7dcb56ab3543086da4a5a51ae7d39430da943e1 100644 (file)
@@ -917,6 +917,12 @@ static int ath6kl_wmi_bssinfo_event_rx(struct wmi *wmi, u8 *datap, int len)
            bih->frame_type != PROBERESP_FTYPE)
                return 0; /* Only update BSS table for now */
 
+       if (bih->frame_type == BEACON_FTYPE &&
+           test_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag)) {
+               clear_bit(CLEAR_BSSFILTER_ON_BEACON, &ar->flag);
+               ath6kl_wmi_bssfilter_cmd(ar->wmi, NONE_BSS_FILTER, 0);
+       }
+
        channel = ieee80211_get_channel(ar->wdev->wiphy, le16_to_cpu(bih->ch));
        if (channel == NULL)
                return -EINVAL;