Driver not loading for D-Link DWL-G510

Live forum:


13-03-2010 11:46:12

I'm having problems getting my wireless card to work and and wondered if anyone had any suggestions.

The card is a D-Link DWL-G510 C2 with a RaLink chipset. I've spent many (many) hours trying to get it to work (on 64bit Fedora 12 and 64bit Ubuntu 9.10) and am now a bit stuck.

I've also tried
* RaLink's own linux driver from their site but it's out of date and doesn't compile against the latest kernel.
* ndiswrapper with every driver I can find.

But nothing works.

'lspci' shows the card as a network controller (see attached for 'lspci -vvv -nn') but there's no driver assigned.
'modprobe -l' shows that the rt61 driver is not loaded.

Adding rt61pci to the to my modules.conf (Fedora) file loads the module with all its dependencies but it still isn't associated with the card.

At one point, I thought I had a breakthrough... I noticed that the devid (or whatever it's called) of the device is '0382' (see lspci output). And running 'modinfo rt61pci' shows the following

filename: /lib/modules/
license: GPL
firmware: rt2661.bin
firmware: rt2561s.bin
firmware: rt2561.bin
description: Ralink RT61 PCI & PCMCIA Wireless LAN driver.
version: 2.3.0
srcversion: 1F8ADC136D38ED1899F7174
alias: pci:v00001814d00000401sv*sd*bc*sc*i*
alias: pci:v00001814d00000302sv*sd*bc*sc*i*
alias: pci:v00001814d00000301sv*sd*bc*sc*i*
depends: rt2x00pci,rt2x00lib,crc-itu-t,eeprom_93cx6
vermagic: SMP mod_unload
parm: nohwcrypt:Disable hardware encryption. (bool)

Which looks like it only recognises cards with a devid of 0301, 0302 and 0401. As a bit of a stab in the dark, I added an alias for my devid to a modprobe config file

cat /etc/modprobe.d/wireless.conf
alias pci:v00001814d00000382sv*sd*bc*sc*i* rt61pci

Doing so caused the rt61pci module to be loaded during boot (along with its dependencies) but other than that nothing changed that I could see.

Epiphany #2 the 0382 devid might be in the latest source for the driver!... Nope.

I checked out the source from the git repo and the only devices listed (I think it was in rt61.c but I may be wrong) were 0301, 0302 and 0401.

So that's as far as I've got.

Is there anything I've missed that could be causing the problem?
I wouldn't say I'm a Linux expert so it may be something fairly obvious.

Any help would be great. Let me know if any further trace is required. I've attached the output from dmesg just in case.



13-03-2010 12:17:07

Are you sure it is a rt61 device and not rt2800?
The entire PCI ID is unknown, so I can't say which device this actually is.

If you want to test a particular driver, you have to edit the rt61pci (or rt2800pci) file and add a PCI_DEVICE() line in the rt61pci_device_table (or rt2800pci_device_table) to cause the driver to load. Hopefully that will give a clue which device this is.


13-03-2010 17:47:59

Hi, thanks for getting back to me so quickly.

The driver cd that came with the card contains windows rt61 drivers so I assume that's the one.

I've updated the rt61pci_device_table and rebuilt the module but am currently having problems getting it to load in the kernel. I'll post back here when I get it loaded.

I assume I've built the module incorrectly as I'm getting 'Invalid module format'.

Hopefully shouldn't be long.


13-03-2010 18:59:53

That error can occur by 2 problems
a) The GCC used to compile the module is different then used to compile the kernel
b) The kernel source used to compile the module is different then the running kernel

Highly likely the second option is the problem


14-03-2010 01:45:58

Ok, progress... I have the modified rt61 module up and running. iwconfig is showing the wlan(s) now but I'm getting 'Invalid firmware filename' in the logs. NetworkManager shows the interfaces but there's no scanning going on.

Is this likely to be something wrong with my configuration or is there something else in the driver code I could tweak?

Thanks for your help so far. I've also attached my /var/log/messages from a single boot.


Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): driver supports SSID scans (scan_capa 0x01).
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): new 802.11 WiFi device (driver: 'rt61pci')
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): exported as /org/freedesktop/NetworkManager/Devices/1
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): now managed
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): device state change: 1 -> 2 (reason 2)
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): bringing up device.
Mar 14 00:55:59 localhost NetworkManager: <info> (wlan0): deactivating device (reason: 2).
Mar 14 00:55:59 localhost kernel: phy0 -> rt2x00lib_request_firmware: Error - Invalid firmware filename.
Mar 14 00:55:59 localhost kernel: Please file bug report to

wlan0 IEEE 802.11abg Mode:Managed Access Point: Not-Associated
Tx-Power=0 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

lcpci -nnvvv
03:05.0 Network controller [0280]: RaLink Device [1814:0382]
Subsystem: D-Link System Inc Device [1186:3c89]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR+ INTx-
Latency: 64 (32000ns min), Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 20
Region 0: Memory at febc0000 (32-bit, non-prefetchable) [size=32K]
Region 1: Memory at <ignored> (32-bit, non-prefetchable)
Region 2: Memory at <ignored> (32-bit, non-prefetchable)
Region 3: Memory at <ignored> (32-bit, non-prefetchable)
Region 4: Memory at <ignored> (32-bit, non-prefetchable)
Region 5: Memory at <ignored> (32-bit, non-prefetchable)
Expansion ROM at <ignored> [disabled]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=100mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Bridge: PM- B3+
Kernel driver in use: rt61pci
Kernel modules: rt61pci

P.s. for anyone in a similar position, you can build against your current kernel version rather than the checked out kernel source by using a command similar to
make -B -C /lib/modules/ M=`pwd` drivers/net/wireless/rt2x00/*.ko


14-03-2010 03:06:01

Check the function rt61pci_get_firmware_name() inside rt61pci.c.
Change the line
[code2llfbyre]fw_name = NULL;[/code2llfbyre]
to one of the following
[code2llfbyre]fw_name = FIRMWARE_RT2561;[/code2llfbyre]
[code2llfbyre]fw_name = FIRMWARE_RT2561s;[/code2llfbyre]
[code2llfbyre]fw_name = FIRMWARE_RT2661;[/code2llfbyre]

Hopefully one of these three will fix cause the device to work properly...


18-03-2010 12:55:27

I tried setting the firware to the above values but unfortunately none of them worked... each of them gave a message similar to the following

rt61pci 0000:03:05.0: firmware: requesting rt2661.bin
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x00002100, value=0xffffffff
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x0000308c, value=0xffffffff
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x0000308c, value=0xffffffff
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x0000308c, value=0xffffffff
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x0000308c, value=0xffffffff
phy0 -> rt2x00pci_regbusy_read: Error - Indirect register access failed: offset=0x0000308c, value=0xffffffff
phy0 -> rt61pci_wait_bbp_ready: Error - BBP register access failed, aborting.
phy0 -> rt61pci_set_device_state: Error - Device failed to enter state 4 (-5).

Attached is the output from dmesg for the 6221 firmware but I didn't think to save the output from the first two attempts.

Do you think it would be worth trying to point the firmware to the latest '.bin' files supplied by RaLink and/or the windows ones supplied on my driver cd? Sorry if that's a stupid question but I'm not too familiar with the way the drivers hang together.



18-03-2010 14:27:00

You could try the latest firmware version from the Ralink website. Not sure if it would work, unless they added the PCI ID to one of the latest drivers as well.