This document is written targeting those who are looking to jump onto the bleeding edge of linux wireless development. Odds are good that at least one of the packages listed, in the state you grab it, is broken. In fact, they all might be broken when you jump onto it. Once a kernel is released with master mode available by default, and stable releases of all of these packages are available, I'll release a new version of this document that uses stable releases of these packages and outlines all the necessary steps to a stable router.
[Wireless Card]
|
[Linux Kernel ]
| |
[udev][libnl]-[iw]
| / \
[crda] \
| \
[ Wireless ] |
[Regulatory] |
[ Database ] |
|
|
[ hostapd ]
Wireless Card: Should be self explanitory... handles sending/receiving wireless packets
Linux Kernel: The linux kernel contains the driver for the wireless card, the mac80211 subsystem which handles packet generation and scheduling, and the nl80211 subsystem, which handles configuring the wireless interfaces for userspace
libnl: libnl is the transport layer used to communicate with the kernel via netlink
udev: udev is the facility the kernel uses to pass events/calls to crda
iw: iw is a userspace utility that we can use to test that libnl is working correctly, as well as create additional virtual wireless interfaces on the wireless card
crda: crda is a userspace program that the kernel queries (through udev) to find what channels/frequencies are usable, and at what powers. This moves the information out of static tables maintained in kernel to userspace, which allows them to be updated without reloading drivers/rebooting
Wireless Regulatory Database: database of allowable frequencies and transmit power levels used by crda
hostapd: This is the daemon that handles generation of beacons and other wireless packets, as wel as wpa-psk, wpa2, etc encryptions.
Successes/Failures/Questions/Concerns to: wireless@erley.org
| Known working version: | |
| libnl: | f9071054d0f2512dea9e95f99c308e931ed78dba |
| iw: | 5406d9e4ee819aec48f384a6f6854513e40e9f26 |
| hostapd: | 97865538ba250730841727a42b7beccd9f7af414 |
| compat-wireless: | 35fe528611e6a82f5e76fd02583437909a53593b |
| wireless-regdb: | dd661723f474ab5c538542ff78e6a28cc3493aa8 |
| crda: | 8e7bec8bb9022544fa8c6383f440c06e38a564db |
| Tested drivers and the wireless-testing git commit tested: | ||
| ath9k | 2.6.28-gentoo-r1 | f69a360f7c2b7bfebae35bb440622c0743157e97 |
# you'll want to change this if you're doing this somewhere other than /usr/src cd /usr/src # Get the wireless-testing tree (this will take a while) git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git # Get compat-wireless git clone git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/compat-wireless-2.6.git # Get wireless regdb git clone git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git # Get crda git clone git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/crda.git # Get libnl (optional) git clone git://git.kernel.org/pub/scm/libs/netlink/libnl.git # Get Hostapd, wpa-supplicant, etc... git clone git://w1.fi/srv/git/hostap.git # Get iw git clone http://git.sipsolutions.net/iw.git
# You only need to do this if your distro doesn't ship a relatively recent version # of libnl. Most distros are shipping libnl-1.1 or later, which will work for # what we need. cd libnl # This is going to install libnl into /usr. # you may need to point this elsewhere for your system. autoconf ./configure --prefix=/usr make && sudo make install cd ..
cd wireless-regdb # First we need to create the location for the wireless regulatory # database mkdir -p /usr/lib/crda # Now we copy the regulatory db over. Note, no need to 'make' here as # the wireless regdb shipped by git is already signed and setup as needed cp regulatory.bin /usr/lib/crda/ cd .. # Now we build crda cd crda # I HIGHLY recommend installing this as it configures udev for using crda # automatically. make && sudo make install cd ..
cd iw # You can leave out the 'sudo make install' if you don't want # to install iw or overwrite your system iw. make && sudo make install cd ..
cd hostap/hostapd # Copy the default config to .config for use during this build cp defconfig .config # Edit .config vi .config # you need to uncomment these lines, at a minimum, and make sure # CONFIG_LIBNL_LOC points to wherever you installed libnl to in # step 3. # # CONFIG_DRIVER_NL80211=y # LIBNL=/usr # CFLAGS += -I$(LIBNL)/include # LIBS += -L$(LIBNL)/lib # # and add # # CONFIG_LIBNL20=y # # If it dies with: # error: 'struct hostapd_config' has no member named 'ieee80211n' # # uncomment # # CONFIG_IEEE80211N=y # # You can leave out the 'sudo make install' if you don't want # to install hostapd or overwrite your system hostapd. make && sudo make install cd ../..
cd compat-wireless-2.6 export GIT_TREE=../wireless-testing scripts/admin-update.sh make && sudo make install
Configuring hostapd to use the nl80211 driver is as easy as:
interface=wlan0 # Replace this with your wireless interface driver=nl80211
802.11n support can be configured in the appropriate section of hostapd.conf, here's the config I'm currently using for my ath9k device, listed as: Atheros AR5416 MAC/BB Rev:2 AR2133 RF Rev:81
ieee80211n=1 ht_capab=[HT40-][SHORT-GI-40][DSSS_CCK-40]
the ht_capab shown here is based on a combination of voodoo and the output of iw list, and may or may not be accurate as I don't yet have any other 802.11n devices to test with
Do not feel obligated to donate. Donations won't make me more likely to update the guide or attempt to solve any issues. I have a full time job and am only adding this as it has actually been requested. I won't complain if people do donate though, haha.