* [PATCH v1] Bluetooth: hci_event: Fix enabling passive scanning
@ 2025-02-28 18:36 Luiz Augusto von Dentz
2025-03-04 15:00 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2025-02-28 18:36 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Passive scanning shall only be enabled when disconnecting LE links,
otherwise it may start result in triggering scanning when e.g. an ISO
link disconnects:
> HCI Event: LE Meta Event (0x3e) plen 29
LE Connected Isochronous Stream Established (0x19)
Status: Success (0x00)
Connection Handle: 257
CIG Synchronization Delay: 0 us (0x000000)
CIS Synchronization Delay: 0 us (0x000000)
Central to Peripheral Latency: 10000 us (0x002710)
Peripheral to Central Latency: 10000 us (0x002710)
Central to Peripheral PHY: LE 2M (0x02)
Peripheral to Central PHY: LE 2M (0x02)
Number of Subevents: 1
Central to Peripheral Burst Number: 1
Peripheral to Central Burst Number: 1
Central to Peripheral Flush Timeout: 2
Peripheral to Central Flush Timeout: 2
Central to Peripheral MTU: 320
Peripheral to Central MTU: 160
ISO Interval: 10.00 msec (0x0008)
...
> HCI Event: Disconnect Complete (0x05) plen 4
Status: Success (0x00)
Handle: 257
Reason: Remote User Terminated Connection (0x13)
< HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
Extended scan: Enabled (0x01)
Filter duplicates: Enabled (0x01)
Duration: 0 msec (0x0000)
Period: 0.00 sec (0x0000)
Fixes: 9fcb18ef3acb ("Bluetooth: Introduce LE auto connect options")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
net/bluetooth/hci_event.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 2cc7a9306350..903b0b52692a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3391,23 +3391,30 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, void *data,
hci_update_scan(hdev);
}
- params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
- if (params) {
- switch (params->auto_connect) {
- case HCI_AUTO_CONN_LINK_LOSS:
- if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT)
+ /* Re-enable passive scanning if disconnected device is marked
+ * as auto-connectable.
+ */
+ if (conn->type == LE_LINK) {
+ params = hci_conn_params_lookup(hdev, &conn->dst,
+ conn->dst_type);
+ if (params) {
+ switch (params->auto_connect) {
+ case HCI_AUTO_CONN_LINK_LOSS:
+ if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT)
+ break;
+ fallthrough;
+
+ case HCI_AUTO_CONN_DIRECT:
+ case HCI_AUTO_CONN_ALWAYS:
+ hci_pend_le_list_del_init(params);
+ hci_pend_le_list_add(params,
+ &hdev->pend_le_conns);
+ hci_update_passive_scan(hdev);
break;
- fallthrough;
- case HCI_AUTO_CONN_DIRECT:
- case HCI_AUTO_CONN_ALWAYS:
- hci_pend_le_list_del_init(params);
- hci_pend_le_list_add(params, &hdev->pend_le_conns);
- hci_update_passive_scan(hdev);
- break;
-
- default:
- break;
+ default:
+ break;
+ }
}
}
--
2.48.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] Bluetooth: hci_event: Fix enabling passive scanning
2025-02-28 18:36 [PATCH v1] Bluetooth: hci_event: Fix enabling passive scanning Luiz Augusto von Dentz
@ 2025-03-04 15:00 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2025-03-04 15:00 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 28 Feb 2025 13:36:51 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> Passive scanning shall only be enabled when disconnecting LE links,
> otherwise it may start result in triggering scanning when e.g. an ISO
> link disconnects:
>
> > HCI Event: LE Meta Event (0x3e) plen 29
> LE Connected Isochronous Stream Established (0x19)
> Status: Success (0x00)
> Connection Handle: 257
> CIG Synchronization Delay: 0 us (0x000000)
> CIS Synchronization Delay: 0 us (0x000000)
> Central to Peripheral Latency: 10000 us (0x002710)
> Peripheral to Central Latency: 10000 us (0x002710)
> Central to Peripheral PHY: LE 2M (0x02)
> Peripheral to Central PHY: LE 2M (0x02)
> Number of Subevents: 1
> Central to Peripheral Burst Number: 1
> Peripheral to Central Burst Number: 1
> Central to Peripheral Flush Timeout: 2
> Peripheral to Central Flush Timeout: 2
> Central to Peripheral MTU: 320
> Peripheral to Central MTU: 160
> ISO Interval: 10.00 msec (0x0008)
> ...
> > HCI Event: Disconnect Complete (0x05) plen 4
> Status: Success (0x00)
> Handle: 257
> Reason: Remote User Terminated Connection (0x13)
> < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
> Extended scan: Enabled (0x01)
> Filter duplicates: Enabled (0x01)
> Duration: 0 msec (0x0000)
> Period: 0.00 sec (0x0000)
>
> [...]
Here is the summary with links:
- [v1] Bluetooth: hci_event: Fix enabling passive scanning
https://git.kernel.org/bluetooth/bluetooth-next/c/c7c65369f5a3
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] 2+ messages in thread
end of thread, other threads:[~2025-03-04 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-28 18:36 [PATCH v1] Bluetooth: hci_event: Fix enabling passive scanning Luiz Augusto von Dentz
2025-03-04 15:00 ` patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox