Mac80211 based open source architecture
From OMAPpedia
| Line 84: | Line 84: | ||
To disconnect from the AP: | To disconnect from the AP: | ||
iw dev wlan0 disconnect | 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 | ||
| + | Copy the following script "ap.sh" to the Filesystem | ||
=To connect to a secured AP use wpa_supplicant= | =To connect to a secured AP use wpa_supplicant= | ||
Revision as of 07:22, 8 August 2011
Contents |
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
- Changes in the Linux Configuration for Kernel Building:
- 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
- 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 in Station mode
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
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
Copy the following script "ap.sh" to the Filesystem
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:
- git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Luca kernel:
- git clone git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
Linux Firmware:
- git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
Ti-Utils:
- git clone git://github.com/gxk/ti-utils.git
iw tool:
- git clone git://git.sipsolutions.net/iw.git
latest wpa_supplicant & hostap:
- 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)
- Patch series required to enable WLAN on Panda are at Panda: Support for WLAN on WL127x
- Make sure you have the dependent patches for WLAN clock and HWMOD changes for MMC.
- For original patches (of adoptation for HSMMC refer to): OMAP: HSMMC: HWMOD adaptation
Back to Connectivity Home Page