on rt61 master mode

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4770

xodr

02-05-2008 16:14:07

Greetings,

First things first Thank you all for the all work you have done. This forum has been an invaluable source of information for the past month but now I'm stuck ?

I'll break down every bit I've done and I'm trying to do so hopefully it will be easier to follow

AIM To get rt61 working in master mode with hostapd.

1) I've cloned the master rt2x00 repository from
[code1p4geuno]git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git/[/code1p4geuno]
almost a week ago. (2.6.25)

2) Managed mode works without any flaws as fas as I'm concerned.

3) bu when i say

[code1p4geuno]iwconfig wlan0 mode master[/code1p4geuno]

what i get is

[code1p4geuno]Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Invalid argument.[/code1p4geuno]

however this is different then what i got when i say
[code1p4geuno]iwconfig wlan0 mode bla

Error for wireless request "Set Mode" (8B06) :
invalid argument "bla".[/code1p4geuno]

I believe this suggests that the attempt to switch to master mode is rejected at some level deeper.

4) Reading many posts and many works on this subject I attempted do clone the master repository of wireless-testing (linville) however unfortunately download is not finished yet, and it doesn't seem to end any time soon (.

5) Being unable to download wireless-testing I resorted to compat-wireless.

6) I've applied the patch
[code1p4geuno]http://johannes.sipsolutions.net/patches/kernel/all/LATEST/042-allow-ap-vlan-modes.patch[/code1p4geuno]
to enable ap modes in mac80211 to compat-wireless.

7) Apllied IvD's patches from the same page.

8 ) compiled and loaded new modules. But the behavior of the driver doesn't change.

I say I'm stuck here because I've downloaded, patched, and compiled both hostapd and libnl and hostapd seems to work upto the point where it says

[code1p4geuno]Hardware does not support configured mode.[/code1p4geuno]

I believe it refers to master mode.


If you have any comments to make I would be more than grateful.

regards.

P.S. search function of the forum doesn't seem to work for a few days now.

IvD

02-05-2008 17:44:19

If you check the patch description of the patch you applied from Johannes Berg
[quote1tx4kbs5]
This patch allows switching interfaces into AP/VLAN modes using
cfg80211 (nl80211). Don't allow doing it with wext because then
people will just attempt to do it manually (without hostapd) and
complain that it doesn't work.
[/quote1tx4kbs5]

You cannot set the interface in master mode through iwconfig,
you _must_ use hostapd. Which makes sense since that is
the tool you need to actually have a working software AP.
Make sure you use the very latest version of hostapd, one that supports cfg80211/nl80211.

xodr

02-05-2008 19:17:36

