1.下载rtl8189ftv驱动:
git clone https://github.com/jwrdegoede/rtl8189ES_linux.git
git checkout -b rtl8189fs origin/rtl8189fs //下载8189fs的分支
git pull //检查更新
2.处理一下包:
进入rtl8189ES_linux目录:把git删除掉
find . -name ".git" | xargs rm -rf
拷贝rtl8189ES_linux到hisi的kernel/linux-(分支)/drivers/net/wireless/rtl8189ES_linux/
3.修改rtl8189ftv驱动包里面的Makefile:
CONFIG_RTL8188F = y#已经默认了,对应rtl8189ftv的驱动
CONFIG_SDIO_HCI = y#使用SDIO接口
CONFIG_PLATFORM_HISILICON = y#对应平台打开
##################################################################
#这里是配置海思平台的内容
ifeq ($(CONFIG_PLATFORM_HISILICON), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_HISILICON
ifeq ($(SUPPORT_CONCURRENT),y)
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
endif
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
ARCH := arm
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE = arm-hisiv500-linux- #修改编译环境
endif
MODULE_NAME := rtl8192eu #指定驱动的名字: rtl8192eu.ko
ifeq ($(KSRC),)
KSRC := ../../../../ #定义kernel位置,注意要编译驱动,先编译kernel,否则驱动编译出错
endif
endif
#######################################################################
4.加载到内核
我们看一下驱动的Kconfig是啥:
cat Kconfig
########################################################################
# SPDX-License-Identifier: GPL-2.0
config RTL8189FS #配置好后; .config文件会有宏:CONFIG_RTL8189FS,用于Makefile使用
tristate "Realtek 8189F SDIO WiFi"
---help---
Help message of RTL8189FS
########################################################################
linux-*/drivers/net/wireless/Kconfig添加:
source "drivers/net/wireless/rtl8189ES_linux/Kconfig"
linux-*/drivers/net/wireless/Makefile添加:其中CONFIG_RTL8189FS由Kconfig添加
obj-$(CONFIG_RTL8189FS) += rtl8189ES_linux/
5.配置kernel:(根据海思的wifi使用指南来做)
a.wifi驱动依赖于cfg80211;所以进入 Network support->Wireless,设置 cfg80211 和 mac80211 为 M
│ │ --- Wireless │ │
│ │
│ │ [ ] nl80211 testmode command │ │
│ │ [ ] enable developer warnings │ │
│ │ [ ] cfg80211 regulatory debugging │ │
│ │ [*] enable powersave by default │ │
│ │ [ ] cfg80211 wireless extensions compatibility │ │
│ │
│ │ Default rate control algorithm (Minstrel) ---> │ │
│ │ [ ] Enable mac80211 mesh networking (pre-802.11s) support │ │
│ │ [ ] Trace all mac80211 debug messages │ │
│ │ [ ] Select mac80211 debugging features ----
b. iwconfig、iwlist、iwpriv依赖于WEXT;而WEXT在 USB ZD1201 based Wireless device support有这个功能;所以在Device Drivers->Network device support->WirelessLAN,设置 USB ZD1201 based Wireless device support 为 M.
其中
│ │ --- Wireless LAN │ │
│ │ < > Marvell 8xxx Libertas WLAN driver support with thin firmware │ │
│ │ < > Atmel at76c503/at76c505/at76c505a USB cards │ │
│ │
│ │ < > Wireless RNDIS USB support │ │
│ │ < > Realtek 8187 and 8187B USB support │ │
│ │
│ │ < > Simulated radio testing tool for mac80211 │ │
│ │ [ ] Enable WiFi control function abstraction │ │
│ │ < > Atheros Wireless Cards ---- │ │
│ │ < > Broadcom 43xx wireless support (mac80211 stack) │ │
│ │ < > Broadcom 43xx-legacy wireless support (mac80211 stack) │ │
│ │ < > Broadcom IEEE802.11n PCIe SoftMAC WLAN driver │ │
│ │ < > Broadcom IEEE802.11n embedded FullMAC WLAN driver │ │
│ │ < > IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) │ │
│ │ < > Marvell 8xxx Libertas WLAN driver support │ │
│ │ < > Softmac Prism54 support │ │
│ │ < > Ralink driver support ---- │ │
│ │
│ │ [ ] TI Wireless LAN support ---- │ │
│ │ < > ZyDAS ZD1211/ZD1211B USB-wireless support │ │
│ │ < > Marvell WiFi-Ex Driver │ │
│ │ < > CW1200 WLAN support │ │
│ │ < > Redpine Signals Inc 91x WLAN driver support
c.rtl8189ftv对应SDIO时钟为 50MHz 左右 (暂未修改); 如果wifi电压为1.8,修改SDIO为1.8v.(暂未修改)
d.Network support->Networking options,设置 The IPv6 protocol 为 y
e.rtl8189ftv需要将 cap-sdio-irq添加到dtsi对应的mmc设备树上
6.编译内核,烧写到板子上,然后运行cfg80211.ko、8189fs.ko
7.运行:ifconfig wlan0 up
看看起来没有:
wlan0 Link encap:Ethernet HWaddr 30:4A:26:46:E8:9A
UP 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)
hostap,udhcpd,wpa_supplicant都是应用层了.