Bluetooth: Disable Extended Adv if enabled
authorSathish Narsimman <nsathish41@gmail.com>
Mon, 17 Feb 2020 09:07:44 +0000 (14:37 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 18 Feb 2020 08:25:19 +0000 (09:25 +0100)
Disabling LEGACY_ADV when EXT_ADV is enabled causes
'command disallowed' during DIRECTED_ADV. This Patch fixes this
issue.

Signed-off-by: Sathish Narsimman <sathish.narasimman@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c

index 65fa44cbe514011a619d2815339268c105fcfc4c..a582c676e584c9de6c2a3a297827d935566109a6 100644 (file)
@@ -1029,11 +1029,8 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
         * anyway have to disable it in order to start directed
         * advertising.
         */
-       if (hci_dev_test_flag(hdev, HCI_LE_ADV)) {
-               u8 enable = 0x00;
-               hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(enable),
-                           &enable);
-       }
+       if (hci_dev_test_flag(hdev, HCI_LE_ADV))
+                __hci_req_disable_advertising(&req);
 
        /* If requested to connect as slave use directed advertising */
        if (conn->role == HCI_ROLE_SLAVE) {