一.在移植無線網卡之前首先得確保你的核心能夠識別你的usb網卡,我的網卡插入後顯示資訊如下
[root@FriendlyARM /]# usb 1-1: USB disconnect, address 2
usb 1-1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1: New USB device found, idVendor=0bda, idProduct=8176
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 802.11n WLAN Adapter
usb 1-1: Manufacturer: Realtek
usb 1-1: SerialNumber: 00e04c000001
usb 1-1: configuration #1 chosen from 1 choice
此外你還可以通過lsusb命令在你的pc linux系統上讀出你的USB網卡型號資訊,然後百度一下就可以查到的無線網卡型號了,我的網卡資訊如下
Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp.
我的無線網卡型號是TL-wn721N開始百度了下說是AR9271後來移植了好久都不行就懷疑網卡型號錯了
二。.到Realtek官網下載源碼包
http://www.realtek.com/downloads/downloadsView.aspx?Langid=3&PNid=48&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true#RTL8192CU
RTL8192xC_USB_linux_v3.4.4_4749.20121105 .zip
解壓到進入到
/home/RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/driver/rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105目錄下
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_S3C2K4 = y //修改晶片架構
CONFIG_POWER_SAVING = n //去掉節能模式
ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
ARCH := arm
CROSS_COMPILE := arm-linux-
KVER := 2.6.32.2
KSRC := /linux-$(KVER)
endif
修改依賴核心類型 我的核心路徑/linux-2.6.32.2,注意你的核心檔案必須的編譯過了的否則會提示找不到config設定檔
最後一步就是make
[root@localhost rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105]# ls
8192cu.ko 8192cu.o hal Kconfig Module.symvers
8192cu.mod.c clean ifcfg-wlan0 Makefile os_dep
8192cu.mod.o core include modules.order wlan0dhcp
其中的8192cu.ko就為我們編譯得到的驅動
三。我們還要編譯wireless_tools
進入/home/RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/wireless_tools/wireless_tools.30.rtl,修改makefile即可
## Compiler to use (modify this for cross compile).
CC = arm-linux-gcc
## Other tools you need to modify for cross compile (static lib only).
AR = arm-linux-ar
RANLIB = arm-linux-ranlib