Merge tag 'for-net-next-2021-04-08' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / net / bluetooth / hci_event.c
index 341c8ce..016b299 100644 (file)
@@ -1212,12 +1212,11 @@ static void hci_cc_le_set_adv_set_random_addr(struct hci_dev *hdev,
 
        hci_dev_lock(hdev);
 
-       if (!hdev->cur_adv_instance) {
+       if (!cp->handle) {
                /* Store in hdev for instance 0 (Set adv and Directed advs) */
                bacpy(&hdev->random_addr, &cp->bdaddr);
        } else {
-               adv_instance = hci_find_adv_instance(hdev,
-                                                    hdev->cur_adv_instance);
+               adv_instance = hci_find_adv_instance(hdev, cp->handle);
                if (adv_instance)
                        bacpy(&adv_instance->random_addr, &cp->bdaddr);
        }
@@ -1778,17 +1777,16 @@ static void hci_cc_set_ext_adv_param(struct hci_dev *hdev, struct sk_buff *skb)
 
        hci_dev_lock(hdev);
        hdev->adv_addr_type = cp->own_addr_type;
-       if (!hdev->cur_adv_instance) {
+       if (!cp->handle) {
                /* Store in hdev for instance 0 */
                hdev->adv_tx_power = rp->tx_power;
        } else {
-               adv_instance = hci_find_adv_instance(hdev,
-                                                    hdev->cur_adv_instance);
+               adv_instance = hci_find_adv_instance(hdev, cp->handle);
                if (adv_instance)
                        adv_instance->tx_power = rp->tx_power;
        }
        /* Update adv data as tx power is known now */
-       hci_req_update_adv_data(hdev, hdev->cur_adv_instance);
+       hci_req_update_adv_data(hdev, cp->handle);
 
        hci_dev_unlock(hdev);
 }
@@ -5308,12 +5306,12 @@ static void hci_le_ext_adv_term_evt(struct hci_dev *hdev, struct sk_buff *skb)
                if (hdev->adv_addr_type != ADDR_LE_DEV_RANDOM)
                        return;
 
-               if (!hdev->cur_adv_instance) {
+               if (!ev->handle) {
                        bacpy(&conn->resp_addr, &hdev->random_addr);
                        return;
                }
 
-               adv_instance = hci_find_adv_instance(hdev, hdev->cur_adv_instance);
+               adv_instance = hci_find_adv_instance(hdev, ev->handle);
                if (adv_instance)
                        bacpy(&conn->resp_addr, &adv_instance->random_addr);
        }
@@ -5891,7 +5889,7 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
                        params->conn_latency = latency;
                        params->supervision_timeout = timeout;
                        store_hint = 0x01;
-               } else{
+               } else {
                        store_hint = 0x00;
                }