【D1 Lichee RV & WIFI】RTL8723DS & BS 的 WiFi 移植记录
-
这里是 sipeed 的大佬鼠喔,前天下午被催着处理,折腾了一天处理掉了,先上结果图吧。
(2021-12-17 大佬鼠我发帖时,BS 加载还有一些bug,所以没有具体的截图)
移植方法的前提有两个,首先拿到全志公开的 SDK ,然后在 lichee/linux-5.4/drivers/net/wireless/rtl8723ds 里添加旧驱动升级上来。
不要去尝试使用主线的 8723bs 驱动和其他 lichee/linux-5.4/drivers/net/ 目录下的驱动,全志只有 XR829 上写了sunxi相关操作,也就是说,其他地方的驱动要从这里抄,或者从以前的旧代码升级上来。
官方有用的讯息只有这个 https://bbs.aw-ol.com/topic/756/faq-全志d1芯片-如何移植-rtl8821cu-wifi-驱动到-linux-5-4内核/1
注意 lichee/linux-5.4/include/linux/timer.h 和 相关 lichee/linux-5.4/drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c 接口的升级,vfs_read 已经发生了改变,所以要用 kernel_read 喔。
最后附带一下我编译好的 8723ds.ko 吧,感兴趣的同学可以试试!
用法如下:
(这版模块插入挺久的,这让我有一点迷惑,之后我再看看要不要优化吧)
root@TinaLinux:/# insmod 8723ds.ko [ 37.434002] RTW: module init start [ 37.437799] RTW: rtl8723ds v5.10.1-26-ga10bc0b8b.20200617_COEX20200103-3535 [ 37.445650] RTW: build time: Dec 17 2021 08:23:15 [ 37.450894] RTW: rtl8723ds BT-Coex version = COEX20200103-3535 [ 37.467463] sunxi-rfkill soc@3000000:rfkill@0: wlan power on success [ 37.574642] sunxi-rfkill soc@3000000:rfkill@0: bus_index: 1 [ 37.580856] ----- platform_wifi_power_on sdc_id: 1 [ 37.586697] RTW: == SDIO Card Info == [ 37.590810] RTW: card: (____ptrval____) [ 37.595340] RTW: clock: 25000000 Hz [ 37.599419] RTW: timing spec: sd high-speed [ 37.604338] RTW: sd3_bus_mode: FALSE [ 37.608515] RTW: func num: 1 [ 37.611915] RTW: func1: (____ptrval____) (*) [ 37.616924] RTW: ================ [ 37.662236] RTW: HW EFUSE [ 37.665197] RTW: 0x000: 29 81 00 7C E1 88 07 00 A0 04 EC 35 12 C0 A3 D8 [ 37.673162] RTW: 0x010: 27 26 25 26 26 26 28 28 27 27 27 01 FF FF FF FF [ 37.681049] RTW: 0x020: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.688995] RTW: 0x030: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.696924] RTW: 0x040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.704884] RTW: 0x050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.712768] RTW: 0x060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.720720] RTW: 0x070: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.728631] RTW: 0x080: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.736583] RTW: 0x090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.744492] RTW: 0x0A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.752395] RTW: 0x0B0: FF FF FF FF FF FF FF FF 20 33 1C 00 00 00 FF FF [ 37.760320] RTW: 0x0C0: FF 29 20 11 00 00 00 FF 00 FF 11 FF FF FF FF FF [ 37.768267] RTW: 0x0D0: 3E 10 01 12 23 FF FF FF 20 04 4C 02 23 D7 21 02 [ 37.776196] RTW: 0x0E0: 0C 00 22 04 00 08 00 32 FF 21 02 0C 00 22 2A 01 [ 37.784171] RTW: 0x0F0: 01 00 00 00 00 00 00 00 00 00 00 00 02 00 FF FF [ 37.792056] RTW: 0x100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 37.800033] RTW: 0x110: 00 EB 00 6E 01 00 00 00 00 FF 38 01 46 2E 86 00 [ 37.807951] RTW: 0x120: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.815907] RTW: 0x130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.823817] RTW: 0x140: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.831719] RTW: 0x150: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.839645] RTW: 0x160: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.847618] RTW: 0x170: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.855551] RTW: 0x180: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.863458] RTW: 0x190: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.871363] RTW: 0x1A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.879289] RTW: 0x1B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.887253] RTW: 0x1C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.895186] RTW: 0x1D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.903133] RTW: 0x1E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.911017] RTW: 0x1F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF [ 37.919138] RTW: hal_com_config_channel_plan chplan:0x20 [ 38.326815] RTW: [RF_PATH] ver_id.RF_TYPE:RF_1T1R [ 38.332066] RTW: [RF_PATH] HALSPEC's rf_reg_trx_path_bmp:0x11, rf_reg_path_avail_num:1, max_tx_cnt:1 [ 38.342360] RTW: [RF_PATH] PG's trx_path_bmp:0x00, max_tx_cnt:0 [ 38.348991] RTW: [RF_PATH] Registry's trx_path_bmp:0x00, tx_path_lmt:0, rx_path_lmt:0 [ 38.357796] RTW: [RF_PATH] HALDATA's trx_path_bmp:0x11, max_tx_cnt:1 [ 38.364907] RTW: [RF_PATH] HALDATA's rf_type:RF_1T1R, NumTotalRFPath:1 [ 38.372205] RTW: [TRX_Nss] HALSPEC - tx_nss:1, rx_nss:1 [ 38.378074] RTW: [TRX_Nss] Registry - tx_nss:0, rx_nss:0 [ 38.384055] RTW: [TRX_Nss] HALDATA - tx_nss:1, rx_nss:1 [ 38.391204] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1 [ 38.405200] RTW: rtw_ndev_init(wlan0) if1 mac_addr=38:01:46:2e:86:00 [ 38.415345] RTW: rtw_ndev_init(wlan1) if2 mac_addr=3a:01:46:2e:86:00 [ 38.437901] RTW: module init ret=0
启动一下网卡(可能)
ifconfig wlan0 up
创建 /etc/wpa_supplicant.conf 文件
ctrl_interface=/var/run/wpa_supplicant update_config=1 network={ ssid="Sipeed_2.4G" key_mgmt=WPA-PSK psk="xxxxxxxxxx" }
清理 !启动 !
killall wpa_supplicant wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf & udhcpc -iwlan0 &
要注意有其他愚蠢的 wpa_supplicant 在执行导致
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
。root@TinaLinux:/# ifconfig br-lan Link encap:Ethernet HWaddr 52:CF:D0:17:82:E0 inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fd38:e6e8:8819::1/60 Scope:Global 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) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:120 errors:0 dropped:0 overruns:0 frame:0 TX packets:120 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9360 (9.1 KiB) TX bytes:9360 (9.1 KiB) wlan0 Link encap:Ethernet HWaddr 38:01:46:2E:86:00 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) root@TinaLinux:/# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf & root@TinaLinux:/# Successfully initialized wpa_supplicant root@TinaLinux:/# wlan0: Trying to associate with 58:41:20:04:df:f4 (SSID='Sipeed_2.4G' freq=2462 MHz) root@TinaLinux:/# wlan0: Associated with 58:41:20:04:df:f4 wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0 root@TinaLinux:/# wlan0: WPA: Key negotiation completed with 58:41:20:04:df:f4 [PTK=CCMP GTK=CCMP] wlan0: CTRL-EVENT-CONNECTED - Connection to 58:41:20:04:df:f4 completed [id=0 id_str=] root@TinaLinux:/# root@TinaLinux:/# udhcpc -iwlan0 & root@TinaLinux:/# udhcpc: started, v1.27.2 udhcpc: sending discover udhcpc: sending select for 192.168.0.119 udhcpc: lease of 192.168.0.119 obtained, lease time 7200 udhcpc: ifconfig wlan0 192.168.0.119 netmask 255.255.255.0 broadcast + udhcpc: setting default routers: 192.168.0.1 [2]+ Done udhcpc -iwlan0 root@TinaLinux:/# \
搜索 和 查看结果!
root@TinaLinux:/# wpa_cli -iwlan0 scan OK root@TinaLinux:/# wpa_cli -iwlan0 scan_results bssid / frequency / signal level / flags / ssid 58:41:20:05:07:96 2462 -47 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Sipeed_Guest 58:41:20:04:df:f4 2462 -58 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Sipeed_2.4G 70:d3:13:e5:c1:e8 2457 -47 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS] ChinaNet-tnYp 58:41:20:04:e4:d1 2462 -66 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Sipeed_2.4G 0c:3a:fa:0e:92:8a 2412 -59 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] smzs 0c:3a:fa:0e:88:fd 2462 -64 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] smzs ea:db:84:df:2e:bc 2412 -60 [WPA2-PSK-CCMP+TKIP][ESS] pwned 58:41:20:04:e1:59 2437 -74 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Sipeed_Guest 76:d6:cb:1c:53:74 2437 -66 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Reach Intelligent 0c:3a:fa:0e:81:7d 2462 -66 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] smzs 74:d6:cb:4c:53:74 2437 -67 [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] 64:64:4a:88:7f:06 2412 -70 [WPA2-PSK-CCMP][WPS][ESS] phone_call 62:58:6c:dd:30:67 2432 -75 [WPA2-PSK-CCMP][WPS][ESS] RC310-004 0c:3a:fa:0e:92:8c 2412 -67 [ESS] 0c:3a:fa:0e:88:ff 2462 -63 [ESS] 0c:3a:fa:0e:81:7f 2462 -69 [ESS] 0c:3a:fa:0e:8c:0b 2437 -74 [ESS] root@TinaLinux:/#
有问题的彩蛋:8723bs-vq0.ko (仅供测试,逃!~)
今天最多修一下 BS 的剩余问题,之后我可能就不会再出没了,如果你们使用上没有问题的话。
-
感谢大佬分享,久仰大名!
-
我优化了一下现在模块插入大概只要8秒了
-
-
-
@juwan Is bluetooth working on your device?
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号