Mac80211 based open source architecture

From OMAPpedia

Revision as of 06:38, 6 April 2011 by Pandu (Talk | contribs)
Jump to: navigation, search

Contents

MAC80211 based Wilink: 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 git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
   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

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

To load WLAN modules

Check the list of modules loaded by using:

   lsmod

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:

   ifconfig 

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 6.1.0.0.343)

To Connect or Disconnect to an AP

Use "iwlist" or "iw" to scan.

   iwlist wlan0 scan
        or
   iw dev wlan0 scan

Connect to an AP listed in open mode:

   iwconfig wlan0 essid "AP_NAME"
         or
   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 255.255.255.0

To disconnect from the AP:

   iw dev wlan0 disconnect

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 &
           or
   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:

   add_network
   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:

   add_network
   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:

   add_network
   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:

   add_network
   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:

https://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Luca kernel:

https://git.kernel.org/?p=linux/kernel/git/luca/wl12xx.git;a=summary
git clone git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git

Linux Firmware:

https://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=summary
git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git

Ti-Utils:

https://github.com/gxk/ti-utils
git clone git://github.com/gxk/ti-utils.git

iw tool:

http://git.sipsolutions.net/?p=iw.git
git clone git://git.sipsolutions.net/iw.git

latest wpa_supplicant & hostap:

http://hostap.epitest.fi
git clone git://w1.fi/srv/git/hostap.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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox