一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

Android KitKat 4.4 Wifi移植之Wifi driver

 caodaoquan 2014-11-10

文講述在Linux 3.10下Realek RTL8723A Linux Wifi 驅(qū)動(dòng)的移植。

 

Prerequisites

硬件平臺(tái):Atmel SAMA5

軟件平臺(tái):Linux 3.10 + Android 4.4

Wifi模組:RTL8723AU (USB接口)

 

Realtek RTL8723A Wi-Fi Software& Driver for Linux and Android

RTL8723A_WiFi_linux_v4.1.6_7336.20130426_CCC02.zip

 

目錄結(jié)構(gòu)

liaops@ubuntu-server:/media/android/liaops/temp/RTL8723A_WiFi_linux_v4.1.6_7336.20130426$tree -L 2

.

├──android_ref_codes_JB_4.1

   ├── linux-3.0.42_STATION_INFO_ASSOC_REQ_IES.diff

   ├── realtek_wifi_SDK_for_android_JB_4.1_20130306.tar.gz

   └── Realtek_Wi-Fi_SDK_for_Android_JB_4_1.pdf

├──android_ref_codes_JB_4.2    // Android JB 4.2 Realtek Wifi移植

│  ├──linux-3.0.42_STATION_INFO_ASSOC_REQ_IES.diff

   ├── realtek_wifi_SDK_for_android_JB_4.2_20130208.tar.gz

   └──Realtek_Wi-Fi_SDK_for_Android_JB_4_2.pdf  //移植文檔

├──android_reference_codes

   ├── realtek_wifi_SDK_for_android_20120618.tar.gz

   └── realtek_wifi_SDK_for_android.txt

├──android_reference_codes_ICS_nl80211

   ├── realtek_wifi_SDK_for_android_ICS_20120621.tar.gz

   └── Realtek_Wi-Fi_SDK_for_Android_ICS.pdf

├── document

   ├── HowTo_enable_driver_to_support_80211d.pdf

   ├──HowTo_enable_driver_to_support_WIFI_certification_test.pdf

   ├── HowTo_enable_the_power_saving_functionality.pdf

   ├── HowTo_support_more_VidPids.pdf

   ├── linux_dhcp_server_notes.txt

   ├── Quick_Start_Guide_for_Bridge.pdf

   ├──Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf

   ├── Quick_Start_Guide_for_SoftAP.pdf

   ├── Quick_Start_Guide_for_Station_Mode.pdf

   ├── Realtek_WiFi_concurrent_mode_Introduction.pdf

   ├── RTK_P2P_WFD_Programming_guide.pdf

   ├── SoftAP_Mode_features.pdf

   ├── Wireless_tools_porting_guide.pdf

   └── wpa_cli_with_wpa_supplicant.pdf

├── driver

   └──rtl8723A_WiFi_linux_v4.1.6_7336.20130426_CCC02.tar.gz   // Realek RTL8723A Linux Wifi 驅(qū)動(dòng)

├── hardware_wps_pbc

   ├── Readme.txt

   └── sample.c

├── install.sh

├── mp_tools

   └── RTL8723A_MPDoc

├── readme.txt

├── ReleaseNotes.pdf

├──WiFi_Direct_User_Interface

   ├── Android.mk

   ├── install.sh

   ├── p2p_api_test_linux.c

   ├── p2p_test.h

   ├── p2p_ui_test_linux.c

   └── Start_Guide_P2P_User_Interface_Linux.pdf

├── wireless_tools

│  └──wireless_tools.30.rtl.tar.gz    //Linux下對無線網(wǎng)絡(luò)配置的工具,包括iwlist,iwpriv,iwconfig

└──wpa_supplicant_hostapd

    ├── p2p_hostapd.conf

    ├── rtl_hostapd_2G.conf

    ├── rtl_hostapd_5G.conf

    ├── wpa_0_8.conf

    ├──wpa_supplicant_8_jb_4.1_rtw_r7281.20130424.tar.gz

    ├──wpa_supplicant_8_jb_4.2_rtw_r7279.20130424.tar.gz

    └──wpa_supplicant_hostapd-0.8_rtw_r7048.20130424.tar.gz

 

 

