diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-02-03 10:09:49 +0530 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-09 15:03:48 -0500 |
commit | d43e87868f67c5b52defd8d82bc3f54347ed2408 (patch) | |
tree | cc8a150a580bcdbadbaab64165c6e2ad4f84d7a3 /net/mac80211/mlme.c | |
parent | de9f97efb2ea2a32a610932d881e4d3653e0f932 (diff) |
mac80211: Remove bss information of the current AP when it goes out of range
There is no point having the bss information of currently associated AP
when the AP is detected to be out of range.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 73808780f53..57967d32e5f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1042,6 +1042,7 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata, struct ieee80211_local *local = sdata->local; struct sta_info *sta; int disassoc; + bool remove_bss = false; /* TODO: start monitoring current AP signal quality and number of * missed beacons. Scan other channels every now and then and search @@ -1067,6 +1068,7 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata, "range\n", sdata->dev->name, ifsta->bssid); disassoc = 1; + remove_bss = true; } else ieee80211_send_probe_req(sdata, ifsta->bssid, ifsta->ssid, @@ -1086,12 +1088,24 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata, rcu_read_unlock(); - if (disassoc) + if (disassoc) { ieee80211_set_disassoc(sdata, ifsta, true, true, WLAN_REASON_PREV_AUTH_NOT_VALID); - else + if (remove_bss) { + struct ieee80211_bss *bss; + + bss = ieee80211_rx_bss_get(local, ifsta->bssid, + local->hw.conf.channel->center_freq, + ifsta->ssid, ifsta->ssid_len); + if (bss) { + atomic_dec(&bss->users); + ieee80211_rx_bss_put(local, bss); + } + } + } else { mod_timer(&ifsta->timer, jiffies + IEEE80211_MONITORING_INTERVAL); + } } |