diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-02-04 07:58:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-11 11:44:23 -0500 |
commit | 7a9470806053f765ecf7f3932acb4c95c204ad4b (patch) | |
tree | 0e0e2110f221babd6fbdb289f3056436fca101b1 /net/mac80211/mlme.c | |
parent | 029bc43270e770e0d57d67dc431fe711c58e74f5 (diff) |
mac80211: Free current bss information in few places where we don't need it any more
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 38 |
1 files changed, 21 insertions, 17 deletions
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 | ||