Bluetooth: allow scatternet connections if supported.
authorAlain Michaud <alainm@chromium.org>
Thu, 23 Apr 2020 14:43:29 +0000 (14:43 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 28 Apr 2020 09:49:12 +0000 (11:49 +0200)
This change allows scatternet connections to be created if the
controller reports support and the HCI_QUIRK_VALID_LE_STATES indicates
that the reported LE states can be trusted.

Signed-off-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_event.c

index 966fc543c01da2d84296b2c285c79b10beceb961..006c24e04b4496aaa78dec478b637d1f17e0b4a3 100644 (file)
@@ -5288,7 +5288,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
        /* Most controller will fail if we try to create new connections
         * while we have an existing one in slave role.
         */
-       if (hdev->conn_hash.le_num_slave > 0)
+       if (hdev->conn_hash.le_num_slave > 0 &&
+           (!test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) ||
+            !(hdev->le_states[3] & 0x10)))
                return NULL;
 
        /* If we're not connectable only connect devices that we have in