Gentoo Linux wireless USB success: Netgear WG111, ndiswrapper, WPA

After conquering the Netgear WG311 PCI wifi adapter on my desktop system, I wanted to get a fast (802.11g) and secure (WPA) USB wireless network adapter working in Linux, for my car stereo computer and for my fiancee's laptop. Here's the complete HOWTO. This was done on a Pentium-III notebook running 2.6.10-gentoo-r6, with USB1 (UHCI) ports, i.e. no USB2.

I bought the Netgear WG111 USB wireless network adapter, which is an 802.11b/g device, supporting 11 or 54 Mbps. (Note that the WG111U and WG111T are different devices than the WG111.) I had searched for info on this device before and discovered that ndiswrapper supports it, so to begin I installed ndiswrapper and wireless-tools:

# emerge -vabk wireless-tools
# emerge -vabk ndiswrapper

...which got me w-t version 27-r1 and ndiswrapper version 1.1-r1.

I ran the lsusb command to determine my adapter's usbid, which is 0846:4220. I then found the corresponding entry on the ndiswrapper supported devices list. According to that page, the WG111v1 has a Prism54 (Intersil 3886 and NetChip NET2280) chipset.

The ndiswrapper page directs you to the Netgear site to get the Windows driver for your device. My device's serial number starts with WG16, so according to the Netgear Knowledgebase that means it's a WG111v1. Serial numbers starting with WG72 are also v1s; those starting with WG41 are WG111v2 devices.

That wpa_supplicant command shows lots of verbose output, from which I can see that it has properly connected to my router. The ifconfig and iwconfig commands also now show wlan0 as active (it shows the AP MAC address that isn't all zeros).

Now, to permanently set my network settings, I put this into /etc/conf.d/net:

...so that we can use rc-update to start the wireless device at startup:

# rc-update add net.wlan0 default

And add this single line to /etc/modules.autoload.d/kernel-2.6 to load ndiswrapper (and thus the driver) at startup:

ndiswrapper

Finally, run:

# /etc/init.d/net.wlan0 start

...to start the device. Then run the route command and you should see that some of your routes are running through the wlan0 interface. But since you probably had a wired ethernet connection already, your default route still uses that. Run:

To permanently disable your old wired connection, so that wlan0 gets the default route at startup from now on, do:

# rc-update del net.eth0 default

Finally, note this from the ndiswrapper wiki FAQ: "If you are using 2.6 kernels, make sure 4K stacks
are not used i.e., disable CONFIG_4KSTACKS" in your kernel. Apparently crashes may result otherwise.