Bug 20152 - Warning while connecting WUSB54GS device
Summary: Warning while connecting WUSB54GS device
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Jussi Kivilinna
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 14:50 UTC by Pitxyoki
Modified: 2010-12-22 15:14 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Warning caught under 2.6.36-rc7 (4.64 KB, text/plain)
2010-10-12 14:51 UTC, Pitxyoki
Details
Warning caught under 2.6.32.24 (5.46 KB, text/plain)
2010-10-12 14:56 UTC, Pitxyoki
Details
Enable debugging output for rndis_wlan. (660 bytes, patch)
2010-10-18 08:43 UTC, Jussi Kivilinna
Details | Diff
Scan tests without network-manager running (21.89 KB, text/plain)
2010-10-18 22:48 UTC, Pitxyoki
Details
Connection test without network-manager running (28.17 KB, text/plain)
2010-10-18 22:49 UTC, Pitxyoki
Details
network-manager connecting (133.84 KB, text/plain)
2010-10-18 22:50 UTC, Pitxyoki
Details
Try to get device return bssid by issuing explicit scan on connect (1.62 KB, patch)
2010-10-19 07:21 UTC, Jussi Kivilinna
Details | Diff
Connection test w/ patch and without n-m (17.20 KB, text/plain)
2010-10-19 11:59 UTC, Pitxyoki
Details
Workaround warning by manually crafting bss when not otherwise available (6.10 KB, patch)
2010-10-19 16:31 UTC, Jussi Kivilinna
Details | Diff
Longer scan delay might fix the scanning issue. (571 bytes, patch)
2010-10-19 16:34 UTC, Jussi Kivilinna
Details | Diff

Description Pitxyoki 2010-10-12 14:50:25 UTC
Hi,

When I connect my USB wireless card (Linksys WUSB54GS, rndis_wlan module) and after configuring it with iwconfig + dhclient, I see a warning on the kernel output. The device seems to work correctly afterwards, though.
If I use network-manager I see no warning at all being printed on the syslog.

I see this behaviour both on 2.6.32.24 as well as 2.6.36-rc7. I haven't tested other kernel versions.

This is the card:
Bus 002 Device 003: ID 13b1:000e Linksys WUSB54GS v1 802.11g Adapter [Broadcom 4320 USB]

I'm attaching said output.


Best regards,
Luís Picciochi
Comment 1 Pitxyoki 2010-10-12 14:51:48 UTC
Created attachment 33362 [details]
Warning caught under 2.6.36-rc7
Comment 2 Pitxyoki 2010-10-12 14:56:25 UTC
Created attachment 33372 [details]
Warning caught under 2.6.32.24
Comment 3 Jussi Kivilinna 2010-10-12 20:21:41 UTC
Problem most likely is that rndis_wlan_do_link_up_work() assumes that "Internal bss list in device always contains at least the currently connected bss" at the time of 'media connect' indication. 

This is true for BCM4320b device that I have, but your device is BCM4320a type. So problem is that cfg80211 doesn't have bss for access point, device is already connected to, thus warning (bss == null).

Maybe BCM4320a needs full scan to get bss information, or maybe rndis_wlan should try just fake/construct bss information for cfg80211 with a-type device.
Comment 4 Pitxyoki 2010-10-12 23:29:54 UTC
I'm not sure that I understand your description but probably this is related:
- It can take a long time (sometimes 20 to 30 minutes) for the device to show my SSID with 'iwlist scan' after starting from a cold boot. Other devices on my network (one of them is usually placed near this one) don't have this problem.

- I notice that I can connect to my network even when 'iwlist scan' doesn't show my AP on the scan results. After I run iwconfig / dhclient and the connection is established, 'iwlist scan' always shows my AP from that point on.

- The time to detect the AP's beacon is particularly noticeable when I use network-manager. n-m seems to connect only after it detects a beacon with a scan.

- If I have n-m running, after I use iwconfig/dhclient and am connected to the network, n-m will re-connect afterwards. I suppose this is because scans show my AP's beacon after the connection is established. n-m then sees the network and will then connect to it.


