Bug 12794

Summary: BCM4320a poor performance with rndis_wlan (was: rndis_wlan causes segmentation fault)
Product: Drivers Reporter: Pitxyoki (Pitxyoki)
Component: network-wirelessAssignee: Jussi Kivilinna (jussi.kivilinna)
Status: CLOSED CODE_FIX    
Severity: normal CC: jussi.kivilinna
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.32-rc5 Subsystem:
Regression: No Bisected commit-id:
Attachments: Fix support for bcm4320a
Fix too late initialization of workqueue/work
dhclient only able to connect on even attempts
Can't connect using iwconfig/dhclient
This patch fixes iwconfig setup for rndis_wlan.
New patch (v2) for iwconfig setup problem
Four test cases using the most recent kernel/driver + patch for iwconfig
Fix buffer overflow in rndis_wlan
Disable 'stalled link' -workaround
Patch 1/2 of tx-power reporting fix
2/2 patch for fixing tx-power reporting

Description Pitxyoki 2009-03-01 05:25:40 UTC
Latest working kernel version: Don't Know

Earliest failing kernel version: 2.6.29-rc6

Distribution: Debian 

Hardware Environment:
$ lsusb
Bus 005 Device 004: ID 13b1:000e Linksys

  This is an USB wireless adapter that is correctly identified by ndiswrapper as 
  wlan0: ethernet device 00:12:17:a0:b9:7c using NDIS driver: wusb54gs, version: 0x33c0d03, NDIS version: 0x501, vendor: 'Linksys Wireless-G USB Network Adapter with SpeedBooster', 13B1:000E.F.conf


Software Environment:
Debian Lenny


Problem Description:
  My wireless adapter works fine under kernel 2.6.26 with ndiswrapper and the Windows driver files loaded. If I remove ndiswrapper and modprobe rndis_wlan, the module gets loaded, but I get the following output when trying to get the device up:


#############################
# modprobe -v rndis_wlan
insmod /lib/modules/2.6.26-1-686/kernel/drivers/net/mii.ko 
insmod /lib/modules/2.6.26-1-686/kernel/drivers/net/usb/usbnet.ko 
insmod /lib/modules/2.6.26-1-686/kernel/drivers/net/usb/cdc_ether.ko 
insmod /lib/modules/2.6.26-1-686/kernel/drivers/net/usb/rndis_host.ko 
insmod /lib/modules/2.6.26-1-686/kernel/drivers/net/wireless/rndis_wlan.ko 


####From /var/log/syslog:####

Mar  1 11:42:45 C-5 kernel: [  149.780864] usbcore: registered new interface driver cdc_ether
Mar  1 11:42:45 C-5 kernel: [  149.836364] usbcore: registered new interface driver rndis_host
Mar  1 11:42:46 C-5 kernel: [  150.182544] rndis_wlan 5-4:1.0: rndis media disconnect
Mar  1 11:42:46 C-5 kernel: [  150.507274] wlan0: register 'rndis_wlan' at usb-0000:00:1d.7-4, Wireless RNDIS device, BCM4320a based, 01:0a:00:00:00:00
Mar  1 11:42:46 C-5 kernel: [  150.507274] usbcore: registered new interface driver rndis_wlan
Mar  1 11:42:46 C-5 kernel: [  150.507274] udev: renamed network interface wlan0 to wlan1


#############################
# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:11:2f:3b:9a:42  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan1     Link encap:Ethernet  HWaddr 01:0a:00:00:00:00  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[12:09:10] C-5:/etc/modprobe.d# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

wlan1     IEEE802.11bg  ESSID:off/any  
          Mode:Managed  Frequency:2.412 GHz  Bit Rate:54 Mb/s   Tx-Power=14 dBm   
          RTS thr=2347 B   Fragment thr=2346 B   
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

[12:09:15] C-5:/etc/modprobe.d# ifup wlan1
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
Listening on LPF/wlan1/01:0a:00:00:00:00
Sending on   LPF/wlan1/01:0a:00:00:00:00
Sending on   Socket/fallback
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 6
send_packet: Network is down
receive_packet failed on wlan1: Network is down
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 14
send_packet: Network is down
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 15
send_packet: Network is down
^C
(...)

#############################

  I notice the hardware address seems strange (HWaddr 01:0a:00:00:00:00). Perhaps this has some relation to the issue.


  After compiling and booting to kernel 2.6.29-rc6 by following the instructions at [1], when I modprobe rndis_wlan I get a segmentation fault with some verbose output on the terminal:


