1、芯片数据手册:TL8188FCA.pdf
2、驱动移植手册:Quick_Start_Guide_for_Driver_Compilation_and_Installation.pdf
3、【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.3.pdf
4、Linux 添加 WiFi 驱动:
5、还有一些其他前辈的教程,十分感谢!
2 环境介绍1、使用的新唐的 NUC980 系列 MCU ;
2、Linux 内核版本:4.4.179 ;
3、交叉编译链版本
arm-none-linux-gnueabi-gcc gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)
4、供应商提供的 WiFi 模块驱动源码;
3 驱动移植1、将 RTL8188FU 驱动添加到 Linux 内核中;
-
在 drivers/net/wireless 路径新建文件夹 realtek_new ;
-
将驱动源码 RTL8188FU_Linux_v5.7.4_33085.20190626\driver\rtl8188FU_linux_v5.7.4_33085.20190419 解压后,放到 realtek_new 文件夹中;
-
修改文件夹名字为 rtl8188fu ;
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 ,添加以下内容,保存
obj-$(CONFIG_RTL8188FU) += rtl8188fu/
5、新增文件 drivers/net/wireless/realtek_new/Kconfig
-
新增文件 Kconfig ,添加以下内容,保存
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、关闭 Debug 功能
-
打开文件 drivers/net/wireless/realtek_new/rtl8188fu/Makefile ;
-
第 88 行,将宏定义 CONFIG_RTW_DEBUG=y 改为 CONFIG_RTW_DEBUG=n ;
-
否则会打印很多调试信息,影响正常使用;
-
修改之后如下图所示:
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 内核配置
1、配置 USB 支持设备
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 设备
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 驱动
-
由于 RTL8188FU 无需加载额外的固件文件,故无需将驱动配置成模块;
-
直接将驱动编译进内核,这样开机就会自动初始化 RTL8188FU ,不需要启动后再手工加载驱动模块;
Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> <*> Realtek wifi ---> --- Realtek wifi <*> select wifi type (Realtek 8188FU USB WiFi) --->
5、在内核源码文件夹根路径,运行命令:
make uImage -j16
6、编译完成;
5 简单测试1、将 WiFi 模块接入控制板;
2、使用新编译的内核,重新启动程序;
3、使用命令 ifconfig -a 测试;
4、如果可以看到 wlan0 网卡,则代表驱动可以正常工作;否则,请检查之前配置步骤是否有误;
5、我的测试结果如下:
[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)
好了,本期内容就是这样,祝您一切顺利,我们下期再见!