Please tell me if there are any tests I can do to help you triage this.
Comment 5 Jussi Kivilinna 2010-10-18 08:42:31 UTC
(In reply to comment #4)
> I'm not sure that I understand your description but probably this is related:
> - It can take a long time (sometimes 20 to 30 minutes) for the device to show
> my SSID with 'iwlist scan' after starting from a cold boot. Other devices on
> my
> network (one of them is usually placed near this one) don't have this
> problem.

Ok, this means that scanning doesn't seem to work with BCM4320a and is mostlikely separate issue from the warning.

> - I notice that I can connect to my network even when 'iwlist scan' doesn't
> show my AP on the scan results. After I run iwconfig / dhclient and the
> connection is established, 'iwlist scan' always shows my AP from that point
> on.

But since we get the warning, currently AP doesn't show up as fast as with BCM4320b. But it's good to know that it will show up quickly after some time. Maybe older firmware requires some extra tricks (like issueing scan before reading scan results in 'media connect' handler).

> - The time to detect the AP's beacon is particularly noticeable when I use
> network-manager. n-m seems to connect only after it detects a beacon with a
> scan.
>
> - If I have n-m running, after I use iwconfig/dhclient and am connected to
> the
> network, n-m will re-connect afterwards. I suppose this is because scans show
> my AP's beacon after the connection is established. n-m then sees the network
> and will then connect to it.

I'd say this is expected as n-m will keep scanning and when it sees AP, it will (re)connect even if its the same AP we are already manually connected. This because n-m doesn't monitor manual use of network devices and expects to be sole user.

> 
> Please tell me if there are any tests I can do to help you triage this.

I'll attach patch for 2.6.36 to enable debugging in rndis_wlan, it might show more info on the scanning issue and about the warning.
Comment 6 Jussi Kivilinna 2010-10-18 08:43:15 UTC
Created attachment 33922 [details]
Enable debugging output for rndis_wlan.
Comment 7 Pitxyoki 2010-10-18 22:46:38 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > I'm not sure that I understand your description but probably this is
> related:
> > - It can take a long time (sometimes 20 to 30 minutes) for the device to
> show
> > my SSID with 'iwlist scan' after starting from a cold boot. Other devices
> on my
> > network (one of them is usually placed near this one) don't have this
> problem.
> 
> Ok, this means that scanning doesn't seem to work with BCM4320a and is
> mostlikely separate issue from the warning.

I forgot to mention that other SSIDs appear when I scan. My SSID always ends up showing, eventually. It just takes time. Sometimes it is not long, others it is. Scanning looks like it's working, just not very well.

I'm attaching the output I got with debugging enabled: two logs are with network-manager disabled, where I tested scanning and connecting without having done any previous scan. The third is just letting n-m do it's thing.
Comment 8 Pitxyoki 2010-10-18 22:48:49 UTC
Created attachment 34062 [details]
Scan tests without network-manager running
Comment 9 Pitxyoki 2010-10-18 22:49:49 UTC
Created attachment 34072 [details]
Connection test without network-manager running
Comment 10 Pitxyoki 2010-10-18 22:50:23 UTC
Created attachment 34082 [details]
network-manager connecting
Comment 11 Jussi Kivilinna 2010-10-19 07:21:49 UTC
Created attachment 34112 [details]
Try to get device return bssid by issuing explicit scan on connect

I read more of the NDIS spec and indeed device should return currectly associated BSSID when retrieving BSSID scan list. So this patch pokes device/firmware little more in hopes that it will update internal bssid list.
Comment 12 Jussi Kivilinna 2010-10-19 07:24:54 UTC
Above patch might work, but on the other hand, debug output with n-m shows that scans after connect do not always get current bssid. So device might not be following NDIS spec correctly.

Please test with debug enabled.
Comment 13 Pitxyoki 2010-10-19 11:58:11 UTC
It doesn't seem to have changed much.
Comment 14 Pitxyoki 2010-10-19 11:59:02 UTC
Created attachment 34132 [details]
 Connection test w/ patch and without n-m
Comment 15 Jussi Kivilinna 2010-10-19 16:31:50 UTC
Created attachment 34142 [details]
Workaround warning by manually crafting bss when not otherwise available

Add workaround but only in case device internal BSS list doesn't have the BSS for currently associated AP.
Comment 16 Jussi Kivilinna 2010-10-19 16:34:56 UTC
Created attachment 34152 [details]
Longer scan delay might fix the scanning issue.

NDIS spec says scan must be ready after 6 seconds. Now this might not be true for real devices, so lets relax scan delay (6 sec to 9 sec) a little bit so we hopefully catch more APs.
Comment 17 Pitxyoki 2010-10-19 18:30:03 UTC
With these patches the warning doesn't seem to appear anymore.

It still takes a long time until I see my beacon. About 20 minutes on my latest test. Should I file a new bug for this?
Comment 18 Jussi Kivilinna 2010-10-20 07:29:18 UTC
(In reply to comment #17)
> With these patches the warning doesn't seem to appear anymore.
> 
> It still takes a long time until I see my beacon. About 20 minutes on my
> latest
> test. Should I file a new bug for this?

Please do. I have few ideas to test.
Comment 19 Jussi Kivilinna 2010-12-22 15:14:39 UTC
'Workaround warning by manually crafting bss when not otherwise available' is going to 2.6.38 and workarounds the hardware bug. Marking bug resolved.

Note You need to log in before you can comment on or make changes to this bug.