RTL 8188 EU移植

14939 ワード

ハードウェアプラットフォーム:NUC 977+RTL 8188 EU(usbインタフェース)ソフトウェアオペレーティングシステム:Linux-3.10.101
rtl 8188 EU駆動バージョン:
rtl 8188 euドライバコードを解凍し、Makefileファイルを変更してnuc 977カーネルをサポート
diff -Npur a/Makefile b/Makefile
--- a/Makefile  2015-09-08 10:57:04.000000000 +0800
+++ b/Makefile  2016-07-27 13:49:58.829174139 +0800
@@ -65,7 +65,7 @@ CONFIG_AP_WOWLAN = n
 ######### Notify SDIO Host Keep Power During Syspend ##########
 CONFIG_RTW_SDIO_PM_KEEP_POWER = y
 ###################### Platform Related #######################
-CONFIG_PLATFORM_I386_PC = y
+CONFIG_PLATFORM_I386_PC = n
 CONFIG_PLATFORM_ANDROID_X86 = n
 CONFIG_PLATFORM_JB_X86 = n
 CONFIG_PLATFORM_ARM_S3C2K4 = n
@@ -107,6 +107,7 @@ CONFIG_PLATFORM_ACTIONS_ATV5201 = n
 CONFIG_PLATFORM_ARM_RTD299X = n
 CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n
 CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n
+CONFIG_PLATFORM_ARM_NUC970 = y
 ###############################################################

 CONFIG_DRVEXT_MODULE = n
@@ -956,7 +957,13 @@ CROSS_COMPILE := /home/share/CusEnv/Free
 KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env
 endif

-
+ifeq ($(CONFIG_PLATFORM_ARM_NUC970), y)
+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN 
+ARCH := arm
+CROSS_COMPILE := arm-linux-
+KSRC := /home/nuc970bsp/linux-3.10.x
+MODDESTDIR := /home/nuc970bsp/rootfs/usr/
+endif

 ifeq ($(CONFIG_PLATFORM_ACTIONS_ATJ227X), y)
 EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X

コンパイル8188 eu.ko
Linux端末のデバッグ8188 euに進む.ko
~ # insmod /usr/8188eu.ko
[    3.290000] RTL871X: module init start
[    3.290000] RTL871X: rtl8188eu v4.3.0.9_15178.20150907
[    3.310000] RTL871X: build time: Jul 27 2016 14:53:30
[    3.320000] bFWReady == _FALSE call reset 8051...
[    3.370000] RTL871X: rtw_ndev_init(wlan0)
[    3.410000] usbcore: registered new interface driver rtl8188eu
[    3.420000] RTL871X: module init ret=0
[    3.880000] ==> rtl8188e_iol_efuse_patch 
~ # [    6.220000] RTL871X: nolinked power save enter
ifconfig lo up
ifconfig wlan0 up

/etcでwpa_を追加supplicant.confファイル、内容は以下の通りです
ctrl_interface=/var/run/wpa_supplicant

network={
        ssid="wifi    "
        psk="wifi    "
        key_mgmt=WPA-PSK
        proto=WPA2
        pairwise=CCMP
        group=CCMP
}

ホットスポット接続の開始:wpa_supplicant -D wext -c/etc/wpa_supplicant.conf-i wlan 0-Bデバッグ情報は、次のように接続に成功したことを示します.
~ # wpa_supplicant -D wext -c  /etc/wpa_supplicant.conf -i wlan0 -B
rfkill: Cannot open RFKILL control device
[  371.180000] ==> rtl8188e_iol_efuse_patch 
[  371.530000] RTL871X: nolinked power save leave
[  371.550000] RTL871X: set bssid:00:00:00:00:00:00
ioctl[SIOCSIWAP]: Operation not permitted
~ # [  373.260000] RTL871X: nolinked power save enter
[  373.700000] ==> rtl8188e_iol_efuse_patch 
[  374.020000] RTL871X: nolinked power save leave
[  374.040000] RTL871X: set ssid [FISCAT_HW_TEST] fw_state=0x00000008
[  374.040000] RTL871X: set bssid:8c:a6:df:0f:73:9c
[  374.160000] RTL871X: start auth
[  374.170000] RTL871X: auth success, start assoc
[  374.180000] RTL871X: assoc success
[  374.180000] RTL871X: recv eapol packet
[  374.200000] RTL871X: send eapol packet
[  374.220000] RsvdPageNum: 8
[  375.490000] RTL871X: rtw_aes_decrypt(wlan0) no_gkey_bc_cnt:2, no_gkey_mc_cnt:0
~ # [  376.910000] RTL871X: recv eapol packet
[  376.910000] RTL871X: send eapol packet
[  376.940000] RTL871X: recv eapol packet
[  376.940000] RTL871X: send eapol packet
[  376.950000] RTL871X: set pairwise key camid:4, addr:8c:a6:df:0f:73:9c, kid:0, type:AES
[  376.960000] RTL871X: set group key camid:5, addr:8c:a6:df:0f:73:9c, kid:2, type:AES

IPの動的取得
~ # udhcpc -i wlan0
udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Sending select for 192.168.0.93...
Lease of 192.168.0.93 obtained, lease time 7200
deleting routers
route: ioctl 0x890c failed: No such process
adding dns 10.10.0.2
adding dns 192.168.0.1

~ # ifconfig 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  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)

wlan0     Link encap:Ethernet  HWaddr 28:F3:66:68:C8:9B  
          inet addr:192.168.0.93  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:44 errors:0 dropped:15 overruns:0 frame:0
          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10049 (9.8 KiB)  TX bytes:2202 (2.1 KiB)