內(nèi)核配置

內(nèi)核編譯前確保Linux配置

# make menuconfig

 

使能WLAN網(wǎng)絡(luò)支持:

[*] Networking support--->

     -*- Wireless --->

 

使能Wireless LAN設(shè)備驅(qū)動(dòng):

Device Drivers --->

     [*] Network device support --->

           [*] Wireless LAN --->

 

使能RealTekRTL8712U無線網(wǎng)卡驅(qū)動(dòng):

Device Drivers --->

     [*] Staging drivers --->

           <M> RealTek RTL8712U (RTL8192SU) Wireless LAN NICdriver

目的是打開CONFIG_WIRELESS_EXT=y和CONFIG_WEXT_PRIV=y

 

上述操作在內(nèi)核中使能下述CONFIG選項(xiàng):

CONFIG_WIRELESS=y

CONFIG_WLAN=y

CONFIG_WIRELESS_EXT=y

CONFIG_WEXT_CORE=y

CONFIG_WEXT_PROC=y

CONFIG_WEXT_PRIV=y

 

使能USB Host支持:

Device Drivers --->

     [*] USB support --->

           <*> Support for Host-side USB

           <*> EHCI HCD (USB 2.0) support

 

 

 

編譯內(nèi)核

根據(jù)上述內(nèi)核配置編譯內(nèi)核。


Wifi驅(qū)動(dòng)配置與編譯

解壓縮驅(qū)動(dòng)源碼:rtl8723A_WiFi_linux_v4.1.6_7336.20130426_CCC02.tar.gz

進(jìn)入驅(qū)動(dòng)源碼目錄:

├──autoconf_rtl8723a_sdio_linux.h

├──autoconf_rtl8723a_usb_linux.h

├── clean

├── core

├── hal

├── ifcfg-wlan0

├── include

├── Kconfig

├──Kconfig_rtl8723a_sdio_linux

├──Kconfig_rtl8723a_usb_linux

├── make_drv

├── Makefile

├── os_dep

├── runwpa

└── wlan0dhcp

 

 

修改Makefile,添加AT91平臺(tái)支持

@@-44,7 +44,7 @@ CONFIG_EXT_CLK = n

 CONFIG_FTP_PROTECT =n

 CONFIG_WOWLAN = n

-CONFIG_PLATFORM_I386_PC= y

+CONFIG_PLATFORM_I386_PC= n

 CONFIG_PLATFORM_ANDROID_X86= n

 CONFIG_PLATFORM_ARM_S3C2K4= n

 CONFIG_PLATFORM_ARM_PXA2XX= n

@@-75,6 +75,7 @@ CONFIG_PLATFORM_ARM_SUN6I = n

 CONFIG_PLATFORM_ACTIONS_ATM702X= n

 CONFIG_PLATFORM_MN10300= n

 CONFIG_PLATFORM_ACTIONS_ATV5201= n

+CONFIG_PLATFORM_ARM_AT91= y

 CONFIG_DRVEXT_MODULE= n

@@-651,6 +652,14 @@ KVER := $(KERNEL_VER)

 KSRC:=$(CFGDIR)/../../kernel/linux-$(KERNEL_VER)

 endif

+ifeq($(CONFIG_PLATFORM_ARM_AT91), y)

+EXTRA_CFLAGS+= -DCONFIG_LITTLE_ENDIAN

+ARCH:= arm

+CROSS_COMPILE:= /usr/local/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi-

+KSRC:= /media/android/liaops/miura/kernel

+MODULE_NAME:= wlan

+endif

+

 ifneq($(USER_MODULE_NAME),)

 MODULE_NAME :=$(USER_MODULE_NAME)

 endif

 

修改autoconf_rtl8723a_usb_linux.h以使能STA+P2P并存模式:

@@-50,7 +50,7 @@

 #defineSUPPORT_HW_RFOFF_DETECTED

-//#defineCONFIG_IOCTL_CFG80211

