1 參考資料 1,、芯片數(shù)據(jù)手冊(cè):TL8188FCA.pdf
2,、驅(qū)動(dòng)移植手冊(cè):Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf
3,、【正點(diǎn)原子】I.MX6U嵌入式Linux驅(qū)動(dòng)開發(fā)指南V1.3.pdf
4、Linux 添加 WiFi 驅(qū)動(dòng):https://blog.csdn.net/sbddbfm/article/details/101222266
5、還有一些其他前輩的教程,,十分感謝,!
2 環(huán)境介紹 1、使用的新唐的 NUC980 系列 MCU ,;
2,、Linux 內(nèi)核版本:4.4.179 ;
3,、交叉編譯鏈版本
arm-none-linux-gnueabi-gcc gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)
4,、供應(yīng)商提供的 WiFi 模塊驅(qū)動(dòng)源碼;
3 驅(qū)動(dòng)移植 1,、將 RTL8188FU
驅(qū)動(dòng)添加到 Linux
內(nèi)核中,;
在 drivers/net/wireless
路徑新建文件夾 realtek_new
;
將驅(qū)動(dòng)源碼 RTL8188FU_Linux_v5.7.4_33085.20190626\driver\rtl8188FU_linux_v5.7.4_33085.20190419
解壓后,,放到 realtek_new
文件夾中,;
2,、修改 drivers/net/wireless/Kconfig
打開 drivers/net/wireless/Kconfig
,,在文件最后一行添加 source 'drivers/net/wireless/realtek_new/Kconfig'
3、修改 drivers/net/wireless/Makefile
打開 drivers/net/wireless/Makefile
,,在文件最后一行添加 obj-y += realtek_new/
4,、新增文件 drivers/net/wireless/realtek_new/Makefile
新增文件 Makefile
,,添加以下內(nèi)容,,保存 obj-$ (CONFIG_RTL8188FU) += rtl8188fu/
5、新增文件 drivers/net/wireless/realtek_new/Kconfig
新增文件 Kconfig
,,添加以下內(nèi)容,,保存 menuconfig REALTEK_WIFI tristate 'Realtek wifi' if REALTEK_WIFI choice prompt 'select wifi type' default RTL8189FU config RTL8188FU depends on REALTEK_WIFI tristate 'Realtek 8188FU USB WiFi' endchoice endif
6、關(guān)閉 Debug
功能
打開文件 drivers/net/wireless/realtek_new/rtl8188fu/Makefile
; 第 88 行,,將宏定義 CONFIG_RTW_DEBUG=y
改為 CONFIG_RTW_DEBUG=n
; 否則會(huì)打印很多調(diào)試信息,,影響正常使用; 87 ########################## Debug ########################### 88 CONFIG_RTW_DEBUG = n 89 # default log level is _DRV_INFO_ = 4, 90 # please refer to 'How_to_set_driver_debug_log_level.doc' to set the available level. 91 CONFIG_RTW_LOG_LEVEL = 4 92 ######################## Wake On Lan ##########################
4 內(nèi)核配置 1,、配置 USB 支持設(shè)備
Device Drivers ---> [*] USB support ---> <*> Support for Host-side USB <*> EHCI HCD (USB 2.0) support <*> OHCI HCD (USB 1.1) support <*> ChipIdea Highspeed Dual Role Controller [*] ChipIdea host controller [*] ChipIdea driver debug
2,、配置支持 WiFi 設(shè)備
Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> <*> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) [*] Support downloading firmware images with Host AP driver [*] Support for non-volatile firmware download
3、配置支持 IEEE 802.11
[*] Networking support ---> -*- Wireless ---> [*] cfg80211 wireless extensions compatibility <*> Generic IEEE 802.11 Networking Stack (mac80211)
4,、配置 RTL8188FU 驅(qū)動(dòng)
由于 RTL8188FU 無(wú)需加載額外的固件文件,,故無(wú)需將驅(qū)動(dòng)配置成模塊; 直接將驅(qū)動(dòng)編譯進(jìn)內(nèi)核,這樣開機(jī)就會(huì)自動(dòng)初始化 RTL8188FU ,,不需要啟動(dòng)后再手工加載驅(qū)動(dòng)模塊; Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> <*> Realtek wifi ---> --- Realtek wifi <*> select wifi type (Realtek 8188FU USB WiFi) --->
5,、在內(nèi)核源碼文件夾根路徑,運(yùn)行命令:
make uImage -j16
6、編譯完成,;
5 簡(jiǎn)單測(cè)試 1,、將 WiFi 模塊接入控制板;
2,、使用新編譯的內(nèi)核,,重新啟動(dòng)程序;
3,、使用命令 ifconfig -a
測(cè)試,;
4、如果可以看到 wlan0 網(wǎng)卡,,則代表驅(qū)動(dòng)可以正常工作,;否則,請(qǐng)檢查之前配置步驟是否有誤,;
5,、我的測(cè)試結(jié)果如下:
[root]# ifconfig -a dummy0 Link encap:Ethernet HWaddr 12:DE:F0:8F:D4:1B BROADCAST NOARP MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth0 Link encap:Ethernet HWaddr 40:00:02:B3:D2:34 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:336 errors:0 dropped:138 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:95476 (93.2 KiB) TX bytes:0 (0.0 B) 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:1 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 68:B9:D3:B2:90:C8 BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
好了,本期內(nèi)容就是這樣,,祝您一切順利,,我們下期再見(jiàn)!