a,内核配置:
.config - Linux/arm 3.10.65 Kernel Configuration
> Networking support > Bluetooth subsystem support ---------------------------------------------------------------------------------
+------------------------------------------------- Bluetooth subsystem support -------------------------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> |
| excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] built-in [ ] |
| excluded <M> module < > module capable |
| |
| +---------------------------------------------------------------------------------------------------------------------------+ |
| | --- Bluetooth subsystem support | |
| | <*> RFCOMM protocol support | |
| | [*] RFCOMM TTY support | |
| | < > BNEP protocol support | |
| | < > HIDP protocol support | |
| | Bluetooth device drivers --->
.config - Linux/arm 3.10.65 Kernel Configuration
> Networking support > Bluetooth subsystem support > Bluetooth device drivers ------------------------------------------------------
+-------------------------------------------------- Bluetooth device drivers ---------------------------------------------------+
| Arrow keys navigate the menu. <Enter> selects submenus --->. Highlighted letters are hotkeys. Pressing <Y> includes, <N> |
| excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> for Help, </> for Search. Legend: [*] built-in [ ] |
| excluded <M> module < > module capable |
| |
| +---------------------------------------------------------------------------------------------------------------------------+ |
| | <*> HCI USB driver | |
| | < > HCI SDIO driver | |
| | < > HCI UART driver | |
| | <*> Realtek HCI USB driver support | |
| | < > HCI BCM203x USB driver | |
| | < > HCI BPA10x USB driver | |
| | < > HCI BlueFRITZ! USB driver | |
| | < > HCI VHCI (Virtual HCI device) driver | |
| | < > Broadcom Bluetooth Low Power Manager Support | |
| | < > Realtek Bluesleep driver support | |
| | < > Marvell Bluetooth driver support | |
| | < > Atheros firmware download driver
b,内核修改
将 D:\jkl\f1c100s\RE817\rtl8723du\欧智通\20240508_LINUX_BT_DRIVER(2)\20240508_LINUX_BT_DRIVER\usb\bluetooth_usb_driver 文件夹下所有.c 和.h 文件拷贝
至 kernel/driver/bluetooth 目录。
修改 kernel/driver/bluetooth 目录下 Kconfig 和 Makefile,增加对 Realtek Bluetooth HCI
USB driver 的支持。
1,diff --git a/tina/lichee/linux-3.10/drivers/bluetooth/Kconfig b/tina/lichee/linux-3.10/drivers/bluetooth/Kconfig
index 04bc2e8..a25b43f 100755
--- a/tina/lichee/linux-3.10/drivers/bluetooth/Kconfig
+++ b/tina/lichee/linux-3.10/drivers/bluetooth/Kconfig
@@ -59,6 +59,18 @@ config BT_HCIUART_BCSP
Say Y here to compile support for HCI BCSP protocol.
+config BT_HCIBTUSB_RTLBTUSB
+ tristate "Realtek HCI USB driver support"
+ depends on USB
+ help
+ Realtek Bluetooth HCI USB driver.
+ This driver is required if you want to use Realtek Bluetooth
+ device with USB interface.
+
+ Say Y here to compile support for Bluetooth USB devices into the
+ kernel or say M to compile it as module (rtk_btusb)
+
+
config BT_HCIUART_ATH3K
bool "Atheros AR300x serial support"
depends on BT_HCIUART
2,diff --git a/tina/lichee/linux-3.10/drivers/bluetooth/Makefile b/tina/lichee/linux-3.10/drivers/bluetooth/Makefile
index 78ca2e0..06d0b7c 100755
--- a/tina/lichee/linux-3.10/drivers/bluetooth/Makefile
+++ b/tina/lichee/linux-3.10/drivers/bluetooth/Makefile
@@ -33,3 +33,6 @@ hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o
hci_uart-$(CONFIG_BT_HCIUART_ATH3K) += hci_ath.o
hci_uart-$(CONFIG_BT_HCIUART_3WIRE) += hci_h5.o
hci_uart-objs := $(hci_uart-y)
+
+obj-$(CONFIG_BT_HCIBTUSB_RTLBTUSB) := rtk_btusb.o
+rtk_btusb-objs := rtk_bt.o rtk_misc.o rtk_coex.o
3.D:\jkl\f1c100s\RE817\rtl8723du\欧智通\20240130_LINUX_BT_DRIVER\usb\bluetooth_usb_driver\rtk_misc.c添加头文件
#include <linux/version.h>
#include <linux/vmalloc.h> ==>添加此处
4.添加request_firmware 函数对应的固件路径:
tina/lichee/linux-3.10/drivers/base/firmware_class.c
static const char * const fw_path[] = {
fw_path_para,
"/lib/firmware/updates/" UTS_RELEASE,
"/lib/firmware/updates",
"/lib/firmware/" UTS_RELEASE,
"/lib/firmware",
"/etc"
};
可参考文档:D:\jkl\f1c100s\RE817\rtl8723du\欧智通\20240130_LINUX_BT_DRIVER\doc\《Realtek_Linux_Bluetooth_Porting_Guide.pdf》
三、测试
复制代码
方式一、
参考链接:https://dandelioncloud.cn/article/details/1577822731087605762
修改配置文件:
1.
/etc/wpa_supplicant.conf:
ctrl_interface=/var/log/wpa_supplicant /*ctrl_interface接口找不到的问题是接口的路径不存在导致的,例如:/etc/wifi/wpa_supplicant/ 这个目录不存在*/
update_config=1
#ap_scan=1
network={
ssid="Magic3"
psk="11111111"
}
2./etc/wpa_supplicant.conf:
ctrl_interface=/var/log/sockets
update_config=1
#ap_scan=1
network={
ssid="Magic3"
psk="11111111"
}
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf & 链接AP
udhcpc -i wlan0 获取IP地址
3.修改wep的加密方式时,wpa配置文件得修改:
ctrl_interface=/var/log/sockets /*ctrl_interface接口找不到的问题是接口的路径不存在导致的,例如:/etc/wifi/wpa_supplicant/ 这个目录不存在*/
update_config=1
network={
ssid="FAST_FW306R"
key_mgmt=NONE
auth_alg=SHARED /*这项要根据路由器的配置 SHARED/OPEN */
wep_key0="12345"
}
参考链接:https://blog.csdn.net/Golden_Chen/article/details/123512744
wpa_cli (使用第二种配置方式才可使用wpa_cli)
wpa_cli -iwlan0 -p/tmp/log/sockets: (socket根据实际路径配置)
命令 返回值 含义 备注
scan ok 搜索wifi
scan_results wifi名称 搜到到的全部wifi名称等信息
set_network ok 设置wifi的SSID和psk
list_network 列出所有的配置文件中的信息 列出保存的文件中的所有信息
add_network 添加一个网络 添加一个网络
save_network OK 将配置保存
remove_network 删除一个网络,根据网络ID删除 删除一个网络ID,根据网络ID删除
方式二、使用wifimanager-v2.0
wifi_deamon ==> 类似于守护进程
wifi:
=======================================================================
************************* sta mode Options **************************
=======================================================================
wifi -o sta
: open sta mode
wifi -f
: close sta mode
wifi -s
: scan wifi
wifi -c ssid [passwd]
: connect to an encrypted or non-encrypted ap
wifi -d
: disconnect from ap
wifi -a [enable/disable]
: Auto reconnect
wifi -l [all]
: list connected or saved ap information
wifi -r [ssid/all]
: remove a specified network or all networks
wifi -p [softap/ble/xconfig/soundwave]
: softap/ble/xconfig/soundwave distribution network
=======================================================================
************************* ap mode Options ***************************
=======================================================================
wifi -o ap [ssid] [passwd]
: open ap mode
: if ssid and passwd is not set, start the default configuration: (allwinner-ap Aa123456)
: if only set ssid, start the ap without passwd
wifi -l
: list current ap mode information
wifi -f
: close ap mode
=======================================================================
*********************** monitor mode Options ************************
=======================================================================
wifi -o monitor
: open monitor mode
wifi -f
: close monitor mode
=======================================================================
*************************** other Options ***************************
=======================================================================
wifi -D [error/warn/info/debug/dump/exce]
: set debug level
wifi -g
: get system mac addr
wifi -m [macaddr]
: set system mac addr
wifi -h
: print help
=======================================================================