* [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option
@ 2025-06-18 19:11 Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 2/3] test-runner.rst: Add documentation for USB-passthrough Luiz Augusto von Dentz
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-18 19:11 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds option to use a host controller plugged over USB:
> tools/test-runner -U "usb-host,vendorid=0x8087,productid=0x0036"... -- /bin/bash
> dmesg
[ 1.046214] usb 1-1: new full-speed USB device number 2 using xhci_hcd
[ 1.192623] Bluetooth: hci0: Firmware timestamp 2025.18 buildtype 2 build 82364
[ 1.192638] Bluetooth: hci0: Firmware SHA1: 0xa66e016b
[ 1.197362] Bluetooth: hci0: Fseq status: Success (0x00)
[ 1.197368] Bluetooth: hci0: Fseq executed: 00.00.04.196
[ 1.197371] Bluetooth: hci0: Fseq BT Top: 00.00.04.197
> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0036 Intel Corp. BE200 Bluetooth
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
---
tools/test-runner.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 7c9386d2c3d3..ae4e653e3502 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -57,6 +57,7 @@ static int num_devs = 0;
static const char *qemu_binary = NULL;
static const char *kernel_image = NULL;
static char *audio_server;
+static char *usb_dev;
static const char *qemu_table[] = {
"qemu-system-x86_64",
@@ -288,7 +289,8 @@ static void start_qemu(void)
testargs);
argv = alloca(sizeof(qemu_argv) +
- (sizeof(char *) * (6 + (num_devs * 4))));
+ (sizeof(char *) * (6 + (num_devs * 4))) +
+ (sizeof(char *) * (usb_dev ? 4 : 0)));
memcpy(argv, qemu_argv, sizeof(qemu_argv));
pos = (sizeof(qemu_argv) / sizeof(char *)) - 1;
@@ -326,6 +328,13 @@ static void start_qemu(void)
argv[pos++] = serdev;
}
+ if (usb_dev) {
+ argv[pos++] = "-device";
+ argv[pos++] = "qemu-xhci";
+ argv[pos++] = "-device";
+ argv[pos++] = usb_dev;
+ }
+
argv[pos] = NULL;
execve(argv[0], argv, qemu_envp);
@@ -1183,6 +1192,7 @@ static void usage(void)
"\t-l, --emulator Start btvirt\n"
"\t-A, --audio[=path] Start audio server\n"
"\t-u, --unix [path] Provide serial device\n"
+ "\t-U, --usb [qemu_args] Provide USB device\n"
"\t-q, --qemu <path> QEMU binary\n"
"\t-H, --qemu-host-cpu Use host CPU (requires KVM support)\n"
"\t-k, --kernel <image> Kernel image (bzImage)\n"
@@ -1202,6 +1212,7 @@ static const struct option main_options[] = {
{ "qemu-host-cpu", no_argument, NULL, 'H' },
{ "kernel", required_argument, NULL, 'k' },
{ "audio", optional_argument, NULL, 'A' },
+ { "usb", required_argument, NULL, 'U' },
{ "version", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
{ }
@@ -1221,8 +1232,8 @@ int main(int argc, char *argv[])
for (;;) {
int opt;
- opt = getopt_long(argc, argv, "aubdslmq:Hk:A::vh", main_options,
- NULL);
+ opt = getopt_long(argc, argv, "aubdslmq:Hk:A::U:vh",
+ main_options, NULL);
if (opt < 0)
break;
@@ -1261,6 +1272,9 @@ int main(int argc, char *argv[])
case 'A':
audio_server = optarg ? optarg : "/usr/bin/pipewire";
break;
+ case 'U':
+ usb_dev = optarg;
+ break;
case 'v':
printf("%s\n", VERSION);
return EXIT_SUCCESS;
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH BlueZ v1 2/3] test-runner.rst: Add documentation for USB-passthrough
2025-06-18 19:11 [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option Luiz Augusto von Dentz
@ 2025-06-18 19:11 ` Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 3/3] tester.config: Add config options for USB-passthrough and drivers Luiz Augusto von Dentz
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-18 19:11 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This documents the newly added option -U/--usb and adds a dedicated
section that explains the required the kernel image to build with
some extra config options to enable passing -device qemu-xhci in order
to use -device usb-host.
---
doc/test-runner.rst | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/doc/test-runner.rst b/doc/test-runner.rst
index 423a9379c0ab..1b4eeb9d4c1c 100644
--- a/doc/test-runner.rst
+++ b/doc/test-runner.rst
@@ -22,6 +22,7 @@ OPTIONS
:-l/--emulator: Start btvirt
:-A/-audio[=path]: Start audio server
:-u/--unix[=path]: Provide serial device
+:-U/--usb=<qemu_args>: Provide USB device
:-q/--qemu=<path>: QEMU binary
:-k/--kernel=<image>: Kernel image (bzImage)
:-h/--help: Show help options
@@ -176,3 +177,18 @@ Running shell with host controller using btproxy
$ tools/btproxy -u [1]
$ tools/test-runner -u -d -k /pathto/bzImage -- /bin/bash [2]
+Running shell with host controller USB-passthrough
+--------------------------------------------------
+
+In addition the above kernel config option the following is required:
+
+.. code-block::
+
+ CONFIG_USB=y
+ CONFIG_USB_XHCI_HCD=y
+ CONFIG_USB_XHCI_PLATFORM=y
+
+.. code-block::
+
+ $ tools/test-runner -U "usb-host,vendorid=<0xxxxx>,productid=<0xxxxx>" \
+ -d -k /pathto/bzImage -- /bin/bash
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH BlueZ v1 3/3] tester.config: Add config options for USB-passthrough and drivers
2025-06-18 19:11 [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 2/3] test-runner.rst: Add documentation for USB-passthrough Luiz Augusto von Dentz
@ 2025-06-18 19:11 ` Luiz Augusto von Dentz
2025-06-18 20:47 ` [BlueZ,v1,1/3] test-runner: Add -U/--usb option bluez.test.bot
2025-06-19 18:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-18 19:11 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds the necessary options in order to enable USB-passthrough
configuration and also enable most of the drivers so they get
build-tested.
---
doc/tester.config | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/doc/tester.config b/doc/tester.config
index 099eddc79bcb..b5fee30b817e 100644
--- a/doc/tester.config
+++ b/doc/tester.config
@@ -34,10 +34,6 @@ CONFIG_BT_MSFTEXT=y
CONFIG_BT_AOSPEXT=y
CONFIG_BT_FEATURE_DEBUG=y
-CONFIG_BT_HCIUART=y
-CONFIG_BT_HCIUART_H4=y
-CONFIG_BT_HCIVHCI=y
-
CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
@@ -57,3 +53,37 @@ CONFIG_PROVE_RCU=y
CONFIG_LOCKDEP=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_KASAN=y
+
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_PLATFORM=y
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_INTEL=y
+CONFIG_BT_BCM=y
+CONFIG_BT_RTL=y
+CONFIG_BT_QCA=y
+CONFIG_BT_MTK=y
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTUSB_POLL_SYNC=y
+CONFIG_BT_HCIBTUSB_BCM=y
+CONFIG_BT_HCIBTUSB_MTK=y
+CONFIG_BT_HCIBTUSB_RTL=y
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_SERDEV=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIUART_3WIRE=y
+CONFIG_BT_HCIUART_QCA=y
+CONFIG_BT_HCIUART_AML=y
+CONFIG_BT_HCIBCM203X=y
+CONFIG_BT_HCIBCM4377=y
+CONFIG_BT_HCIVHCI=y
+CONFIG_BT_MTKSDIO=y
+CONFIG_BT_MTKUART=y
+CONFIG_BT_VIRTIO=y
+CONFIG_BT_NXPUART=y
+CONFIG_BT_INTEL_PCIE=y
+# end of Bluetooth device drivers
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [BlueZ,v1,1/3] test-runner: Add -U/--usb option
2025-06-18 19:11 [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 2/3] test-runner.rst: Add documentation for USB-passthrough Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 3/3] tester.config: Add config options for USB-passthrough and drivers Luiz Augusto von Dentz
@ 2025-06-18 20:47 ` bluez.test.bot
2025-06-19 18:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-06-18 20:47 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=973550
---Test result---
Test Summary:
CheckPatch PENDING 0.24 seconds
GitLint PENDING 0.24 seconds
BuildEll PASS 20.29 seconds
BluezMake PASS 2980.79 seconds
MakeCheck PASS 20.14 seconds
MakeDistcheck PASS 201.55 seconds
CheckValgrind PASS 278.48 seconds
CheckSmatch PASS 306.49 seconds
bluezmakeextell PASS 128.88 seconds
IncrementalBuild PENDING 0.23 seconds
ScanBuild PASS 919.54 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option
2025-06-18 19:11 [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option Luiz Augusto von Dentz
` (2 preceding siblings ...)
2025-06-18 20:47 ` [BlueZ,v1,1/3] test-runner: Add -U/--usb option bluez.test.bot
@ 2025-06-19 18:10 ` patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2025-06-19 18:10 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Wed, 18 Jun 2025 15:11:23 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This adds option to use a host controller plugged over USB:
>
> > tools/test-runner -U "usb-host,vendorid=0x8087,productid=0x0036"... -- /bin/bash
> > dmesg
> [ 1.046214] usb 1-1: new full-speed USB device number 2 using xhci_hcd
> [ 1.192623] Bluetooth: hci0: Firmware timestamp 2025.18 buildtype 2 build 82364
> [ 1.192638] Bluetooth: hci0: Firmware SHA1: 0xa66e016b
> [ 1.197362] Bluetooth: hci0: Fseq status: Success (0x00)
> [ 1.197368] Bluetooth: hci0: Fseq executed: 00.00.04.196
> [ 1.197371] Bluetooth: hci0: Fseq BT Top: 00.00.04.197
> > lsusb
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 001 Device 002: ID 8087:0036 Intel Corp. BE200 Bluetooth
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
>
> [...]
Here is the summary with links:
- [BlueZ,v1,1/3] test-runner: Add -U/--usb option
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b8bbd5236ee0
- [BlueZ,v1,2/3] test-runner.rst: Add documentation for USB-passthrough
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f67234aa71b
- [BlueZ,v1,3/3] tester.config: Add config options for USB-passthrough and drivers
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab13c24eab87
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-19 18:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 19:11 [PATCH BlueZ v1 1/3] test-runner: Add -U/--usb option Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 2/3] test-runner.rst: Add documentation for USB-passthrough Luiz Augusto von Dentz
2025-06-18 19:11 ` [PATCH BlueZ v1 3/3] tester.config: Add config options for USB-passthrough and drivers Luiz Augusto von Dentz
2025-06-18 20:47 ` [BlueZ,v1,1/3] test-runner: Add -U/--usb option bluez.test.bot
2025-06-19 18:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.