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: stable@vger.kernel.org # 6.4.y+
Link: https://github.com/bluez/bluez/issues/577
Link: https://github.com/bluez/bluez/issues/582
Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/#
Fixes: 288c9022 ("Bluetooth: Enable all supported LE PHY by default")
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 7866b9fa
...@@ -2787,6 +2787,9 @@ static int btintel_setup_combined(struct hci_dev *hdev) ...@@ -2787,6 +2787,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
&hdev->quirks); &hdev->quirks);
/* These variants don't seem to support LE Coded PHY */
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
/* Setup MSFT Extension support */ /* Setup MSFT Extension support */
btintel_set_msft_opcode(hdev, ver.hw_variant); btintel_set_msft_opcode(hdev, ver.hw_variant);
...@@ -2858,6 +2861,9 @@ static int btintel_setup_combined(struct hci_dev *hdev) ...@@ -2858,6 +2861,9 @@ static int btintel_setup_combined(struct hci_dev *hdev)
*/ */
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
/* These variants don't seem to support LE Coded PHY */
set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks);
/* Set Valid LE States quirk */ /* Set Valid LE States quirk */
set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
......
...@@ -319,6 +319,16 @@ enum { ...@@ -319,6 +319,16 @@ enum {
* This quirk must be set before hci_register_dev is called. * This quirk must be set before hci_register_dev is called.
*/ */
HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER,
/*
* When this quirk is set, LE Coded PHY shall not be used. This is
* required for some Intel controllers which erroneously claim to
* support it but it causes problems with extended scanning.
*
* This quirk can be set before hci_register_dev is called or
* during the hdev->setup vendor callback.
*/
HCI_QUIRK_BROKEN_LE_CODED,
}; };
/* HCI device flags */ /* HCI device flags */
......
...@@ -1817,7 +1817,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); ...@@ -1817,7 +1817,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define scan_2m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_2M) || \ #define scan_2m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_2M) || \
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M)) ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M))
#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED)) #define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \
!test_bit(HCI_QUIRK_BROKEN_LE_CODED, \
&(dev)->quirks))
#define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \ #define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED)) ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
......
...@@ -4668,7 +4668,10 @@ static const struct { ...@@ -4668,7 +4668,10 @@ static const struct {
"advertised, but not supported."), "advertised, but not supported."),
HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT, HCI_QUIRK_BROKEN(SET_RPA_TIMEOUT,
"HCI LE Set Random Private Address Timeout command is " "HCI LE Set Random Private Address Timeout command is "
"advertised, but not supported.") "advertised, but not supported."),
HCI_QUIRK_BROKEN(LE_CODED,
"HCI LE Coded PHY feature bit is set, "
"but its usage is not supported.")
}; };
/* This function handles hdev setup stage: /* This function handles hdev setup stage:
......
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