+#defineCONFIG_IOCTL_CFG80211

 #ifdefCONFIG_PLATFORM_ARM_SUNxI

    #ifndef CONFIG_IOCTL_CFG80211

        #define CONFIG_IOCTL_CFG80211

@@-59,7 +59,7 @@

 #ifdefCONFIG_IOCTL_CFG80211

    //#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc throughcfg80211_new_sta */

-#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER

+//#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER

    //#define CONFIG_DEBUG_CFG80211

    #define CONFIG_SET_SCAN_DENY_TIMER

 #endif

@@-86,7 +86,7 @@

    //#define CONFIG_DBG_P2P

    #define CONFIG_P2P_PS

-//#define CONFIG_P2P_IPS

+#define CONFIG_P2P_IPS

 #endif

 // Added by Kurt20110511

@@-102,7 +102,7 @@

 #defineCONFIG_LAYER2_ROAMING

 #defineCONFIG_LAYER2_ROAMING_RESUME

-//#defineCONFIG_CONCURRENT_MODE

+#defineCONFIG_CONCURRENT_MODE

 #ifdefCONFIG_CONCURRENT_MODE

    #define CONFIG_TSF_RESET_OFFLOAD // For 2 PORT TSF SYNC.

    //#define CONFIG_HWPORT_SWAP //Port0->Sec , Port1 -> Pri

 

編譯驅(qū)動(dòng)

make KSRC=<內(nèi)核源代碼碼路徑>

 

當(dāng)前目錄下得到Wifi驅(qū)動(dòng)模塊:wlan.ko

 

 

編譯Android源代碼

 

 

 

編譯wireless_tools無線網(wǎng)絡(luò)管理工具

解壓縮wireless_tools.30.rtl.tar.gzAndroid源代碼 external/目錄下

(1)tar zxvf wireless_tools.30.rtl.tar.gz

(2)cp wireless_tools.30.rtl <ANDROID_SDK>/external/

(3)cd <ANDROID_SDK>

(4)make iwconfig iwlist iwpriv

 

 

安裝Wifi驅(qū)動(dòng)模塊

wlan.ko拷貝到Android文件系統(tǒng)out/target/product/sama5d3/system/lib/modules目錄下

 

 

制作Android根文件系統(tǒng)并燒寫到開發(fā)板

 

 

 

測試

啟動(dòng)后插入USB Wifi模塊

usb 1-2: newhigh-speed USB device number 2 using atmel-ehci

usb 1-2: NewUSB device found, idVendor=0bda, idProduct=0724

usb 1-2: NewUSB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-2:Product: 802.11n WLAN Adapter

usb 1-2:Manufacturer: Realtek

usb 1-2:SerialNumber: 00e04c000001

 

加載模塊前

root@sama5d3:/ # netcfg

eth0     UP                                    0.0.0.0/0   0x000010433a:1f:34:08:54:54

can0     DOWN                                  0.0.0.0/0   0x0000008000:00:00:00:00:00

sit0     DOWN                                  0.0.0.0/0   0x0000008000:00:00:00:00:00

lo       UP                                  127.0.0.1/8   0x0000004900:00:00:00:00:00

 

加載模塊

root@sama5d3:/# insmod /system/lib/modules/wlan.ko

usbcore:registered new interface driver rtl8723au

 

加載模塊后

root@sama5d3:/# netcfg

wlan0 DOWN 0.0.0.0/0 0x00001002 00:02:72:3c:0c:c1

wlan1 DOWN 0.0.0.0/0 0x00001002 02:02:72:3c:0c:c1

eth0 UP 0.0.0.0/0 0x00001043 3a:1f:34:08:54:54

can0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00

sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:00:00:00

lo UP 127.0.0.1/8 0x00000049 00:00:00:00:00:00

 

可以看到多了兩個(gè)接口wlan0wlan1

 

打開wlan0

root@sama5d3:/# netcfg wlan0 up

IPv6:ADDRCONF(NETDEV_UP): wlan0: link is not ready

RTL871X:nolinked power save enter

 

執(zhí)行命令iwlist wlan0 scanning,搜索可用的無線AP

部分結(jié)果如下:

root@sama5d3:/# iwlist wlan0 scanning

RTL871X:nolinked power save leave

wlan0Scan completed :

     Cell 01 - Address: D8:15:0D:D9:1F:F0

          ESSID:"Intest_Hardware"

          Protocol:IEEE 802.11bgn

          Mode:Master

          Frequency:2.412 GHz (Channel 1)

          Encryption key:on

          Bit Rates:300 Mb/s

          Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202

          IE: WPA Version 1

            Group Cipher : CCMP

            Pairwise Ciphers (1) : CCMP

            Authentication Suites (1) : PSK

          Extra:rsn_ie=30140100000fac040100000fac040100000fac020000

          IE: IEEE 802.11i/WPA2 Version 1

            Group Cipher : CCMP

            Pairwise Ciphers (1) : CCMP

            Authentication Suites (1) : PSK

          IE: Unknown: DD180050F204104A00011010440001021049000600372A000120

          Quality=0/100 Signal level=-74 dBm

     Cell 02 - Address: A8:57:4E:FC:4B:3E

          ESSID:"\xBE\xDE\xC3\xC0\xB9\xFA\xBC\xCA"

          Protocol:IEEE 802.11bgn

          Mode:Master

          Frequency:2.437 GHz (Channel 6)

          Encryption key:on

          Bit Rates:300 Mb/s

          Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202

          IE: WPA Version 1

            Group Cipher : CCMP

            Pairwise Ciphers (1) : CCMP

            Authentication Suites (1) : PSK

          Extra:rsn_ie=30140100000fac040100000fac040100000fac020000

          IE: IEEE 802.11i/WPA2 Version 1

            Group Cipher : CCMP

            Pairwise Ciphers (1) : CCMP

            Authentication Suites (1) : PSK

          IE: Unknown:DD9B0050F204104A0001101044000102103B0001031047001000000000000010000000A8574EFC4B101021000754502D4C494E4B1023000A544C2D5744523333323010240003312E3010420003312E301054000800060050F20400011011001A576972656C65737320526F7574657220544C2D57445233333230100800020086103C000101104900140024E26002000101600000020001600100020001

          Quality=0/100 Signal level=-71 dBm

     Cell 03 - Address: 1C:BD:B9:C7:84:98

          ESSID:"hikvision"

          Protocol:IEEE 802.11bgn

          Mode:Master

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多

    97人摸人人澡人人人超碰| 午夜福利在线观看免费| 亚洲精品深夜福利视频| 粗暴蹂躏中文一区二区三区| 日本免费熟女一区二区三区 | 最近最新中文字幕免费| 99精品国产自在现线观看| 少妇高潮呻吟浪语91| 国产91色综合久久高清| 深夜福利亚洲高清性感| 欧美性猛交内射老熟妇| 日本加勒比不卡二三四区| 国产亚洲二区精品美女久久| 国产极品粉嫩尤物一区二区| 成人免费在线视频大香蕉| 午夜精品福利视频观看| 日韩中文字幕在线不卡一区| 欧美字幕一区二区三区| 亚洲国产成人久久一区二区三区| 亚洲伊人久久精品国产| 免费在线播放不卡视频| 久久香蕉综合网精品视频| 国产日产欧美精品视频| 大伊香蕉一区二区三区| 日韩美成人免费在线视频| 亚洲精品福利入口在线| 99视频精品免费视频| 欧美精品久久男人的天堂| 日本丰满大奶熟女一区二区| 色综合久久超碰色婷婷| 亚洲欧洲精品一区二区三区| 久久99精品日韩人妻| 国产av大片一区二区三区| 欧美一二三区高清不卡| 亚洲中文字幕乱码亚洲| 欧美日韩有码一二三区| 欧洲精品一区二区三区四区| 一区二区免费视频中文乱码国产| 国产一区二区三区四区中文| 黄片免费观看一区二区| 国产午夜精品亚洲精品国产|