驱动版本:8188eu_USB_Linux
因为我们是要移植到ARM开发板上,所以首先我们需要更改驱动的Makefile;
CONFIG_PLATFORM_I386_PC = n CONFIG_PLATFORM_ANDROID_X86 = n CONFIG_PLATFORM_ARM_S3C2K4 = n CONFIG_PLATFORM_ARM_PXA2XX = n CONFIG_PLATFORM_ARM_S3C6K4 = y
根据自身 linux 开发环境修改s3c6410处编译环境
ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := arm-none-linux-gnueabi- KVER := 3.0.8 KSRC ?= /usr/src/linux-3.0.8 endif其中KVER是你开发板的linux版本,一般情况下跟我们电脑环境的Linux版本是不一样的,那么此时我们就需要把开发板上的内核在电脑上编译一下(详细编译方法一般开发板光盘上面就有),编译完成后KSRC就指向你所编译的内核。
当这些全部完成之后,执行make命令编译,就可以得到开发板上面的驱动文件8188eu.ko。
zhaokeke@ubuntu:~/8188eu_USB_linux/driver/rtl8188eu$ make zhaokeke@ubuntu:~/8188eu_USB_linux/driver/rtl8188eu$ ls 8188eu.ko Makefile.bak hal 8188eu.mod.c Makefile_1 ifcfg-wlan0 8188eu.mod.o Module.symvers include 8188eu.o READEME make_drv Kconfig autoconf_rtl8188e_usb_linux.h modules.order Kconfig_rtl8188e_usb_linux autoconf_rtl8189e_sdio_linux.h os_dep Kconfig_rtl8189e_sdio_linux clean runwpa Makefile core wlan0dhcp
[root@FriendlyARM /sdcard]# insmod 8188eu.ko
[root@FriendlyARM /sdcard]# ifconfig eth0 Link encap:Ethernet HWaddr 00:22:12:34:56:90 inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:57 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6144 (6.0 KiB) TX bytes:1338 (1.3 KiB) Interrupt:108 Base address:0x8000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)此时仍然看不到USB无线网卡wlan0,如何确定我们的驱动安装是否正确呢?此时我们可以在/proc/net 目录下可以看到 wlan0
[root@FriendlyARM /sdcard]# cd /proc/net/ [root@FriendlyARM net]# cat wireless Inter-| sta-| Quality | Discarded packets | Missed | WE face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 wlan0: 0000 0. 0. 0. 0 0 0 0 0 0如果能看到上面的wlan0,说明驱动是没有什么问题了,此时我们需要配置网卡;
首先我们需要绑定IP地址:
[root@FriendlyARM net]# ifconfig wlan0 192.168.1.22
[root@FriendlyARM net]# ifconfig wlan0 up这一步很重要,我觉得好像就是打开无线网卡,如果没有这一步的话,无论后面的再正确都是无法ping通的。
执行iwconfig命令可以看到如下结果,
[root@FriendlyARM net]# iwconfig lo no wireless extensions. ifb0 no wireless extensions. ifb1 no wireless extensions. eth0 no wireless extensions. sit0 no wireless extensions. ip6tnl0 no wireless extensions. wlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Encryption key:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0扫描附近的wifi:
[root@FriendlyARM /sdcard]# iwlist wlan0 scan
[root@FriendlyARM net]# iwconfig wlan0 essid "AirJ"这是没有密码的,如果有密码,需要在后面加上key ******;
连接过之后可以通过ping电脑来测试是否连接成功
[root@FriendlyARM net]# ping 172.21.15.1 PING 172.21.15.1 (172.21.15.1): 56 data bytes 64 bytes from 172.21.15.1: seq=0 ttl=64 time=2.700 ms 64 bytes from 172.21.15.1: seq=1 ttl=64 time=2.642 ms 64 bytes from 172.21.15.1: seq=2 ttl=64 time=4.012 ms 64 bytes from 172.21.15.1: seq=3 ttl=64 time=4.909 ms 64 bytes from 172.21.15.1: seq=4 ttl=64 time=193.940 ms 64 bytes from 172.21.15.1: seq=5 ttl=64 time=2.855 ms