Better Wi-Fi on the Linux Horizon
Wireless support in Linux has been "good enough" for some time. An all-new WLAN stack promises something better than "o.k."
OK, so maybe it's not going to be quite that Utopian, but things are definitely looking up, thanks to a lot of hard work by a lot of talented developers.
So what's going to be different? A brand-new wireless LAN (WLAN) kernel stack, which is going to reduce the current WLAN herd-of-cats approach to a single unified subsystem that supports all wireless drivers. It all started with Devicescape, which released its previously proprietary Advanced Datapath Driver under the GPL in May 2006, and which is now in the Andrew Morton (mm) kernel tree. Sometime not too long from now it will be merged into the mainline kernel. Devicescape says this delivers "the first-ever native Wi-Fi support in the Linux kernel." "What?" you cry, "Linux has had wireless support since forever!" Which is true, but as a hodge-podge of overlapping, disorganized drivers and utilities for different types of wireless devices. It hasn't had a unified Wi-Fi-compliant subsystem until now.
A brief digression here, since this is a common point of confusion. Wi-Fi is a trademarked brand name with a specific meaning. It refers to drivers and devices that support the growing family of IEEE 802.11 wireless specifications. The current IEEE 802.11 wireless specifications that users and admins are most concerned with are:
- 802.11 legacy
The good news is eventually it will all sort itself out, because after all this is all new bleeding-edge fun.
Meanwhile, Back At the WLAN Ranch
John Linville, ace kernel developer and kindly answerer-of-questions, shared a lot of interesting information about the shiny new Linux wireless code.
Currently the goal is to replace the elderly (but all lifesavers in their time) wireless-tools extensions, the ieee80211+softmac layer, and perhaps someday the ieee80211 subsystem. Mr. Linville explains some of the challenges in supporting modern wireless hardware:
"Early wireless networking hardware went to a lot of trouble to look like ethernet adapters. This generally involved an on-board controller running firmware that accepted ethernet frames from the host, converted them to wireless frames for transmission, and then did the reverse on reception. These are referenced as "full MAC" devices, because they implement this MAC-layer functionality on the hardware itself. Of course, having a controller and memory for the firmware adds cost to the hardware. So, most newer (especially consumer-grade) hardware has minimized or eliminated those components. This leaves some or all of the explicitly wireless networking bits in the hands of the host CPU. (Such devices are referenced as "half MAC" or "soft MAC" devices, because they rely on software to implement this MAC-layer functionality.)"
Currently the ieee80211+softmac layer does this job for a number of devices. A notable exception is Atheros-based interfaces, which are supported by the MadWiFi drivers. As Mr. Linville said
"Some drivers (notably MadWifi and many drivers for "other" operating systems) simply implement the wireless bits themselves, while still presenting themselves to the host networking stack more-or-less as ethernet devices. The problem here is that each driver is then responsible for re-implementing this functionality. This is not only wasteful of programming talent, it is also error prone and likely to result in inconsistent behaviour and feature support between different drivers."
Which explains a lot of the problems with trying to build a Linux-based wireless access point. I use Atheros-based interfaces because they deliver all the functionality that I want: AP (Access Point) Mode, Managed, Ad-Hoc, Monitor, and WDS (Wireless Distribution System), which supports wireless mesh networks. But Atheros has the infamous binary kernel blob problem. Other wireless interfaces just don't do what I want. But there is hope for more choices:
"One example of this is that AP mode is only supported by a handful of hardware in today's mainline kernels, while potentially it could be supported by many more devices if the driver authors did not have to do all the work themselves. By providing the mac80211 component, the Linux wireless community can provide a consistent feature set across a broad range of wireless drivers while minimizing the effort to create and maintain those drivers. Surely that sounds impressive!"
You're darn tootin' it does. Which leads us to the main components of the new WLAN subsystem:
- • mac80211
- Common driver base for soft-MAC devices
- • cfg80211
- Kernel wireless API (Application Programming Interface)
- • nl80211
- User-space API
The existing ieee80211 system is going to be needed for awhile yet. It supports the older ipw2100 and ipw2200 drivers (for Intel Pro interfaces), which are full MAC devices. The current plan is to refactor some of the code from ieee80211 and mac80211 and use that to build a nice new lib80211. Then the remaining bits of ieee80211 will be converted into a library specifically to support the ipw2100 and ipw2200 drivers, which will be called libipw or something equally hummable.
Supported Drivers and Devices
You'll find lists at LinuxWireless.org/en/users. Vendors such as Ralink, Realtek, Atmel, Broadcom, Intel, Texas Instruments, and Intersil are represented here. A notable omission is Atheros, because of the binary regulatory blob problem and other issues. But even here, according to Mr. Linville, there is hope of working out the various issues and bringing Atheros devices on board as well.
- Linux Wireless.org, home of the new Linux WLAN
- ieee80211 subsystem for Linux
- ieee80211 softmac layer
- New Linux WLAN subsystem integrated into mm kernel tree
- Nice Wikipedia article on IEEE 802.11
- OpenBSD: wpi, A Blob Free Intel PRO/Wireless 3945ABG Driver
- Feature: OpenBSD Works To Open Wireless Chipsets. You can always count on Theo de Raadt for plain talk- "But the cost savings demanded by chip-packaging companies... eventually pushed the vendors to remove that flash. Saved them about 10 cents, maybe."
- the old wireless extensions for Linux
- Access for All Wi-Fi Devices