2009-01-23 02:08:42

by Larry Finger

[permalink] [raw]
Subject: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

With the commit of the subject, my b43 and p54usb devices stopped working. They could
associate and authenticate with my WPA2 network, but never finish the DHCP connection and
get an IP address. Surprisingly, my rtl8187 devices continued to work.

Please excuse the second sending of this. I missed wireless the first time.

Larry



2009-01-23 05:17:32

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Fri, Jan 23, 2009 at 2:08 AM, Larry Finger <[email protected]> wrote:
> With the commit of the subject, my b43 and p54usb devices stopped working. They could
> associate and authenticate with my WPA2 network, but never finish the DHCP connection and
> get an IP address. Surprisingly, my rtl8187 devices continued to work.

I don't want to do a "me too", but my rtl8187B broke yesterday after
upgrading to wireless-testing/compat-wireless head,
and it worked again today. There are only two patches between
yesterday and today and one of them is John's revert, so it is
possible that the rtl8187B is also affected.

The symptom is as you said, I can associate and authenticate, but dhcp
won't finish and wpa_suplicant ifdown the device.
I tried that a few times and restarting NM, modprobe -r/-v, etc. In
the end it was easier just to blow away the compat-wireless update
redirectory and revert back to the vendor-shipped kernel modules - and
hope that it is just a transient problem and the problem would go away
when I git fetch next time :-).

2009-01-23 16:04:24

by Michael Büsch

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Friday 23 January 2009 16:49:18 John W. Linville wrote:
> On Fri, Jan 23, 2009 at 04:47:50PM +0100, Michael Buesch wrote:
> > On Friday 23 January 2009 03:08:31 Larry Finger wrote:
> > > With the commit of the subject, my b43 and p54usb devices stopped working. They could
> > > associate and authenticate with my WPA2 network, but never finish the DHCP connection and
> > > get an IP address. Surprisingly, my rtl8187 devices continued to work.
> > >
> > > Please excuse the second sending of this. I missed wireless the first time.
> >
> > Do you have a diff of this commit? Or at least the date it was committed?
> > I have some strange AP mode issue and it might be related to this. I just want to verify.
>
> That commit ID should still be available in wireless-testing --
> git show e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Oh ok. I thought you just took it out and rebased.
Thanks :)

--
Greetings, Michael.

2009-01-23 12:33:35

by Samuel Ortiz

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Fri, Jan 23, 2009 at 08:13:45AM +0100, Alina Friedrichsen wrote:
> Hello!
>=20
> > > I reverted this in wireless-testing (and it never went anywhere
> > > upstream). Of course, now it looks like Samuel has a fix...maybe
> > > I'll combine them...
> >=20
> > Samuel's fix works for me.
>=20
> If this works for the others too, I would propose the following patch=
=2E Without it, e.g. the beacon messages in IBSS mode are broken, if yo=
u set a fixed BSSID.
>=20
> (The iwl4965 low level driver sends back an error code, if you want t=
o set a fixed BSSID, so I think, we should simply ignore it, as it will=
be tried the next time when the initiated new network join is complete=
=2E)
>
I dont think we should ignore the if_config() return value.
Is the 4965 error code sent when trying to set a fixed BSSID in IBSS ?
I dont see it in STA mode, when associating to my AP.

Cheers,
Samuel.
=20
> Regards
> Alina
>=20
> --=20
> Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit a=
llen: http://www.gmx.net/de/go/multimessenger

