ralinkwifi driver RT2561/RT61

Forum thread started by gif on Tue, 2011-02-15 13:36

hi there!

i recently installed several versions of the haiku-nightlies (most recently 40448 gcc2-hybrid), but i can't get the ralinkwifi driver working.
the card is ok, i had it working under several other (mostly useless) os-es.

ok so my device is being reported as "device 0301: RT2561/RT61 802.11g PCI" by listdev (full list here: http://gif.7miles.hu/listdev.txt),
and the kernel reports the following error into syslog (more here: http://gif.7miles.hu/syslog.txt):

KERN: [ralinkwifi] (ral) bus_alloc_resource(1, [0], 0x0, 0xffffffff, 0x1,0x6)
KERN: [ralinkwifi] (ral) could not allocate interrupt resource

the machine is a packard bell easynote r1004 laptop, some 4-5 years old, it should be best for some haiku geekness :)

any help is much appreciated.

cheers
/gif

Comments

Re: ralinkwifi driver RT2561/RT61

quick search shows driver in Haiku for your device:

     72 static const struct ral_pci_ident ral_pci_ids[] = {
     73 	{ 0x1814, 0x0201, "Ralink Technology RT2560" },
     74 	{ 0x1814, 0x0301, "Ralink Technology RT2561S" },
     75 	{ 0x1814, 0x0302, "Ralink Technology RT2561" },
     76 	{ 0x1814, 0x0401, "Ralink Technology RT2661" },

Have you also installed firmware? Might be required by your card to work.
http://www.haiku-os.org/guides/daily-tasks/wireless

"KERN: [ralinkwifi] (ral) could not allocate interrupt resource"
Maybe interrupt (sharing) issue (?) but you should try installing firmware first to see if that makes the card work or not.

Re: ralinkwifi driver RT2561/RT61

The log shows this device doesn't have an interrupt line assigned. Haiku's PCI code reports it as line zero, which means none. To get the device working it needs an interrupt, most commonly the BIOS will do this assignment during startup, but Haiku also needs to be able to do this at runtime.

It's possible that you can work around this by tweaking BIOS options labelled e.g. "PnP OS" or by manually assigning the IRQ line if there's a feature which lets you do that.

Re: ralinkwifi driver RT2561/RT61

tonestone57 wrote:

"KERN: [ralinkwifi] (ral) could not allocate interrupt resource"
Maybe interrupt (sharing) issue (?) but you should try installing firmware first to see if that makes the card work or not.

i forgot to mention that i ran the install-wifi-firmwares.sh, but as far as i know the ralink firmwares are included.
anyway, i had no luck with that.

Re: ralinkwifi driver RT2561/RT61

NoHaikuForMe wrote:

The log shows this device doesn't have an interrupt line assigned. Haiku's PCI code reports it as line zero, which means none. To get the device working it needs an interrupt, most commonly the BIOS will do this assignment during startup, but Haiku also needs to be able to do this at runtime.

It's possible that you can work around this by tweaking BIOS options labelled e.g. "PnP OS" or by manually assigning the IRQ line if there's a feature which lets you do that.

well that's the worst part of all, the bios on this laptop is the lamest one i've ever seen, it has only options for boot order, date and memory allocated to the videocard. I already searched for a bios upgrade but this machine is ancient, and i don't believe the upgraded version has more features.

is there any possibility that the OS can do this irq assignment? (or do any of you know some other way around this?) I mean either inside (maybe some parameters for the driver or the pci code) or outside Haiku (I'm not much into custom bios hacking but there may be something out there)

Re: ralinkwifi driver RT2561/RT61

I have seen few people able to resolve the IRQ issue by disabling their wired network card. Sometimes an IRQ conflict happens for some people.

To see your IRQ list, in terminal type: kernel_debugger
then ints
you will see int X, where X=0 to 15 plus any device using that IRQ
then type exit to leave

You can disable wired card (and audio card too) by removing their drivers from Haiku. Then they won't take up any IRQs. Maybe you get lucky and then WiFi works.

Why not use your wired network? Seems your wired network card was detected but dhcp was not working for you.

There was a dhcp issue recently fixed in 40492. Get a newer nightly.
http://dev.haiku-os.org/changeset/40492

Re: ralinkwifi driver RT2561/RT61

ok i updated to 40501, i looked at my irq list, and practically removed every driver i could (including usb, ps2, audio, wired network), but sadly nothing helped, the wifi card still reports the same error.
Btw, there's a line in the syslog which i don't understand:

KERN: ioapic explicitly disabled, not using ioapics for interrupt routing

maybe enabling this feature would help me?

i'm not using the wired interface because all my other devices use the same wifi router, so i had to pull the cable off my wifi router to download the optional packages (and the firmwares).

Re: ralinkwifi driver RT2561/RT61

gif wrote:

Btw, there's a line in the syslog which i don't understand:

KERN: ioapic explicitly disabled, not using ioapics for interrupt routing

maybe enabling this feature would help me?

Yes, but no. Having working interrupt routing would help you, in that then your WiFi could work. Having IOAPIC support could be a step in that direction.

But as far as I can tell Haiku's IOAPIC support is "explicitly" disabled because it simply doesn't work. So enabling this (you might be able to from the "safe mode" menu) is likely to just crash the PC.

Re: ralinkwifi driver RT2561/RT61

NoHaikuForMe wrote:

Yes, but no. Having working interrupt routing would help you, in that then your WiFi could work. Having IOAPIC support could be a step in that direction.

But as far as I can tell Haiku's IOAPIC support is "explicitly" disabled because it simply doesn't work. So enabling this (you might be able to from the "safe mode" menu) is likely to just crash the PC.

I'll definetly try it this evening, am I right that this is the one we're talking about?
http://dev.haiku-os.org/ticket/5

Re: ralinkwifi driver RT2561/RT61

gif wrote:

well that's the worst part of all, the bios on this laptop is the lamest one i've ever seen, it has only options for boot order, date and memory allocated to the videocard. I already searched for a bios upgrade but this machine is ancient, and i don't believe the upgraded version has more features.

is there any possibility that the OS can do this irq assignment? (or do any of you know some other way around this?) I mean either inside (maybe some parameters for the driver or the pci code) or outside Haiku (I'm not much into custom bios hacking but there may be something out there)

does your bios have a PlugandPlay Aware/capable OS setting ? If so set it to NO instead of Yes. That should get the bios to assing IRQ's are boot time. Which in thoery should get your wireless card to work.

Re: ralinkwifi driver RT2561/RT61

Since you removed things like usb, ps2, audio, wired networking and still couldn't get an IRQ then you're out of luck. Doing this would have freed up IRQs for the card to use without IRQ sharing.

Some systems had buggy IRQ/MP table or buggy BIOSes. I will guess that is the case with your laptop. BIOS upgrade was the way to fix this.

Example of buggy BIOS:
http://lists.debian.org/debian-kernel/2010/09/msg00757.html

Ticket #5 may fix your issue but cannot say for sure.

IOAPIC
http://en.wikipedia.org/wiki/IOAPIC

IOAPIC is disabled in Haiku for a reason but you can try it out to see what happens. You can try disabling ACPI in safe-mode and see if that helps.

My WiFi router does both wireless and wired connections. So I get to choose what I want to use.

Re: ralinkwifi driver RT2561/RT61

hey, thanks for all the help so far, it's much appreciated.

i debugged the free'd irq-s constantly with the kernel_debugger, but it seems it tried to acquire something i couldn't free. (i even moved the ata driver but that resulted in a livecd boot ;D)

i just burned the bios upgrade cd at my workplace, i'll take my shot with it in a few hours. (but to be honest i don't expect much).

tonestone57 wrote:

Example of buggy BIOS:
http://lists.debian.org/debian-kernel/2010/09/msg00757.html

i wasn't sure these two symptoms were connected, but with acpi i also didn't have usb working. after playing around with drivers, by removing the acpi and ehci driver, usb started to work (i thought it was ehci, but it may be that only acpi was the one)

so i'll dig myself into this also, i'm not that giving up type regarding Haiku ;)

thanks again, you're all great help:)

((as for the wired thing, i also prefer wired plainly for the sake of speed/response, but we have a newborn baby and it's just super complex now to move around rooms with cables))

Re: ralinkwifi driver RT2561/RT61

You can also disable ACPI with safe-mode. You get to safe-mode by holding down SHIFT key right at very start of booting Haiku.

ACPI can be disabled from the kernel (text) file to make this change permanent.

EHCI = USB 2.0
UHCI (Intel & VIA) & OHCI (SiS, Nvidia) = USB 1.x

Seems like buggy BIOS like that Toshiba link I provided. That person disabled ACPI and things worked better for him. See if that helps your situation.

Understand that your issue sounds more about getting (being assigned) an IRQ. Which points to a BIOS issue and trying to work around it. ie: buggy or Plug N Play BIOS,

Re: ralinkwifi driver RT2561/RT61

i tried several variations yesterday evening, (i used space to get the boot menu) and tried to disable acpi, and/or enable ioapic, combined with moving drivers out of the kernel drivers folder and/or leaving them in their original place.

i got mixed results but the wifi card was never initialized. it's interesting that if every driver is in their original place and i go with the safe boot acpi disable option, then Haiku freezes at boot (is there any way to see the initializations via textmode?). USB only works if I remove the acpi driver by hand from the kernel drivers along the ehci driver.

i'm running out of ideas :|

Re: ralinkwifi driver RT2561/RT61

gif wrote:

i tried several variations yesterday evening, (i used space to get the boot menu) and tried to disable acpi, and/or enable ioapic, combined with moving drivers out of the kernel drivers folder and/or leaving them in their original place.

i got mixed results but the wifi card was never initialized. it's interesting that if every driver is in their original place and i go with the safe boot acpi disable option, then Haiku freezes at boot (is there any way to see the initializations via textmode?). USB only works if I remove the acpi driver by hand from the kernel drivers along the ehci driver.

i'm running out of ideas :|

When you get to safe mode you will see options for debugging output. You can set it to on screen debugging.

Re: ralinkwifi driver RT2561/RT61

You have done everything possible to get it working. At some point you will have to give up. It seems like BIOS issue and I do not think you can get around it with Haiku.

You have disabled ACPI, enabled IOAPIC, removed other drivers (to free IRQs), etc.

You can also try searching for similar bugs at bug tracker:
http://dev.haiku-os.org/search

You can also try asking on the General Mailing list and maybe get help from there.
http://www.haiku-os.org/community/ml

Re: ralinkwifi driver RT2561/RT61

I subscribed myself to the mailing list, thank you all for your kind help!