This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Wireless & Mobile

Two tools for enabling wireless cards

By Bruce Byfield on August 17, 2007 (9:00:00 AM)

Share    Print    Comments   

No other hardware nowadays supports GNU/Linux as weakly as wireless network adapters. Between the constant release of new models and major vendors who are uninterested in supporting the operating system, free drivers for wireless cards are next to impossible to reverse engineer. Nor can you find many retailers willing to customize laptops as readily as they do workstations. In this situation, ndiswrapper and the Broadcom firmware cutter provide a functional, if not always satisfactory, solution.

These two programs are unsatisfactory for two reasons. First, they fall under the category that the Debian repositories label "contrib": they are free in themselves, but depend on proprietary programs to work. Basically, the programs extract the necessary GNU/Linux drivers from Windows drivers released by the manufacturers and provide a means of using them under GNU/Linux -- a process that many free software supporters may find philosophically objectionable and that, despite the free availability of the drivers, may be technically illegal. Second, using the two programs is arcane enough to intimidate many users, especially since some of the details vary depending on the distribution with which they're used.

To make matters worse, partial documentation for both programs clogs the Internet. Without trying this documentation, you cannot easily assess its quality, yet, by trying it, you risk leaving your computer in a state unfit for future attempts.

To make the effort less painful, this article assembles the information needed to use both programs and explains their requirements. So far as possible, it presents this information generically, but, at some stages in the use of the two programs, you may need to consult documentation for your distribution in order to complete the process.

Using ndiswrapper

ndiswrapper (Network Driver Interface Specification wrapper) provides an interface that allows you to use Windows drivers for your wireless card in GNU/Linux. At least two graphical interfaces are available for ndiswrapper, but most distributions and instructions do not bother to mention them -- no doubt because anybody likely to use the program is apt to be comfortable at the command line.

To use ndiswrapper, you need at least a 2.6.6 or 2.4.26 kernel in their respective series. You also need the kernel headers for the kernel, gcc, and the wireless-tools package. If you are using an RPM distribution, you can use the dkms-ndiswrapper package from FreshRPMS, which includes the kernel-headers. Should your distribution not have wireless-tools, you can download it from Hewlett-Packard's Wireless LAN Resources Page.

Before you begin, you also need to know whether you can use your card with ndiswrapper. Run lspci and record the first column entry for your wireless card. Then run lspci -n and use the first column entry from the bare command to locate the line for that card. In the third or fourth column of the line is the PCI ID for the wireless card, which consists of four digits followed by a colon and another four digits -- for example, 14e4:4311. With this information, go to the project's list of supported cards, look up the card by name, then see if the PCI ID is listed. If it is, you should be able to use ndiswrapper; if not, look into the firmware cutter instead.

Next, if you have already tried using ndiswrapper, remove all traces of the previous installation. Start by removing any drivers installed with the program with the command ndiswrapper -r driver. Next, remove the program, using either your distribution's package management tool, or, if you compiled it from source, by using the command make uninstall in the directory that contains the ndiswrapper files. Then, enter the command modprobe -r ndiswrapper to remove the module from the kernel. If you used ndiswrapper -m to create an alias, run rm -f /etc/modprobe.d/ndiswrapper as well. Finally, delete the loadndisdrive file and any other reference to ndiswrapper from /usr/sbin and the kernel module from /lib/modules/<kernelname>/misc. Should your distro store files in other locations, use a search tool to find the files related to ndiswrapper.

Once your system is clean, you can install ndiswrapper, using either your distribution's package name or the source code available on the ndiswrapper site. Use the command sequence distclean, make, and make install to compile the source.

With this step, you are ready to begin installing the driver. The project's list of supported drivers, which you used to see if installation was possible, also contains the name and URL of the driver you need. Download the driver to a new directory, and run unzip -a driverfile to decompress it.

Note that, in some of the incomplete sets of instructions you can find on the Internet, you may find other possible drivers available from other sources, and some of them might even work. However, other drivers for different versions of the wireless card model may not work, or may allow your system to detect the card without being able to use it. Currently, too, ndiswrapper supports only Windows XP drivers, so Vista drivers may not work. You should use alternative sources only if the recommended one does not work -- and then you are off into the world of trial and error.

If you have a copy of Windows XP on your computer, you can find the .sys driver for your card under Control Panel -> System -> Hardware -> Device Manager. Search in the \Windows\inf folder for both the .sys and .inf file of that name and transfer the files to your GNU/Linux distribution.

However you get the driver, find the .inf file associated with it and run the command ndiswrapper -i name.inf to install the driver. If you are using a driver that you have unzipped, you will find the necessary file in the /DRIVER folder in the directory of uncompressed files.

The command copies the necessary files to /etc/ndiswrapper and creates the configuration file for the card. If you run ndiswrapper -l, you can check whether the driver is installed and your system is detecting the device.

At this point, configure the wireless network interface using the programs contained in wireless-tools. Some of the most succinct instructions available are in the ndiswrapper documentation.

When you are satisfied that you can connect to a wireless network, enter the command ndiswrapper -m to load ndiswrapper -- and hence the driver -- anytime that the wireless interface is activated from a program like wifi-radar and network-manager. If you want the module loaded automatically at boot time, consult your distribution's documentation for how to do so -- in many distributions, you only need to add the line ndiswrapper in /etc/modules or the line modprobe ndiswrapper in /etc/rc.d/rc.local.

Using the Broadcom firmware cutter

The firmware cutter is for use specifically with Broadcom wireless cards. It uses a driver that is part of recent Linux kernels, but extracts the firmware it needs from files provided for Windows (either a file called bcm43xx or bem43xx_mac80211).

The firmware cutter requires at least a 2.6.17-rc2 kernel. As with ndiswrapper, you may also want to install wireless-tools to help you configure your wireless connection.

In addition, check that your wireless card can use a version of the firmware that the program supports. To find the firmware version, enter the command lspci and record the first column entry for your wireless card, then run lspci -vn and locate the entry for the card using the first column entry obtained by running the bare command. In the third or fourth column is the Chip ID, a four digit number, followed by a colon and another four digits. Take the last four digits and refer to the Devices page of the project homepage to see if your card is supported. If you have just bought your computer then the card is almost certainly supported, but you should check to make sure.

If this is not your first attempt to use the firmware cutter, you should also ensure a clean reinstall by removing all traces of previous efforts. You can do so in two ways: either with the command modprobe -r drivername or with echo 'blacklist drivername' >> /etc/modprobe.d/blacklist, which writes the driver to a list of modules that should not be loaded. To avoid confusion, you can also remove any downloaded files from previous attempts. Unlike with ndiswrapper, removing previous versions of the firmware cutter before installing a new one is not necessary.

You can install the firmware cutter from the repositories of many distributions. Alternatively, you can download the latest version from the project's repository using the command checkout svn://svn.berlios.de/bcm43xx/trunk/sprom.

Once the firmware cutter is installed, your next step is to download the Broadcom firmware itself to a new directory. Just now, the most common source is the OpenWrt repository, but some distributions, such as Ubuntu, have other sources, so you should check the user forums for any customized versions of the firmware. These specialized versions of the firmware may give you a higher chance of using the firmware cutter successfully.

After the firmware is downloaded, change to its directory and run the command /usr/bin/bcm43xx-fwcutter -w /lib/firmware wl_apsta.o. At least one how-to also suggests adding the firmware to the kernel folder with bcm43xx-fwcutter -w /lib/firmware/`uname -r` ~/Desktop/wl_apsta.o>, but that does nothing so far as I can tell from my own experiences.

If, after using wireless-tools, you can establish a wireless connection, you may also choose to add modprobe drivername. Many how-tos leave out this step, and it does not seem necessary, but I mention it for the sake of thoroughness.

Conclusion

Even a summary of what ndiswrapper and the firmware cutter do sounds chancy, so don't be discouraged if your first efforts at using either fails. Check your distribution's mailing lists and IRC channels to see if they have any specific information about using these programs, and make sure that you start with a clean system to improve your chances. You may find that a different download source or a different software version or file makes all the difference.

Some day, using these programs may be as obsolete as balancing config.sys in DOS, but, for now, many users may have no other choice. The only other alternatives are to wait in the hopes that native support becomes available before your computer becomes obsolete, or to buy a card that works natively -- and no one should be blamed for feeling that they should not have to do either.

Bruce Byfield is a computer journalist who writes regularly for Linux.com.

Share    Print    Comments   

Comments

on Two tools for enabling wireless cards

Note: Comments are owned by the poster. We are not responsible for their content.

I couldn't disagree more

Posted by: Anonymous [ip: 198.240.213.26] on August 17, 2007 10:37 AM

The only other alternatives are to wait in the hopes that native support becomes available before your computer becomes obsolete, or to buy a card that works natively -- and no one should be blamed for feeling that they should not have to do either.


There's one, and only one, good kind of driver, and that's a native driver. Wrappers are not just legally dubious, they're a kludge that adds a layer of inefficiency.


And there's one, and only one, way to encourage manufacturers to stop putting roadblocks in the way of people who want to implement free native drivers: Buy a card that works natively.


Do not buy cards that don't work natively.


This is the only way to encourage card manufacturers to do the right thing.

#

Re: I couldn't disagree more

Posted by: Anonymous [ip: 72.145.230.203] on August 20, 2007 12:31 PM
This is a very good article for something technical that you do not need to do. If you can afford $10 US for a native already; automatically working device, then that's what you do. Google and buying that instead.

Just get it out of your head that it's open software developers failure to make it work. That deck of cards is stacked.

