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 v1 03/12] mgmt: Add Shorter Connection Interval setting and Load Connection Subrate
Date: Fri, 24 Jul 2026 15:12:16 -0400	[thread overview]
Message-ID: <20260724191225.1815634-4-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260724191225.1815634-1-luiz.dentz@gmail.com>

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

Add the Shorter Connection Interval setting bit (25) to indicate
controller support for SCI feature.

Add the Load Connection Subrate command (0x005C) which allows
loading connection subrate parameters for devices that support
shorter connection intervals as defined in Bluetooth 6.2.
---
 doc/mgmt-protocol.rst | 125 ++++++++++++++++++++++++++++++++++++++++++
 lib/bluetooth/mgmt.h  |  31 +++++++++++
 2 files changed, 156 insertions(+)

diff --git a/doc/mgmt-protocol.rst b/doc/mgmt-protocol.rst
index 35446dd974ac..f0564075f92f 100644
--- a/doc/mgmt-protocol.rst
+++ b/doc/mgmt-protocol.rst
@@ -321,6 +321,7 @@ following available bits:
     22, LL Privacy
     23, PAST Sender
     24, PAST Receiver
+    25, Shorter Connection Interval
 
 This command generates a Command Complete event on success or a Command Status
 event on failure.
@@ -4170,6 +4171,86 @@ Possible errors:
 :Failed:
 :Invalid Parameters:
 
