Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 1/1] emulator: Fix version of 6.2 and 7.0 controllers
Date: Mon, 16 Nov 2026 16:28:05 -0500	[thread overview]
Message-ID: <20261116212805.3083583-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

BTDEV_TYPE_BREDRLE62 reported 0x0e (6.0) since it never set a version
of its own and BTDEV_TYPE_BREDRLE70 reported 0x10, which is 6.2, so
set them to 0x10 and 0x12 respectively as decoded by btmon.

The version set for BTDEV_TYPE_BREDRLE70 in btdev_create was always
overwritten by set_bredrle_features, so fold it into the other
BREDRLE types. Update the versions expected by mgmt-tester to match.

Fixes: a938cf48d083 ("emulator/btdev: Add emulation support for HIDS
1.1 SCI commands")
Fixes: a7f03764fa5f ("emulator: Add HDT support to btdev")
Assisted-by: OpenCode:claude-fable-5.2
---
 emulator/btdev.c    | 10 +++-------
 tools/mgmt-tester.c |  4 ++--
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index b3d13e39741a..1140acd90e7d 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -9151,6 +9151,7 @@ static void set_bredrle_features(struct btdev *btdev)
 	}
 
 	if (btdev->type >= BTDEV_TYPE_BREDRLE62) {
+		btdev->version = 0x10;
 		/* Shorter Connection Intervals */
 		btdev->le_features[9] |= BIT(0);
 		/* Shorter Connection Intervals (Host Support) */
@@ -9160,7 +9161,7 @@ static void set_bredrle_features(struct btdev *btdev)
 	if (btdev->type >= BTDEV_TYPE_BREDRLE70) {
 		uint8_t *page_1 = &btdev->le_features[8];
 
-		btdev->version = 0x10;
+		btdev->version = 0x12;
 
 		/* The data length commands of 7.0 are the ones emulated */
 		btdev->le_features[0] |= BIT(5); /* LE Data Length Extension */
@@ -9302,17 +9303,12 @@ struct btdev *btdev_create(enum btdev_type type, uint16_t id)
 	btdev->revision = 0x0000;
 
 	switch (btdev->type) {
-	case BTDEV_TYPE_BREDRLE70:
-		btdev->version = 0x0e;
-		set_bredrle_features(btdev);
-		set_bredrle_commands(btdev);
-		set_le_states(btdev);
-		break;
 	case BTDEV_TYPE_BREDRLE:
 	case BTDEV_TYPE_BREDRLE50:
 	case BTDEV_TYPE_BREDRLE52:
 	case BTDEV_TYPE_BREDRLE60:
 	case BTDEV_TYPE_BREDRLE62:
+	case BTDEV_TYPE_BREDRLE70:
 		btdev->version = 0x09;
 		set_bredrle_features(btdev);
 		set_bredrle_commands(btdev);
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 100e3cd6082c..18dbd3f89096 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -706,14 +706,14 @@ static void test_condition_complete(struct test_data *data)
 
 #define test_bredrle62_full(name, data, setup, func, timeout) \
 	test_full(name, data, setup, func, timeout, HCIEMU_TYPE_BREDRLE62, \
-					0x0e, 0x0201beff, 0x00000080)
+					0x10, 0x0201beff, 0x00000080)
 
 #define test_bredrle62(name, data, setup, func) \
 	test_bredrle62_full(name, data, setup, func, 2)
 
 #define test_bredrle70_full(name, data, setup, func, timeout) \
 	test_full(name, data, setup, func, timeout, HCIEMU_TYPE_BREDRLE70, \
-					0x10, 0x0601beff, 0x00000080)
+					0x12, 0x0601beff, 0x00000080)
 
 #define test_bredrle70(name, data, setup, func) \
 	test_bredrle70_full(name, data, setup, func, 2)
-- 
2.56.0


             reply	other threads:[~2026-11-16 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 21:28 Luiz Augusto von Dentz [this message]
2026-11-17 13:03 ` [BlueZ,v2,1/1] emulator: Fix version of 6.2 and 7.0 controllers bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116212805.3083583-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox