Wednesday, February 6, 2008

Linux + Wireless

I just installed the newly released openSUSE 10.3 on a Dell Latitude D800 laptop. One of the major complaints about Linux is lack of support for wireless networking. openSUSE does a pretty good job of making things relatively painless, but your wireless card may not work out of the box. From my experience the Intel PRO/Wireless cards work really well.

When I checked my hardware information in SUSE and saw 'Dell Truemobile 1450 MiniPCI' as my wireless card I wasn't excited. YaST did list my wireless card under Network Devices -> Network Card and this gave me a ray of hope. However, running 'ifconfig' only showed my eth0 wired network card. 'iwconfig' did show my wireless card as eth1, however 'iwlist eth1 scan' reported that the device did not exist.

The Dell Truemobile 1450 MiniPCI uses the Broadcom bcm43xx chipset . This information can be found by running 'hwinfo --wlan'.

cobweb:/home/bean # hwinfo --wlan
18: PCI 203.0: 0282 WLAN controller
Model: "Dell Truemobile 1450 MiniPCI"
Vendor: pci 0x14e4 "Broadcom"
Device: pci 0x4324 "BCM4309 802.11a/b/g"
SubVendor: pci 0x1028 "Dell"
SubDevice: pci 0x0003 "Truemobile 1450 MiniPCI"

There is a 'bcm43xx' kernel model, which was loaded (you can check loaded kernel modules using the 'lsmod' command), but it apparently wasn't working correctly.

Apparently Broadcom never released details about these chips. So the driver included in the Linux kernel is based upon reverse engineered specifications. This might explain why it wasn't working for me.

I did find a couple of possible solutions in the NDISwrapper and bcm43xx-fwcutter. ndiswrapper is the solution that I used; it was only slightly painful and seems to be working great now. Madwifi is a solution for wireless cards with Atheros (not Broadcom) chipsets.

NDISwrapper

ndiswrapper implements Windows kernel API and NDIS (Network Driver Interface Specification) API within Linux kernel. A Windows driver for wireless network card is then linked to this implementation so that the driver runs natively, as though it is in Windows, without binary emulation. In short, ndiswrapper allows you to use Windows drivers for WLAN cards in Linux.

With ndiswrapper, most miniPCI (builtin), PCI, PCMCIA (Cardbus only) or USB wireless network cards work in Linux with x86 or x86-64. Although ndiswrapper is intended for wireless network cards, other devices are known to work: e.g., ethernet cards, USB to serial port device, home phone network device etc.

ndiswrapper packages come with openSUSE, but they are not installed. Simply install the ndiswrapper package and the ndiswrapper-kmd- package (you can get your kernel flavor by running 'uname -r' as root).

Once I had the ndiswrapper installed I followed these steps

  1. Grab the windows drivers for the Dell TrueMobile 1450 miniPCI card from Dell's support page.
  2. new directory, move the downloaded .exe inside, and unzip the .exe: mkdir ~/tmp; mv R90501.EXE ~/tmp; cd ~/tmp; unzip R90501.EXE
  3. Tell ndiswrapper where the inf is: 'ndiswrapper -i ~/tmp/bcmwl5a.inf'. This will create a directory in /etc/ndiswrapper named bcmw15a. ndiswrapper will automatically try to load all drivers in this directory when the ndiswrapper kernel module is started. Also note that ndiswrapper looks for other files (such as .sys files) in addition to the .inf files, so it's a good idea to just put all the windows drivers files in the same directory.
  4. Disable the bcm43xx kernel module and related kernel modules. First, see what's loaded: 'lsmod | grep bcm'. Then, disable what's loaded: 'rmmod >module name>'. The modules to unload will probably be bcm43xx, ieee80211softmac, ieee80211, and firmware_class.
  5. Load the ndiswrapper kernel module: 'modprobe ndiswrapper'

If you have installed the correct driver you should see something like this:

bcmwl5: driver installed
device (14E4:4320) present

and you should now be able to use your wireless card.

‘present’ means that you have a card that can be used with the driver installed. In this case, broadcom driver bcmwl5 is used. If you see ‘cannot locate lspci. Unable to see if hardware is present’, you need to install the pciutils package.

If you get something like

bcmwl5: driver installed
device (14E4:4320) present (alternate driver: bcm43xx)

then you / kernel may use bcm43xx module for that device. If that module is loaded, then ndiswrapper wouldn’t be able to use that device; see Troubleshooting. . This usually occurs if the kernel is trying to use an alternative driver (this is why we rmmod the other kernel modules).

You should now be able to use your wireless lan card normally.

To make this change permanent you will want to do a couple of other things:

First, you will want to blacklist the kernel modules you don't want to load anymore. This can be done by adding lines similar to those below to your /etc/modules.d/blacklist file:

# wireless card
blacklist bcm43xx
blacklist ieee80211softmac
blacklist ieee80211
blacklist firmware_class

You might not want to copy and paste this verbatim. The blacklisted modules should be the modules you unload in the steps above (using rmmod).

Second, you will want to make sure the ndiswrapper module is loaded when you boot. To do this, add "ndiswrapper" to the MODULES_LOADED_ON_BOOT variable in /etc/sysconfig/kernel or add "modprobe ndiswrapper" to to /etc/init.d/boot.local or a script that runs at boot time.

Here is a list of cards known to work with ndiswrapper.

bcm43xx-fwcutter

As the name suggests this solution is only for Broadcom 43xx chips.

http://forums.gentoo.org/viewtopic-t-409194-postdays-0-postorder-asc-start-0.html

These are Gentoo specific instructions, but they should be easy to translate to SUSE. You won't need to work about the kernel compilation as the BCM43XX support is enabled by default in openSUSE, and Instead of emerging bcm43xx-fwcutter you can get it at http://developer.berlios.de/project/showfiles.php?group_id=4547.

Madwifi

The Madwifi team develops Linux kernel drivers for Wireless LAN devices with Atheros chipsets.

Here is a list of cards known to work with ndiswrapper.

Madwifi has good doucumentation that can be found here http://madwifi.org/wiki/UserDocs/FirstTimeHowTo. openSUSE comes with the Madwifi package available, so you don't need to compile it; just install the rpm.

1 comment:

Unknown said...

Brian...

Thanks for posting your solution to the wifi card Dell-Laptop Linux problem. I have Suse 10.3 installed on my Inspiron 8500 (after some work!) and my wifi card (the TrueMobile 1450) didn't work either.

I followed your script pretty closely but took the Windows drivers from an install disk that came with the 1450.

A couple of differences from the script. After the steps numbered 1 - 5, after step 5, 'modprobe ndiswrapper' I didn't see the output you show "bcmwl5:driver installed
......"

Nothing printed at all

Second,rmmod firmware_class didn't complete correctly because the file was in use.

The blacklist file is in /etc/modprobe.d in my suse install and I chose to modify the /etc/init.d/boot.local file.

BUT IT ALL WORKED!!!

THANKS!

...btw...I'm thinking of using the DLink range extender card supported by Madwifi. do you think it would give me enough improvement to be worth the effort of getting Madwifi to work?