+Load Connection Subrate
+```````````````````````
+
+:Command Code:		0x005C
+:Controller Index:	<controller id>
+:Command Parameters:	Param_Count (2 Octets)
+:...:			Address[] (6 Octets)
+:...:			Address_Type[] (1 Octet)
+:...:			Min_Connection_Interval[] (2 Octets)
+:...:			Max_Connection_Interval[] (2 Octets)
+:...:			Subrate_Min[] (2 Octets)
+:...:			Subrate_Max[] (2 Octets)
+:...:			Max_Latency[] (2 Octets)
+:...:			Continuation_Number[] (2 Octets)
+:...:			Supervision_Timeout[] (2 Octets)
+:...:			...[]
+:Return Parameters:
+
+This command is used to load connection subrate parameters from several devices
+into the kernel. This is only supported on controllers with Low Energy support
+and the Shorter Connection Interval (SCI) feature.
+
+This command operates on the same device entries as Load Connection Parameters
+(0x0035). If an entry for the given device already exists, the subrate-specific
+fields are updated on that entry. If no entry exists, a new one is created. The
+device must have been previously added via Load Connection Parameters or this
+command.
+
+Note that the Min_Connection_Interval and Max_Connection_Interval parameters in
+this command refer to the connection rate interval used with the LE Connection
+Rate Request procedure, which has different valid ranges than the connection
+interval in Load Connection Parameters. The Load Connection Parameters interval
+is specified in units of 1.25 ms (range: 6 to 3200), while the connection rate
+interval here is specified in units of 0.125 ms (range: 8 to 3200).
+
+Loading with multiple entries overwrites the subrate parameters for all listed
+devices. Loading with a single entry attempts to update the parameters if an
+entry for the given device already exists, or adds a new entry otherwise.
+
+Possible values for the Address_Type parameter:
+
+.. csv-table::
+	:header: "Value", "Description"
+	:widths: auto
+
+	0x00, BR/EDR
+	0x01, LE Public
+	0x02, LE Random
+
+The provided Address and Address_Type are the identity of a device. So either
+its public address or static random address.
+
+The Min_Connection_Interval and Max_Connection_Interval parameters specify the
+connection rate interval range in units of 0.125 ms (range: 0x0008 to 0x0C80,
+corresponding to 1.0 ms to 400.0 ms). These are distinct from the connection
+parameters interval in Load Connection Parameters which uses units of 1.25 ms.
+
+The Subrate_Min and Subrate_Max parameters specify the acceptable subrate factor
+range.
+
+The Max_Latency parameter specifies the maximum peripheral latency in units of
+subrated connection events.
+
+The Continuation_Number parameter specifies the number of continuation events
+the peripheral will be listened to.
+
+The Supervision_Timeout parameter specifies the link supervision timeout in
+units of 10 ms.
+
+This command can be used when the controller is not powered.
+
+This command generates a Command Complete event on success or a Command Status
+event on failure.
+
+Possible errors:
+
+:Invalid Parameters:
+:Invalid Index:
+:Not Supported:
+
 Events
 ------
 
@@ -5396,3 +5477,47 @@ This event indicates that a requested outbound Mesh packet has completed and no
 longer occupies a transmit slot.
 
 This event will be sent to all management sockets.
+
+Connection Subrate
+``````````````````
+
+:Event Code:		0x0033
+:Controller Index:	<controller id>
+:Event Parameters:	Address (6 Octets)
+:...:			Address_Type (1 Octet)
+:...:			Status (1 Octet)
+:...:			Interval (2 Octets)
+:...:			Subrate (2 Octets)
+:...:			Latency (2 Octets)
+:...:			Continuation_Number (2 Octets)
+:...:			Supervision_Timeout (2 Octets)
+
+This event indicates that the connection rate has changed for a device. This
+can be a result of a successful LE Connection Rate Request or a change
+initiated by the remote device.
+
+Possible values for the Address_Type parameter:
+
+.. csv-table::
+	:header: "Value", "Description"
+	:widths: auto
+
+	0x01, LE Public
+	0x02, LE Random
+
+The Status indicates whether the connection rate change was successful.
+
+The Interval parameter specifies the new connection interval in units of
+0.125 ms.
+
+The Subrate parameter specifies the subrate factor.
+
+The Latency parameter specifies the peripheral latency.
+
+The Continuation_Number parameter specifies the number of continuation
+events.
+
+The Supervision_Timeout parameter specifies the supervision timeout in units
+of 10 ms.
+
+This event will be sent to all management sockets.
diff --git a/lib/bluetooth/mgmt.h b/lib/bluetooth/mgmt.h
index 7fab3d7a0bba..9df0c1ba2fbf 100644
--- a/lib/bluetooth/mgmt.h
+++ b/lib/bluetooth/mgmt.h
@@ -107,6 +107,7 @@ struct mgmt_rp_read_index_list {
 #define MGMT_SETTING_LL_PRIVACY		BIT(22)
 #define MGMT_SETTING_PAST_SENDER	BIT(23)
 #define MGMT_SETTING_PAST_RECEIVER	BIT(24)
+#define MGMT_SETTING_SCI		BIT(25)
 
 #define MGMT_OP_READ_INFO		0x0004
 struct mgmt_rp_read_info {
@@ -814,6 +815,23 @@ struct mgmt_cp_hci_cmd_sync {
 	uint8_t  params[];
 } __packed;
 
+struct mgmt_conn_subrate {
+	struct mgmt_addr_info addr;
+	uint16_t min_interval;
+	uint16_t max_interval;
+	uint16_t subrate_min;
+	uint16_t subrate_max;
+	uint16_t max_latency;
+	uint16_t cont_num;
+	uint16_t supv_timeout;
+} __packed;
+
+#define MGMT_OP_LOAD_CONN_SUBRATE	0x005C
+struct mgmt_cp_load_conn_subrate {
+	uint16_t param_count;
+	struct mgmt_conn_subrate params[];
+} __packed;
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	uint16_t opcode;
@@ -1107,6 +1125,17 @@ struct mgmt_ev_mesh_pkt_cmplt {
 	uint8_t	handle;
 } __packed;
 
+#define MGMT_EV_CONN_SUBRATE			0x0033
+struct mgmt_ev_conn_subrate {
+	struct mgmt_addr_info addr;
+	uint8_t  status;
+	uint16_t interval;
+	uint16_t subrate;
+	uint16_t latency;
+	uint16_t cont_num;
+	uint16_t supv_timeout;
+} __packed;
+
 static const char *mgmt_op[] = {
 	"<0x0000>",
 	"Read Version",
@@ -1200,6 +1229,7 @@ static const char *mgmt_op[] = {
 	"Mesh Send",
 	"Mesh Send Cancel",
 	"HCI Cmd Sync",
+	"Load Connection Subrate",
 };
 
 static const char *mgmt_ev[] = {
@@ -1254,6 +1284,7 @@ static const char *mgmt_ev[] = {
 	"Advertisement Monitor Device Lost",
 	"Mesh Packet Found",
 	"Mesh Packet Complete",
+	"Connection Subrate",
 };
 
 static const char *mgmt_status[] = {
-- 
2.54.0


  parent reply	other threads:[~2026-07-24 19:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 19:12 [PATCH BlueZ v1 00/12] Add support for Shorter Connection Interval (SCI) Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 01/12] input/hog-lib: Add discovery support for HIDS 1.1 SCI attributes Luiz Augusto von Dentz
2026-07-24 20:41   ` Add support for Shorter Connection Interval (SCI) bluez.test.bot
2026-07-24 19:12 ` [PATCH BlueZ v1 02/12] emulator/btdev: Add emulation support for HIDS 1.1 SCI commands Luiz Augusto von Dentz
2026-07-24 19:12 ` Luiz Augusto von Dentz [this message]
2026-07-24 19:12 ` [PATCH BlueZ v1 04/12] mgmt-tester: Add tests for SCI setting and Load Connection Subrate Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 05/12] adapter: Add support for loading connection subrate parameters Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 06/12] monitor: Add decoding for Load Connection Subrate, SCI setting and event Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 07/12] doc: Document ConnectionSubrate storage format Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 08/12] client/mgmt: Add conn-subrate command Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 09/12] mgmt-tester: Add HIDS recommended SCI parameter tests Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 10/12] l2cap-tester: Add SCI mode tests for LE client connections Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 11/12] emulator/bthost: Add LE Connection Rate Request support Luiz Augusto von Dentz
2026-07-24 19:12 ` [PATCH BlueZ v1 12/12] l2cap-tester: Add SCI mode tests for LE server connections Luiz Augusto von Dentz

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=20260724191225.1815634-4-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