Commit d2f8114f authored by Aditya Garg's avatar Aditya Garg Committed by Marcel Holtmann

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: default avatarAditya Garg <gargaditya08@live.com>
Reported-by: default avatarOrlando Chamberlain <redecorating@protonmail.com>
Tested-by: default avatarOrlando Chamberlain <redecorating@protonmail.com>
Link:
https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
Fixes: 7c395ea5 ("Bluetooth: Query LE tx power on startup")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 16ada83b
...@@ -246,6 +246,15 @@ enum { ...@@ -246,6 +246,15 @@ enum {
* HCI after resume. * HCI after resume.
*/ */
HCI_QUIRK_NO_SUSPEND_NOTIFIER, HCI_QUIRK_NO_SUSPEND_NOTIFIER,
/*
* When this quirk is set, LE tx power is not queried on startup
* and the min/max tx power values default to HCI_TX_POWER_INVALID.
*
* This quirk can be set before hci_register_dev is called or
* during the hdev->setup vendor callback.
*/
HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
}; };
/* HCI device flags */ /* HCI device flags */
......
...@@ -3300,7 +3300,8 @@ static int hci_le_read_adv_tx_power_sync(struct hci_dev *hdev) ...@@ -3300,7 +3300,8 @@ static int hci_le_read_adv_tx_power_sync(struct hci_dev *hdev)
/* Read LE Min/Max Tx Power*/ /* Read LE Min/Max Tx Power*/
static int hci_le_read_tx_power_sync(struct hci_dev *hdev) static int hci_le_read_tx_power_sync(struct hci_dev *hdev)
{ {
if (!(hdev->commands[38] & 0x80)) if (!(hdev->commands[38] & 0x80) ||
test_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks))
return 0; return 0;
return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_TRANSMIT_POWER, return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_TRANSMIT_POWER,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment