1. 准备工作(虚拟机,开发板)及配置内核选择WIFI驱动
1.1 选型:确定网卡的VID,PID是否在列表里:
选购WIFI:
Atheros : VID 0x13D3 PID 0x3327 (成品型号 AR9271)
realtek : VID 0x0bda PID 0x8176 (成品型号TP-LINK公司TL-WN721N)
1.2 搭建开发环境:
a. 设置VMWARE的网络为桥接, 并选择使用哪一个网卡
b. 把PC windows网卡, vmware linux的网卡、开发板的有线网卡IP设为192.168.7.xxx
因为以后开发板上USB WIFI网卡将使用192.168.1.xxx
1.3 配置内核以支持USB WIFI网卡
a. 内核基本配置
b. 配置内核: 根据网卡的VID/PID确定使用哪一个源码
打开源码所在目录的Makefile进而确定配置项的名称
make menuconfig, /名
Atheros
cd drivers/net/wireless/
grep "0x3327" * -nR
ath/ath9k/hif_usb.c:32: { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
打开ath/ath9k/Makefile可知配置项为 CONFIG_ATH9K_HTC
make menuconfig, /CONFIG_ATH9K_HTC 得到下面信息
Symbol: ATH9K_HTC [=n] |
| Type : tristate |
| Prompt: Atheros HTC based wireless cards support |
| Defined at drivers/net/wireless/ath/ath9k/Kconfig:100 |
| Depends on: NETDEVICES [=y] && WLAN [=y] && ATH_COMMON [=n] && USB [=y] && MAC80211 [=m] |
| Location: |
| -> Device Drivers |
| -> Network device support (NETDEVICES [=y]) |
| -> Wireless LAN (WLAN [=y]) |
| -> Atheros Wireless Cards (ATH_COMMON [=n])
配置:
-> Networking suppor
-> Wireless
<*> cfg80211 - wireless configuration API
<*> Generic IEEE 802.11 Networking Stack (mac80211)
-> Device Drivers
-> Network device support
-> Wireless LAN
-> Atheros Wireless Cards
<*> Atheros HTC based wireless cards support
make uImage
另一款网卡: realtek
cd drivers/net/wireless/
grep "0x8176" * -nR
rtlwifi/rtl8192cu/sw.c:273: {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8176, rtl92cu_hal_cfg)},
打开rtlwifi/rtl8192cu/Makefile确定配置项为 CONFIG_RTL8192CU
make menuconfig, /CONFIG_RTL8192CU
-> General setup
[*] Prompt for development and/or incomplete code/drivers
-> Device Drivers
-> Network device support
-> Wireless LAN
<*> Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter
make uImage
uboot:
set bootargs console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.7.124:/work/nfs_root/fs_mini_mdev_new ip=192.168.7.17
set bootcmd 'nfs 32000000 192.168.7.124:/work/nfs_root/uImage_mini2440_wifi; bootm 32000000'
save
boot
c. 编译、使用
c.1 把固件htc_9271.fw放到单板/lib/firmware
接上USB网卡, ifconfig wlan0 up
c.2 对于"realtek : VID 0x0bda PID 0x8176 (成品型号TP-LINK公司TL-WN721N)"
修改bug:
make uImage
阅读(3819) | 评论(0) | 转发(0) |