Tuesday, 22 March 2011

Linux Lab: NDIS and Windows Wireless Drivers

Belkin and Netgear Wireless USB under NDis
(Inspired by Nikos, Full Circle Magazine #44)


You may have heard reference on the podcast to my antique Pentium-4 'test' box, the 'Home Improvement' -style PC that's so non-branded it doesn't even have a case. Thanks to the placement of phone sockets in my house, wireless networking is essential, but the P-4 has no built-in wireless, cards or PCI-Express slots.

The good news/bad news is the Belkin FD7050 Wireless USB works on Ubuntu 10.10 out of the box: just really badly. Forget using any webmail clients, carrier pidgeon would be faster (happily the networking stack in 11.04 Alpha-1 appears to work at regular speed, but not the graphics - sigh). It was worth a try to get the Belkin going under NDIS Wrapper using the Windows drivers...

Common Tongue

NDIS is short for the “Network Driver Interface Specification” which was created to define a standard API for Network Interface Cards (NIC's). In order to get the card's hardware to work, you need a Media Access Controller (MAC) device driver to translate networking commands across the programming interface. Such is the diversity of manufacturers, chipsets and versions, in our world of GNU/Linux, native drivers just don't exist for every card and the nearest Linux equivalent may not work at speed.

Fortunately, NDIS also provides a library of functions (commonly called a “wrapper”) that can be used by MAC drivers and higher-level protocol drivers such as TCP/IP. This is the NDIS-Wrapper that we'll use to get the manufacturer's Windows drivers to work. You can find out more at http://www.ndis.com/.

Ingredients

In Synaptic, I installed the following:
  • ndiswrapper-common – implements Windows kernel API and NDIS (Network Driver Interface Specification) API within your Linux kernel, which allows you to run wrapper scripts to call out to the proper versions of whatever -ndiswrappper-utils package is installed.
  • ndiswrapper-utils-1.9 - dependent package to manage NDIS userspaces
  • ndisgtk - this is the gtk graphical user interface for managing windows wireless drivers, for people like me who avoid terminal sessions whenever there's an easier way.
Plugging the Belkin into the PC, I got a flashing light right away to indicate that the PC recognised the USB dongle by polling.

With the Belkin drivers CD inserted, I then go to System -> Admin -> Wireless Network Drivers, selecting Install New Driver and browsing the CD to the .inf file which describes the driver for the specific chipset. Belkin in this case used a Ralink chipset, the RT73. More recent versions of drivers downloadable from the internet can be more reliable, robust and/or faster.

Some Windows drivers are in two parts. I have a couple of Netgear WG111T dongles which require both the Atheros firmware driver for the chipset (athfwwdl.inf) and a specific Netgear implementation driver (ntgwg11t.inf) in order to work. Why am I not using these? The antenna is so bad on that model, it won't even detect my router downstairs (sigh again).

Upon installation, Wireless Wireless Drivers listed under 'Currently Installed Drivers' the RT73 chipset driver with 'Hardware Present: yes'.

I needed to ensure the ndiswrapper was ready to run on Bootup using:

sudo ndiswrapper -m

This normally writes a copy of the settings to the /etc/modprobe.d/ndiswrapper file. I got the confirmation message:

module configuration already contains alias directive

which indicated Windows Wireless Drivers had already done it for me.

In the case of older ('deprecated') drivers or on older versions of Ubuntu, you might have to manually edit the /etc/modules file via

sudo gedit /etc/modules

to insert the entry

ndiswrapper

Just to make sure everything loads properly with no driver conflicts - and being an optimist - I rebooted here.

The Belkin flashed away happily and Windows Wireless Drivers show the rt73 driver persisted, so I check the Belkin can see my wireless router with the terminal command:

iwlist scan

With the result:

lo
Interface doesn’t support scanning.
eth0
Interface doesn’t support scanning.
wlan0
Scan completed :
Cell 02 – Address: 00:0D:93:7E:27:BB
ESSID:”MY_HOME”
Protocol:IEEE 802.11g
Mode:Managed
Frequency:2.417 GHz (Channel 2)
Quality:53/100 Signal level:-62 dBm Noise level:-96 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:atim=0

which confirmed it can see the wireless network on wlan0 at decent signal strength. We don't care about lo (Loopback) or eth0 (wired ethernet) in this case.

So I visited System -> Admin -> Network to start Network Manager to manually select the wireless “MY_HOME” network and entered my WPA-PSK security key. Network Manager took care of the connection. With my network credentials stored in my default Keyring, the Belkin automatically connects from this point on with good transfer speeds.

Coda

I used this same process to try out the Netgear WG111T's. The process worked but they were both useless at getting a signal inside my building. I can tell you wireless networking of both Belkin and Netgear dongles is a lot easier than it used to be, but older hardware is anything but consistent. Not all versions of Ralink chipsets behave this well, so expect some further fault finding if you try this yourself. The forums are full of Linux users with Broadcom chipset problems, as another example. If you have older PCI or PCMCIA wireless cards, this same process should work for NDIS-wrapping those too. RC

Lab machine specs: Pentium-4, 2.14GHz, 1Gb RAM, 40Gb HD, NVidia GT4800 grahics.

No comments:

Post a Comment

At least try to be nice, it won't kill you...