Skip to content

Commit 91b6d02

Browse files
rcheleguiniVudentz
authored andcommitted
Bluetooth: Add new quirk for broken set random RPA timeout for ATS2851
The ATS2851 based controller advertises support for command "LE Set Random Private Address Timeout" but does not actually implement it, impeding the controller initialization. Add the quirk HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT to unblock the controller initialization. < HCI Command: LE Set Resolvable Private... (0x08|0x002e) plen 2 Timeout: 900 seconds > HCI Event: Command Status (0x0f) plen 4 LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 1 Status: Unknown HCI Command (0x01) Co-developed-by: imoc <wzj9912@gmail.com> Signed-off-by: imoc <wzj9912@gmail.com> Signed-off-by: Raul Cheleguini <raul.cheleguini@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent c09b80b commit 91b6d02

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

drivers/bluetooth/btusb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,6 +4149,7 @@ static int btusb_probe(struct usb_interface *intf,
41494149
/* Support is advertised, but not implemented */
41504150
set_bit(HCI_QUIRK_BROKEN_ERR_DATA_REPORTING, &hdev->quirks);
41514151
set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
4152+
set_bit(HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT, &hdev->quirks);
41524153
set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks);
41534154
}
41544155

include/net/bluetooth/hci.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ enum {
301301
* don't actually support features declared there.
302302
*/
303303
HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
304+
305+
/*
306+
* When this quirk is set, the HCI_OP_LE_SET_RPA_TIMEOUT command is
307+
* skipped during initialization. This is required for the Actions
308+
* Semiconductor ATS2851 based controllers, which erroneously claims
309+
* to support it.
310+
*/
311+
HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT,
304312
};
305313

306314
/* HCI device flags */

net/bluetooth/hci_sync.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4093,7 +4093,8 @@ static int hci_le_set_rpa_timeout_sync(struct hci_dev *hdev)
40934093
{
40944094
__le16 timeout = cpu_to_le16(hdev->rpa_timeout);
40954095

4096-
if (!(hdev->commands[35] & 0x04))
4096+
if (!(hdev->commands[35] & 0x04) ||
4097+
test_bit(HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT, &hdev->quirks))
40974098
return 0;
40984099

40994100
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_RPA_TIMEOUT,
@@ -4553,6 +4554,9 @@ static const struct {
45534554
"HCI Set Event Filter command not supported."),
45544555
HCI_QUIRK_BROKEN(ENHANCED_SETUP_SYNC_CONN,
45554556
"HCI Enhanced Setup Synchronous Connection command is "
4557+
"advertised, but not supported."),
4558+
HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT,
4559+
"HCI LE Set Random Private Address Timeout command is "
45564560
"advertised, but not supported.")
45574561
};
45584562

0 commit comments

Comments
 (0)