rpms/kernel/F-7 0001-mac80211-store-freq-info-in-sta_bss_list.patch, NONE, 1.1.2.1 kernel-2.6.spec, 1.3317, 1.3317.2.1

John W. Linville (linville) fedora-extras-commits at redhat.com
Thu Aug 16 20:02:59 UTC 2007


Author: linville

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5006

Modified Files:
      Tag: private-linville-bz250913-branch
	kernel-2.6.spec 
Added Files:
      Tag: private-linville-bz250913-branch
	0001-mac80211-store-freq-info-in-sta_bss_list.patch 
Log Message:
mac80211: store freq info in sta_bss_list

0001-mac80211-store-freq-info-in-sta_bss_list.patch:

--- NEW FILE 0001-mac80211-store-freq-info-in-sta_bss_list.patch ---
>From 1ceaf761622a98db7e075a4a56db4a600338c54c Mon Sep 17 00:00:00 2001
From: John W. Linville <linville at linville-tester.local>
Date: Thu, 16 Aug 2007 15:28:11 -0400
Subject: [PATCH] [PATCH] mac80211: store freq info in sta_bss_list

Some AP equipment "in the wild" uses the same BSSID on multiple
channels (particularly "a" vs. "b/g").  This changes the key of
the sta_bss_list to include both the BSSID and the frequency so as
to prevent a BSSID on one channel from eclipsing the same BSSID on
another channel.