[11:36:47] C-5:/home/luis# modprobe -v rndis_wlan
insmod /lib/modules/2.6.29-rc6/kernel/drivers/net/mii.ko 
insmod /lib/modules/2.6.29-rc6/kernel/drivers/net/usb/usbnet.ko 
insmod /lib/modules/2.6.29-rc6/kernel/drivers/net/usb/cdc_ether.ko 
insmod /lib/modules/2.6.29-rc6/kernel/drivers/net/usb/rndis_host.ko 
insmod /lib/modules/2.6.29-rc6/kernel/drivers/net/wireless/rndis_wlan.ko 
Segmentation fault
[11:37:02] C-5:/home/luis# 
Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548593] last sysfs file: /sys/block/sda/sda1/stat

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548576] ------------[ cut here ]------------

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548731] Process modprobe (pid: 2863, ti=f1b12000 task=f6bd7810 task.ti=f1b12000)

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548587] invalid opcode: 0000 [#1] SMP 

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548735] Stack:

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548762]  0001010e f1fec480 f19d0878 f19d0800 00000401 f1b13e5c f19d0800 f1fec480

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548774] Call Trace:

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548777]  [<f8c53329>] rndis_command+0x1b8/0x247 [rndis_host]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548788]  [<f8c602e2>] rndis_set_oid+0xc9/0x123 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548798]  [<f8c61fbb>] rndis_wext_bind+0xa3/0x296 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548807]  [<c0197a3b>] find_inode+0x1b/0x56

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548813]  [<c0286ca1>] alloc_netdev_mq+0xfa/0x105

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548822]  [<c02911ed>] ether_setup+0x0/0x74

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548834]  [<f8c0c57b>] usbnet_probe+0x221/0x4fc [usbnet]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548851]  [<f88805e3>] usb_match_one_id+0x19/0x6e [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548885]  [<f8880b92>] usb_autopm_do_device+0xb4/0xbb [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548750]  0000000c 00000000 f19d09f8 f1b13e60 f19d0a18 00000020 f8c602e2 f1b13e5c

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548921]  [<f888134c>] usb_probe_interface+0xe2/0x12b [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548965]  [<c0262d51>] __driver_attach+0x49/0x67

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548975]  [<c0262708>] bus_for_each_dev+0x35/0x5b

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548956]  [<c0262c79>] driver_probe_device+0x99/0x128

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548986]  [<c0262b30>] driver_attach+0x11/0x13

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548992]  [<c0262d08>] __driver_attach+0x0/0x67

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548999]  [<c026218e>] bus_add_driver+0x91/0x1a7

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549014]  [<c0262ed5>] driver_register+0x7d/0xd6

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549032]  [<f888115b>] usb_register_driver+0x5d/0xb4 [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549065]  [<f8c2f000>] rndis_wlan_init+0x0/0x14 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549075]  [<c010112c>] _stext+0x44/0x119

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549081]  [<c0160299>] tracepoint_module_notify+0x21/0x24

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549089]  [<c013acae>] notifier_call_chain+0x2a/0x47

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549100]  [<c013af03>] __blocking_notifier_call_chain+0x3f/0x49

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549111]  [<c0147c27>] sys_init_module+0x87/0x182

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549118]  [<c01033db>] sysenter_do_call+0x12/0x2f

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549125] Code: 06 8b 0d bc 34 3d c0 8b 00 f7 d0 8b 04 88 eb 80 56 53 89 c3 89 d6 f0 0f ba 29 00 19 c0 31 d2 85 c0 75 2a 8d 41 04 39 41 04 74 04 <0f> 0b eb fe 83 7e 10 00 0f 45 1d bc 34 3d c0 8b 06 f7 d0 8b 04 

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549190] EIP: [<c0135197>] queue_work_on+0x1b/0x42 SS:ESP 0068:f1b13dc4
[11:37:02] C-5:/home/luis# 



##########################/var/log/syslog:######################################


Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548576] ------------[ cut here ]------------

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548593] last sysfs file: /sys/block/sda/sda1/stat

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548587] invalid opcode: 0000 [#1] SMP 

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548731] Process modprobe (pid: 2863, ti=f1b12000 task=f6bd7810 task.ti=f1b12000)

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548735] Stack:

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548762]  0001010e f1fec480 f19d0878 f19d0800 00000401 f1b13e5c f19d0800 f1fec480

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548774] Call Trace:

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548777]  [<f8c53329>] rndis_command+0x1b8/0x247 [rndis_host]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548788]  [<f8c602e2>] rndis_set_oid+0xc9/0x123 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548798]  [<f8c61fbb>] rndis_wext_bind+0xa3/0x296 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548807]  [<c0197a3b>] find_inode+0x1b/0x56

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548813]  [<c0286ca1>] alloc_netdev_mq+0xfa/0x105

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548822]  [<c02911ed>] ether_setup+0x0/0x74

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548834]  [<f8c0c57b>] usbnet_probe+0x221/0x4fc [usbnet]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548851]  [<f88805e3>] usb_match_one_id+0x19/0x6e [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548750]  0000000c 00000000 f19d09f8 f1b13e60 f19d0a18 00000020 f8c602e2 f1b13e5c

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548885]  [<f8880b92>] usb_autopm_do_device+0xb4/0xbb [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548921]  [<f888134c>] usb_probe_interface+0xe2/0x12b [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548965]  [<c0262d51>] __driver_attach+0x49/0x67

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548956]  [<c0262c79>] driver_probe_device+0x99/0x128

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548975]  [<c0262708>] bus_for_each_dev+0x35/0x5b

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548986]  [<c0262b30>] driver_attach+0x11/0x13

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548992]  [<c0262d08>] __driver_attach+0x0/0x67

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.548999]  [<c026218e>] bus_add_driver+0x91/0x1a7

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549014]  [<c0262ed5>] driver_register+0x7d/0xd6

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549032]  [<f888115b>] usb_register_driver+0x5d/0xb4 [usbcore]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549065]  [<f8c2f000>] rndis_wlan_init+0x0/0x14 [rndis_wlan]

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549075]  [<c010112c>] _stext+0x44/0x119

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549081]  [<c0160299>] tracepoint_module_notify+0x21/0x24

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549089]  [<c013acae>] notifier_call_chain+0x2a/0x47

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549100]  [<c013af03>] __blocking_notifier_call_chain+0x3f/0x49

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549111]  [<c0147c27>] sys_init_module+0x87/0x182

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549118]  [<c01033db>] sysenter_do_call+0x12/0x2f

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549125] Code: 06 8b 0d bc 34 3d c0 8b 00 f7 d0 8b 04 88 eb 80 56 53 89 c3 89 d6 f0 0f ba 29 00 19 c0 31 d2 85 c0 75 2a 8d 41 04 39 41 04 74 04 <0f> 0b eb fe 83 7e 10 00 0f 45 1d bc 34 3d c0 8b 06 f7 d0 8b 04 