Thanks a lot for your answer! (I've read that part but I erroneously thought that this patch was written to solve that issue)

With your remark, I've focused on the hostapd.conf file and to my surprise it refuses to work with the same previous message. Apparently hw_mode has to be set to g. when it's b it doesn't work.

After this hostapd starts after printing several warning messages however when I scan with my laptop I cannot see the new AP.

[code2r6oul6f]Could not set passive scanning: Unknown error 4294967295
...
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver
...
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver
...[/code2r6oul6f]

Attached you may find the hostapd.conf and log files.


regards.

IvD

02-05-2008 19:43:20

Did you interrupt hostapd prior to uploading the log file?
It says
[quote3qhr2w4s]Signal 2 received - terminating[/quote3qhr2w4s]
which is the reason why it stops.

The error messages about configuration options can probably be ignored. You might want to disable those options in the hostap configuration file to limit those messages.

xodr

02-05-2008 20:01:39

yes. it's because I pressed ctrl+c to terminate hostapd. Of course I'm scanning for the new AP while hostapd is running.

I'll try again in the weekend. I'll post my findings on sunday.

regards.

xodr

04-05-2008 15:42:01

What I've found is very encouraging

When I call hostapd after the system boots and wait for some time, the system freezes.

However if I;
[codei028ccoo]ifconfig wlan0 down
rmmod rt61pci
modprobe rt61pci[/codei028ccoo]

hostapd works fine. I can connect to my new AP. After setting up a DHCP server, I could assign IPs to my clients and I managed to open an SSH connection to the AP through one of the clients.

Next I will try with the kernel from the wireless-testing tree (in case if I messed up with the last kernel that I've been working on) and post my findings.

regards and thanks a lot for your help!

xodr

04-05-2008 15:53:55

I've changed my mind. I'll use the rt2x00 tree. You seem to include the allow AP modes patch from Johannes Berg and your tree seems more uptodate for my purposes.

IvD

04-05-2008 15:54:49

That crash sounds disturbing, if you are going to recompile a kernel anyway, could you enabled the following config options

CONFIG_CC_STACKPROTECTOR
CONFIG_CC_STACKPROTECTOR_ALL
CONFIG_DEBUG_KERNEL
CONFIG_DEBUG_SPINLOCK
CONFIG_DEBUG_STACKOVERFLOW

This will make the kernel image size very large, but it will protect you against some problems (aka instead of crashing it will print a stack trace in your log). If you notice stack traces and warnings in your kernel log, please attach your log to this thread.

For regular use the above kernel config options should best be disabled, they are only needed for debugging. )

xodr

04-05-2008 17:21:00

OK, will do that.

xodr

04-05-2008 20:31:12

After compiling rt2x00 tree I have the following

[code13luf04s]May 4 22:09:44 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
May 4 22:09:44 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
May 4 22:09:44 alphan-box kernel: Trying to free already-free IRQ 17
May 4 22:09:44 alphan-box kernel: BUG: unable to handle kernel NULL pointer dereference at 00000010
May 4 22:09:44 alphan-box kernel: IP: [<f88150af>] :rt2x00pci:rt2x00pci_uninitialize+0x29/0x9a
May 4 22:09:44 alphan-box kernel: *pde = 00000000
May 4 22:09:44 alphan-box kernel: Oops: 0000 [#1] PREEMPT
May 4 22:09:44 alphan-box kernel: Modules linked in: sd_mod vfat fat usb_storage scsi_mod usbhid libusual rt61pci rt2x00pci rt2x00lib mac80211 cfg80211 ehci_hcd uhci_hcd eeprom_93cx6 rng_core usbcore
May 4 22:09:44 alphan-box kernel:
May 4 22:09:44 alphan-box kernel: Pid: 2018, comm: ifconfig Not tainted (2.6.25-wl-00000-g9a3f520-dirty #1)
May 4 22:09:44 alphan-box kernel: EIP: 0060:[<f88150af>] EFLAGS: 00010283 CPU: 0
May 4 22:09:44 alphan-box kernel: EIP is at rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci]
May 4 22:09:44 alphan-box kernel: EAX: 00000000 EBX: f7eb426c ECX: c02d5f0c EDX: f7eb4248
May 4 22:09:44 alphan-box kernel: ESI: f75e7be0 EDI: 00000980 EBP: 37f40000 ESP: f752be44
May 4 22:09:44 alphan-box kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
May 4 22:09:44 alphan-box kernel: Process ifconfig (pid: 2018, ti=f752a000 task=f75f2ff0 task.ti=f752a000)
May 4 22:09:44 alphan-box kernel: Stack: 0000000c f7c1ec54 f7c1ec00 fffffff4 f7eb426c 00000020 00000000 f881549b
May 4 22:09:44 alphan-box kernel: f75e7be0 f7c1ec00 0000000c f7f474c0 000000f0 37f40000 f75e7be0 00000000
May 4 22:09:44 alphan-box kernel: 00001002 f75e7180 f8838504 f7c42360 f7c42800 f88b57c7 c02fb58c f7c42800
May 4 22:09:44 alphan-box kernel: Call Trace:
May 4 22:09:44 alphan-box kernel: [<f881549b>] rt2x00pci_initialize+0x17d/0x187 [rt2x00pci]
May 4 22:09:44 alphan-box kernel: [<f8838504>] rt2x00lib_start+0x35/0x85 [rt2x00lib]
May 4 22:09:44 alphan-box kernel: [<f88b57c7>] ieee80211_open+0x219/0x4cb [mac80211]
May 4 22:09:44 alphan-box kernel: [<c0206634>] dev_open+0x3e/0x6e
May 4 22:09:44 alphan-box kernel: [<c0205969>] dev_change_flags+0x95/0x140
May 4 22:09:44 alphan-box kernel: [<c02364fb>] devinet_ioctl+0x235/0x536
May 4 22:09:44 alphan-box kernel: [<c01fc00f>] sock_ioctl+0x1a8/0x1ca
May 4 22:09:44 alphan-box kernel: [<c01fbe67>] sock_ioctl+0x0/0x1ca
May 4 22:09:44 alphan-box kernel: [<c0154e58>] vfs_ioctl+0x1c/0x5d
May 4 22:09:44 alphan-box kernel: [<c01550d2>] do_vfs_ioctl+0x239/0x24c
May 4 22:09:44 alphan-box kernel: [<c010c13e>] do_page_fault+0x1f9/0x507
May 4 22:09:44 alphan-box kernel: [<c0155111>] sys_ioctl+0x2c/0x43
May 4 22:09:44 alphan-box kernel: [<c0102896>] syscall_call+0x7/0xb
May 4 22:09:44 alphan-box kernel: [<c0250000>] pfkey_send_acquire+0x5ee/0x6e8
May 4 22:09:44 alphan-box kernel: =======================
May 4 22:09:44 alphan-box kernel: Code: 99 c7 55 57 56 89 c6 53 89 f2 83 ec 0c 8b 00 8b 80 64 01 00 00 e8 d6 8c 91 c7 8b 96 98 01 00 00 eb 5a 8b 06 89 44 24 08 8b 43 e0 <8b> 40 10 8b 48 08 8b 68 0c c7 40 08 00 00 00 00 85 c9 74 3b 0f
May 4 22:09:44 alphan-box kernel: EIP: [<f88150af>] rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci] SS:ESP 0068:f752be44
May 4 22:09:44 alphan-box kernel: ---[ end trace 931ca722d459a3b9 ]---
[/code13luf04s]

Later I tried wireless-testing during which I realized that I left preemption "on". I disabled it just in case. I didn't have any problems related with rt61 with wireless-testing but hostapd gives segmentation fault.

Before checking out the latest version of hostapd, I will try compiling rt2x00 with preemption disabled.

IvD

04-05-2008 21:50:17

I think I have fixed that NULL pointer error, but that bug is triggered during a failed initialization, one which apparently didn't print any message in your log... S

xodr

05-05-2008 08:43:21

I don't know if this will be of any help but still, I have another trace here with some lines in the beginning not included in the previous trace I posted

[code19psxzpr]May 5 11:41:09 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - NIC: 0xff80
May 5 11:41:09 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET BG: 0x0000
May 5 11:41:09 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET A: 0x0000
May 5 11:41:09 alphan-box kernel: phy1 -> rt2x00_set_chip: Info - Chipset detected - rt: 0301, rf: 0003, rev: 0002561c.
May 5 11:41:09 alphan-box kernel: phy1: Selected rate control algorithm 'pid'
May 5 11:41:13 alphan-box kernel: phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
May 5 11:41:13 alphan-box kernel: phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
May 5 11:41:13 alphan-box kernel: Trying to free already-free IRQ 17
May 5 11:41:13 alphan-box kernel: BUG: unable to handle kernel NULL pointer dereference at 00000010
May 5 11:41:13 alphan-box kernel: IP: [<f883c0af>] :rt2x00pci:rt2x00pci_uninitialize+0x29/0x9a
May 5 11:41:13 alphan-box kernel: *pde = 00000000
May 5 11:41:13 alphan-box kernel: Oops: 0000 [#1]
May 5 11:41:13 alphan-box kernel: Modules linked in: rt61pci nls_iso8859_1 nls_cp437 sd_mod vfat fat usb_storage scsi_mod usbhid libusual rt2x00pci rt2x00lib mac80211 ehci_hcd uhci_hcd cfg80211 usbcore eeprom_93cx6 rng_core [last unloaded: rt61pci]
May 5 11:41:13 alphan-box kernel:
May 5 11:41:13 alphan-box kernel: Pid: 2304, comm: ifconfig Not tainted (2.6.25-wl-00000-g9a3f520-dirty #1)
May 5 11:41:13 alphan-box kernel: EIP: 0060:[<f883c0af>] EFLAGS: 00010283 CPU: 0
May 5 11:41:13 alphan-box kernel: EIP is at rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci]
May 5 11:41:13 alphan-box kernel: EAX: 00000000 EBX: f7ee416c ECX: c16fe218 EDX: f7ee4148
May 5 11:41:13 alphan-box kernel: ESI: f749bbe0 EDI: 00000980 EBP: 37470000 ESP: f7f05e54
May 5 11:41:13 alphan-box kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
May 5 11:41:13 alphan-box kernel: Process ifconfig (pid: 2304, ti=f7f04000 task=f7f06000 task.ti=f7f04000)
May 5 11:41:13 alphan-box kernel: Stack: 0000000c f7c1ec54 f7c1ec00 fffffff4 f7ee416c 00000020 00000000 f883c49b
May 5 11:41:13 alphan-box kernel: f749bbe0 f7c1ec00 0000000c f74774c0 000000f0 37470000 f749bbe0 00000000
May 5 11:41:13 alphan-box kernel: 00001002 f749b180 f8889515 f7439b60 f743a000 f8852ac3 00000000 f743a000
May 5 11:41:13 alphan-box kernel: Call Trace:
May 5 11:41:13 alphan-box kernel: [<f883c49b>] rt2x00pci_initialize+0x17d/0x187 [rt2x00pci]
May 5 11:41:13 alphan-box kernel: [<f8889515>] rt2x00lib_start+0x35/0x85 [rt2x00lib]
May 5 11:41:13 alphan-box kernel: [<f8852ac3>] ieee80211_open+0x219/0x4b7 [mac80211]
May 5 11:41:13 alphan-box kernel: [<c012b89c>] find_lock_page+0x12/0x5c
May 5 11:41:13 alphan-box kernel: [<c01f7593>] dev_open+0x3e/0x6e
May 5 11:41:13 alphan-box kernel: [<c01f63c4>] dev_change_flags+0x95/0x140
May 5 11:41:13 alphan-box kernel: [<c0224dd6>] devinet_ioctl+0x235/0x537
May 5 11:41:13 alphan-box kernel: [<c01ed06b>] sock_ioctl+0x1a8/0x1ca
May 5 11:41:13 alphan-box kernel: [<c01ecec3>] sock_ioctl+0x0/0x1ca
May 5 11:41:13 alphan-box kernel: [<c014d596>] vfs_ioctl+0x16/0x48
May 5 11:41:13 alphan-box kernel: [<c014d7a6>] do_vfs_ioctl+0x1de/0x1f1
May 5 11:41:13 alphan-box kernel: [<c010b886>] do_page_fault+0x1f9/0x507
May 5 11:41:13 alphan-box kernel: [<c014d7e5>] sys_ioctl+0x2c/0x43
May 5 11:41:13 alphan-box kernel: [<c010275a>] syscall_call+0x7/0xb
May 5 11:41:13 alphan-box kernel: [<c0240000>] pci_scan_bridge+0x31a/0x329
May 5 11:41:13 alphan-box kernel: =======================
May 5 11:41:13 alphan-box kernel: Code: 96 c7 55 57 56 89 c6 53 89 f2 83 ec 0c 8b 00 8b 80 64 01 00 00 e8 60 dc 8e c7 8b 96 98 01 00 00 eb 5a 8b 06 89 44 24 08 8b 43 e0 <8b> 40 10 8b 48 08 8b 68 0c c7 40 08 00 00 00 00 85 c9 74 3b 0f
May 5 11:41:13 alphan-box kernel: EIP: [<f883c0af>] rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci] SS:ESP 0068:f7f05e54
May 5 11:41:13 alphan-box kernel: ---[ end trace 81be6b0852518fb3 ]---[/code19psxzpr]

IvD

05-05-2008 08:47:30

Was te above trace with "rt2x00 Fix broken recover-on-error path" as last patch in rt2x00.git?
Could you otherwise check if editing drivers/net/wireless/rt2x00/rt61pci.c line 2690
[code1u1s9lkc] .data_size = 0, /* No DMA required for beacons */[/code1u1s9lkc]
and change that line into
[code1u1s9lkc] .data_size = MGMT_FRAME_SIZE,[/code1u1s9lkc]

and see if that works better

xodr

05-05-2008 13:42:13

No it wasn't. I've downloaded that one too and will try but before that I've tried your suggestion and again rt61pci fails to initialize.

I've tried with your latest commit (rt2x00 skb allocation should include ICV length) with
[coder6ydpqpw].data_size = MGMT_FRAME_SIZE,[/coder6ydpqpw]

and it can't initialize the card either (

the log of my last attempt (disabled multiple queue support)

[coder6ydpqpw]May 5 16:11:27 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
May 5 16:11:27 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
May 5 16:11:27 alphan-box kernel: Trying to free already-free IRQ 17
May 5 16:11:27 alphan-box kernel: BUG: unable to handle kernel NULL pointer dereference at 00000010
May 5 16:11:27 alphan-box kernel: IP: [<f88350af>] :rt2x00pci:rt2x00pci_uninitialize+0x29/0x9a
May 5 16:11:27 alphan-box kernel: *pde = 00000000
May 5 16:11:27 alphan-box kernel: Oops: 0000 [#1]
May 5 16:11:27 alphan-box kernel: Modules linked in: sd_mod vfat fat usb_storage scsi_mod usbhid libusual rt61pci rt2x00pci rt2x00lib mac80211 cfg80211 ehci_hcd uhci_hcd eeprom_93cx6 rng_core usbcore
May 5 16:11:27 alphan-box kernel:
May 5 16:11:27 alphan-box kernel: Pid: 2262, comm: ifconfig Not tainted (2.6.25ivo-wl-00000-g69e4a9d-dirty #2)
May 5 16:11:27 alphan-box kernel: EIP: 0060:[<f88350af>] EFLAGS: 00010283 CPU: 0
May 5 16:11:27 alphan-box kernel: EIP is at rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci]
May 5 16:11:27 alphan-box kernel: EAX: 00000000 EBX: f74a266c ECX: c02beeb4 EDX: f74a2648
May 5 16:11:27 alphan-box kernel: ESI: f7588b80 EDI: 00000980 EBP: 37470000 ESP: f751be54
May 5 16:11:27 alphan-box kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
May 5 16:11:27 alphan-box kernel: Process ifconfig (pid: 2262, ti=f751a000 task=f7e4da90 task.ti=f751a000)
May 5 16:11:27 alphan-box kernel: Stack: 0000000c f7c1ec54 f7c1ec00 fffffff4 f74a266c 00000020 00000000 f883549b
May 5 16:11:27 alphan-box kernel: f7588b80 f7c1ec00 0000000c f74774c0 000000f0 37470000 f7588b80 00000000
May 5 16:11:27 alphan-box kernel: 00001002 f7588180 f888953c f7c42360 f7c42800 f8852a8c 00000000 f7c42800
May 5 16:11:27 alphan-box kernel: Call Trace:
May 5 16:11:27 alphan-box kernel: [<f883549b>] rt2x00pci_initialize+0x17d/0x187 [rt2x00pci]
May 5 16:11:27 alphan-box kernel: [<f888953c>] rt2x00lib_start+0x35/0x8e [rt2x00lib]
May 5 16:11:27 alphan-box kernel: [<f8852a8c>] ieee80211_open+0x219/0x4b7 [mac80211]
May 5 16:11:27 alphan-box kernel: [<c012b89c>] find_lock_page+0x12/0x5c
May 5 16:11:27 alphan-box kernel: [<c01f759d>] dev_open+0x3e/0x6e
May 5 16:11:27 alphan-box kernel: [<c01f63ce>] dev_change_flags+0x95/0x140
May 5 16:11:27 alphan-box kernel: [<c0224d8a>] devinet_ioctl+0x235/0x537
May 5 16:11:27 alphan-box kernel: [<c01ed067>] sock_ioctl+0x1a8/0x1ca
May 5 16:11:27 alphan-box kernel: [<c01ecebf>] sock_ioctl+0x0/0x1ca
May 5 16:11:27 alphan-box kernel: [<c014d596>] vfs_ioctl+0x16/0x48
May 5 16:11:27 alphan-box kernel: [<c014d7a6>] do_vfs_ioctl+0x1de/0x1f1
May 5 16:11:27 alphan-box kernel: [<c010b886>] do_page_fault+0x1f9/0x507
May 5 16:11:27 alphan-box kernel: [<c014d7e5>] sys_ioctl+0x2c/0x43
May 5 16:11:27 alphan-box kernel: [<c010275a>] syscall_call+0x7/0xb
May 5 16:11:27 alphan-box kernel: [<c0240000>] pci_scan_child_bus+0x59/0x76
May 5 16:11:27 alphan-box kernel: =======================
May 5 16:11:27 alphan-box kernel: Code: 96 c7 55 57 56 89 c6 53 89 f2 83 ec 0c 8b 00 8b 80 64 01 00 00 e8 60 4c 8f c7 8b 96 98 01 00 00 eb 5a 8b 06 89 44 24 08 8b 43 e0 <8b> 40 10 8b 48 08 8b 68 0c c7 40 08 00 00 00 00 85 c9 74 3b 0f
May 5 16:11:27 alphan-box kernel: EIP: [<f88350af>] rt2x00pci_uninitialize+0x29/0x9a [rt2x00pci] SS:ESP 0068:f751be54
May 5 16:11:27 alphan-box kernel: ---[ end trace 35dfdecf8761dfe6 ]---[/coder6ydpqpw]

IvD

05-05-2008 14:25:26

Could you update to the latest rt2x00.git version, because I threw a lot of code around, and apply attached patch which will print some extra debugging information.

xodr

05-05-2008 15:18:45

I've tried with the latest git version + your debug.diff patch applied. I've the following

[codemi0yiamf]May 5 18:17:11 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - NIC: 0xff80
May 5 18:17:11 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET BG: 0x0000
May 5 18:17:11 alphan-box kernel: phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET A: 0x0000
May 5 18:17:11 alphan-box kernel: phy1 -> rt2x00_set_chip: Info - Chipset detected - rt: 0301, rf: 0003, rev: 0002561c.
May 5 18:17:11 alphan-box kernel: phy1: Selected rate control algorithm 'pid'
May 5 18:17:18 alphan-box kernel: phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
May 5 18:17:18 alphan-box kernel: phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
May 5 18:17:18 alphan-box kernel: phy1 -> rt2x00pci_initialize: Error - DMA allocation failed for queue 1.
May 5 18:17:18 alphan-box kernel: Trying to free already-free IRQ 17
May 5 18:17:18 alphan-box kernel: BUG: unable to handle kernel NULL pointer dereference at 00000010
May 5 18:17:18 alphan-box kernel: IP: [<f88310b2>] :rt2x00pci:rt2x00pci_uninitialize+0x2c/0xd6
May 5 18:17:18 alphan-box kernel: *pde = 00000000
May 5 18:17:18 alphan-box kernel: Oops: 0000 [#1] PREEMPT
May 5 18:17:18 alphan-box kernel: Modules linked in: rt61pci nls_iso8859_1 nls_cp437 sd_mod vfat fat usb_storage scsi_mod usbhid libusual rt2x00pci rt2x00lib mac80211 ehci_hcd uhci_hcd rng_core cfg80211 eeprom_93cx6 usbcore [last unloaded: rt61pci]
May 5 18:17:18 alphan-box kernel:
May 5 18:17:18 alphan-box kernel: Pid: 2330, comm: ifconfig Not tainted (2.6.25-wl-00000-gba16f26-dirty #1)
May 5 18:17:18 alphan-box kernel: EIP: 0060:[<f88310b2>] EFLAGS: 00010283 CPU: 0
May 5 18:17:18 alphan-box kernel: EIP is at rt2x00pci_uninitialize+0x2c/0xd6 [rt2x00pci]
May 5 18:17:18 alphan-box kernel: EAX: 00000000 EBX: f740616c ECX: c16fe018 EDX: f7406148
May 5 18:17:18 alphan-box kernel: ESI: f746bbe0 EDI: f74d3cf0 EBP: f75b8000 ESP: f7f0de48
May 5 18:17:18 alphan-box kernel: DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
May 5 18:17:18 alphan-box kernel: Process ifconfig (pid: 2330, ti=f7f0c000 task=f7f0e000 task.ti=f7f0c000)
May 5 18:17:18 alphan-box kernel: Stack: 0000000c 375b8000 f7c1ec54 f7c1ec00 fffffff4 f740616c 00000020 00000000
May 5 18:17:18 alphan-box kernel: f883150b 000000f0 f746bbe0 f7c1ec00 375b8000 f746bbe0 00000000 00001002
May 5 18:17:18 alphan-box kernel: f746b180 f883852b f7581b60 f7582800 f88b56aa f7ee700d f7582800 f7582b60
May 5 18:17:18 alphan-box kernel: Call Trace:
May 5 18:17:18 alphan-box kernel: [<f883150b>] rt2x00pci_initialize+0x1b1/0x1bb [rt2x00pci]
May 5 18:17:18 alphan-box kernel: [<f883852b>] rt2x00lib_start+0x35/0x8e [rt2x00lib]
May 5 18:17:18 alphan-box kernel: [<f88b56aa>] ieee80211_open+0x219/0x4cb [mac80211]
May 5 18:17:18 alphan-box kernel: [<c0206634>] dev_open+0x3e/0x6e
May 5 18:17:18 alphan-box kernel: [<c0205969>] dev_change_flags+0x95/0x140
May 5 18:17:18 alphan-box kernel: [<c02364fb>] devinet_ioctl+0x235/0x536
May 5 18:17:18 alphan-box kernel: [<c01fc00f>] sock_ioctl+0x1a8/0x1ca
May 5 18:17:18 alphan-box kernel: [<c01fbe67>] sock_ioctl+0x0/0x1ca
May 5 18:17:18 alphan-box kernel: [<c0154e58>] vfs_ioctl+0x1c/0x5d
May 5 18:17:18 alphan-box kernel: [<c01550d2>] do_vfs_ioctl+0x239/0x24c
May 5 18:17:18 alphan-box kernel: [<c010c13e>] do_page_fault+0x1f9/0x507
May 5 18:17:18 alphan-box kernel: [<c0155111>] sys_ioctl+0x2c/0x43
May 5 18:17:18 alphan-box kernel: [<c0102896>] syscall_call+0x7/0xb
May 5 18:17:18 alphan-box kernel: [<c0250000>] pfkey_send_acquire+0x5ee/0x6e8
May 5 18:17:18 alphan-box kernel: =======================
May 5 18:17:18 alphan-box kernel: Code: 57 56 89 c6 53 89 f2 83 ec 10 8b 00 8b 80 64 01 00 00 e8 d6 cc 8f c7 8b 96 98 01 00 00 e9 8f 00 00 00 8b 06 89 44 24 0c 8b 43 e0 <8b> 78 10 85 ff 75 28 ff 73 e4 8b 46 08 68 8c 1b 83 f8 68 46 1b
May 5 18:17:18 alphan-box kernel: EIP: [<f88310b2>] rt2x00pci_uninitialize+0x2c/0xd6 [rt2x00pci] SS:ESP 0068:f7f0de48
May 5 18:17:18 alphan-box kernel: ---[ end trace c185bceb7f6b85b7 ]---[/codemi0yiamf]


I believe the line

[codemi0yiamf]May 5 18:17:18 alphan-box kernel: phy1 -> rt2x00pci_initialize: Error - DMA allocation failed for queue 1.[/codemi0yiamf]

may be of some help.

Thanks a lot for your support!

regards

xodr

05-05-2008 15:22:16

I saw your latest commit. Will try that now!

IvD

05-05-2008 15:22:44

I just received a patch which should address this issue, it needs some tweaking before I apply it, but as soon it is in rt2x00.git I'll let you know.

However the issue seems to be related to multiqueue support, or to be more exact when multiqueue is disabled. If you enable CONFIG_NET_SCHED and CONFIG_NETDEVICES_MULTIQUEUE in your kernel you will enable the full use of all TX queues rt61pci provides _and_ it should fix the panic for you. )

xodr

05-05-2008 16:03:13

If you enable CONFIG_NET_SCHED and CONFIG_NETDEVICES_MULTIQUEUE in your kernel you will enable the full use of all TX queues rt61pci provides _and_ it should fix the panic for you. )[/quote703cuq5b]


Yes, exactly! It fixed the panic. I can bring wlan0 up and scan successfully. However now I've the following when I start hostapd (it's again a null pointer dereference)

[code703cuq5b]phy1 -> rt61pci_validate_eeprom: EEPROM recovery - NIC: 0xff80
phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET BG: 0x0000
phy1 -> rt61pci_validate_eeprom: EEPROM recovery - RSSI OFFSET A: 0x0000
phy1 -> rt2x00_set_chip: Info - Chipset detected - rt: 0301, rf: 0003, rev: 0002561c.
phy1: Selected rate control algorithm 'pid'
phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
phy1: HW CONFIG: freq=2412
phy1: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
phy1: HW CONFIG: freq=2442
phy1: HW CONFIG: freq=2442
BUG: unable to handle kernel NULL pointer dereference at 00000000
IP: [<f885b000>] :rt2x00lib:rt2x00lib_key_to_cipher+0x0/0x27
*pde = 00000000
Oops: 0000 [#1] PREEMPT
Modules linked in: rt61pci nls_iso8859_1 nls_cp437 sd_mod usb_storage scsi_mod usbhid libusual vfat fat rt2x00pci rt2x00lib mac80211 ehci_hcd uhci_hcd cfg80211 usbcore rng_core eeprom_93cx6 [last unloaded: rt61pci]

Pid: 2574, comm: hostapd Not tainted (2.6.25-wl-00000-g747738d-dirty #2)
EIP: 0060:[<f885b000>] EFLAGS: 00210246 CPU: 0
EIP is at rt2x00lib_key_to_cipher+0x0/0x27 [rt2x00lib]
EAX: 00000000 EBX: f778dc34 ECX: 00000000 EDX: f77b801b
ESI: 00000080 EDI: 00000070 EBP: f75a4c20 ESP: f778dc00
DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
Process hostapd (pid: 2574, ti=f778c000 task=f7ea2550 task.ti=f778c000)
Stack: f885cd77 f76d4be0 f77b801b f75a4180 00000000 00000000 f7ff2ddc f778dc80
f76d4be0 f75a4c00 f8892207 f76d4be0 f7ff2de0 00000100 0000000d 00000000
00000000 00020000 00050000 0000000a 00000000 00000000 f7ff2ddc f778dc80
Call Trace:
[<f885cd77>] rt2x00queue_create_tx_descriptor+0xe1/0x284 [rt2x00lib]
[<f8892207>] rt61pci_beacon_update+0x3c/0x145 [rt61pci]
[<f885c32b>] rt2x00mac_config_interface+0x72/0x8b [rt2x00lib]
[<f88b5164>] __ieee80211_if_config+0xaa/0xb5 [mac80211]
[<f88c280a>] ieee80211_add_beacon+0x0/0x29 [mac80211]
[<f881622e>] nl80211_addset_beacon+0x11b/0x146 [cfg80211]
[<c0217bbd>] genl_rcv_msg+0x130/0x14a
[<c0217a8d>] genl_rcv_msg+0x0/0x14a
[<c02156e9>] netlink_rcv_skb+0x2d/0x7e
[<c0217d59>] genl_rcv+0x19/0x24
[<c02154d6>] netlink_unicast+0x1b6/0x20c
[<c0215c09>] netlink_sendmsg+0x23e/0x24b
[<c01fbf92>] sock_sendmsg+0xb7/0xd0
[<c012048a>] autoremove_wake_function+0x0/0x2d
[<c012048a>] autoremove_wake_function+0x0/0x2d
[<c010eea3>] try_to_wake_up+0x6b/0x73
[<c0254e93>] wireless_send_event+0x2a3/0x2bb
[<c02022aa>] verify_iovec+0x3e/0x70
[<c01fc13a>] sys_sendmsg+0x18f/0x1f2
[<c01fc9d0>] sys_recvmsg+0x148/0x1ca
[<c020452b>] __dev_get_by_name+0x68/0x73
[<c02065e9>] netdev_run_todo+0x1d4/0x1da
[<c0136669>] mark_page_accessed+0x18/0x29
[<c020452b>] __dev_get_by_name+0x68/0x73
[<c020452b>] __dev_get_by_name+0x68/0x73
[<c01fdccb>] sk_prot_alloc+0x13/0x7f
[<c01fcfdd>] sys_socketcall+0x168/0x181
[<c014ae48>] sys_close+0x6d/0xb5
[<c0102896>] syscall_call+0x7/0xb
[<c0250000>] tpacket_rcv+0x1fe/0x3db
=======================
Code: <8b> 10 89 c1 b8 03 00 00 00 83 fa 01 74 18 72 0c 31 c0 83 fa 02 0f
EIP: [<f885b000>] rt2x00lib_key_to_cipher+0x0/0x27 [rt2x00lib] SS:ESP 0068:f778dc00
---[ end trace ef9723e0d42ae10e ]---[/code703cuq5b]


regards

IvD

05-05-2008 16:17:16

Could you try attached patch to see if that helps?

xodr

05-05-2008 16:29:19

perfect! It works! Thanks a lot!!!

If you don't bother could you make a brief explanation of the last patch? I've configured hostap to open mode and I don't use any encryption. Was mac80211 trying to encrypt beacons?

IvD

05-05-2008 16:31:45

perfect! It works! Thanks a lot!!!

If you don't bother could you make a brief explanation of the last patch? I've configured hostap to open mode and I don't use any encryption. Was mac80211 trying to encrypt beacons?[/quotedjv9yib9]

Yes, that was exactly what happend. Or actually it didn't tell rt2x00 to not not encrypt it. (mac80211 only provides a flag to the drivers when a frame should not be encrypted). Since rt2x00 looks at the flags and not really to the type of frame it tried to set the encryption parameters which weren't provided by mac80211 (since it doesn't want it to be encryped).

xodr

05-05-2008 16:33:21

By the way I have another question

I guess it's nothing important but what causes the

[code2p5iwnep]SKB BUG: Invalid truesize (288) len=142, sizeof(sk_buff)=160[/code2p5iwnep]

I have tons of these scrolling the screen.

regards.

IvD

05-05-2008 16:38:57

Hmm that seems to be a bug in mac80211, which is currently under investigation by the maintainer. I have already seen dozens of mails about this message come by on the mailinglist, so hopefully it is fixed soon. )

IvD

05-05-2008 16:42:08

P.S. I have just committed the multiqueue fix to rt2x00.git

xodr

05-05-2008 17:44:26

I have another observation

Leds on my card behave weird. When system boots up and the interface is down they're off.
When I bring wlan0 up they are "both" turned on.
when I bring wlan0 down they are left on.

Both leds are always on (in other words data led is not blinking).

Can this be in any way related to this

When I try to run hostapd for the first when the system boots, everything is OK.
After bringing wlan0 up once, whatever I do I can't get hostapd function correctly (that is it doesn't crash but it doesn't broadcast or do anything useful).

I will check the logs and post if I can find anything useful.

regards

xodr

05-05-2008 17:59:37

I've the following

[codecxph27la]May 5 20:53:45 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2561s.bin'.
May 5 20:53:45 alphan-box kernel: phy0 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.8.
May 5 20:53:45 alphan-box kernel: phy0 -> rt61pci_init_bbp: Notice - Waiting for BBP register.
May 5 20:53:45 alphan-box kernel: phy0: HW CONFIG: freq=2412
May 5 20:53:45 alphan-box udevd-event[2275]: rename_netif: error changing netif name mon.wlan0 to wlan0: Device or resource busy
May 5 20:53:45 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:53:45 alphan-box kernel: phy0: HW CONFIG: freq=2462
May 5 20:53:45 alphan-box last message repeated 2 times
May 5 20:53:50 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:16:e3:0e:40:84 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:54:13 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:80:5e A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:54:29 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:8c:b6 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:54:29 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:8c:b6 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:54:40 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:16:e3:0e:40:84 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:54:53 alphan-box last message repeated 2 times
May 5 20:55:08 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:7f:50 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:13 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:80:5e A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:13 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:80:5e A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:29 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:8c:b6 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:29 alphan-box kernel: phy0: TX to low-level driver (len=102) FC=0x0050 DUR=0x013a A1=00:1b:9e:3a:8c:b6 A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:41 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:41 alphan-box kernel: no beacon data avail for wlan0
May 5 20:55:42 alphan-box kernel: phy0: HW CONFIG: freq=2462
May 5 20:55:42 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:55:42 alphan-box kernel: phy0: HW CONFIG: freq=2462
May 5 20:55:42 alphan-box last message repeated 2 times
May 5 20:56:42 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:56:42 alphan-box kernel: no beacon data avail for wlan0
May 5 20:56:43 alphan-box kernel: phy0: HW CONFIG: freq=2462
May 5 20:56:43 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:56:43 alphan-box kernel: phy0: HW CONFIG: freq=2462
May 5 20:56:43 alphan-box last message repeated 2 times
May 5 20:57:34 alphan-box kernel: phy0: TX to low-level driver (len=26) FC=0x00c0 DUR=0x0000 A1=ff:ff:ff:ff:ff:ff A2=00:08:a1:b7:aa:bc A3=00:08:a1:b7:aa:bc
May 5 20:57:34 alphan-box kernel: no beacon data avail for wlan0[/codecxph27la]

out of which, I can't make any sense of this

[codecxph27la]udevd-event[2275]: rename_netif: error changing netif name mon.wlan0 to wlan0: Device or resource busy[/codecxph27la]

and the following is probably related with the problem

[codecxph27la]kernel: no beacon data avail for wlan0[/codecxph27la]

Because it appeared only after the 2nd and 3rd run attempts of hostapd.

regards

IvD

05-05-2008 18:19:40

I also noticed you have Hardware encryption enabled, could you try disabling that? So far it only works with WEP, but has some issues with AES (most likely TKIP as well).
The beacon data error is bit troublesome, and I'm not sure what could cause that.. S

xodr

05-05-2008 20:22:50

I've disabled it nothing seems to change.

xodr

05-05-2008 20:32:50

Is there a way to reset the NIC? (get it to the state it was when the system boots.)

ifconfig wlan0 down and rmmod rt61pci doesn't seem to work since they leave leds of the NIC on.

IvD

05-05-2008 20:49:17

No the only way it can properly reset itself to all defaults is by cutting the power to the device.
Although the driver touches many registers, some registers are changed indirectly, which means they won't automatically reset the the default value.
The LED code is a bit buggy and I haven't investigated into great depths because LEDs aren't a high priority, overall you can assume little useful from their state at this time. ;)

xodr

05-05-2008 21:02:05

OK mrgreen thanks!