Mac80211 based open source architecture

From OMAPpedia

Revision as of 08:33, 8 August 2011 by Pandu (Talk | contribs)
Jump to: navigation, search


mac80211 based WLAN driver: Description

As of April 2011, Linux 2.6.39 RC1 kernel supports WLAN in the 'station mode.' Soft access point (SoftAP) feature is going to be supported from Linux kernel 39 onwards. Alternatively, you can apply just the wireless patches to your present kernel. To do so, you can use compact wireless wl12xx.git to pull the SoftAP patches; and then apply them to your kernel code.

Procedure to build WLAN and test on Ubuntu FS

To enable WLAN on the Panda Board Linux Kernel

Enable WLAN on Panda Board in the kernel configuration menu:
   Device Drivers  ---> 
       [*] Network device support  --->
           [*]   Wireless LAN  ---> 
               <M>   TI wl12xx driver support  --->
                   <M>   TI wl12xx support  
                       <M>     TI wl12xx SDIO support
Enable "nl80211 testmode command" in kernel configuration to use iw tool (needed only if you want use iw)
   [*] Networking support  --->
      --- Wireless
            <M>   cfg80211 - wireless configuration API
                [*]     nl80211 testmode command
Build the uImage and modules and copy them to the Filesystem
   make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage
   make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules
   make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=<PATH_TO_FS> modules_install

Firmware and NVS for the WLAN

   git clone
   Firmware and NVS for station:     wl1271-fw.bin  & wl1271-nvs.bin
   Firmware and NVS for SoftAP:    wl1271-fw-ap.bin & wl1271-nvs-ap.bin

Testing WLAN in Station mode

TI WLAN interface name will show up as: "wlan0"

To load WLAN modules

Check the list of modules loaded by using:


The modules required are: wl12xx.ko and wl12xx_sdio.ko.

If they are not present, load them:

   insmod /lib/modules/`uname -r`/kernel/net/wireless/cfg80211.ko
   insmod /lib/modules/`uname -r`/kernel/net/mac80211/mac80211.ko
   insmod /lib/modules/`uname -r`/kernel/drivers/net/wireless/wl12xx/wl12xx.ko
   insmod /lib/modules/`uname -r`/kernel/drivers/net/wireless/wl12xx/wl12xx_sdio.ko

To verify the drivers loaded successfully:

   tail -3 /var/log/kern.log

The expected (typical) output is:

   cfg80211: Calling CRDA to update world regulatory domain
   wl1271: loaded
   wl1271: initialized

To bring WLAN interface UP

To list all the interfaces that are up:


If the interface is not listed, check all the interfaces available:

   ifconfig -a

Check whether wlan0 has a valid MAC address. If not assign it:

   ifconfig wlan0 hw ether 00:22:33:44:55:66

Bring up the interface:

   ifconfig wlan0 up

To verify the drivers loaded successfully:

   tail -1 /var/log/kern.log 

The expected (typical) output is:

   wl1271: firmware booted (Rev

To Connect or Disconnect to an AP

Use "iwlist" or "iw" to scan.

   iwlist wlan0 scan
   iw dev wlan0 scan

Connect to an AP listed in open mode:

   iwconfig wlan0 essid "AP_NAME"
   iw wlan0 connect AP_NAME

If AP has the DHCP capability, get the IP address:

   dhclient wlan0
      or assign it using: 
   ifconfig wlan0 xx.xx.xx.xx netmask

To disconnect from the AP:

   iw dev wlan0 disconnect

Testing WLAN in SoftAP mode

Install hostapd and udhcpd packages in the filesystem ,if they are not present.

   To install hostapd and udhpcd:
       sudo apt-get install hostapd
       sudo apt-get install udhcpd

Download SoftAP.tar.gz to the Filesystem and untar it.

   mkdir /SoftAP
   cd /SoftAP
   tar xvzf SoftAP.tar.gz
   cp udhcpd.conf /etc/.
   sudo chmod 755

To bring up WLAN in AP mode:

   If it is in station mode, stop wpa_supplicant
   ./ sta_atop
   Now start WLAN in SoftAP mode
   ./ ap

The expected (typical) output is:

   Starting AP
   Configuration file: /tmp/hostapd.ap.conf
   Using interface wlan0 with hwaddr de:ad:be:ef:00:00 and ssid 'blazetest'
   Could not set DTIM period for kernel driver
   Starting DHCP server
   AP start complete

To list all the stations connected to our SoftAP:

   hostapd_cli all_sta

To stop WLAN in SoftAP mode:

   ./ ap_stop

NOTE: The default configuration of hostapd using the is:

   Interface: wlan0
   BSSID : blazetest
   Security : WPA2-AES 
   Password : password
   Ip address:

To change Security mode of SoftAP

Change the function generate-hostapd() in file accordingly. Refer hospad.conf file for all parameters.

To connect to a secured AP use wpa_supplicant

1. First kill the supplicant if it is present:

   sudo su
   service network-manager stop
   killall wpa_supplicant 

2. Start with the following options:

   wpa_supplicant -Dwext -iwlan0 -C/var/run -u &
   wpa_supplicant -Dnl80211 -iwlan0 -C/var/run -u &

3. Use wpa_cli to connect to any network( open or secured)

   wpa_cli -p/var/run

No security (OPEN)

To connect to an AP without security:

   set_network 0 ssid "name of AP"
   set_network 0 key_mgmt NONE
   enable_network 0

With WEP security

To connect to an AP with WEP security:

   set_network 0 ssid "name of AP"
   set_network 0 key_mgmt NONE
   set_network 0 wep_key0 <key>
   enable_network 0

NOTE: WEP key must be 10 or 26 characters long according to whether it is WEP40 or WEP128 respectively.

With WPA-TKIP security

To connect to an AP with WPA1 security:

   set_network 0 ssid "name of AP"
   set_network 0 key_mgmt WPA-PSK
   set_network 0 pairwise TKIP
   set_network 0 psk "key"
   enable_network 0

With WPA-AES-CCMP security

To connect to an AP with WPA2 security:

   set_network 0 ssid "name of AP"
   set_network 0 key_mgmt WPA-PSK
   set_network 0 pairwise CCMP
   set_network 0 psk "key"
   enable_network 0

Useful Links

Mainline kernel:;a=summary
git clone git://

Luca kernel:;a=summary
git clone git://

Linux Firmware:;a=summary
git clone git://

git clone git://

iw tool:
git clone git://

latest wpa_supplicant & hostap:
git clone git://

Patches required to add WLAN support on the Panda Board (Linux Kernel version <= 2.6.38)

Please refer to the following links for WLAN clock patches: Patch 1 and Patch 2.
For original patches (of adoptation for HSMMC refer to): OMAP: HSMMC: HWMOD adaptation

Back to Connectivity Home Page

Personal tools