Skip to content

Commit 136b735

Browse files
Vudentzmarcan
authored andcommitted
Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED
This introduces HCI_QUIRK_BROKEN_LE_CODED which is used to indicate that LE Coded PHY shall not be used, it is then set for some Intel models that claim to support it but when used causes many problems. Cc: [email protected] # 6.4.y+ Link: bluez/bluez#577 Link: bluez/bluez#582 Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/# Fixes: 288c902 ("Bluetooth: Enable all supported LE PHY by default") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 2dde18c commit 136b735

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

drivers/bluetooth/btintel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,6 +2658,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
26582658
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
26592659
&hdev->quirks);
26602660

2661+
/* These variants don't seem to support LE Coded PHY */
2662+
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
2663+
26612664
/* Setup MSFT Extension support */
26622665
btintel_set_msft_opcode(hdev, ver.hw_variant);
26632666

@@ -2729,6 +2732,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
27292732
*/
27302733
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
27312734

2735+
/* These variants don't seem to support LE Coded PHY */
2736+
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
2737+
27322738
/* Set Valid LE States quirk */
27332739
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
27342740

include/net/bluetooth/hci.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,16 @@ enum {
309309
* to support it.
310310
*/
311311
HCI_QUIRK_BROKEN_SET_RPA_TIMEOUT,
312+
313+
/*
314+
* When this quirk is set, LE Coded PHY shall not be used. This is
315+
* required for some Intel controllers which erroneously claim to
316+
* support it but it causes problems with extended scanning.
317+
*
318+
* This quirk can be set before hci_register_dev is called or
319+
* during the hdev->setup vendor callback.
320+
*/
321+
HCI_QUIRK_BROKEN_LE_CODED,
312322
};
313323

314324
/* HCI device flags */

include/net/bluetooth/hci_core.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
17131713
#define scan_2m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_2M) || \
17141714
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M))
17151715

1716-
#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED))
1716+
#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \
1717+
!test_bit(HCI_QUIRK_BROKEN_LE_CODED, \
1718+
&(dev)->quirks))
17171719

17181720
#define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \
17191721
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))

net/bluetooth/hci_sync.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4684,7 +4684,10 @@ static const struct {
46844684
"advertised, but not supported."),
46854685
HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT,
46864686
"HCI LE Set Random Private Address Timeout command is "
4687-
"advertised, but not supported.")
4687+
"advertised, but not supported."),
4688+
HCI_QUIRK_BROKEN(LE_CODED,
4689+
"HCI LE Coded PHY feature bit is set, "
4690+
"but its usage is not supported.")
46884691
};
46894692

46904693
/* This function handles hdev setup stage:

0 commit comments

Comments
 (0)