Search Linux Wireless

Re: [PATCH 09/13] mac80211: remove hw_scan callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Wu wrote:
From: Michael Wu <flamingice@xxxxxxxxxxxx>

The hw_scan callback breaks the auto AP selection code in ieee80211_sta.c.
No in-tree drivers use it either. This patch removes it.

The auto AP selection code is broken because ieee80211_sta_config_auth wasn't selecting a network if the RSSI was negative.)

Thanks,
James

----

[PATCH] Fix ieee80211_sta_config_auth to select networks if rssi < 0

The rssi check was against the top_rssi being less than the network
rssi.  However, 0 is higher than all negative rssi, so if an adapter
returned negative rssi values, auto AP selection would never work.

This patch changes behavior such if no network is currently selected it
ignores the rssi comparison and picks the network that matches all other criteria.

Signed-off-by: James Ketrenos <jketreno@xxxxxxxxxxxxxxx>
---
net/mac80211/ieee80211_sta.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 92e575a..6889e79 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2249,7 +2249,7 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
		    !ieee80211_sta_match_ssid(ifsta, bss->ssid, bss->ssid_len))
			continue;

-		if (top_rssi < bss->rssi) {
+		if (!selected || top_rssi < bss->rssi) {
			selected = bss;
			top_rssi = bss->rssi;
		}
--
1.5.0.6
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux