Bluetooth: Add new quirk for broken extended create connection for ATS2851
Subsystems (2)
PATCH v2 1/1 Bluetooth: Add new quirk for broken extended create connection for ATS2851
The controller based on ATS2851 advertises support for the "LE Extended Create Connection" command, but it does not actually implement it. This issue is blocking the pairing process from beginning.
To resolve this, add the quirk HCI_QUIRK_BROKEN_EXT_CREATE_CONN. This will avoid the unsupported command and instead send a regular "LE Create Connection" command.
< HCI Command: LE Extended Create Conn.. (0x08|0x0043) plen 26
Filter policy: Accept list is not used (0x00)
Own address type: Public (0x00)
Peer address type: Random (0x01)
Peer address: DD:5E:B9:FE:49:3D (Static)
Initiating PHYs: 0x01
Entry 0: LE 1M
Scan interval: 60.000 msec (0x0060)
Scan window: 60.000 msec (0x0060)
Min connection interval: 30.00 msec (0x0018)
Max connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 420 msec (0x002a)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Extended Create Connection (0x08|0x0043) ncmd 1
Status: Unknown HCI Command (0x01)---
V1 -> V2: Grammar fix in commit message.
- Note that this patch depends on the RPA timeout quirk sent via [1]. [1]. https://marc.info/?l=linux-bluetooth&m=167957918920723&w=2
drivers/bluetooth/btusb.c | 1 + include/net/bluetooth/hci.h | 7 +++++++ include/net/bluetooth/hci_core.h | 3 ++- net/bluetooth/hci_sync.c | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-)
drivers/bluetooth/btusb.c +1 -0
@@ -4107,6 +4107,7 @@ static int btusb_probe(struct usb_interface *intf,set_bit (HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_EXT_SCAN , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_EXT_CREATE_CONN , &hdev->quirks); }if (!reset)
include/net/bluetooth/hci.h +7 -0
@@ -309,6 +309,13 @@ enum {* to support it. */ HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , + +/* +* When this quirk is set, the HCI_OP_LE_EXT_CREATE_CONN command is +* disabled. This is required for the Actions Semiconductor ATS2851 +* based controllers, which erroneously claims to support it. +*/ + HCI_QUIRK_BROKEN_EXT_CREATE_CONN, };/* HCI device flags */
include/net/bluetooth/hci_core.h +2 -1
@@ -1695,7 +1695,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn); !test_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &(dev)->quirks))/* Use ext create connection if command is supported */ -#define use_ext_conn (dev) ((dev)->commands[37] & 0x80) +#define use_ext_conn (dev) (((dev)->commands[37] & 0x80) && \ + !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, &(dev)->quirks))/* Extended advertising support */ #define ext_adv_capable (dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))
net/bluetooth/hci_sync.c +4 -0
@@ -4534,6 +4534,9 @@ static const struct { "advertised, but not supported."),HCI_QUIRK_BROKEN (SET_RPA_TIMEOUT ,"HCI LE Set Random Private Address Timeout command is " +"advertised, but not supported." ), +HCI_QUIRK_BROKEN (EXT_CREATE_CONN , +"HCI LE Extended Create Connection command is " "advertised, but not supported.") };
@@ -6071,6 +6074,7 @@ int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn)if (err) goto done; +/* Send command LE Extended Create Connection if supported */ if (use_ext_conn (hdev)) { err =hci_le_ext_create_conn_sync (hdev, conn, own_addr_type); goto done;
Signature · 1 line
2.39.2
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=743095
---Test result---
Test Summary:
CheckPatch FAIL 1.44 seconds GitLint FAIL 0.56 seconds SubjectPrefix PASS 0.10 seconds BuildKernel PASS 32.96 seconds CheckAllWarning PASS 36.71 seconds CheckSparse PASS 41.33 seconds CheckSmatch PASS 111.31 seconds BuildKernel32 PASS 32.35 seconds TestRunnerSetup PASS 455.78 seconds TestRunner_l2cap-tester PASS 17.19 seconds TestRunner_iso-tester PASS 21.70 seconds TestRunner_bnep-tester PASS 5.64 seconds TestRunner_mgmt-tester PASS 116.88 seconds TestRunner_rfcomm-tester PASS 9.04 seconds TestRunner_sco-tester PASS 8.31 seconds TestRunner_ioctl-tester PASS 9.73 seconds TestRunner_mesh-tester PASS 7.06 seconds TestRunner_smp-tester PASS 8.29 seconds TestRunner_userchan-tester PASS 6.00 seconds IncrementalBuild PASS 29.70 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2] Bluetooth: Add new quirk for broken extended create connection for ATS2851
WARNING: Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html
#113:
[1]. https://marc.info/?l=linux-bluetooth&m=167957918920723&w=2
WARNING: quoted string split across lines
#173: FILE: net/bluetooth/hci_sync.c:4537:
"HCI LE Set Random Private Address Timeout command is "
+ "advertised, but not supported."),
total: 0 errors, 2 warnings, 0 checks, 45 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13223516.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v2] Bluetooth: Add new quirk for broken extended create connection for ATS2851
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
36: B2 Line has trailing whitespace: " "
---
Regards,
Linux Bluetooth
Quoted 8 lines · On Tue, 25 Apr 2023 13:31:20 -0300 Raul Cheleguini <[email protected]>…
The controller based on ATS2851 advertises support for the "LE Extended Create Connection" command, but it does not actually implement it. This issue is blocking the pairing process from beginning.
To resolve this, add the quirk
HCI_QUIRK_BROKEN_EXT_CREATE_CONN. This will avoid the unsupported command and instead send a regular "LE Create Connection" command.
I'm interested in getting this patch merged. Was this just forgotten, or is there still work to be done before it can be merged?
Best regards,
Markus Uhr
Luiz Augusto von Dentz
maintainerHi Markus,
Quoted 9 lines · Markus Uhr
Quoted 5 lines · On Tue, 25 Apr 2023 13:31:20 -0300 Raul Cheleguini <[email protected]>…
The controller based on ATS2851 advertises support for the "LE Extended Create Connection" command, but it does not actually implement it. This issue is blocking the pairing process from beginning.
Quoted 6 lines
Quoted 3 lines
To resolve this, add the quirk
HCI_QUIRK_BROKEN_EXT_CREATE_CONN. This will avoid the unsupported command and instead send a regular "LE Create Connection" command.I'm interested in getting this patch merged. Was this just forgotten, or is there still work to be done before it can be merged?
It might need to be resend since it is no longer listed in patchwork.
Quoted 2 lines
Best regards,
Markus Uhr
Signature · 1 line
Luiz Augusto von Dentz
Quoted 7 lines · On Mon, 12 Aug 2024 11:17:20 -0400 Luiz Augusto von Dentz…
Quoted 4 lines · Markus Uhr
I'm interested in getting this patch merged. Was this just forgotten, or is there still work to be done before it can be merged?
It might need to be resend since it is no longer listed in patchwork.
This is a resubmission of the patch, rebased on current bluetooth-next master.
In addition to the original change, this revision also disables 'enhanced connection complete' when the quirk is active. This eliminates an ugly kernel error log
Bluetooth: hci0: Opcode 0x200e failed: -16
when the controller connects successfully.
Best,
Markus
-- >8 --
Subject: [PATCH v3] Bluetooth: Add new quirk for broken extended create connection for ATS2851
The controller based on ATS2851 advertises support for the "LE Extended Create Connection" command, but it does not actually implement it. This issue is blocking the pairing process from beginning.
To resolve this, add the quirk HCI_QUIRK_BROKEN_EXT_CREATE_CONN. This will avoid the unsupported command and instead send a regular "LE Create Connection" command.
< HCI Command: LE Extended Create Conn.. (0x08|0x0043) plen 26
Filter policy: Accept list is not used (0x00)
Own address type: Public (0x00)
Peer address type: Random (0x01)
Peer address: DD:5E:B9:FE:49:3D (Static)
Initiating PHYs: 0x01
Entry 0: LE 1M
Scan interval: 60.000 msec (0x0060)
Scan window: 60.000 msec (0x0060)
Min connection interval: 30.00 msec (0x0018)
Max connection interval: 50.00 msec (0x0028)
Connection latency: 0 (0x0000)
Supervision timeout: 420 msec (0x002a)
Min connection length: 0.000 msec (0x0000)
Max connection length: 0.000 msec (0x0000)Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
LE Extended Create Connection (0x08|0x0043) ncmd 1
Status: Unknown HCI Command (0x01)--- drivers/bluetooth/btusb.c | 1 + include/net/bluetooth/hci.h | 7 +++++++ include/net/bluetooth/hci_core.h | 9 ++++++--- net/bluetooth/hci_sync.c | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-)
drivers/bluetooth/btusb.c +1 -0
@@ -3883,6 +3883,7 @@ static int btusb_probe(struct usb_interface *intf,set_bit (HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_EXT_SCAN , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_EXT_CREATE_CONN , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , &hdev->quirks); }
include/net/bluetooth/hci.h +7 -0
@@ -328,6 +328,13 @@ enum {*/ HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , +/* +* When this quirk is set, the HCI_OP_LE_EXT_CREATE_CONN command is +* disabled. This is required for the Actions Semiconductor ATS2851 +* based controllers, which erroneously claims to support it. +*/ + HCI_QUIRK_BROKEN_EXT_CREATE_CONN, +/* * When this quirk is set, the reserved bits of Primary/Secondary_PHY * inside the LE Extended Advertising Report events are discarded.
include/net/bluetooth/hci_core.h +6 -3
@@ -1876,7 +1876,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn); !test_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &(dev)->quirks))/* Use ext create connection if command is supported */ -#define use_ext_conn (dev) ((dev)->commands[37] & 0x80) +#define use_ext_conn (dev) (((dev)->commands[37] & 0x80) && \ + !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, &(dev)->quirks))/* Extended advertising support */ #define ext_adv_capable (dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))
@@ -1890,8 +1891,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn);* C24: Mandatory if the LE Controller supports Connection State and either * LE Feature (LL Privacy) or LE Feature (Extended Advertising) is supported */ -#define use_enhanced_conn_complete (dev) (ll_privacy_capable(dev) || \ - ext_adv_capable(dev)) +#define use_enhanced_conn_complete (dev) ((ll_privacy_capable(dev) || \ + ext_adv_capable(dev)) && \ + !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, \ + &(dev)->quirks))/* Periodic advertising support */ #define per_adv_capable (dev) (((dev)->le_features[1] & HCI_LE_PERIODIC_ADV))
net/bluetooth/hci_sync.c +4 -0
@@ -4800,6 +4800,9 @@ static const struct {HCI_QUIRK_BROKEN (SET_RPA_TIMEOUT ,"HCI LE Set Random Private Address Timeout command is " "advertised, but not supported." ), +HCI_QUIRK_BROKEN (EXT_CREATE_CONN , +"HCI LE Extended Create Connection command is " +"advertised, but not supported." ),HCI_QUIRK_BROKEN (LE_CODED ,"HCI LE Coded PHY feature bit is set, " "but its usage is not supported." )
@@ -6427,6 +6430,7 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)if (err) goto done; +/* Send command LE Extended Create Connection if supported */ if (use_ext_conn (hdev)) { err =hci_le_ext_create_conn_sync (hdev, conn, own_addr_type); goto done;
Signature · 1 line
2.46.0
Hi!
Any news? I'm also interested in getting this patch into the kernel.
27.08.2024 3:21, Markus Uhr пишет:
Quoted 140 lines
Quoted 5 lines · On Mon, 12 Aug 2024 11:17:20 -0400 Luiz Augusto von Dentz…
Quoted 3 lines · Markus Uhr
I'm interested in getting this patch merged. Was this just forgotten, or is there still work to be done before it can be merged?
It might need to be resend since it is no longer listed in patchwork.
This is a resubmission of the patch, rebased on current bluetooth-next master.
In addition to the original change, this revision also disables 'enhanced connection complete' when the quirk is active. This eliminates an ugly kernel error log
Bluetooth: hci0: Opcode 0x200e failed: -16when the controller connects successfully.
Best,
Markus-- >8 --
Subject: [PATCH v3] Bluetooth: Add new quirk for broken extended create connection for ATS2851The controller based on ATS2851 advertises support for the "LE Extended Create Connection" command, but it does not actually implement it. This issue is blocking the pairing process from beginning.
To resolve this, add the quirk
HCI_QUIRK_BROKEN_EXT_CREATE_CONN. This will avoid the unsupported command and instead send a regular "LE Create Connection" command.< HCI Command: LE Extended Create Conn.. (0x08|0x0043) plen 26
Filter policy: Accept list is not used (0x00) Own address type: Public (0x00) Peer address type: Random (0x01) Peer address: DD:5E:B9:FE:49:3D (Static) Initiating PHYs: 0x01 Entry 0: LE 1M Scan interval: 60.000 msec (0x0060) Scan window: 60.000 msec (0x0060) Min connection interval: 30.00 msec (0x0018) Max connection interval: 50.00 msec (0x0028) Connection latency: 0 (0x0000) Supervision timeout: 420 msec (0x002a) Min connection length: 0.000 msec (0x0000) Max connection length: 0.000 msec (0x0000)Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4LE Extended Create Connection (0x08|0x0043) ncmd 1 Status: Unknown HCI Command (0x01)Signed-off-by Markus Uhr <[email protected]>--- drivers/bluetooth/btusb.c | 1 + include/net/bluetooth/hci.h | 7 +++++++ include/net/bluetooth/hci_core.h | 9 ++++++--- net/bluetooth/hci_sync.c | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-)drivers/bluetooth/btusb.c +1
-0@@ -3883,6 +3883,7 @@ static int btusb_probe(struct usb_interface *intf,set_bit (HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_EXT_SCAN , &hdev->quirks); +set_bit (HCI_QUIRK_BROKEN_EXT_CREATE_CONN , &hdev->quirks);set_bit (HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , &hdev->quirks); }include/net/bluetooth/hci.h +7
-0@@ -328,6 +328,13 @@ enum {*/ HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE , +/* +* When this quirk is set, the HCI_OP_LE_EXT_CREATE_CONN command is +* disabled. This is required for the Actions Semiconductor ATS2851 +* based controllers, which erroneously claims to support it. +*/ + HCI_QUIRK_BROKEN_EXT_CREATE_CONN, +/* * When this quirk is set, the reserved bits of Primary/Secondary_PHY * inside the LE Extended Advertising Report events are discarded. include/net/bluetooth/hci_core.h +6
-3@@ -1876,7 +1876,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn); !test_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &(dev)->quirks))/* Use ext create connection if command is supported */ -#define use_ext_conn (dev) ((dev)->commands[37] & 0x80) +#define use_ext_conn (dev) (((dev)->commands[37] & 0x80) && \ + !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, &(dev)->quirks))/* Extended advertising support */ #define ext_adv_capable (dev) (((dev)->le_features[1] & HCI_LE_EXT_ADV))@@ -1890,8 +1891,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn);* C24: Mandatory if the LE Controller supports Connection State and either * LE Feature (LL Privacy) or LE Feature (Extended Advertising) is supported */ -#define use_enhanced_conn_complete (dev) (ll_privacy_capable(dev) || \ - ext_adv_capable(dev)) +#define use_enhanced_conn_complete (dev) ((ll_privacy_capable(dev) || \ + ext_adv_capable(dev)) && \ + !test_bit(HCI_QUIRK_BROKEN_EXT_CREATE_CONN, \ + &(dev)->quirks))/* Periodic advertising support */ #define per_adv_capable (dev) (((dev)->le_features[1] & HCI_LE_PERIODIC_ADV))net/bluetooth/hci_sync.c +4
-0@@ -4800,6 +4800,9 @@ static const struct {HCI_QUIRK_BROKEN (SET_RPA_TIMEOUT ,"HCI LE Set Random Private Address Timeout command is " "advertised, but not supported." ), +HCI_QUIRK_BROKEN (EXT_CREATE_CONN , +"HCI LE Extended Create Connection command is " +"advertised, but not supported." ),HCI_QUIRK_BROKEN (LE_CODED ,"HCI LE Coded PHY feature bit is set, " "but its usage is not supported." )@@ -6427,6 +6430,7 @@ static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)if (err) goto done; +/* Send command LE Extended Create Connection if supported */ if (use_ext_conn (hdev)) { err =hci_le_ext_create_conn_sync (hdev, conn, own_addr_type); goto done;