Skip to content

Commit d2f8114

Browse files
AdityaGarg8holtmann
authored andcommitted
Bluetooth: add quirk disabling LE Read Transmit Power
Some devices have a bug causing them to not work if they query LE tx power on startup. Thus we add a quirk in order to not query it and default min/max tx power values to HCI_TX_POWER_INVALID. Signed-off-by: Aditya Garg <[email protected]> Reported-by: Orlando Chamberlain <[email protected]> Tested-by: Orlando Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 7c395ea ("Bluetooth: Query LE tx power on startup") Cc: [email protected] Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 16ada83 commit d2f8114

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

include/net/bluetooth/hci.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ enum {
246246
* HCI after resume.
247247
*/
248248
HCI_QUIRK_NO_SUSPEND_NOTIFIER,
249+
250+
/*
251+
* When this quirk is set, LE tx power is not queried on startup
252+
* and the min/max tx power values default to HCI_TX_POWER_INVALID.
253+
*
254+
* This quirk can be set before hci_register_dev is called or
255+
* during the hdev->setup vendor callback.
256+
*/
257+
HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
249258
};
250259

251260
/* HCI device flags */

net/bluetooth/hci_sync.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,8 @@ static int hci_le_read_adv_tx_power_sync(struct hci_dev *hdev)
33003300
/* Read LE Min/Max Tx Power*/
33013301
static int hci_le_read_tx_power_sync(struct hci_dev *hdev)
33023302
{
3303-
if (!(hdev->commands[38] & 0x80))
3303+
if (!(hdev->commands[38] & 0x80) ||
3304+
test_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks))
33043305
return 0;
33053306

33063307
return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_TRANSMIT_POWER,

0 commit comments

Comments
 (0)