Skip to content

Commit f9f462f

Browse files
holtmannJohan Hedberg
authored andcommitted
Bluetooth: Add quirk for disabling Delete Stored Link Key command
Some controller pretend they support the Delete Stored Link Key command, but in reality they really don't support it. < HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7 bdaddr 00:00:00:00:00:00 all 1 > HCI Event: Command Complete (0x0e) plen 4 Delete Stored Link Key (0x03|0x0012) ncmd 1 status 0x11 deleted 0 Error: Unsupported Feature or Parameter Value Not correctly supporting this command causes the controller setup to fail and will make a device not work. However sending the command for controller that handle stored link keys is important. This quirk allows a driver to disable the command if it knows that this command handling is broken. Signed-off-by: Marcel Holtmann <[email protected]> Signed-off-by: Johan Hedberg <[email protected]>
1 parent bc72197 commit f9f462f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/net/bluetooth/hci.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
enum {
8484
HCI_QUIRK_RESET_ON_CLOSE,
8585
HCI_QUIRK_RAW_DEVICE,
86-
HCI_QUIRK_FIXUP_BUFFER_SIZE
86+
HCI_QUIRK_FIXUP_BUFFER_SIZE,
87+
HCI_QUIRK_BROKEN_STORED_LINK_KEY,
8788
};
8889

8990
/* HCI device flags */

net/bluetooth/hci_core.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,8 +1304,13 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
13041304
* as supported send it. If not supported assume that the controller
13051305
* does not have actual support for stored link keys which makes this
13061306
* command redundant anyway.
1307+
*
1308+
* Some controllers indicate that they support handling deleting
1309+
* stored link keys, but they don't. The quirk lets a driver
1310+
* just disable this command.
13071311
*/
1308-
if (hdev->commands[6] & 0x80) {
1312+
if (hdev->commands[6] & 0x80 &&
1313+
!test_bit(HCI_QUIRK_BROKEN_STORED_LINK_KEY, &hdev->quirks)) {
13091314
struct hci_cp_delete_stored_link_key cp;
13101315

13111316
bacpy(&cp.bdaddr, BDADDR_ANY);

0 commit comments

Comments
 (0)