Linux bluetooth development
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/2] Bluetooth: LE connection event length requests
@ 2026-12-03  1:55 Kyle Pepper
  2026-12-03  1:55 ` [RFC PATCH v2 1/2] Bluetooth: Match LE connection update completions Kyle Pepper
  2026-12-03  1:55 ` [RFC PATCH v2 2/2] Bluetooth: Add " Kyle Pepper
  0 siblings, 2 replies; 7+ messages in thread
From: Kyle Pepper @ 2026-12-03  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, luiz.dentz

Expose connection-wide advisory CE length hints to connected Central LE
sockets so ASHA can request event time and wait for setup before START.
First correct synchronous LE update completion matching and error reporting.
No controller-specific defaults or connection interval changes are added.

The hints are in 0.625 ms units and can be ignored by the controller.
The API uses shared last-writer state, not per-socket reservations. Option 23
is provisional. The getter returns native-endian u16 min/max hints and an
optional s32 completion status; its full result is eight bytes.

AI assistance: Codex (GPT-6).

Base: bluetooth-next 7a1a7a5baa1e0f84d0568fc999421ee7dcbccaf5.
Changes in v2: patch 1 is unchanged. Patch 2 avoids a recursive device lock
on cancellation and balances queue-time references and pending accounting.
All other feature code is unchanged.

Previous version (human-reported Message-ID; archive fetch unavailable):
https://lore.kernel.org/linux-bluetooth/20261202235608.3238527-1-cochcoder@proton.me/

BlueZ companion, already archived:
https://lore.kernel.org/linux-bluetooth/20261202160403.226082-1-cochcoder@proton.me/

Validation of v2: defconfig with BT/BT_LE/BT_L2CAP enabled; W=1 hci_conn.o
and full net/bluetooth/ including l2cap_sock.o build without warnings.
GCC/Clang UBSan tests execute the production callback and setter; the old
callback reproduces recursive locking. Unsigned strict CheckPatch is clean
with the human sign-off check deferred until DCO certification.
The exact source has no hardware, PTS or running-kernel lockdep result.
Older integrated N8/MT7922 trials do not establish general controller support.


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [RFC PATCH 1/2] Bluetooth: Match LE connection update completions
@ 2026-12-02 23:56 Kyle Pepper
  2026-12-03  1:17 ` Bluetooth: LE connection event length requests bluez.test.bot
  0 siblings, 1 reply; 7+ messages in thread
From: Kyle Pepper @ 2026-12-02 23:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, luiz.dentz

LE meta dispatch completes synchronous connection updates on the
subevent alone and supplies success without checking the event status.
An update for another handle, or a failed or truncated update, can release
the wait as successful.

Match the requested connection handle and require the complete event body
before completing the request. Propagate its status while still dispatching
unrelated link updates to their normal handler.

AI assistance: Codex (GPT-6).

Signed-off-by: Kyle Pepper <cochcoder@proton.me>
---
Base: bluetooth-next 7a1a7a5baa1e0f84d0568fc999421ee7dcbccaf5.
This is a first public kernel CE RFC; local candidate numbers are not
previous public versions. No kernel CE Message-ID is verified.

BlueZ companion, already archived:
https://lore.kernel.org/linux-bluetooth/20261202160403.226082-1-cochcoder@proton.me/

Offline validation: four W=1 objects; GCC/Clang source-extracted LE dispatch
and CE queue tests; getter lengths 0..16 and baseline/negative controls.
The exact source has no hardware, PTS or running-kernel lockdep result.
Older integrated N8/MT7922 trials do not establish general controller support.

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -8494,11 +8494,29 @@
 	   (hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) == 0x08 ||
 	    hci_skb_opcode(hdev->req_skb) == HCI_OP_NOP) &&
 	    hci_skb_event(hdev->req_skb) == ev->subevent) {
+		if (hci_skb_opcode(hdev->req_skb) == HCI_OP_LE_CONN_UPDATE) {
+			struct hci_cp_le_conn_update *cp;
+			struct hci_ev_le_conn_update_complete *complete;
+
+			if (hdev->req_skb->len < HCI_COMMAND_HDR_SIZE +
+							 sizeof(*cp) ||
+			    skb->len < sizeof(*complete))
+				goto dispatch;
+
+			cp = (void *)(hdev->req_skb->data + HCI_COMMAND_HDR_SIZE);
+			complete = (void *)skb->data;
+			if (cp->handle != complete->handle)
+				goto dispatch;
+
+			*status = complete->status;
+		}
+
 		*opcode = hci_skb_opcode(hdev->req_skb);
-		hci_req_cmd_complete(hdev, *opcode, 0x00, req_complete,
+		hci_req_cmd_complete(hdev, *opcode, *status, req_complete,
 				     req_complete_skb);
 	}
 
+dispatch:
 	subev = &hci_le_ev_table[ev->subevent];
 	if (!subev->func)
 		return;


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-04  2:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  1:55 [RFC PATCH v2 0/2] Bluetooth: LE connection event length requests Kyle Pepper
2026-12-03  1:55 ` [RFC PATCH v2 1/2] Bluetooth: Match LE connection update completions Kyle Pepper
2026-12-03 16:00   ` Luiz Augusto von Dentz
2026-12-04  2:11   ` Bluetooth: LE connection event length requests bluez.test.bot
2026-12-03  1:55 ` [RFC PATCH v2 2/2] Bluetooth: Add " Kyle Pepper
2026-12-03 16:07   ` Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2026-12-02 23:56 [RFC PATCH 1/2] Bluetooth: Match LE connection update completions Kyle Pepper
2026-12-03  1:17 ` Bluetooth: LE connection event length requests bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox