Tuesday, March 4, 2008

Adventures with a D-Link DWL-G123

I've spent the last few hours attempting to get a newly purchased D-Link USB Wireless Adapter working on one of my older desktop boxes that had a dead ISA NIC.

(Yep, not a PCI NIC, but an ISA one)

So, after purchasing a USB daughterboard with 4 ports on it and plugging in the USB adapter -- there's no lights.

A quick search on the web indicated that the card might be atheros based, but the Madwifi site didn't gleam any good answers.

Next, the box in question had a half-complete Ubuntu 7.04 install (upgraded from 6.10) on it and no working NIC.

Easier solution to that, having found the CDRW in the box doesn't like DVDRW discs -- putting the Ubuntu 7.10 installation on a USB key and mounting the ISO via loopback using:

mount -t iso9660 -o loop /media/disk/ubuntu-7.10-alternate-i386.iso /media/cdrom

Then adding:

deb file:///media/cdrom gutsy main restricted universe

To the /etc/apt/sources.list file, then doing a standard apt-get update && apt-get -f dist-upgrade command line got things underway.

After an hour or so, the upgrade had completed and prompted me to reboot -- after I did, it bombed to the command line and told me that /dev/sda1 had been used by another device or driver -- while the kernel spewed device-mapper lines across the screen talking about devices it couldn't locate.

Returning to the internet on another machine, I found this bug post that looked similar -- sure enough, removing EVMS with apt-get remove evms and rebooting did the trick.

At this point, I had a desktop -- but no Internet.

So I put the driver CD into the machine and run:

ndiswrapper -i /media/cdrom/Drivers/2KXP/NetA5AGU.inf

Which returns:

installing neta5agu ...
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64

Then ndiswrapper -l to make sure the driver is correctly loaded, which returns:

neta5agu : driver installed
device (2001:3A03) present

Finally, I modprobe the ndiswrapper module with modprobe ndiswrapper

... and the lights come on -- and clicking on the network-manager icon finds my network and prompts me for my password.

But that's as far as it gets, the lower green dot stays on for a good 90 seconds, then goes back to showing disconnected.

OK, off to get the newest drivers -- which are located here

Extract the drivers (use the 2KXP drivers and not the Vista ones, which are incompatible with ndiswrapper) and remove and replace the drivers.

Use modprobe -r ndiswrapper && ndiswrapper -r neta5agu to remove the drivers.

Then use the instructions above to install the new drivers, replacing /media/cdrom with the patch you extracted your downloaded drivers to.

But ...

Network Manager still didn't want to connect, I selected my network, entered my password and waited -- but Network Manager still didn't connect to my WLAN.

In a fit of desperation, I decided to backport the version of ndiswrapper that is in the upcoming version of Ubuntu to 7.10.

You can get those from here.

Then I installed those using dpkg -i ndiswrapper*.deb


Then re-inserted the ndiswrapper module using modprobe.

... both lights came on ...

Logged into my machine.

... crossed my fingers while the green dot sat with the grey one ...

... then the green one ...

... then the strength bar! ...

At this point, I had networking, could use Epiphany and all.

So to finish up, I built the configuration for ndiswrapper using ndiswrapper -m then added ndiswrapper to the /etc/modules file so that the ndiswrapper module would be automatically loaded on startup.

I rebooted again, just to make sure everything remained in a working fashion -- everything came up normally, complete with the strength bar in the NetworkManager applet.

It's all good.

In summary, if you use the latest driver from D-Link and Ubuntu Hardy (8.0x) it might "just work" -- but if you use any of the earlier Ubuntu's and are having trouble getting your card working, I hope the instructions above work for you too.

No comments: