Lines Matching defs:instance
1113 static u8 get_adv_instance_scan_rsp_len(struct hci_dev *hdev, u8 instance)
1118 if (instance == 0x00)
1121 adv_instance = hci_find_adv_instance(hdev, instance);
1219 /* Call for each tracked instance to be re-enabled */
1222 adv->instance);
1226 /* Schedule for most recent instance to be restarted and begin
1376 u8 instance = hdev->cur_adv_instance;
1380 if (instance == 0x00)
1383 adv_instance = hci_find_adv_instance(hdev, instance);
1405 static u32 get_adv_instance_flags(struct hci_dev *hdev, u8 instance)
1410 if (instance == 0x00) {
1416 /* For instance 0, the HCI_ADVERTISING_CONNECTABLE setting
1417 * corresponds to the "connectable" instance flag.
1430 adv_instance = hci_find_adv_instance(hdev, instance);
1432 /* Return 0 when we got an invalid instance identifier. */
1510 /* If the "connectable" instance flag was not set, then choose between
1624 static u8 create_instance_scan_rsp_data(struct hci_dev *hdev, u8 instance,
1631 adv_instance = hci_find_adv_instance(hdev, instance);
1652 void __hci_req_update_scan_rsp_data(struct hci_request *req, u8 instance)
1668 if (instance)
1669 len = create_instance_scan_rsp_data(hdev, instance,
1681 pdu.cp.handle = instance;
1693 if (instance)
1694 len = create_instance_scan_rsp_data(hdev, instance,
1712 static u8 create_instance_adv_data(struct hci_dev *hdev, u8 instance, u8 *ptr)
1718 /* Return 0 when the current instance identifier is invalid. */
1719 if (instance) {
1720 adv_instance = hci_find_adv_instance(hdev, instance);
1725 instance_flags = get_adv_instance_flags(hdev, instance);
1727 /* If instance already has the flags set skip adding it once
1801 void __hci_req_update_adv_data(struct hci_request *req, u8 instance)
1817 len = create_instance_adv_data(hdev, instance, pdu.data);
1828 pdu.cp.handle = instance;
1839 len = create_instance_adv_data(hdev, instance, cp.data);
1855 int hci_req_update_adv_data(struct hci_dev *hdev, u8 instance)
1860 __hci_req_update_adv_data(&req, instance);
1924 u8 instance;
1932 instance = hdev->cur_adv_instance;
1933 if (instance == 0x00)
1938 hci_req_clear_adv_instance(hdev, NULL, &req, instance, false);
2097 int __hci_req_setup_ext_adv_instance(struct hci_request *req, u8 instance)
2109 if (instance > 0) {
2110 adv_instance = hci_find_adv_instance(hdev, instance);
2117 flags = get_adv_instance_flags(hdev, instance);
2119 /* If the "connectable" instance flag was not set, then choose between
2151 } else if (get_adv_instance_scan_rsp_len(hdev, instance)) {
2166 cp.handle = instance;
2197 cp.handle = instance;
2208 int __hci_req_enable_ext_advertising(struct hci_request *req, u8 instance)
2216 if (instance > 0) {
2217 adv_instance = hci_find_adv_instance(hdev, instance);
2234 adv_set->handle = instance;
2236 /* Set duration per instance since controller is responsible for
2253 int __hci_req_disable_ext_adv_instance(struct hci_request *req, u8 instance)
2261 /* If request specifies an instance that doesn't exist, fail */
2262 if (instance > 0 && !hci_find_adv_instance(hdev, instance))
2271 cp->num_of_sets = !!instance;
2274 adv_set->handle = instance;
2282 int __hci_req_remove_ext_adv_instance(struct hci_request *req, u8 instance)
2286 /* If request specifies an instance that doesn't exist, fail */
2287 if (instance > 0 && !hci_find_adv_instance(hdev, instance))
2290 hci_req_add(req, HCI_OP_LE_REMOVE_ADV_SET, sizeof(instance), &instance);
2295 int __hci_req_start_ext_adv(struct hci_request *req, u8 instance)
2298 struct adv_info *adv_instance = hci_find_adv_instance(hdev, instance);
2301 /* If instance isn't pending, the chip knows about it, and it's safe to
2305 __hci_req_disable_ext_adv_instance(req, instance);
2307 err = __hci_req_setup_ext_adv_instance(req, instance);
2311 __hci_req_update_scan_rsp_data(req, instance);
2312 __hci_req_enable_ext_advertising(req, instance);
2317 int __hci_req_schedule_adv_instance(struct hci_request *req, u8 instance,
2331 adv_instance = hci_find_adv_instance(hdev, instance);
2336 * only one instance, duration should be ignored. We still set a timeout
2339 * If the remaining lifetime of the instance is more than the duration
2341 * reduced to the remaining instance lifetime.
2349 /* The remaining time is being reduced unless the instance is being
2364 /* If we're just re-scheduling the same instance again then do not
2365 * execute any HCI commands. This happens when a single instance is
2368 if (!force && hdev->cur_adv_instance == instance &&
2372 hdev->cur_adv_instance = instance;
2374 __hci_req_start_ext_adv(req, instance);
2376 __hci_req_update_adv_data(req, instance);
2377 __hci_req_update_scan_rsp_data(req, instance);
2384 /* For a single instance:
2385 * - force == true: The instance will be removed even when its remaining
2387 * - force == false: the instance will be deactivated but kept stored unless
2390 * For instance == 0x00:
2396 struct hci_request *req, u8 instance,
2403 /* Cancel any timeout concerning the removed instance(s). */
2404 if (!instance || hdev->cur_adv_instance == instance)
2407 /* Get the next instance to advertise BEFORE we remove
2408 * the current one. This can be the same instance again
2409 * if there is only one instance.
2411 if (instance && hdev->cur_adv_instance == instance)
2412 next_instance = hci_get_next_instance(hdev, instance);
2414 if (instance == 0x00) {
2420 rem_inst = adv_instance->instance;
2426 adv_instance = hci_find_adv_instance(hdev, instance);
2430 /* Don't advertise a removed instance. */
2432 next_instance->instance == instance)
2435 err = hci_remove_adv_instance(hdev, instance);
2437 mgmt_advertising_removed(sk, hdev, instance);
2446 __hci_req_schedule_adv_instance(req, next_instance->instance,
3383 adv_instance->instance,