> diff -urN compat-wireless-2009-01-23.orig/net/mac80211/mlme.c compat-=
wireless-2009-01-23/net/mac80211/mlme.c
> --- compat-wireless-2009-01-23.orig/net/mac80211/mlme.c 2009-01-23 06=
:12:14.000000000 +0100
> +++ compat-wireless-2009-01-23/net/mac80211/mlme.c 2009-01-23 07:58:3=
1.000000000 +0100
> @@ -1614,6 +1614,7 @@
> =20
> ieee80211_sta_def_wmm_params(sdata, bss);
> =20
> + ifsta->flags |=3D IEEE80211_STA_PREV_BSSID_SET;
> ifsta->state =3D IEEE80211_STA_MLME_IBSS_JOINED;
> mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);
> =20
> @@ -2177,19 +2178,18 @@
> int i;
> int ret;
> =20
> -#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 prope=
r
> - * random number generator get different BSSID. */
> - get_random_bytes(bssid, ETH_ALEN);
> - for (i =3D 0; i < ETH_ALEN; i++)
> - bssid[i] ^=3D sdata->dev->dev_addr[i];
> - bssid[0] &=3D ~0x01;
> - bssid[0] |=3D 0x02;
> -#endif
> + 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 prop=
er
> + * random number generator get different BSSID. */
> + get_random_bytes(bssid, ETH_ALEN);
> + for (i =3D 0; i < ETH_ALEN; i++)
> + bssid[i] ^=3D sdata->dev->dev_addr[i];
> + bssid[0] &=3D ~0x01;
> + bssid[0] |=3D 0x02;
> + }
> =20
> printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n",
> sdata->dev->name, bssid);
> @@ -2250,6 +2250,9 @@
> memcmp(ifsta->ssid, bss->ssid, bss->ssid_len) !=3D 0
> || !(bss->capability & WLAN_CAPABILITY_IBSS))
> continue;
> + if ((ifsta->flags & IEEE80211_STA_BSSID_SET) &&
> + memcmp(ifsta->bssid, bss->bssid, ETH_ALEN) !=3D 0)
> + continue;
> #ifdef CONFIG_MAC80211_IBSS_DEBUG
> printk(KERN_DEBUG " bssid=3D%pM found\n", bss->bssid);
> #endif /* CONFIG_MAC80211_IBSS_DEBUG */
> @@ -2266,7 +2269,9 @@
> "%pM\n", bssid, ifsta->bssid);
> #endif /* CONFIG_MAC80211_IBSS_DEBUG */
> =20
> - if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) !=3D 0) {
> + if (found &&
> + ((!(ifsta->flags & IEEE80211_STA_PREV_BSSID_SET)) ||
> + memcmp(ifsta->bssid, bssid, ETH_ALEN) !=3D 0)) {
> int ret;
> int search_freq;
> =20
> @@ -2604,16 +2609,16 @@
> memset(ifsta->ssid, 0, sizeof(ifsta->ssid));
> memcpy(ifsta->ssid, ssid, len);
> ifsta->ssid_len =3D len;
> - ifsta->flags &=3D ~IEEE80211_STA_PREV_BSSID_SET;
> }
> =20
> + ifsta->flags &=3D ~IEEE80211_STA_PREV_BSSID_SET;
> +
> if (len)
> ifsta->flags |=3D IEEE80211_STA_SSID_SET;
> else
> ifsta->flags &=3D ~IEEE80211_STA_SSID_SET;
> =20
> - if (sdata->vif.type =3D=3D NL80211_IFTYPE_ADHOC &&
> - !(ifsta->flags & IEEE80211_STA_BSSID_SET)) {
> + if (sdata->vif.type =3D=3D NL80211_IFTYPE_ADHOC) {
> ifsta->ibss_join_req =3D jiffies;
> ifsta->state =3D IEEE80211_STA_MLME_IBSS_SEARCH;
> return ieee80211_sta_find_ibss(sdata, ifsta);
> @@ -2633,36 +2638,21 @@
> int ieee80211_sta_set_bssid(struct ieee80211_sub_if_data *sdata, u8 =
*bssid)
> {
> struct ieee80211_if_sta *ifsta;
> - int res;
> - bool valid;
> =20
> ifsta =3D &sdata->u.sta;
> - valid =3D is_valid_ether_addr(bssid);
> =20
> - if (memcmp(ifsta->bssid, bssid, ETH_ALEN) !=3D 0) {
> - if(valid)
> - memcpy(ifsta->bssid, bssid, ETH_ALEN);
> - else
> - memset(ifsta->bssid, 0, ETH_ALEN);
> - res =3D 0;
> - /*
> - * Hack! See also ieee80211_sta_set_ssid.
> - */
> - if (netif_running(sdata->dev))
> - res =3D 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 (valid)
> + if (is_valid_ether_addr(bssid)) {
> + memcpy(ifsta->bssid, bssid, ETH_ALEN);
> ifsta->flags |=3D IEEE80211_STA_BSSID_SET;
> - else
> + } else {
> + memset(ifsta->bssid, 0, ETH_ALEN);
> ifsta->flags &=3D ~IEEE80211_STA_BSSID_SET;
> + }
> =20
> - return 0;
> + if (netif_running(sdata->dev))
> + ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID);
> +
> + return ieee80211_sta_set_ssid(sdata, ifsta->ssid, ifsta->ssid_len);
> }
> =20
> int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, =
char *ie, size_t len)


--=20
Intel Open Source Technology Centre
http://oss.intel.com/

2009-01-23 15:48:55

by Michael Büsch

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Friday 23 January 2009 03:08:31 Larry Finger wrote:
> With the commit of the subject, my b43 and p54usb devices stopped working. They could
> associate and authenticate with my WPA2 network, but never finish the DHCP connection and
> get an IP address. Surprisingly, my rtl8187 devices continued to work.
>
> Please excuse the second sending of this. I missed wireless the first time.

Do you have a diff of this commit? Or at least the date it was committed?
I have some strange AP mode issue and it might be related to this. I just want to verify.

--
Greetings, Michael.

2009-01-23 05:40:55

by Alina Friedrichsen

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hello!

> I don't want to do a "me too", but my rtl8187B broke yesterday after
> upgrading to wireless-testing/compat-wireless head,
> and it worked again today. There are only two patches between
> yesterday and today and one of them is John's revert, so it is
> possible that the rtl8187B is also affected.
>=20
> The symptom is as you said, I can associate and authenticate, but dhc=
p
> won't finish and wpa_suplicant ifdown the device.
> I tried that a few times and restarting NM, modprobe -r/-v, etc. In
> the end it was easier just to blow away the compat-wireless update
> redirectory and revert back to the vendor-shipped kernel modules - an=
d
> hope that it is just a transient problem and the problem would go awa=
y
> when I git fetch next time :-).

I unfortunately can't reproduce the problem with my b43 und my other ca=
rds work fine, too. But I think the problem is that the NetworkManager =
does the following: (And causes with it some low level drivers and wifi=
cards into trouble.)

[99554.112921] wlan0: Set SSID
[99554.113853] wlan0: Set BSSID
[99554.113861] wlan0: Set SSID
[99554.115084] wlan0: Set BSSID
[99554.115091] wlan0: Set SSID

Have you test it manual with the NetworkManager disabled?

Regards
Alina

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger

2009-01-23 16:34:11

by Larry Finger

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

I saw some mention of a V4 of this patch in other mails but V3 fixes
the problem for me.

Larry


2009-01-23 05:32:56

by Larry Finger

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

John W. Linville wrote:
>
> I reverted this in wireless-testing (and it never went anywhere
> upstream). Of course, now it looks like Samuel has a fix...maybe
> I'll combine them...

Samuel's fix works for me.

Larry

2009-01-23 07:13:53

by Alina Friedrichsen

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hello!

> > I reverted this in wireless-testing (and it never went anywhere
> > upstream). Of course, now it looks like Samuel has a fix...maybe
> > I'll combine them...
>
> Samuel's fix works for me.

If this works for the others too, I would propose the following patch. Without it, e.g. the beacon messages in IBSS mode are broken, if you set a fixed BSSID.

(The iwl4965 low level driver sends back an error code, if you want to set a fixed BSSID, so I think, we should simply ignore it, as it will be tried the next time when the initiated new network join is complete.)

Regards
Alina

--
Psssst! Schon vom neuen GMX MultiMessenger geh?rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


Attachments:
fixed-bssid-revisited-v3.patch (4.06 kB)

2009-01-23 23:16:12

by Alina Friedrichsen

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hi Samuel!

> I dont think we should ignore the if_config() return value.

I can write a warning in the kernel log, to help the low-level driver d=
evelopers to debug this problem, but I don't want to stop the new mergi=
ng process, so that the driver hangs in a mostly undefined state.

> Is the 4965 error code sent when trying to set a fixed BSSID in IBSS =
?
> I dont see it in STA mode, when associating to my AP.

I unfortunately don't know the error code, because I don't have the car=
d, but I think if the setting of the BSSID fails here, I should work in=
the new initiated normal joining process, even in broken low-level dri=
vers.

Regards
Alina

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger

2009-01-23 20:18:36

by Sedat Dilek

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Sorry for the confusion, it's
"mac80211-Fixed-BSSID-handling-revisited-v3.patch" (not v4, see [1]).
And as I mentioned before - it works for me, too.
I requested to Alina to send a separate email incl. this new v3 patch.
Hope this will stop confusing.

Don't know if Samuels complains about if_config()/STA mode for iwl4965
[2] were clarified in the meantime.

-SD

[1] http://marc.info/?l=linux-wireless&m=123270461025225&w=2
[2] http://marc.info/?l=linux-wireless&m=123271402006665&w=2

On Fri, Jan 23, 2009 at 5:33 PM, Larry Finger <[email protected]> wrote:
> I saw some mention of a V4 of this patch in other mails but V3 fixes
> the problem for me.
>
> Larry
>
> --
> 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
>

2009-01-23 16:00:49

by John W. Linville

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Fri, Jan 23, 2009 at 04:47:50PM +0100, Michael Buesch wrote:
> On Friday 23 January 2009 03:08:31 Larry Finger wrote:
> > With the commit of the subject, my b43 and p54usb devices stopped working. They could
> > associate and authenticate with my WPA2 network, but never finish the DHCP connection and
> > get an IP address. Surprisingly, my rtl8187 devices continued to work.
> >
> > Please excuse the second sending of this. I missed wireless the first time.
>
> Do you have a diff of this commit? Or at least the date it was committed?
> I have some strange AP mode issue and it might be related to this. I just want to verify.

That commit ID should still be available in wireless-testing --
git show e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hth!

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2009-01-23 09:56:28

by Sedat Dilek

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hi Alina,

Version 4 of your patch is working for me against wl
(master-2009-01-22) and with iwl3945.
Samuel's patch is obsolete.

Could you please send a separate email containing your new patch v4?
>>> [PATCH v4] mac80211: Fixed BSSID handling revisited. <<<

My 2nd request is just cosmetics:
Can you please patch next time against wireless directory (patch is attached).
This is just a proposal.

Thanks for your help.

Kind Regards,
Sedat

On Fri, Jan 23, 2009 at 8:13 AM, Alina Friedrichsen <[email protected]> wrote:
> Hello!
>
>> > I reverted this in wireless-testing (and it never went anywhere
>> > upstream). Of course, now it looks like Samuel has a fix...maybe
>> > I'll combine them...
>>
>> Samuel's fix works for me.
>
> If this works for the others too, I would propose the following patch. Without it, e.g. the beacon messages in IBSS mode are broken, if you set a fixed BSSID.
>
> (The iwl4965 low level driver sends back an error code, if you want to set a fixed BSSID, so I think, we should simply ignore it, as it will be tried the next time when the initiated new network join is complete.)
>
> Regards
> Alina
>
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
>


Attachments:
mac80211-Fixed-BSSID-handling-revisited-v4.patch (3.97 kB)

2009-01-23 02:12:01

by John W. Linville

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

On Thu, Jan 22, 2009 at 08:08:31PM -0600, Larry Finger wrote:
> With the commit of the subject, my b43 and p54usb devices stopped working. They could
> associate and authenticate with my WPA2 network, but never finish the DHCP connection and
> get an IP address. Surprisingly, my rtl8187 devices continued to work.
>
> Please excuse the second sending of this. I missed wireless the first time.

I reverted this in wireless-testing (and it never went anywhere
upstream). Of course, now it looks like Samuel has a fix...maybe
I'll combine them...

John
--
John W. Linville Linux should be at the core
[email protected] of your literate lifestyle.

2009-01-23 02:21:02

by Alina Friedrichsen

[permalink] [raw]
Subject: Re: Regression caused by commit e32b1b9a33759e8a83ac566c4c43f23ed5d6343b

Hello!

> I reverted this in wireless-testing (and it never went anywhere
> upstream). Of course, now it looks like Samuel has a fix...maybe
> I'll combine them...

I will check this problem and look for the cleanest solution.

Sorry, for the trouble. :(

Regards
Alina

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger