Bluetooth: HCI: Invert LE State quirk to be opt-out rather then opt-in
This inverts the LE State quirk so by default we assume the controllers
would report valid states rather than invalid which is how quirks
normally behave, also this would result in HCI command failing it the LE
States are really broken thus exposing the controllers that are really
broken in this respect.
Link: https://github.com/bluez/bluez/issues/584
Fixes: 220915857e ("Bluetooth: Adding driver and quirk defs for multi-role LE")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
@@ -206,14 +206,17 @@ enum {
|
||||
*/
|
||||
HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED,
|
||||
|
||||
/* When this quirk is set, the controller has validated that
|
||||
* LE states reported through the HCI_LE_READ_SUPPORTED_STATES are
|
||||
* valid. This mechanism is necessary as many controllers have
|
||||
* been seen has having trouble initiating a connectable
|
||||
* advertisement despite the state combination being reported as
|
||||
* supported.
|
||||
/* When this quirk is set, the LE states reported through the
|
||||
* HCI_LE_READ_SUPPORTED_STATES are invalid/broken.
|
||||
*
|
||||
* This mechanism is necessary as many controllers have been seen has
|
||||
* having trouble initiating a connectable advertisement despite the
|
||||
* state combination being reported as supported.
|
||||
*
|
||||
* This quirk can be set before hci_register_dev is called or
|
||||
* during the hdev->setup vendor callback.
|
||||
*/
|
||||
HCI_QUIRK_VALID_LE_STATES,
|
||||
HCI_QUIRK_BROKEN_LE_STATES,
|
||||
|
||||
/* When this quirk is set, then erroneous data reporting
|
||||
* is ignored. This is mainly due to the fact that the HCI
|
||||
|
||||
@@ -825,7 +825,7 @@ extern struct mutex hci_cb_list_lock;
|
||||
} while (0)
|
||||
|
||||
#define hci_dev_le_state_simultaneous(hdev) \
|
||||
(test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) && \
|
||||
(!test_bit(HCI_QUIRK_BROKEN_LE_STATES, &hdev->quirks) && \
|
||||
(hdev->le_states[4] & 0x08) && /* Central */ \
|
||||
(hdev->le_states[4] & 0x40) && /* Peripheral */ \
|
||||
(hdev->le_states[3] & 0x10)) /* Simultaneous */
|
||||
|
||||
Reference in New Issue
Block a user