Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range
@ 2009-02-03  4:39 Vasanthakumar Thiagarajan
  2009-02-03 10:10 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2009-02-03  4:39 UTC (permalink / raw)
  To: linville, johannes; +Cc: linux-wireless

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>
---
 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 9d51e27..945c10d 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);
+	}
 }
 
 
-- 
1.5.5.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range
  2009-02-03  4:39 [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range Vasanthakumar Thiagarajan
@ 2009-02-03 10:10 ` Johannes Berg
  2009-02-03 10:19   ` Vasanthakumar Thiagarajan
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2009-02-03 10:10 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2083 bytes --]

On Tue, 2009-02-03 at 10:09 +0530, Vasanthakumar Thiagarajan wrote:
> There is no point having the bss information of currently associated AP
> when the AP is detected to be out of range.

Seems sane to me. There are a few other places I think where we hold on
to the bss info way too long, in fact, we hold on to it _forever_ most
of the time.

> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> ---
>  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 9d51e27..945c10d 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);
> +	}
>  }
>  
> 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range
  2009-02-03 10:10 ` Johannes Berg
@ 2009-02-03 10:19   ` Vasanthakumar Thiagarajan
  2009-02-03 10:24     ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Vasanthakumar Thiagarajan @ 2009-02-03 10:19 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vasanth Thiagarajan, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

On Tue, Feb 03, 2009 at 03:40:53PM +0530, Johannes Berg wrote:
> On Tue, 2009-02-03 at 10:09 +0530, Vasanthakumar Thiagarajan wrote:
> > There is no point having the bss information of currently associated AP
> > when the AP is detected to be out of range.
> 
> Seems sane to me. There are a few other places I think where we hold on
> to the bss info way too long, in fact, we hold on to it _forever_ most
> of the time.
> 

Yeah, we hold bss info when we get direct probe timeout, auth timeout and assoc
timeout. I will remove bss in those places also n the next version.

Thanks,

Vasanth

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range
  2009-02-03 10:19   ` Vasanthakumar Thiagarajan
@ 2009-02-03 10:24     ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2009-02-03 10:24 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan
  Cc: Vasanth Thiagarajan, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

On Tue, 2009-02-03 at 15:49 +0530, Vasanthakumar Thiagarajan wrote:
> On Tue, Feb 03, 2009 at 03:40:53PM +0530, Johannes Berg wrote:
> > On Tue, 2009-02-03 at 10:09 +0530, Vasanthakumar Thiagarajan wrote:
> > > There is no point having the bss information of currently associated AP
> > > when the AP is detected to be out of range.
> > 
> > Seems sane to me. There are a few other places I think where we hold on
> > to the bss info way too long, in fact, we hold on to it _forever_ most
> > of the time.
> > 
> 
> Yeah, we hold bss info when we get direct probe timeout, auth timeout and assoc
> timeout. I will remove bss in those places also n the next version.

Not just that, but also when we've found a BSS and never connect to it,
we'll never time it out. It's nothing you need to fix though, I'm
perfectly ok with just putting this patch in as a start.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-03 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03  4:39 [PATCH v2] mac80211: Remove bss information of the current AP when it goes out of range Vasanthakumar Thiagarajan
2009-02-03 10:10 ` Johannes Berg
2009-02-03 10:19   ` Vasanthakumar Thiagarajan
2009-02-03 10:24     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox