Skip to content

Commit 253f339

Browse files
committed
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 7866b9f commit 253f339

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

drivers/bluetooth/btintel.c

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

2790+
/* These variants don't seem to support LE Coded PHY */
2791+
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
2792+
27902793
/* Setup MSFT Extension support */
27912794
btintel_set_msft_opcode(hdev, ver.hw_variant);
27922795

@@ -2858,6 +2861,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
28582861
*/
28592862
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
28602863

2864+
/* These variants don't seem to support LE Coded PHY */
2865+
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
2866+
28612867
/* Set Valid LE States quirk */
28622868
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
28632869

include/net/bluetooth/hci.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,16 @@ enum {
319319
* This quirk must be set before hci_register_dev is called.
320320
*/
321321
HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
322+
323+
/*
324+
* When this quirk is set, LE Coded PHY shall not be used. This is
325+
* required for some Intel controllers which erroneously claim to
326+
* support it but it causes problems with extended scanning.
327+
*
328+
* This quirk can be set before hci_register_dev is called or
329+
* during the hdev->setup vendor callback.
330+
*/
331+
HCI_QUIRK_BROKEN_LE_CODED,
322332
};
323333

324334
/* HCI device flags */

include/net/bluetooth/hci_core.h

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

1820-
#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED))
1820+
#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \
1821+
!test_bit(HCI_QUIRK_BROKEN_LE_CODED, \
1822+
&(dev)->quirks))
18211823

18221824
#define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \
18231825
((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
@@ -4668,7 +4668,10 @@ static const struct {
46684668
"advertised, but not supported."),
46694669
HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT,
46704670
"HCI LE Set Random Private Address Timeout command is "
4671-
"advertised, but not supported.")
4671+
"advertised, but not supported."),
4672+
HCI_QUIRK_BROKEN(LE_CODED,
4673+
"HCI LE Coded PHY feature bit is set, "
4674+
"but its usage is not supported.")
46724675
};
46734676

46744677
/* This function handles hdev setup stage:

0 commit comments

Comments
 (0)