软件总体结构
wsc hostapd 应用层 MAC处理 驱动层 PCI接口 HAL层 madwifi 物理层 NIC 整个WLAN的软件分为驱动层和应用层。驱动层实现802.11协议栈、5416硬件驱动等功能,应用层实现802.11i/WPA/WPA2无线安全协议、WiFi WPS协议。其中:
? hostapd:实现AP侧的WPA/WPA2标准,开源项目(http://hostap.epitest.fi/hostapd) ? wsc:实现WPS标准,Intel的开源软件
(http://softwarecommunity.intel.com/articles/eng/2662.htm) ? madwifi:实现802.11协议栈、atheros无线芯片驱动,开源项目(http://madwifi.org)
2 编译过程
1、 编译环境
Pb42软件包自带交叉编译器,不需要准备额外的交叉编译器。 编译时需要使用uuencode命令,Redhat 下要安装sharutils包。 2、 解压文件到同一目录(假定为/opt/pb42): #cd /opt/pb42
#tar xzvf LSDK-pb42-6.1.1.86.tar.gz
#tar xzvf LSDK-WLAN-pb426.1.1.86.tar.gz
3、 修改tail Bug
LSDK-pb42-6.1.1.86编译时会出现一个错误:tail: cannot open `+2' for reading: No such file or directory
解决方法:
修改boot/redboot/ecos/packages/hal/mips/pb42/current/cdl/hal_mips_pb42.cdl 的102行,在@tail之后增加 -n,即改为:
@tail -n +2 plf_defs.tmp >> $(notdir $@).deps 4、 编译
#cd build
#make BUILD_TYPE=jffs2 BOARD_TYPE=pb42
可以把上面的命令写入一个脚本,方便以后使用。 5、 编译结果
编译后会生成/opt/pb42/images/pb42目录,包含boodloader, kernel, rootfs,文件列表: -rw-r--r-- 1 root root 6291456 Sep 26 16:35 pb42-jffs2
-rwxr-xr-x 1 root root 250672 Sep 26 16:34 redboot.pb42.bin -rwxr-xr-x 1 root root 258112 Sep 26 16:33 redboot.pb42.rom -rwxr-xr-x 1 root root 752148 Sep 26 16:34 redboot.pb42.srec -rwxr-xr-x 1 root root 2199686 Sep 26 16:33 vmlinux.bin -rwxr-xr-x 1 root root 1005459 Sep 26 16:33 vmlinux.bin.gz -rw-r--r-- 1 root root 35 Sep 26 16:33 vmlinux.info
没有打包的根文件系统存放在/opt/pb42/rootfs.build/下。
3 WLAN驱动分析 3.1 概述
1. 2. 3. 4.
驱动程序位于目录wlan/madwifi中。
支持IEEE 802.11e (QoS),802.11h(去除噪声环境干扰),802.11i(无线认证) 使用了开源的madwifi (Multimode Atherors Driver for wifi) http://madwifi.org。 支持Linux Wireless Extensions(LWE),使用了开源项目Wireless Tools for Linux,http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html 5. 使用了开源项目:wpa_supplicant,hostap
3.2 目录结构
wlan/madwifi
├─dfs 802.11n的动态频率选择功能, 802.11h定义,ath_dfs模块 ├─hal Hardware Access Layer硬件抽象,供madwifi使用 │ └─main │ ├─alq │ ├─ar5210 │ ├─ar5211 │ ├─ar5212 │ ├─ar5312 │ ├─ar5416 pb42使用的MAC/BB芯片 │ ├─ar5Owl │ ├─ardecode │ ├─diag
│ ├─freebsd │ ├─linux │ ├─public │ └─regdomain ├─madwifi │ ├─ath ath_pci模块 │ ├─ath_hal ath_hal模块,源代码来自wlan/madwifi/hal/mail/linux/$(TARGET) │ ├─ath_pktlog ath_pklog模块
│ ├─ath_rate 使用了ratectrl11n,该目录没有使用 │ │ ├─amrr │ │ └─onoe
│ ├─atrc atrcm.ko模块,solosw启动无线设备时没有使用该模块。 │ ├─hal 使用了上层的hal,该目录没有使用 │ │ ├─linux │ │ └─public │ ├─howto │ ├─include │ │ └─sys
│ ├─net80211 实现802.11协议栈,生成wlan*.ko模块,启动无线设备 │ │ 时没有使用wlan_scan_ap和wlan_scan_sta模块 │ └─tools 自带的配置工具 └─ratectrl11n 802.11n速率控制,生成ath_rate_atheros.ko模块
应用程序目录: apps/
|-- wireless_tools.28 Linux Wireless Extensions 配置无线驱动的工具 `-- wpa
|-- hostapd-0.4.8
|-- wpa_supplicant-0.5.5
`-- wsc WiFi Simple Config,来自Intel的实现
3.3 模块分析
各个模块之间的关系:
wlan.ko wlan_scan_ap.ko wlan_acl.ko wlan_xauth.ko 加密认证模块 wlan_tkip.ko wlan_ccmp.ko wlan_wep.ko ath_dfs.ko ath_pci.ko ath_rate_atheros.ko ath_hal.ko
模块说明:
ath_hal.ko:处理硬件寄存器设置等底层硬件功能。 ath_pci.ko:PCI总线接口
wlan.ko:802.11协议栈(MAC)
ath_dfs.ko:支持DFS(动态频率选择)标准 ath_rate_atheros.ko:自动速率选择算法 wlan_scan_ap.ko:支持AP模式下扫描站点
wlan_acl:ACL(Access Control List)实现MAC地址过滤功能
wlan_xauth.ko:802.1x认证功能的一个框架,目前没有使用到,利用hostapd实现。 wlan_tkip.ko:处理TKIP加密算法,目前没有使用 wlan_ccmp.ko:处理CCMP加密算法,目前没有使用 wlan_wep.ko:处理WEP加密算法
默认配置:
CONFIG_SYSCTL is not set CONFIG_PM is not set
DECLARE_TASKLET is not set OWLAGGR defined by if_ath.c
#define USE_HEADERLEN_RESV 1 in if_athproto.h ATH_SUPERG_FF被Makefile定义, fast frame
4 WLAN应用层程序分析 4.1 hostapd
hostapd是Linux系统下实现无线AP的一个用户层守护进程,实现了802.11 AP的管理、IEEE8021x/WPA/WPA2/EAP等认证方式,RADIUS客户端,EAP Server和RADIUS认证Server。目前支持Linux下的hostap/madwifi/prism54无线驱动和FreeBSD的net80211。
4.1.1 支持的WPA/802.11i/EAP/802.1x特性
? ? ? ? ? ? ?
WPA-PSK (\
WPA with EAP (with integrated EAP server or an external RADIUS backend authentication server) (\key management for CCMP, TKIP, WEP104, WEP40 WPA and full IEEE 802.11i/RSN/WPA2 RSN: PMKSA caching, pre-authentication RADIUS accounting
RADIUS authentication server with EAP
4.1.2 支持的EAP方法
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
EAP-TLS
EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1) EAP-PEAP/GTC (both PEAPv0 and PEAPv1)
EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1) EAP-TTLS/EAP-MD5-Challenge EAP-TTLS/EAP-GTC
EAP-TTLS/EAP-MSCHAPv2 EAP-TTLS/MSCHAPv2 EAP-TTLS/MSCHAP EAP-TTLS/PAP EAP-TTLS/CHAP EAP-SIM EAP-AKA EAP-PAX EAP-PSK EAP-SAKE EAP-FAST
EAP-GPSK (experimental)
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库Atherose pb42无线AP简要分析 (2)(2)在线全文阅读。
相关推荐: