Page MenuHomeFreeBSD

Initial cut at Intel AX210 bluetooth support
Needs ReviewPublic

Authored by shurd on Apr 19 2024, 3:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 14, 11:52 PM
Unknown Object (File)
Fri, Jun 14, 9:47 PM
Unknown Object (File)
Fri, Jun 14, 9:46 PM
Unknown Object (File)
Sun, Jun 9, 6:35 AM
Unknown Object (File)
Fri, Jun 7, 4:46 PM
Unknown Object (File)
Fri, Jun 7, 4:45 PM
Unknown Object (File)
Wed, Jun 5, 5:48 PM
Unknown Object (File)
Wed, Jun 5, 5:43 PM

Details

Reviewers
adrian
markj
wulf
Summary

This allows loading the firmware and attaching the driver. I haven't yet managed to pair with aything.

Test Plan

Will test with BT stuff I have laying around.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57211
Build 54099: arc lint + arc unit

Event Timeline

shurd requested review of this revision.Apr 19 2024, 3:46 AM
shurd retitled this revision from Initial work... doesn't. to Initial cut at Intel AX210 bluetooth support.Apr 19 2024, 3:48 AM
shurd edited the summary of this revision. (Show Details)
shurd edited the test plan for this revision. (Show Details)

Tested with Google Pixel Buds A... with virtual_oss, pairs and right channel works.

  • Retry reset command up to twice.
  • Add macros for TLV types

Going on vacation for a couple weeks, and will look at this again when I get back... adding adrian@ as a reviewer, feel free to add more appropriate reviewers as actionable feedback will be welcome when I return.

I wonder if that'll support a lot more than just AX210?

With minor modifications and updated comms/iwmbtfw it works with AX211.

diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c
index 058b9137dd8e..ecaa06c2d21e 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_intel.c
@@ -99,8 +99,9 @@ static const STRUCT_USB_HOST_ID ubt_intel_devs[] =
 	{ USB_VPI(USB_VENDOR_INTEL2, 0x0025, UBT_INTEL_DEVICE_8260) },
 	{ USB_VPI(USB_VENDOR_INTEL2, 0x0026, UBT_INTEL_DEVICE_8260) },
 	{ USB_VPI(USB_VENDOR_INTEL2, 0x0029, UBT_INTEL_DEVICE_8260) },
-	/* Intel AX210 */
+	/* Intel AX210, AX211 */
 	{ USB_VPI(USB_VENDOR_INTEL2, 0x0032, UBT_INTEL_DEVICE_TLV) },
+	{ USB_VPI(USB_VENDOR_INTEL2, 0x0033, UBT_INTEL_DEVICE_TLV) },
 };
 
 /*
diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8 b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8
index 700108ac8379..d47f9e91ae0f 100644
--- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8
+++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.8
@@ -28,7 +28,7 @@
 .Os
 .Sh NAME
 .Nm iwmbtfw
-.Nd firmware download utility for Intel Wireless 7260/8260/8265/AX210 chip based Bluetooth
+.Nd firmware download utility for Intel Wireless 7260/8260/8265/AX210/AX211 chip based Bluetooth
 USB devices
 .Sh SYNOPSIS
 .Nm
@@ -45,7 +45,7 @@ device.
 .Pp
 This utility will
 .Em only
-work with Intel Wireless 7260/8260/8265/AX210 chip based Bluetooth USB devices and some of
+work with Intel Wireless 7260/8260/8265/AX210/AX211 chip based Bluetooth USB devices and some of
 their successors.
 The identification is currently based on USB vendor ID/product ID pair.
 The vendor ID should be 0x8087
diff --git a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf
index 77ed79e8458e..070aa0b4c20d 100644
--- a/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf
+++ b/usr.sbin/bluetooth/iwmbtfw/iwmbtfw.conf
@@ -6,6 +6,6 @@ notify 100 {
 	match "subsystem"	"DEVICE";
 	match "type"		"ATTACH";
 	match "vendor"		"0x8087";
-	match "product"		"(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029|0x0032)";
+	match "product"		"(0x07dc|0x0a2a|0x0aa7|0x0a2b|0x0aaa|0x0025|0x0026|0x0029|0x0032|0x0033)";
 	action "/usr/sbin/iwmbtfw -d $cdev -f /usr/local/share/iwmbt-firmware";
 };
diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c
index 662967f090c1..caf6924228e9 100644
--- a/usr.sbin/bluetooth/iwmbtfw/main.c
+++ b/usr.sbin/bluetooth/iwmbtfw/main.c
@@ -77,6 +77,7 @@ static struct iwmbt_devid iwmbt_list_82xx[] = {
 static struct iwmbt_devid iwmbt_list_tlv[] = {
 
 	{ .vendor_id = 0x8087, .product_id = 0x0032 },
+	{ .vendor_id = 0x8087, .product_id = 0x0033 },
 
 };
 
@@ -718,6 +719,8 @@ main(int argc, char *argv[])
 		switch (ver.hw_variant) {
 			case 0x17:
 				break;
+			case 0x18:
+				break;
 			default:
 				iwmbt_err("unknown hw_variant 0x%02x", (int) ver.hw_variant);
 				goto shutdown;

I tested this change in 14.1-STABLE and a pair of Fairbuds XL. After ensuring the firmware was loaded, I ran the following commands:

  1. service bluetooth start ubt0
  2. hccontrol -n ubt0hci inquiry
  3. hccontrol -n ubt0hci create_connection headphones
  4. <added entries to /etc/bluetooth/hcsecd.conf and /etc/bluetooth/hosts>`
  5. virtual_oss -T /dev/sndstat -S -a o,-4 -C 2 -c 2 -r 44100 -b 16 -s 1024 -R /dev/null -P /dev/bluetooth/headphones -d dspbt -t vdsp.ctl

I tried this both with and without running hccontrol -n ubt0hci write_authentication_enable 1, and settings the -P device name to /dev/bluetooth/headphones and /dev/bluetooth/<BT_ADDR>

With the Fairbuds, I received backend_bt: PSM=0x19 and backend_bt: Could not connect to HC: 60 after running the virtual_oss command.

I'll add markj to reviews as he was the one to add the last additions if I remember correctly and actually knows the code.
Also wulf has been active in that area in the past if I don't misremember.

Might help you to actually get a good review.