aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mlme.c38
-rw-r--r--net/mac80211/scan.c13
3 files changed, 36 insertions, 17 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index eaf3603862b7..5a1f19ad43c8 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -955,6 +955,8 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq,
955 u8 *ssid, u8 ssid_len); 955 u8 *ssid, u8 ssid_len);
956void ieee80211_rx_bss_put(struct ieee80211_local *local, 956void ieee80211_rx_bss_put(struct ieee80211_local *local,
957 struct ieee80211_bss *bss); 957 struct ieee80211_bss *bss);
958void ieee80211_rx_bss_remove(struct ieee80211_sub_if_data *sdata, u8 *bssid,
959 int freq, u8 *ssid, u8 ssid_len);
958 960
959/* interface handling */ 961/* interface handling */
960int ieee80211_if_add(struct ieee80211_local *local, const char *name, 962int ieee80211_if_add(struct ieee80211_local *local, const char *name,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 57967d32e5fd..91c9a5a5746d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -840,6 +840,14 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata,
840 sdata->dev->name, ifsta->bssid); 840 sdata->dev->name, ifsta->bssid);
841 ifsta->state = IEEE80211_STA_MLME_DISABLED; 841 ifsta->state = IEEE80211_STA_MLME_DISABLED;
842 ieee80211_sta_send_apinfo(sdata, ifsta); 842 ieee80211_sta_send_apinfo(sdata, ifsta);
843
844 /*
845 * Most likely AP is not in the range so remove the
846 * bss information associated to the AP
847 */
848 ieee80211_rx_bss_remove(sdata, ifsta->bssid,
849 sdata->local->hw.conf.channel->center_freq,
850 ifsta->ssid, ifsta->ssid_len);
843 return; 851 return;
844 } 852 }
845 853
@@ -871,6 +879,9 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,
871 sdata->dev->name, ifsta->bssid); 879 sdata->dev->name, ifsta->bssid);
872 ifsta->state = IEEE80211_STA_MLME_DISABLED; 880 ifsta->state = IEEE80211_STA_MLME_DISABLED;
873 ieee80211_sta_send_apinfo(sdata, ifsta); 881 ieee80211_sta_send_apinfo(sdata, ifsta);
882 ieee80211_rx_bss_remove(sdata, ifsta->bssid,
883 sdata->local->hw.conf.channel->center_freq,
884 ifsta->ssid, ifsta->ssid_len);
874 return; 885 return;
875 } 886 }
876 887
@@ -933,8 +944,12 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
933 944
934 ieee80211_sta_send_apinfo(sdata, ifsta); 945 ieee80211_sta_send_apinfo(sdata, ifsta);
935 946
936 if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT) 947 if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT) {
937 ifsta->state = IEEE80211_STA_MLME_DISABLED; 948 ifsta->state = IEEE80211_STA_MLME_DISABLED;
949 ieee80211_rx_bss_remove(sdata, ifsta->bssid,
950 sdata->local->hw.conf.channel->center_freq,
951 ifsta->ssid, ifsta->ssid_len);
952 }
938 953
939 rcu_read_unlock(); 954 rcu_read_unlock();
940 955
@@ -1017,6 +1032,9 @@ static void ieee80211_associate(struct ieee80211_sub_if_data *sdata,
1017 sdata->dev->name, ifsta->bssid); 1032 sdata->dev->name, ifsta->bssid);
1018 ifsta->state = IEEE80211_STA_MLME_DISABLED; 1033 ifsta->state = IEEE80211_STA_MLME_DISABLED;
1019 ieee80211_sta_send_apinfo(sdata, ifsta); 1034 ieee80211_sta_send_apinfo(sdata, ifsta);
1035 ieee80211_rx_bss_remove(sdata, ifsta->bssid,
1036 sdata->local->hw.conf.channel->center_freq,
1037 ifsta->ssid, ifsta->ssid_len);
1020 return; 1038 return;
1021 } 1039 }
1022 1040
@@ -1042,7 +1060,6 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
1042 struct ieee80211_local *local = sdata->local; 1060 struct ieee80211_local *local = sdata->local;
1043 struct sta_info *sta; 1061 struct sta_info *sta;
1044 int disassoc; 1062 int disassoc;
1045 bool remove_bss = false;
1046 1063
1047 /* TODO: start monitoring current AP signal quality and number of 1064 /* TODO: start monitoring current AP signal quality and number of
1048 * missed beacons. Scan other channels every now and then and search 1065 * missed beacons. Scan other channels every now and then and search
@@ -1068,7 +1085,6 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
1068 "range\n", 1085 "range\n",
1069 sdata->dev->name, ifsta->bssid); 1086 sdata->dev->name, ifsta->bssid);
1070 disassoc = 1; 1087 disassoc = 1;
1071 remove_bss = true;
1072 } else 1088 } else
1073 ieee80211_send_probe_req(sdata, ifsta->bssid, 1089 ieee80211_send_probe_req(sdata, ifsta->bssid,
1074 ifsta->ssid, 1090 ifsta->ssid,
@@ -1088,24 +1104,12 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
1088 1104
1089 rcu_read_unlock(); 1105 rcu_read_unlock();
1090 1106
1091 if (disassoc) { 1107 if (disassoc)
1092 ieee80211_set_disassoc(sdata, ifsta, true, true, 1108 ieee80211_set_disassoc(sdata, ifsta, true, true,
1093 WLAN_REASON_PREV_AUTH_NOT_VALID); 1109 WLAN_REASON_PREV_AUTH_NOT_VALID);
1094 if (remove_bss) { 1110 else
1095 struct ieee80211_bss *bss;
1096
1097 bss = ieee80211_rx_bss_get(local, ifsta->bssid,
1098 local->hw.conf.channel->center_freq,
1099 ifsta->ssid, ifsta->ssid_len);
1100 if (bss) {
1101 atomic_dec(&bss->users);
1102 ieee80211_rx_bss_put(local, bss);
1103 }
1104 }
1105 } else {
1106 mod_timer(&ifsta->timer, jiffies + 1111 mod_timer(&ifsta->timer, jiffies +
1107 IEEE80211_MONITORING_INTERVAL); 1112 IEEE80211_MONITORING_INTERVAL);
1108 }
1109} 1113}
1110 1114
1111 1115
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 282e6a0dec01..50719ea08172 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -327,6 +327,19 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
327 return bss; 327 return bss;
328} 328}
329 329
330void ieee80211_rx_bss_remove(struct ieee80211_sub_if_data *sdata, u8 *bssid,
331 int freq, u8 *ssid, u8 ssid_len)
332{
333 struct ieee80211_bss *bss;
334 struct ieee80211_local *local = sdata->local;
335
336 bss = ieee80211_rx_bss_get(local, bssid, freq, ssid, ssid_len);
337 if (bss) {
338 atomic_dec(&bss->users);
339 ieee80211_rx_bss_put(local, bss);
340 }
341}
342
330ieee80211_rx_result 343ieee80211_rx_result
331ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, 344ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
332 struct ieee80211_rx_status *rx_status) 345 struct ieee80211_rx_status *rx_status)