Signed-off-by: John W. Linville <linville at tuxdriver.com>
---
 net/mac80211/ieee80211_sta.c |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index b996332..7bfe748 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -64,7 +64,7 @@
 static void ieee80211_send_probe_req(struct net_device *dev, u8 *dst,
 				     u8 *ssid, size_t ssid_len);
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid);
+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int freq);
 static void ieee80211_rx_bss_put(struct net_device *dev,
 				 struct ieee80211_sta_bss *bss);
 static int ieee80211_sta_find_ibss(struct net_device *dev,
@@ -446,6 +446,7 @@ static void ieee80211_sta_send_associnfo(struct net_device *dev,
 static void ieee80211_set_associated(struct net_device *dev,
 				     struct ieee80211_if_sta *ifsta, int assoc)
 {
+	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	union iwreq_data wrqu;
 
 	if (ifsta->associated == assoc)
@@ -460,7 +461,8 @@ static void ieee80211_set_associated(struct net_device *dev,
 		if (sdata->type != IEEE80211_IF_TYPE_STA)
 			return;
 
-		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
+					   local->hw.conf.freq);
 		if (bss) {
 			if (bss->has_erp_value)
 				ieee80211_handle_erp_ie(dev, bss->erp_value);
@@ -603,7 +605,7 @@ static void ieee80211_send_assoc(struct net_device *dev,
 		capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME |
 			WLAN_CAPABILITY_SHORT_PREAMBLE;
 	}
-	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.freq);
 	if (bss) {
 		if (bss->capability & WLAN_CAPABILITY_PRIVACY)
 			capab |= WLAN_CAPABILITY_PRIVACY;
@@ -1165,6 +1167,7 @@ void ieee80211_send_dls_teardown(struct net_device *dev,
 static int ieee80211_privacy_mismatch(struct net_device *dev,
 				      struct ieee80211_if_sta *ifsta)
 {
+	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sta_bss *bss;
 	int res = 0;
 
@@ -1172,7 +1175,7 @@ static int ieee80211_privacy_mismatch(struct net_device *dev,
 	    ifsta->key_mgmt != IEEE80211_KEY_MGMT_NONE)
 		return 0;
 
-	bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+	bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.freq);
 	if (!bss)
 		return 0;
 
@@ -1682,7 +1685,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
 	 * update our stored copy */
 	if (elems.erp_info && elems.erp_info_len >= 1) {
 		struct ieee80211_sta_bss *bss
-			= ieee80211_rx_bss_get(dev, ifsta->bssid);
+			= ieee80211_rx_bss_get(dev, ifsta->bssid,
+					       local->hw.conf.freq);
 		if (bss) {
 			bss->erp_value = elems.erp_info[0];
 			bss->has_erp_value = 1;
@@ -1712,7 +1716,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
 			       " AP\n", dev->name);
 			return;
 		}
-		bss = ieee80211_rx_bss_get(dev, ifsta->bssid);
+		bss = ieee80211_rx_bss_get(dev, ifsta->bssid,
+					   local->hw.conf.freq);
 		if (bss) {
 			sta->last_rssi = bss->rssi;
 			sta->last_signal = bss->signal;
@@ -2060,7 +2065,7 @@ static void __ieee80211_rx_bss_hash_del(struct net_device *dev,
 
 
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
+ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid, int freq)
 {
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sta_bss *bss;
@@ -2071,6 +2076,7 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
 	atomic_inc(&bss->users);
 	atomic_inc(&bss->users);
 	memcpy(bss->bssid, bssid, ETH_ALEN);
+	bss->freq = freq;
 
 	spin_lock_bh(&local->sta_bss_lock);
 	/* TODO: order by RSSI? */
@@ -2082,7 +2088,7 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
 
 
 static struct ieee80211_sta_bss *
-ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
+ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid, int freq)
 {
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sta_bss *bss;
@@ -2090,7 +2096,8 @@ ieee80211_rx_bss_get(struct net_device *dev, u8 *bssid)
 	spin_lock_bh(&local->sta_bss_lock);
 	bss = local->sta_bss_hash[STA_HASH(bssid)];
 	while (bss) {
-		if (memcmp(bss->bssid, bssid, ETH_ALEN) == 0) {
+		if (memcmp(bss->bssid, bssid, ETH_ALEN) == 0 &&
+		    bss->freq == freq) {
 			atomic_inc(&bss->users);
 			break;
 		}
@@ -2259,9 +2266,9 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
 	else
 		channel = rx_status->channel;
 
-	bss = ieee80211_rx_bss_get(dev, mgmt->bssid);
+	bss = ieee80211_rx_bss_get(dev, mgmt->bssid, rx_status->freq);
 	if (!bss) {
-		bss = ieee80211_rx_bss_add(dev, mgmt->bssid);
+		bss = ieee80211_rx_bss_add(dev, mgmt->bssid, rx_status->freq);
 		if (!bss)
 			return;
 	} else {
@@ -2379,7 +2386,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
 
 	bss->hw_mode = rx_status->phymode;
 	bss->channel = channel;
-	bss->freq = rx_status->freq;
 	if (channel != rx_status->channel &&
 	    (bss->hw_mode == MODE_IEEE80211G ||
 	     bss->hw_mode == MODE_IEEE80211B) &&
@@ -3325,7 +3331,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
 	printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID " MAC_FMT "\n",
 	       dev->name, MAC_ARG(bssid));
 
-	bss = ieee80211_rx_bss_add(dev, bssid);
+	bss = ieee80211_rx_bss_add(dev, bssid, local->hw.conf.freq);
 	if (!bss)
 		return -ENOMEM;
 
@@ -3337,7 +3343,6 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
 	bss->beacon_int = local->hw.conf.beacon_int;
 	bss->hw_mode = local->hw.conf.phymode;
 	bss->channel = local->hw.conf.channel;
-	bss->freq = local->hw.conf.freq;
 	bss->last_update = jiffies;
 	bss->capability = WLAN_CAPABILITY_IBSS;
 	if (sdata->default_key) {
@@ -3396,7 +3401,7 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
 	       MAC_FMT "\n", MAC_ARG(bssid), MAC_ARG(ifsta->bssid));
 #endif /* CONFIG_MAC80211_IBSS_DEBUG */
 	if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
-	    (bss = ieee80211_rx_bss_get(dev, bssid))) {
+	    (bss = ieee80211_rx_bss_get(dev, bssid, local->hw.conf.freq))) {
 		printk(KERN_DEBUG "%s: Selected IBSS BSSID " MAC_FMT
 		       " based on configured SSID\n",
 		       dev->name, MAC_ARG(bssid));
-- 
1.5.2.2



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3317
retrieving revision 1.3317.2.1
diff -u -r1.3317 -r1.3317.2.1
--- kernel-2.6.spec	14 Aug 2007 21:06:03 -0000	1.3317
+++ kernel-2.6.spec	16 Aug 2007 20:02:24 -0000	1.3317.2.1
@@ -13,6 +13,7 @@
 # by setting the define to ".local" or ".bz123456"
 #
 #% define buildid .local
+%define buildid .bz250913
 
 # fedora_build defines which build revision of this kernel version we're
 # building. Rather than incrementing forever, as with the prior versioning
@@ -20,7 +21,8 @@
 # kernel spec when the kernel is rebased, so fedora_build automatically
 # works out to the offset from the rebase, so it doesn't get too ginormous.
 %define fedora_cvs_origin 3260
-%define fedora_build %(R="$Revision$"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})
+#%define fedora_build %(R="$Revision$"; R="${R%% \$}"; R="${R##: 1.}"; expr $R - %{fedora_cvs_origin})
+%define fedora_build 57
 
 # base_sublevel is the kernel version we're starting with and patching
 # on top of -- for example, 2.6.22-rc7-git1 starts with a 2.6.21 base,
@@ -595,6 +597,7 @@
 Patch690: git-wireless-dev.patch
 Patch691: linux-2.6-mac80211-local-mcast-filter.patch
 Patch692: linux-2.6-mac80211-probe-hidden-essid.patch
+Patch693: 0001-mac80211-store-freq-info-in-sta_bss_list.patch
 Patch700: linux-2.6-iwlwifi-fw-name-compat.patch
 Patch701: linux-2.6-rt2x00-usb-1_1-timeout.patch
 Patch702: linux-2.6-b43-module-alias.patch
@@ -1295,6 +1298,8 @@
 ApplyPatch linux-2.6-mac80211-local-mcast-filter.patch
 # mac80211: probe for hidden SSIDs when SSID not found
 ApplyPatch linux-2.6-mac80211-probe-hidden-essid.patch
+# mac80211: store freq info in sta_bss_list
+ApplyPatch 0001-mac80211-store-freq-info-in-sta_bss_list.patch
 # temp compat patch for iwlwifi firmware filenames
 ApplyPatch linux-2.6-iwlwifi-fw-name-compat.patch
 # temp make rt2x00 play nice w/ USB 1.1
@@ -2277,6 +2282,9 @@
 %endif
 
 %changelog
+* Thu Aug 16 2007 John W. Linville <linville at redhat.com>
+- mac80211: store freq info in sta_bss_list
+
 * Tue Aug 14 2007 Chuck Ebbert <cebbert at redhat.com>
 - revert "don't BUG on too-large memory allocation"
 - limit memory allocated by input force feedback drivers




More information about the fedora-extras-commits mailing list