#

Re(1): I couldn't disagree more

Posted by: Anonymous [ip: 76.185.110.212] on August 20, 2007 10:27 PM
The last time I googled I found 2 g cards which claimed to work with drivers. Neither worked and was later told that it was because the chipset had changed. It has been very frustrating at times dealing with wireless, video cards and monitors which are not fully supported by linux. I have been hearing the same thing for five years and it doesn't really appear to be getting all that much better. The technology is moving to fast to expect open software developers to keep up and the vendors really don't seem to give a crap (The linux base doesn't appear to have a significant markey share). So until linux becomes a significant segment of the market, let's say 5-10% I don't think they are going to care. And I don't think linux is going to hit those numbers in the next 5 years considering that after 10 they only have 1% market share.
Outside of IT 95% of the population is still what's linux.

#

You cannot always tell which card to buy

Posted by: Anonymous [ip: 208.101.168.53] on August 17, 2007 12:58 PM
How do you know if the wireless card you're about to purchase is based on a chipset your distro can handle? I've run into situations where two cards from the same manufacturer, outwardly identical, use chips from different vendors. While it is nice to advise others to stand firm and take one for the good of humanity -- particularly when the wireless card in your own machine just happens to work -- getting a machine to work in the first place is the only goal the rest of us have,



Yes, it is preferred to only use native drivers, but in the absence of such drivers, people are going to do anything it takes to make their computers work. Otherwise, there'd be no pressure on FOSS developers to create that native solution. The squeaky wheel, and all that.

#

Please don't make it sound like Linux has poor hardware support

Posted by: Anonymous [ip: 90.149.125.101] on August 17, 2007 01:42 PM
I don't like it when articles start by implying the poor hardware driver situation for Linux. There's no other operating system with nearly as good hardware support as Linux, and most drivers are Free and Open Source. When it comes to wireless network cards I have tried about ten different, and all of them worked. Some of them needed ndiswrapper, I admit, and that is a problem, but at least I could use them.
I do of course agree that it is a problem that harware producers don't share information with the Free Software community, so we can have Linux drivers for any hardware at once, but it's nevertheless a success that the Free drivers are produced eventually, without such cooperation.
Otherwise I like the article, with accurate information about how to use ndiswrapper and the Broadcom firmware cutter. Except I would like to remark that the bcm43xx driver is a Free driver. The firmware can't be open, since that would enable people to set the cards to illegal frequencies. But Broadcom hasn't helped making the Free drivers, and even sabbotage them by not allowing distribution of the firmware.

#

Re: Please don't make it sound like Linux has poor hardware support

Posted by: Anonymous [ip: 68.126.176.174] on August 17, 2007 09:37 PM
There's no other operating system with nearly as good hardware support as Linux, and most drivers are Free and Open Source.

If that's the case, then why do GNU/Linux users often have to use the Windows / Mac driver through a wrapper like ndiswrapper?


Seems to me like Windows (yes, even Vista nowadays from my experience) has better wireless driver support.

As an aside, again, Linux.com developers, please use <a href="http://php.net/nl2br">nl2br()</a>!

It's tedious reading other comments, such as the parent, that aren't "br" tag delimited.

#

Re(1): Please don't make it sound like Linux has poor hardware support

Posted by: Anonymous [ip: 90.149.125.101] on August 19, 2007 06:26 PM
Yes, of course current versions of windows has better hardware support for new devices, but only because the drivers are provided by the hardware manufacturers. But there's no guarantee that the drivers will be maintained either my ms or the manufacturers. So a lot of older, but still usable hardware can not be used on Vista or even XP, but Linux has no problems with them.

Linux also supports a much broader rage of hardware than windows does, since windows is limited to the i386 family of processors. When it comes to wireless support in windows, the cards may have working drivers, but the configuring tools are really confusing, since it seems like every card comes with it's own program that for some reason overrides the standard windows tool. Of course I have only limited experience with this, since I don't use windows.

By the way, notice my nice line breaks :)

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 97.81.79.124] on August 17, 2007 02:03 PM
You didn't mention another driver -- MadWifi -- which works with Atheros chipsets. It works well and is easy to install.

#

mac80211 != Apple Mac

Posted by: Anonymous [ip: 86.144.6.126] on August 17, 2007 02:25 PM
The bcm43xx-mac80211 driver is the bcm43xx port from the old Softmac stack to the newly merged Devicescape stack, it is not a different version of bcm43xx for Mac driver firmware.

Instead of making what I must assume was an educated guess, try reading a reputable source for Linux Wifi information, such as Jean Tourrilhes excellent web page. http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/

#

Re: mac80211 != Apple Mac

Posted by: nanday on August 17, 2007 06:58 PM
Thanks for the correction. For the record, it wasn't an educated guess, but a piece of widely distributed misinformation.

- Bruce Byfield (nanday)

#

Re: mac80211 != Apple Mac

Posted by: Anonymous [ip: 88.240.178.25] on November 09, 2007 04:39 PM
Thanks for the correction. (<a href="http://www.efegame.com" title="game">game</a>)

#

Webcams!!!

Posted by: Anonymous [ip: 68.79.182.230] on August 17, 2007 04:08 PM
<code>No other hardware nowadays supports GNU/Linux as weakly as wireless network adapters!!!?????</code>


Try USB webcams!!


emk

#

Re: Blue Tooth....

Posted by: Anonymous [ip: 201.160.12.54] on August 20, 2007 12:46 PM
I have not had problems with my wireless on either Kubuntu, PC Linux2007 or Sabayon, all detected at installation. Bluetooth however doesn't work with any of them neither on my Thinkpad or on Dell Precicion.

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 71.190.93.48] on August 17, 2007 04:23 PM
check this site

www.linuxant.com

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 68.60.141.54] on August 17, 2007 10:22 PM
I have tried several times over a period of 2 years to find a wireless pc card that is currently for sale that has native Linux drivers. I have failed every time. Can someone tell me the ordering information for such a card?

I don't think this should be so difficult in an operating system that is truly ready for widespread use.

#

Re: Two tools for enabling wireless cards

Posted by: Anonymous [ip: 172.26.10.7] on August 20, 2007 10:56 AM
I'm using an Intel mini-pci (ipw2200) with a mini-pci to pci adapter. Other Intel models are also supported (see http://ipw2100.sourceforge.net/ http://ipw2200.sourceforge.net/ and http://ipw3945.sourceforge.net/). Mini-pci adapters are available from LinITX (see http://linitx.com/viewproduct.php?prodid=11082). Don't forget to add a good antenna.

#

Re: Two tools for enabling wireless cards

Posted by: Anonymous [ip: 82.152.154.75] on August 20, 2007 06:11 PM
They are based in the UK, but seem to ship globally:


<a href="http://www.linuxemporium.co.uk/products/wireless/">http://www.linuxemporium.co.uk/products/wireless/</a>

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 83.4.132.221] on August 19, 2007 11:23 PM
Thanks for another very interesting article Bruce!. Regards
<a href="http://www.profesjonalna-reklama.pl" target="_blank">Pozycjonowanie</a>

#

A "gotcha" using these instructions with Ubuntu.

Posted by: Anonymous [ip: 141.150.127.185] on August 24, 2007 07:35 AM

Nice, clear article -- and just in time to help me get 802.11g going on my laptop.



One problem that I had to overcome:



"delete ... the kernel module from /lib/modules/<kernelname>/misc" will cause mischief if you do it with Ubuntu 7.04 (Feisty), as I found out the hard way.



The files



/lib/modules/<kernelname>/kernel/ubuntu/misc/ndiswrapper



and



/lib/modules/<kernelname>/kernel/ubuntu/misc/ndiswrapper/ndiswrapper.ko



are not packaged with ndiswrapper in Ubuntu; rather, they are packaged with the kernel.



After deleting them manually, I had to reinstall the kernel package (linux-image-<kernelname>)and reboot to get my wireless card working.



I hope my mentioning this might spare someone else having to figure it out the hard way.

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 71.222.115.232] on August 28, 2007 03:56 AM
I'm surprised that there is a problem with Linux programs and wireless cards, I have a IBM A21 laptop and I bought a D-LINK card plugged it in on dapper and it worked immediately.

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 87.105.131.9] on October 03, 2007 08:27 AM
Very interesting site mate! <a href="http://air-com.com">sprężarki</a>

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 89.59.158.209] on October 10, 2007 02:34 PM
Thank you very much for this interesting Article and for sharing your thoughts with us. <a href="http://www.yellobook.eu">yellowpages</a>

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 88.228.24.75] on November 07, 2007 02:56 PM
thank you site page very good
<a href="http://www.bilgisavar.com">Oyun</a>

#

Re: Two tools for enabling wireless cards

Posted by: Anonymous [ip: 88.245.127.89] on November 07, 2007 03:28 PM
That query got the attention of heretofore silent <a href="http://www.nezh.com/">video</a>

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 78.160.62.100] on December 07, 2007 05:47 AM
<a href="http://www.ramvideos.info">ram videos</a> <a href="http://www.justvideo.info">arab videos</a> <a href="http://www.yotobe-yutup.info">arab dance</a> <a href="http://www.videousa.info">hot dance</a>

#

Two tools for enabling wireless cards

Posted by: Anonymous [ip: 82.171.248.82] on December 13, 2007 04:31 PM
I am running Ubuntu 6.06 (Dapper Drake) and I skipped the instruction "delete ... the kernel module from /lib/modules/<kernelname>/misc". My card worked.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya