Understanding Linux wireless drivers

Wireless on Linux can be very enigmatic.  The two greatest sources of confusion, I think, are failure to understand the difference between legacy and next-generation drivers, and confusion about what a wireless chipset is and how to identify one.  I hope this page helps clear up some of these issues for Linux users.

Legacy vs. next-generation drivers

As the aircrack people outline here, for most wireless chipset families, there are two sets of Linux drivers.  The older, or legacy, drivers are part of the ieee80211 stack and are usually not included by default in Linux distributions (you usually had to build them yourself from source).  “Next-generation” drivers, or the mac80211 stack, are built into modern Linux kernels–so if you’re using a Linux distribution released since 2007 and didn’t do anything special to make your wireless work (i.e., it “just worked” out-of-the-box), you’re probably using the next-generation drivers.

While the next-generation drivers are for various reasons better overall for Linux, in many cases they’re not yet as stable as you might like.  By this point (summer 2008), most of the next-generation drivers merged into the kernel are stable enough for normal operation in managed mode (the mode you use to connect to a standard wireless router).  However, their support for advanced features, like monitor or ad-hoc modes and MAC-address spoofing, may not be what it should; if you have trouble running aircrack (or airodump) or resetting MAC addresses, among other things, there’s a good chance that reverting to the legacy drivers for your chipset (which will probably require downloading the legacy-driver source and compiling it), and adding the next-generation modules to your /etc/modprobe.d/blacklist file so that they’re not used, will yield better results.

What’s a chipset and which one do I have?

A chipset is the brains of your wireless card and is the only part that really matters to Linux.  There are about a dozen families of wireless chipsets in the world (each produced by a different manufacturer), and each chipset uses a different driver to work on Linux (in some cases, there is no native Linux driver available, and you have to use ndiswrapper).  It’s important to note that in most cases, the name under which your wireless card was sold gives little indication of which chipset it contains–for example, the “Dell Wireless 1390″ card that came with your laptop or the “Linksys WMP54G” that you bought at Best Buy could use any number of different chipsets.  Dell and Linksys don’t manufacture chipsets; they just buy them from other companies and put them together with other components (e.g., antennas).

It’s rarely clear from the box, or even the documentation that comes with your wireless card, which chipset the device uses–and to make things more complicated, wireless card vendors often change the chipset of a product completely but continue to sell the device under the same exact name–so even if the name on the box of your wireless card is exactly the same as that of your friend’s, your card may use a completely different chipset.

Consequently, the only reliable way to figure out which chipset your wireless card uses is with the lspci command (or lsusb if your wireless card is an external USB stick).  The output lists hardware information and will include a line pertaining to your wireless card (note that the relevant line may not mention “wireless” explicitly; it may only say something about “ethernet” or “communications device”).  For example, this is the lspci entry for my Atheros PCI card:

Ethernet controller: Atheros Communications Inc. AR2413 802.11bg NIC (rev 01)

As you can see, my card uses an Atheros AR2413 (rev. 01) chipset.  Fortunately, my card “just works” in Ubuntu, but if I had trouble with it, the first thing to do would be to google something like “ubuntu ar2413.”

Which driver do I need to use?

Once you’ve determined your card’s chipset, you can find out whether or not it has a native Linux driver. Here’s a list of popular chipsets and their corresponding drivers:

There are plenty of other chipsets that have native Linux support; these are only the most popular ones.  See http://linuxwireless.org/ if your chipset isn’t listed here.

Why doesn’t my card work with command-line tools?

Finally, note that in some cases, since development of the ieee80211 stack was not centralized, some legacy drivers (the Atheros ones, at least) use special tools for controlling wireless features.  If you get errors trying to use ifconfig or iwconfig with your wireless card, check the site of the driver developers to make sure that you’re not supposed to be using a different utility.  As far as I know, the next-generation drivers are all standardized and should work normally with ifconfig and iwconfig.