Thanks Samuel, this works. -SD ----- BEGIN series ----- # 00xx-series: All patches against wireless-testing (master-2009-01-21) 0000-patches-against-wl-v2.6.29-rc2-11925-g88e5942 # # 01xx-series: Patches from <kernel.org> 0100-patch-2.6.29-rc2-git1 # # 02xx-series: Patches from wl-mailing-list 0200-Revert-mac80211-Fixed-BSSID-handling-revisited.patch ----- END series ----- On Fri, Jan 23, 2009 at 12:41 AM, <samuel@xxxxxxxxxx> wrote: > > On Thu, 22 Jan 2009 13:34:48 -0500, "John W. Linville" > <linville@xxxxxxxxxxxxx> wrote: >> On Thu, Jan 22, 2009 at 08:26:14PM +0200, Kalle Valo wrote: >>> Hello, >>> >>> I upgraded to the latest wireless-testing and my iwl3945 is now >>> broken. It can associate but no data is transfered after that. Tried >>> with open and wep modes. With dhcp I cannot get ip and with static ip >>> ping to the gateway doesn't work. >>> >>> Any hints? >> >> Lots of iwlwifi stuff merged yesterday... > The bad commit seems to be e32b1b9a33759e8a83ac566c4c43f23ed5d6343b, which > is not iwlwifi related. > Even though it's an mlme commit, it doesnt seem to affect other drivers (at > least b43 and ath5k). > I'll come up soon with a proper fix, but for now iwl3945 users should > revert that commit locally. > > Cheers, > Samuel. > >> >> Chatre, Reinette (1): >> iwl3945: add debugging for wrong command queue >> >> Helmut Schaa (2): >> iwl3945: fix some warnings when compiled without debug >> iwlagn: fix hw-rfkill while the interface is down >> >> Jay Sternberg (4): >> iwlwifi: correct Kconfig to prevent following entries from not >> indenting >> iwlwifi: remove static from 5000 structures >> iwlwifi: add recognition of Intel WiFi Link 6000 and 6050 Series >> iwlwifi: add recognition of Intel WiFi Link 100 Series >> >> Reinette Chatre (1): >> iwlwifi: return NETDEV_TX_OK from _tx ops >> >> Samuel Ortiz (3): >> iwl3945: Use iwl_txq_update_write_ptr >> iwlwifi: Add TFD library operations >> iwl3945: Use iwl-hcmd host command routines >> >> Winkler, Tomas (6): >> iwlwifi: make iwl-power.c more readable >> iwlwifi: fix iwl_mac_set_key and iwl3945_mac_set_key >> iwlwifi: kill iwl3945_scan_cancel and iwl3945_scan_cancel_timeout >> iwlwifi: kill scan39 >> iwlwifi: remove unused or twice defined members in iwl_priv >> iwlwifi: eliminate power_data_39. > -- > 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 >
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index ca9e415..b9e4b93 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1614,7 +1614,6 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, ieee80211_sta_def_wmm_params(sdata, bss); - ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET; ifsta->state = IEEE80211_STA_MLME_IBSS_JOINED; mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL); @@ -1758,8 +1757,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, (unsigned long long)(rx_timestamp - beacon_timestamp), jiffies); #endif /* CONFIG_MAC80211_IBSS_DEBUG */ - if (beacon_timestamp > rx_timestamp && - memcmp(sdata->u.sta.bssid, mgmt->bssid, ETH_ALEN) != 0) { + if (beacon_timestamp > rx_timestamp) { #ifdef CONFIG_MAC80211_IBSS_DEBUG printk(KERN_DEBUG "%s: beacon TSF higher than " "local TSF - IBSS merge with BSSID %pM\n", @@ -2179,18 +2177,19 @@ static int ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata, int i; int ret; - if (sdata->u.sta.flags & IEEE80211_STA_BSSID_SET) { - memcpy(bssid, ifsta->bssid, ETH_ALEN); - } else { - /* Generate random, not broadcast, locally administered BSSID. Mix in - * own MAC address to make sure that devices that do not have proper - * random number generator get different BSSID. */ - get_random_bytes(bssid, ETH_ALEN); - for (i = 0; i < ETH_ALEN; i++) - bssid[i] ^= sdata->dev->dev_addr[i]; - bssid[0] &= ~0x01; - bssid[0] |= 0x02; - } +#if 0 + /* Easier testing, use fixed BSSID. */ + memset(bssid, 0xfe, ETH_ALEN); +#else + /* Generate random, not broadcast, locally administered BSSID. Mix in + * own MAC address to make sure that devices that do not have proper + * random number generator get different BSSID. */ + get_random_bytes(bssid, ETH_ALEN); + for (i = 0; i < ETH_ALEN; i++) + bssid[i] ^= sdata->dev->dev_addr[i]; + bssid[0] &= ~0x01; + bssid[0] |= 0x02; +#endif printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", sdata->dev->name, bssid); @@ -2251,9 +2250,6 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata, memcmp(ifsta->ssid, bss->ssid, bss->ssid_len) != 0 || !(bss->capability & WLAN_CAPABILITY_IBSS)) continue; - if ((ifsta->flags & IEEE80211_STA_BSSID_SET) && - memcmp(ifsta->bssid, bss->bssid, ETH_ALEN) != 0) - continue; #ifdef CONFIG_MAC80211_IBSS_DEBUG printk(KERN_DEBUG " bssid=%pM found\n", bss->bssid); #endif /* CONFIG_MAC80211_IBSS_DEBUG */ @@ -2270,9 +2266,7 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata, "%pM\n", bssid, ifsta->bssid); #endif /* CONFIG_MAC80211_IBSS_DEBUG */ - if (found && - ((!(ifsta->flags & IEEE80211_STA_PREV_BSSID_SET)) || - memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0)) { + if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { int ret; int search_freq; @@ -2610,16 +2604,16 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size memset(ifsta->ssid, 0, sizeof(ifsta->ssid)); memcpy(ifsta->ssid, ssid, len); ifsta->ssid_len = len; + ifsta->flags &= ~IEEE80211_STA_PREV_BSSID_SET; } - ifsta->flags &= ~IEEE80211_STA_PREV_BSSID_SET; - if (len) ifsta->flags |= IEEE80211_STA_SSID_SET; else ifsta->flags &= ~IEEE80211_STA_SSID_SET; - if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { + if (sdata->vif.type == NL80211_IFTYPE_ADHOC && + !(ifsta->flags & IEEE80211_STA_BSSID_SET)) { ifsta->ibss_join_req = jiffies; ifsta->state = IEEE80211_STA_MLME_IBSS_SEARCH; return ieee80211_sta_find_ibss(sdata, ifsta); @@ -2639,18 +2633,36 @@ int ieee80211_sta_get_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 *bssid) { struct ieee80211_if_sta *ifsta; + int res; + bool valid; ifsta = &sdata->u.sta; + valid = is_valid_ether_addr(bssid); + + if (memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { + if(valid) + memcpy(ifsta->bssid, bssid, ETH_ALEN); + else + memset(ifsta->bssid, 0, ETH_ALEN); + res = 0; + /* + * Hack! See also ieee80211_sta_set_ssid. + */ + if (netif_running(sdata->dev)) + res = ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID); + if (res) { + printk(KERN_DEBUG "%s: Failed to config new BSSID to " + "the low-level driver\n", sdata->dev->name); + return res; + } + } - if (is_valid_ether_addr(bssid)) { - memcpy(ifsta->bssid, bssid, ETH_ALEN); + if (valid) ifsta->flags |= IEEE80211_STA_BSSID_SET; - } else { - memset(ifsta->bssid, 0, ETH_ALEN); + else ifsta->flags &= ~IEEE80211_STA_BSSID_SET; - } - return ieee80211_sta_set_ssid(sdata, ifsta->ssid, ifsta->ssid_len); + return 0; } int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, char *ie, size_t len)