struct sk_buff *skb)
 {
        struct hci_cp_le_set_ext_adv_enable *cp;
+       struct hci_cp_ext_adv_set *set;
        __u8 status = *((__u8 *) skb->data);
+       struct adv_info *adv = NULL, *n;
 
        BT_DBG("%s status 0x%2.2x", hdev->name, status);
 
        if (!cp)
                return;
 
+       set = (void *)cp->data;
+
        hci_dev_lock(hdev);
 
+       if (cp->num_of_sets)
+               adv = hci_find_adv_instance(hdev, set->handle);
+
        if (cp->enable) {
                struct hci_conn *conn;
 
                hci_dev_set_flag(hdev, HCI_LE_ADV);
 
+               if (adv)
+                       adv->enabled = true;
+
                conn = hci_lookup_le_connect(hdev);
                if (conn)
                        queue_delayed_work(hdev->workqueue,
                                           &conn->le_conn_timeout,
                                           conn->conn_timeout);
        } else {
+               if (adv) {
+                       adv->enabled = false;
+                       /* If just one instance was disabled check if there are
+                        * any other instance enabled before clearing HCI_LE_ADV
+                        */
+                       list_for_each_entry_safe(adv, n, &hdev->adv_instances,
+                                                list) {
+                               if (adv->enabled)
+                                       goto unlock;
+                       }
+               } else {
+                       /* All instances shall be considered disabled */
+                       list_for_each_entry_safe(adv, n, &hdev->adv_instances,
+                                                list)
+                               adv->enabled = false;
+               }
+
                hci_dev_clear_flag(hdev, HCI_LE_ADV);
        }
 
+unlock:
        hci_dev_unlock(hdev);
 }