Message from syslogd@C-5 at Sun Mar  1 11:37:02 2009 ...
C-5 kernel: [   91.549190] EIP: [<c0135197>] queue_work_on+0x1b/0x42 SS:ESP 0068:f1b13dc4
Mar  1 11:37:02 C-5 kernel: [   91.211925] usbcore: registered new interface driver cdc_ether
Mar  1 11:37:02 C-5 kernel: [   91.256692] usbcore: registered new interface driver rndis_host
Mar  1 11:37:02 C-5 kernel: [   91.548549] rndis_wlan 5-4:1.0: rndis media disconnect
Mar  1 11:37:02 C-5 kernel: [   91.548576] ------------[ cut here ]------------
Mar  1 11:37:02 C-5 kernel: [   91.548582] kernel BUG at kernel/workqueue.c:189!
Mar  1 11:37:02 C-5 kernel: [   91.548587] invalid opcode: 0000 [#1] SMP 
Mar  1 11:37:02 C-5 kernel: [   91.548593] last sysfs file: /sys/block/sda/sda1/stat
Mar  1 11:37:02 C-5 kernel: [   91.548596] Modules linked in: rndis_wlan(+) rndis_host cdc_ether usbnet mii snd_seq_dummy i915 drm ppdev lp i2c_algo_bit ipv6 ntfs nls_utf8 nls_cp437 vfat fat nls_base w83627ehf hwmon_vid sbp2 loop snd_hda_codec_cmedia snd_hda_intel serio_raw psmouse i2c_i801 snd_hda_codec pcspkr rng_core i2c_core iTCO_wdt snd_pcm snd_seq snd_timer snd_seq_device parport_pc parport snd button soundcore snd_page_alloc intel_agp agpgart evdev ext3 jbd mbcache sg sr_mod cdrom sd_mod ide_pci_generic piix ata_generic ide_gd_mod ahci ata_piix libata it821x floppy scsi_mod ohci1394 ide_core ehci_hcd ieee1394 uhci_hcd usbcore sky2 thermal processor fan thermal_sys
Mar  1 11:37:02 C-5 kernel: [   91.548692] 
Mar  1 11:37:02 C-5 kernel: [   91.548697] Pid: 2863, comm: modprobe Not tainted (2.6.29-rc6 #1) To Be Filled By O.E.M.
Mar  1 11:37:02 C-5 kernel: [   91.548703] EIP: 0060:[<c0135197>] EFLAGS: 00210213 CPU: 0
Mar  1 11:37:02 C-5 kernel: [   91.548712] EIP is at queue_work_on+0x1b/0x42
Mar  1 11:37:02 C-5 kernel: [   91.548717] EAX: f19d086c EBX: 00000000 ECX: f19d0868 EDX: 00000000
Mar  1 11:37:02 C-5 kernel: [   91.548721] ESI: 00000000 EDI: f8c539a8 EBP: f1fec480 ESP: f1b13dc4
Mar  1 11:37:02 C-5 kernel: [   91.548726]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Mar  1 11:37:02 C-5 kernel: [   91.548731] Process modprobe (pid: 2863, ti=f1b12000 task=f6bd7810 task.ti=f1b12000)
Mar  1 11:37:02 C-5 kernel: [   91.548735] Stack:
Mar  1 11:37:02 C-5 kernel: [   91.548738]  f68ea688 f19d09f8 f8c53329 00000401 f1fec550 00000000 00000000 80000005
Mar  1 11:37:02 C-5 kernel: [   91.548750]  0000000c 00000000 f19d09f8 f1b13e60 f19d0a18 00000020 f8c602e2 f1b13e5c
Mar  1 11:37:02 C-5 kernel: [   91.548762]  0001010e f1fec480 f19d0878 f19d0800 00000401 f1b13e5c f19d0800 f1fec480
Mar  1 11:37:02 C-5 kernel: [   91.548774] Call Trace:
Mar  1 11:37:02 C-5 kernel: [   91.548777]  [<f8c53329>] rndis_command+0x1b8/0x247 [rndis_host]
Mar  1 11:37:02 C-5 kernel: [   91.548788]  [<f8c602e2>] rndis_set_oid+0xc9/0x123 [rndis_wlan]
Mar  1 11:37:02 C-5 kernel: [   91.548798]  [<f8c61fbb>] rndis_wext_bind+0xa3/0x296 [rndis_wlan]
Mar  1 11:37:02 C-5 kernel: [   91.548807]  [<c0197a3b>] find_inode+0x1b/0x56
Mar  1 11:37:02 C-5 kernel: [   91.548813]  [<c0286ca1>] alloc_netdev_mq+0xfa/0x105
Mar  1 11:37:02 C-5 kernel: [   91.548822]  [<c02911ed>] ether_setup+0x0/0x74
Mar  1 11:37:02 C-5 kernel: [   91.548834]  [<f8c0c57b>] usbnet_probe+0x221/0x4fc [usbnet]
Mar  1 11:37:02 C-5 kernel: [   91.548851]  [<f88805e3>] usb_match_one_id+0x19/0x6e [usbcore]
Mar  1 11:37:02 C-5 kernel: [   91.548885]  [<f8880b92>] usb_autopm_do_device+0xb4/0xbb [usbcore]
Mar  1 11:37:02 C-5 kernel: [   91.548921]  [<f888134c>] usb_probe_interface+0xe2/0x12b [usbcore]
Mar  1 11:37:02 C-5 kernel: [   91.548956]  [<c0262c79>] driver_probe_device+0x99/0x128
Mar  1 11:37:02 C-5 kernel: [   91.548965]  [<c0262d51>] __driver_attach+0x49/0x67
Mar  1 11:37:02 C-5 kernel: [   91.548975]  [<c0262708>] bus_for_each_dev+0x35/0x5b
Mar  1 11:37:02 C-5 kernel: [   91.548986]  [<c0262b30>] driver_attach+0x11/0x13
Mar  1 11:37:02 C-5 kernel: [   91.548992]  [<c0262d08>] __driver_attach+0x0/0x67
Mar  1 11:37:02 C-5 kernel: [   91.548999]  [<c026218e>] bus_add_driver+0x91/0x1a7
Mar  1 11:37:02 C-5 kernel: [   91.549014]  [<c0262ed5>] driver_register+0x7d/0xd6
Mar  1 11:37:02 C-5 kernel: [   91.549032]  [<f888115b>] usb_register_driver+0x5d/0xb4 [usbcore]
Mar  1 11:37:02 C-5 kernel: [   91.549065]  [<f8c2f000>] rndis_wlan_init+0x0/0x14 [rndis_wlan]
Mar  1 11:37:02 C-5 kernel: [   91.549075]  [<c010112c>] _stext+0x44/0x119
Mar  1 11:37:02 C-5 kernel: [   91.549081]  [<c0160299>] tracepoint_module_notify+0x21/0x24
Mar  1 11:37:02 C-5 kernel: [   91.549089]  [<c013acae>] notifier_call_chain+0x2a/0x47
Mar  1 11:37:02 C-5 kernel: [   91.549100]  [<c013af03>] __blocking_notifier_call_chain+0x3f/0x49
Mar  1 11:37:02 C-5 kernel: [   91.549111]  [<c0147c27>] sys_init_module+0x87/0x182
Mar  1 11:37:02 C-5 kernel: [   91.549118]  [<c01033db>] sysenter_do_call+0x12/0x2f
Mar  1 11:37:02 C-5 kernel: [   91.549125] Code: 06 8b 0d bc 34 3d c0 8b 00 f7 d0 8b 04 88 eb 80 56 53 89 c3 89 d6 f0 0f ba 29 00 19 c0 31 d2 85 c0 75 2a 8d 41 04 39 41 04 74 04 <0f> 0b eb fe 83 7e 10 00 0f 45 1d bc 34 3d c0 8b 06 f7 d0 8b 04 
Mar  1 11:37:02 C-5 kernel: [   91.549190] EIP: [<c0135197>] queue_work_on+0x1b/0x42 SS:ESP 0068:f1b13dc4
Mar  1 11:37:02 C-5 kernel: [   91.549201] ---[ end trace 6c88d7dc3a1cb034 ]---

#############################


  After this segfault, the network interface doesn't even show up on ifconfig or iwconfig:


[12:36:18] C-5:/etc/modprobe.d# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:11:2f:3b:9a:42  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[12:36:23] C-5:/etc/modprobe.d# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

[12:36:26] C-5:/etc/modprobe.d# lsmod | grep ndis
rndis_wlan             18628  1 
rndis_host              6316  1 rndis_wlan
cdc_ether               4380  1 rndis_host
usbnet                 13768  3 rndis_wlan,rndis_host,cdc_ether
usbcore               124440  7 rndis_wlan,rndis_host,cdc_ether,usbnet,ehci_hcd,uhci_hcd



Regards,
  Luís Picciochi

[1] - http://kernel-handbook.alioth.debian.org/lenny/ch-common-tasks.html
Comment 1 Jussi Kivilinna 2009-04-16 21:38:00 UTC
Created attachment 21019 [details]
Fix support for bcm4320a

This patch disables configuration parameters for bcm4320a variant, as bcm4320a INF-file doesn't include theim either. Trying to set parameters which are for bcm4320b on bcm4320a might mess up device too much.
Comment 2 Jussi Kivilinna 2009-04-16 22:07:55 UTC
Created attachment 21020 [details]
Fix too late initialization of workqueue/work

I noticed something is actually wrong in driver (and ofcourse messed up device shouldn't cause oops anyway.. I should try to avoid late night coding).

So here's new patch, haven't compile tested yet, should be ok (it's for 2.6.29)...

rndis_wlan: fix initialization order for workqueue/worker

rndis_wext_link_change() might be called from rndis_command() at initialization stage and priv->workqueue/priv->work have not been initialized yet, resulting oops. Initialize workqueue/work in rndis_wext_bind() before rndis_host usage.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Comment 4 Pitxyoki 2009-05-15 18:58:14 UTC
Hi,
Using kernel 2.6.30-rc5, there is no segfault anymore.

However, my wireless adapter is still not connecting. It is shown on ifconfig and iwconfig, but ifupping it does not work.
Notice that the MAC address for the interface is still shown as 01:0a:00:00:00:00.

See below the output for ifconfig and iwconfig.

When I plug it in, /var/log/syslog shows:

May 15 18:10:15 C-5 kernel: [  101.576026] usb 2-2: new full speed USB device using uhci_hcd and address 3
May 15 18:10:15 C-5 kernel: [  101.751319] usb 2-2: New USB device found, idVendor=13b1, idProduct=000e
May 15 18:10:15 C-5 kernel: [  101.751324] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 15 18:10:15 C-5 kernel: [  101.751328] usb 2-2: Product: Linksys Wireless-G USB Network Adapter with SpeedBooster
May 15 18:10:15 C-5 kernel: [  101.751332] usb 2-2: Manufacturer: Cisco-Linksys
May 15 18:10:15 C-5 kernel: [  101.751335] usb 2-2: SerialNumber: 1111
May 15 18:10:15 C-5 kernel: [  101.751452] usb 2-2: configuration #1 chosen from 1 choice
May 15 18:10:15 C-5 kernel: [  101.886551] usbcore: registered new interface driver cdc_ether
May 15 18:10:16 C-5 kernel: [  102.046373] usbcore: registered new interface driver rndis_host
May 15 18:10:16 C-5 kernel: [  102.337315] rndis_wlan 2-2:1.0: rndis media disconnect
May 15 18:10:16 C-5 kernel: [  102.492425] wlan0: register 'rndis_wlan' at usb-0000:00:1d.1-2, Wireless RNDIS device, BCM4320a based, 01:0a:00:00:00:00
May 15 18:10:16 C-5 kernel: [  102.492461] usbcore: registered new interface driver rndis_wlan



[18:10:30] C-5:~# ifconfig -a
eth1      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:200 (200.0 B)  TX bytes:200 (200.0 B)

wlan0     Link encap:Ethernet  HWaddr 01:0a:00:00:00:00  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[18:10:34] C-5:~# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

wlan0     IEEE802.11bg  ESSID:off/any  
          Mode:Managed  Frequency:2.412 GHz  Bit Rate=54 Mb/s   Tx-Power=14 dBm   
          RTS thr=2347 B   Fragment thr=2346 B   
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

[18:10:37] C-5:~# ifup wlan0
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

SIOCSIFFLAGS: Cannot assign requested address
SIOCSIFFLAGS: Cannot assign requested address
Listening on LPF/wlan0/01:0a:00:00:00:00
Sending on   LPF/wlan0/01:0a:00:00:00:00
Sending on   Socket/fallback
receive_packet failed on wlan0: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
send_packet: Network is down
No DHCPOFFERS received.




Also, I noticed that this gets written to /etc/udev/rules.d/70-persistent-net.rules :

[18:12:13] C-5:~# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x11ab:0x4362 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# USB device 0x:0x (rndis_wlan)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="01:0a:00:00:00:00", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"



Regards,
  Pitxyoki
Comment 5 Jussi Kivilinna 2009-05-16 12:15:45 UTC
Have you tried the first patch on this page? The "Fix support for bcm4320a" one?
Comment 6 Pitxyoki 2009-05-17 14:17:10 UTC
Sorry, I thought that patch had also been included in mainline. Yes, I can finally connect (I'm actually writing this using a 2.6.30-rc6 kernel)!

I'm still having a problem: I can only connect if I disable MAC filtering on my router. Here are the steps I followed to get connected:


1. Connected the interface
/var/log/syslog:
May 17 14:32:06 C-5 kernel: [  169.281017] usb 2-2: new full speed USB device using uhci_hcd and address 3
May 17 14:32:06 C-5 kernel: [  169.455928] usb 2-2: New USB device found, idVendor=13b1, idProduct=000e
May 17 14:32:06 C-5 kernel: [  169.455933] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 17 14:32:06 C-5 kernel: [  169.455938] usb 2-2: Product: Linksys Wireless-G USB Network Adapter with SpeedBooster
May 17 14:32:06 C-5 kernel: [  169.455941] usb 2-2: Manufacturer: Cisco-Linksys
May 17 14:32:06 C-5 kernel: [  169.455944] usb 2-2: SerialNumber: 1111
May 17 14:32:06 C-5 kernel: [  169.456097] usb 2-2: configuration #1 chosen from 1 choice
May 17 14:32:06 C-5 kernel: [  169.551386] usbcore: registered new interface driver cdc_ether
May 17 14:32:07 C-5 kernel: [  169.706991] usbcore: registered new interface driver rndis_host
May 17 14:32:07 C-5 kernel: [  169.809942] rndis_wlan 2-2:1.0: rndis media disconnect
May 17 14:32:07 C-5 kernel: [  169.965726] wlan0: register 'rndis_wlan' at usb-0000:00:1d.1-2, Wireless RNDIS device, BCM4320a based, XX:XX:XX:XX:XX:XX
May 17 14:32:07 C-5 kernel: [  169.965775] usbcore: registered new interface driver rndis_wlan


2.
# ifup wlan0:
/var/log/syslog:
May 17 14:32:23 C-5 dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 17 14:32:23 C-5 dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 17 14:32:23 C-5 dhclient: All rights reserved.
May 17 14:32:23 C-5 dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 17 14:32:23 C-5 dhclient: 
May 17 14:32:23 C-5 kernel: [  186.251833] ADDRCONF(NETDEV_UP): wlan0: link is not ready
May 17 14:32:24 C-5 dhclient: Listening on LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:32:24 C-5 dhclient: Sending on   LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:32:24 C-5 dhclient: Sending on   Socket/fallback
May 17 14:32:26 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
May 17 14:32:32 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
May 17 14:32:45 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
May 17 14:33:05 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
May 17 14:33:17 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
May 17 14:33:25 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
May 17 14:33:26 C-5 dhclient: No DHCPOFFERS received.
May 17 14:33:26 C-5 dhclient: No working leases in persistent database - sleeping.


3.
# ifdown wlan0
# iwconfig wlan0 essid MYESSID
# iwconfig wlan0 key MYKEY
/var/log/syslog:
May 17 14:37:19 C-5 kernel: [  482.003494] rndis_wlan 2-2:1.0: rndis media connect


4.
# dhclient wlan0
/var/log/syslog:
May 17 14:37:32 C-5 dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 17 14:37:32 C-5 dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 17 14:37:32 C-5 dhclient: All rights reserved.
May 17 14:37:32 C-5 dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 17 14:37:32 C-5 dhclient: 
May 17 14:37:32 C-5 kernel: [  495.582947] rndis_wlan 2-2:1.0: rndis media disconnect
May 17 14:37:33 C-5 kernel: [  495.730192] ADDRCONF(NETDEV_UP): wlan0: link is not ready
May 17 14:37:34 C-5 dhclient: Listening on LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:37:34 C-5 dhclient: Sending on   LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:37:34 C-5 dhclient: Sending on   Socket/fallback
May 17 14:37:37 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
May 17 14:37:40 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
May 17 14:37:45 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
May 17 14:37:57 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
May 17 14:38:14 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
May 17 14:38:34 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
May 17 14:38:38 C-5 dhclient: No DHCPOFFERS received.
May 17 14:38:38 C-5 dhclient: No working leases in persistent database - sleeping.



5. After removing MAC filtering at the router:
# dhclient wlan0
May 17 14:43:01 C-5 dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 17 14:43:01 C-5 dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 17 14:43:01 C-5 dhclient: All rights reserved.
May 17 14:43:01 C-5 dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 17 14:43:01 C-5 dhclient: 
May 17 14:43:02 C-5 kernel: [  825.005082] rndis_wlan 2-2:1.0: rndis media connect
May 17 14:43:02 C-5 dhclient: Listening on LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:43:02 C-5 dhclient: Sending on   LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 14:43:02 C-5 dhclient: Sending on   Socket/fallback
May 17 14:43:02 C-5 kernel: [  825.046229] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
May 17 14:43:03 C-5 avahi-daemon[2289]: Joining mDNS multicast group on interface wlan0.IPv6 with address XXXX::XXXX:XXXX:XXXX:XXXX.
May 17 14:43:03 C-5 avahi-daemon[2289]: New relevant interface wlan0.IPv6 for mDNS.
May 17 14:43:03 C-5 avahi-daemon[2289]: Registering new address record for XXXX::XXXX:XXXX:XXXX:XXXX on wlan0.*.
May 17 14:43:06 C-5 dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
May 17 14:43:06 C-5 dhclient: DHCPOFFER from 192.168.2.1
May 17 14:43:06 C-5 dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
May 17 14:43:06 C-5 dhclient: DHCPACK from 192.168.2.1
May 17 14:43:06 C-5 avahi-daemon[2289]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.115.
May 17 14:43:06 C-5 avahi-daemon[2289]: New relevant interface wlan0.IPv4 for mDNS.
May 17 14:43:06 C-5 avahi-daemon[2289]: Registering new address record for 192.168.2.115 on wlan0.IPv4.
May 17 14:43:06 C-5 avahi-daemon[2289]: Withdrawing address record for XXXX::XXXX:XXXX:XXXX:XXXX on wlan0.
May 17 14:43:06 C-5 avahi-daemon[2289]: Leaving mDNS multicast group on interface wlan0.IPv6 with address XXXX::XXXX:XXXX:XXXX:XXXX.
May 17 14:43:06 C-5 avahi-daemon[2289]: Interface wlan0.IPv6 no longer relevant for mDNS.
May 17 14:43:06 C-5 dhclient: bound to 192.168.2.115 -- renewal in 227061 seconds.
Comment 7 Pitxyoki 2009-05-17 15:23:08 UTC
Please forget my last reply.
The module is working with the patch, regardless of the MAC address filtering on the router or not.

What is strange is that it only connects on each "pair" number of attempts. On the first attempt, it always fails; on the second one, it connects - and so on.
Also, I could only get it to connect with iwconfig+dhclient. I haven't been able to make it work with ifup at all.

Here is my most recent test (I'm attaching these results so they are more legible and you can see them without bugzilla's wrapping):

1. Connected the device
May 17 16:03:27 C-5 kernel: [ 1399.376028] usb 2-2: new full speed USB device using uhci_hcd and address 6
May 17 16:03:27 C-5 kernel: [ 1399.551743] usb 2-2: New USB device found, idVendor=13b1, idProduct=000e
May 17 16:03:27 C-5 kernel: [ 1399.551748] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
May 17 16:03:27 C-5 kernel: [ 1399.551753] usb 2-2: Product: Linksys Wireless-G USB Network Adapter with SpeedBooster
May 17 16:03:27 C-5 kernel: [ 1399.551756] usb 2-2: Manufacturer: Cisco-Linksys
May 17 16:03:27 C-5 kernel: [ 1399.551759] usb 2-2: SerialNumber: 1111
May 17 16:03:27 C-5 kernel: [ 1399.551878] usb 2-2: configuration #1 chosen from 1 choice
May 17 16:03:27 C-5 kernel: [ 1399.589514] usbcore: registered new interface driver cdc_ether
May 17 16:03:27 C-5 kernel: [ 1399.747844] usbcore: registered new interface driver rndis_host
May 17 16:03:27 C-5 kernel: [ 1399.821753] rndis_wlan 2-2:1.0: rndis media disconnect
May 17 16:03:28 C-5 kernel: [ 1399.981464] wlan0: register 'rndis_wlan' at usb-0000:00:1d.1-2, Wireless RNDIS device, BCM4320a based, XX:XX:XX:XX:XX:XX
May 17 16:03:28 C-5 kernel: [ 1399.981507] usbcore: registered new interface driver rndis_wlan

2. configured it
[16:03:11] C-5:/usr/src# iwconfig wlan0 essid MYESSID
[16:05:16] C-5:/usr/src# iwconfig wlan0 key MYKEY
May 17 16:05:21 C-5 kernel: [ 1513.003582] rndis_wlan 2-2:1.0: rndis media connect

3. dhclient... No connection now.
[16:05:26] C-5:/usr/src# dhclient wlan0
May 17 16:05:30 C-5 dhclient: There is already a pid file /var/run/dhclient.pid with pid 3398
May 17 16:05:30 C-5 dhclient: killed old client process, removed PID file
May 17 16:05:30 C-5 dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 17 16:05:30 C-5 dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 17 16:05:30 C-5 dhclient: All rights reserved.
May 17 16:05:30 C-5 dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 17 16:05:30 C-5 dhclient: 
May 17 16:05:30 C-5 kernel: [ 1522.291894] rndis_wlan 2-2:1.0: rndis media disconnect
May 17 16:05:30 C-5 kernel: [ 1522.438125] ADDRCONF(NETDEV_UP): wlan0: link is not ready
May 17 16:05:31 C-5 dhclient: Listening on LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 16:05:31 C-5 dhclient: Sending on   LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 16:05:31 C-5 dhclient: Sending on   Socket/fallback
May 17 16:05:31 C-5 dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
May 17 16:05:36 C-5 nss_wins[2624]: Deleting interface #5 wlan0, 192.168.2.115#123, interface stats: received=0, sent=0, dropped=0, active_time=900 secs
May 17 16:05:38 C-5 dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
(...)

4. configured it again
[16:05:40] C-5:/usr/src# iwconfig wlan0 essid MYESSID
[16:05:42] C-5:/usr/src# iwconfig wlan0 key MYKEY
May 17 16:05:45 C-5 kernel: [ 1537.003392] rndis_wlan 2-2:1.0: rndis media connect
May 17 16:05:45 C-5 kernel: [ 1537.038512] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
May 17 16:05:46 C-5 avahi-daemon[2288]: Joining mDNS multicast group on interface wlan0.IPv6 with address XXXX:XXXX:XXXX:XXXX:XXXX.
May 17 16:05:46 C-5 avahi-daemon[2288]: New relevant interface wlan0.IPv6 for mDNS.
May 17 16:05:46 C-5 avahi-daemon[2288]: Registering new address record for XXXX:XXXX:XXXX:XXXX:XXXX on wlan0.*.

5. dhclient... Connected!
[16:05:44] C-5:/usr/src# dhclient wlan0
May 17 16:05:50 C-5 dhclient: Internet Systems Consortium DHCP Client V3.1.1
May 17 16:05:50 C-5 dhclient: Copyright 2004-2008 Internet Systems Consortium.
May 17 16:05:50 C-5 dhclient: All rights reserved.
May 17 16:05:50 C-5 dhclient: For info, please visit http://www.isc.org/sw/dhcp/
May 17 16:05:50 C-5 dhclient: 
May 17 16:05:51 C-5 dhclient: Listening on LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 16:05:51 C-5 dhclient: Sending on   LPF/wlan0/XX:XX:XX:XX:XX:XX
May 17 16:05:51 C-5 dhclient: Sending on   Socket/fallback
May 17 16:05:54 C-5 dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
May 17 16:05:54 C-5 dhclient: DHCPACK from 192.168.2.1
May 17 16:05:54 C-5 avahi-daemon[2288]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.2.115.
May 17 16:05:54 C-5 avahi-daemon[2288]: New relevant interface wlan0.IPv4 for mDNS.
May 17 16:05:54 C-5 avahi-daemon[2288]: Registering new address record for 192.168.2.115 on wlan0.IPv4.
May 17 16:05:54 C-5 avahi-daemon[2288]: Withdrawing address record for XXXX:XXXX:XXXX:XXXX:XXXX on wlan0.
May 17 16:05:54 C-5 avahi-daemon[2288]: Leaving mDNS multicast group on interface wlan0.IPv6 with address XXXX:XXXX:XXXX:XXXX:XXXX.
May 17 16:05:54 C-5 avahi-daemon[2288]: Interface wlan0.IPv6 no longer relevant for mDNS.
May 17 16:05:54 C-5 dhclient: bound to 192.168.2.115 -- renewal in 280798 seconds.
Comment 8 Pitxyoki 2009-05-17 15:25:26 UTC
Created attachment 21390 [details]
dhclient only able to connect on even attempts
Comment 9 Jussi Kivilinna 2009-05-22 14:28:12 UTC
Ok, I managed to reproduce 'connect only on even attempts'. It's different bug and appeared somewhere between rc4 and rc6. I have submitted patch for bcm4320a support upstream and will bisect even-connect bug when I have time.
Comment 10 Pitxyoki 2009-10-24 23:05:37 UTC
This bug is still present as of kernel 2.6.32-rc5.
Besides, I can't connect using a static configuration from /etc/network/interfaces or using iwconfig anymore. Now I can only connect with this adapter if I use network-manager.

I reproduced the steps I reported on my last attachment - I'm attaching the output starting from step 2 (step 1 gave a very similar output, so you can check my previous attachment).

Besides, this module's performance is very poor in comparison with what was available some time ago using ndiswrapper and the Windows driver's .sys/.inf files (nowadays ndiswrapper doesn't even make the device visible to ifconfig). With ndiswrapper I used to have only around 1~2% packet loss on average. Now I get 25~30% with rndis_wlan, which considerably impairs my connection. Add to this the sudden disconnects now and then and this adapter gets quite unusable.

Is any work being made on this?

Thanks and regards,
Pitxyoki
Comment 11 Pitxyoki 2009-10-24 23:06:56 UTC
Created attachment 23516 [details]
Can't connect using iwconfig/dhclient
Comment 12 Jussi Kivilinna 2009-11-16 09:58:42 UTC
Created attachment 23798 [details]
This patch fixes iwconfig setup for rndis_wlan.
Comment 13 Jussi Kivilinna 2009-11-16 10:19:37 UTC
In 2.6.32 rndis_wlan has been reworked to use cfg80211 api. I noticed driver was missing setup for one flag and this is why iwconfig didn't work. 

I attached patch that fixes this.

Performance for bcm4320b is good, I can get 54mbit with 0% packet loss (throught computer/wall/bookcase). I don't have bcm4320a based device, so I cannot test/fix for it, sorry.

I guess performance problem has something to do with RNDIS spec requirement that control channel shouldn't be polled to command results, but which rndis_host does anyway. rndis_wlan runs on top of rndis_host/usbnet, rndis_wlan handles wifi-setup, rndis_host/usbnet handle data transfers and command channel. If this is the case, rndis_host would require significant rework.
Comment 14 Jussi Kivilinna 2009-11-16 11:04:29 UTC
Created attachment 23799 [details]
New patch (v2) for iwconfig setup problem
Comment 15 Pitxyoki 2009-11-19 15:25:24 UTC
Thanks. Your last patch fixed the issue with iwconfig and now I can use iwconfig + dhclient again.
The device seems to be working despite the high packet loss, the disconnects and an some kernel oops I'm starting to suspect that may be related with this driver.
I'm attaching some syslog outputs I got while testing the adapter recently.

The first attachment is from when I started my computer with the config at /etc/network/interfaces. The device connected and everything went well. You can see there was a warning from the kernel after the "media connect". Anyway, I got connected and everything went well.

On the second one, I restarted my computer with the device disconnected. Then I connected the device and ifup'ed it. I also got connected but you can see the warning there again.
This warning seems to be reproducible every time I use the static configuration.

The third log is from when I started my computer with the entries at /etc/network/interfaces commented out so network-manager would manage the device. After some time, I got disconnected. Probably the line starting with "Nov 18 13:43:24" corresponds to the time of the disconnect. I'm not sure.
I couldn't get connected again, so I did modprobe -r rndis_wlan, disconnected the device and connected it again. I got connected but after a while you can see lots and lots of "slab error"s. I can't tell precisely when, but my computer gave a system beep and suddenly got unresponsive. I had to shut it down (using ssh? I can't remember) to get back to work.

After this I restarted my computer once again so that it used the interfaces file again. The slab errors came back again (fourth log). Once again I had to power off the computer.

---
When I started using 2.6.32-rc5, I noticed that my computer was halting from time to time, apparently in an unpredictable way. I reported this (bug #14436) and re-compiled the kernel with the debug flags that I've been recommended to on that bug. I'm thinking that maybe these halts were related to the rndis_wlan driver. One thing I notice is that they only happened when I connect the wireless adapter, but I'm not sure if this is what causes the halts.

Relating with the high packet loss, I noticed that iwconfig always reports a txpower of 7 dBm and I can't change that to any other value. I checked the user guide for my adapter[1]. On page 44 of the PDF the "transmitted power" is indicated as 15-17dBm. Could this be related?

Regards and thank you for your attention,
Pitxyoki

1 - http://downloads.linksysbycisco.com/downloads/wusb54gs_ug_1,0.pdf
Comment 16 Pitxyoki 2009-11-19 15:28:38 UTC
Created attachment 23828 [details]
Four test cases using the most recent kernel/driver + patch for iwconfig
Comment 17 Jussi Kivilinna 2009-11-21 12:26:51 UTC
Please try these two patches. First one fixes buffer overflow in rndis_wlan, second one disable 'stalled link' workaround (which works and is for bcm4320a).

rndis_wlan cannot set tx_power for device, the reported tx_power levels are for "Linksys WUSB54GSC". You can ignore the tx_power reported by iwconfig. Are you setting any module parameters? 7 dBm is only print if you set "power_output=0". power_output doesn't have effect with bcm4320a, only bcm4320b.
Comment 18 Jussi Kivilinna 2009-11-21 12:27:27 UTC
Created attachment 23854 [details]
Fix buffer overflow in rndis_wlan
Comment 19 Jussi Kivilinna 2009-11-21 12:28:02 UTC
Created attachment 23855 [details]
Disable 'stalled link' -workaround
Comment 20 Pitxyoki 2009-11-21 21:59:05 UTC
We seem to be getting closer!
Today before I even read your reply I noticed my connection seemed pretty stable.
I checked the syslog: the call trace after the "media connect" was there, but the "slab error"s didn't appear one single time.

I caught some ping statistics, and I didn't see anything like this for a long time on this adapter: 12% packet loss at the worse case. 4~2% or about 8~11% on others. I also did some updates on my machine and copied some files over from my laptop - I got something like 100KB/s on average on all transfers! This is completely unusual for this adapter on Linux since about a year or more. This is very, __very__ good for what I'm used to see with this.

Anyway, after I rebooted my computer, this wasn't the case anymore. Interestingly, the call trace after the "media connect" didn't appear after that reboot, but the kernel "slab error"s did. The connection was again unstable and with about ~20% packet loss.

Then I recompiled the kernel with your patches. The connection seems quite flashy again. I have already restarted my computer a couple of times and the connection seems to stay stable, like it was today in the morning.
If things stay like this for some more days, say a week or two, I'd say that all previous issues are gone. Let's give it some time for the initial euphoria to pass away... :-)

As for the txpower: no, I don't do anything except modprobe -v rndis_wlan when I want to load the module or modprobe -rv to unload it. When I restart the computer, I let it load it by itself.
# iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"MYESSID"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: YY:YY:YY:YY:YY:YY   
          Bit Rate=36 Mb/s   Tx-Power=7 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:MYKE-YMYK-EY
          Power Management:on
          Link Quality=25/100  Signal level=25/100  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


I just ran iperf, and I have to say that I am really amazed:
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 2.0 sec    576 KBytes  2.36 Mbits/sec
[  3]  2.0- 4.0 sec    576 KBytes  2.36 Mbits/sec
[  3]  4.0- 6.0 sec    528 KBytes  2.16 Mbits/sec
[  3]  6.0- 8.0 sec    456 KBytes  1.87 Mbits/sec
[  3]  8.0-10.0 sec    408 KBytes  1.67 Mbits/sec
[  3] 10.0-12.0 sec    552 KBytes  2.26 Mbits/sec
[  3] 12.0-14.0 sec    536 KBytes  2.20 Mbits/sec
[  3] 14.0-16.0 sec    568 KBytes  2.33 Mbits/sec
[  3] 16.0-18.0 sec    520 KBytes  2.13 Mbits/sec
[  3] 18.0-20.0 sec    512 KBytes  2.10 Mbits/sec
[  3]  0.0-20.0 sec  5.12 MBytes  2.14 Mbits/sec
Comment 21 Jussi Kivilinna 2009-11-22 18:13:57 UTC
Created attachment 23873 [details]
Patch 1/2 of tx-power reporting fix
Comment 22 Jussi Kivilinna 2009-11-22 18:14:30 UTC
Created attachment 23874 [details]
2/2 patch for fixing tx-power reporting
Comment 23 Jussi Kivilinna 2009-11-22 18:14:51 UTC
These two patches should fix tx-power reporting.
Comment 24 Pitxyoki 2009-12-07 16:13:07 UTC
The problems with this adapter seem to be definitively gone.

I still experienced a connection loss once or twice since applying your last patch, but I'm convinced this must be an hardware problem (I remember this happening on Windows too):
Sometimes after losing the connection, I can get connected to the AP, but then I don't seem to be able to receive all packets on the network. One of the effects is that I don't even get to receive an IP by DHCP, even though I can see some packets coming from the router.
Removing and inserting the module again sometimes solves it. Simply waiting some minutes and trying again later may solve it too.

Apart from this, on Windows the driver wasn't even as stable as it seems now on Linux.


The tx-power now reports 13dBm. A bit more consistent with the adapter's documentation.


Jussi: I really appreciate your attention on this. Is there any way I can pay you?  I'd like to thank you for your work somehow.
You can reply to my e-mail address if you have something like a wishlist. :)

Many thanks,
Luís Picciochi