Mac80211 based open source architecture

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
m (To Connect or Disconnect to an AP)
m (To Connect or Disconnect to an AP)
Line 78: Line 78:
:If AP has the DHCP capability, get the IP address:
:If AP has the DHCP capability, get the IP address:
     dhclient wlan0
     dhclient wlan0
-
 
       or assign it using:  
       or assign it using:  
-
 
     ifconfig wlan0 xx.xx.xx.xx netmask 255.255.255.0
     ifconfig wlan0 xx.xx.xx.xx netmask 255.255.255.0
:To disconnect from the AP:
:To disconnect from the AP:

Revision as of 20:26, 15 March 2011

Contents

MAC80211 based Wilink

As of March 2011, Linux 2.6.37 RC4 kernel supports for WLAN in the 'station mode.' Soft access point (SoftAP) feature is going to be supported 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 soft Access point patches; and then apply them to your kernel.

Procedure to build WLAN and test on Ubuntu FS

To enable wlan on panda

  1. Patch series required to enable WLAN on Panda are at Panda: Support for WLAN on WL127x
  2. Make sure you have the dependent patches for WLAN clock and HWMOD changes for MMC.
    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
  1. Changes in the Linux Configuration for Kernel Building:
Enable wlan on panda in kernel configuration:
   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
4. Firmware and NVS for the wlan:

Clone the git tree : git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git

   git clone git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git

Copy the contents of "ti-connectivity" folder to /lib/firmware/ folder of the filesystem.

   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

wl12xx.ko and wl12xx_sdio.ko are modules required.

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 would be:
           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 would be:
           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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox