Skip to contentSkip to conversation

mac80211: Remove bss information of the current AP when it goes out of range

PATCH Superseded Vasanthakumar Thiagarajan 1 participant 2 messages Feb 2, 2009 – Feb 3, 2009 mac80211

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 net/mac80211/mlme.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +15 -2
index 9d51e27..a671fc0 100644
@@ -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,23 @@ 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);
+	}
 }
 
 
Signature · 1 line
1.5.5.1
#1 lore raw

net/mac80211/mlme.c static void ieee80211_associated(struct ieee80211_sub_if_data *sdata, · line 1102

Quoted 9 lines · Vasanth Thiagarajan
net/mac80211/mlme.c +9 -0
+               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);

oops, I missed braces here.

Quoted 9 lines

--
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html