aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-03-15 18:06:52 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-03-18 13:01:59 -0400
commit890ea8988f7d17453515122041adb0e1acdb6025 (patch)
treea024dfdd2c6aeab5d9db31807d02240c766cddd9 /net/bluetooth/mgmt.c
parent70da624376b8ba8d0db83eb817a7bc140778a26f (diff)
Bluetooth: Update mgmt powered HCI commands to use async requests
This patch updates sending of HCI commands related to mgmt_set_powered (e.g. class, name and EIR data) to be sent using asynchronous requests. This is necessary since it's the only (well, at least the cleanest) way to keep the power on procedure synchronized and let user space know it has completed only when all HCI commands are completed (this actual fix is coming in a subsequent patch). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c163
1 files changed, 100 insertions, 63 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 7d58b44540ac..4726876298f0 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -591,32 +591,33 @@ static void create_eir(struct hci_dev *hdev, u8 *data)
591 ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data)); 591 ptr = create_uuid128_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
592} 592}
593 593
594static int update_eir(struct hci_dev *hdev) 594static void update_eir(struct hci_request *req)
595{ 595{
596 struct hci_dev *hdev = req->hdev;
596 struct hci_cp_write_eir cp; 597 struct hci_cp_write_eir cp;
597 598
598 if (!hdev_is_powered(hdev)) 599 if (!hdev_is_powered(hdev))
599 return 0; 600 return;
600 601
601 if (!lmp_ext_inq_capable(hdev)) 602 if (!lmp_ext_inq_capable(hdev))
602 return 0; 603 return;
603 604
604 if (!test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) 605 if (!test_bit(HCI_SSP_ENABLED, &hdev->dev_flags))
605 return 0; 606 return;
606 607
607 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) 608 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
608 return 0; 609 return;
609 610
610 memset(&cp, 0, sizeof(cp)); 611 memset(&cp, 0, sizeof(cp));
611 612
612 create_eir(hdev, cp.data); 613 create_eir(hdev, cp.data);
613 614
614 if (memcmp(cp.data, hdev->eir, sizeof(cp.data)) == 0) 615 if (memcmp(cp.data, hdev->eir, sizeof(cp.data)) == 0)
615 return 0; 616 return;
616 617
617 memcpy(hdev->eir, cp.data, sizeof(cp.data)); 618 memcpy(hdev->eir, cp.data, sizeof(cp.data));
618 619
619 return hci_send_cmd(hdev, HCI_OP_WRITE_EIR, sizeof(cp), &cp); 620 hci_req_add(req, HCI_OP_WRITE_EIR, sizeof(cp), &cp);
620} 621}
621 622
622static u8 get_service_classes(struct hci_dev *hdev) 623static u8 get_service_classes(struct hci_dev *hdev)
@@ -630,47 +631,50 @@ static u8 get_service_classes(struct hci_dev *hdev)
630 return val; 631 return val;
631} 632}
632 633
633static int update_class(struct hci_dev *hdev) 634static void update_class(struct hci_request *req)
634{ 635{
636 struct hci_dev *hdev = req->hdev;
635 u8 cod[3]; 637 u8 cod[3];
636 int err;
637 638
638 BT_DBG("%s", hdev->name); 639 BT_DBG("%s", hdev->name);
639 640
640 if (!hdev_is_powered(hdev)) 641 if (!hdev_is_powered(hdev))
641 return 0; 642 return;
642 643
643 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) 644 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
644 return 0; 645 return;
645 646
646 cod[0] = hdev->minor_class; 647 cod[0] = hdev->minor_class;
647 cod[1] = hdev->major_class; 648 cod[1] = hdev->major_class;
648 cod[2] = get_service_classes(hdev); 649 cod[2] = get_service_classes(hdev);
649 650
650 if (memcmp(cod, hdev->dev_class, 3) == 0) 651 if (memcmp(cod, hdev->dev_class, 3) == 0)
651 return 0; 652 return;
652 653
653 err = hci_send_cmd(hdev, HCI_OP_WRITE_CLASS_OF_DEV, sizeof(cod), cod); 654 hci_req_add(req, HCI_OP_WRITE_CLASS_OF_DEV, sizeof(cod), cod);
654 if (err == 0)
655 set_bit(HCI_PENDING_CLASS, &hdev->dev_flags);
656 655
657 return err; 656 set_bit(HCI_PENDING_CLASS, &hdev->dev_flags);
658} 657}
659 658
660static void service_cache_off(struct work_struct *work) 659static void service_cache_off(struct work_struct *work)
661{ 660{
662 struct hci_dev *hdev = container_of(work, struct hci_dev, 661 struct hci_dev *hdev = container_of(work, struct hci_dev,
663 service_cache.work); 662 service_cache.work);
663 struct hci_request req;
664 664
665 if (!test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) 665 if (!test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
666 return; 666 return;
667 667
668 hci_req_init(&req, hdev);
669
668 hci_dev_lock(hdev); 670 hci_dev_lock(hdev);
669 671
670 update_eir(hdev); 672 update_eir(&req);
671 update_class(hdev); 673 update_class(&req);
672 674
673 hci_dev_unlock(hdev); 675 hci_dev_unlock(hdev);
676
677 hci_req_run(&req, NULL);
674} 678}
675 679
676static void mgmt_init_hdev(struct sock *sk, struct hci_dev *hdev) 680static void mgmt_init_hdev(struct sock *sk, struct hci_dev *hdev)
@@ -1355,6 +1359,7 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1355{ 1359{
1356 struct mgmt_cp_add_uuid *cp = data; 1360 struct mgmt_cp_add_uuid *cp = data;
1357 struct pending_cmd *cmd; 1361 struct pending_cmd *cmd;
1362 struct hci_request req;
1358 struct bt_uuid *uuid; 1363 struct bt_uuid *uuid;
1359 int err; 1364 int err;
1360 1365
@@ -1380,13 +1385,12 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1380 1385
1381 list_add_tail(&uuid->list, &hdev->uuids); 1386 list_add_tail(&uuid->list, &hdev->uuids);
1382 1387
1383 err = update_class(hdev); 1388 hci_req_init(&req, hdev);
1384 if (err < 0)
1385 goto failed;
1386 1389
1387 err = update_eir(hdev); 1390 update_class(&req);
1388 if (err < 0) 1391 update_eir(&req);
1389 goto failed; 1392
1393 hci_req_run(&req, NULL);
1390 1394
1391 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) { 1395 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) {
1392 err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_UUID, 0, 1396 err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_UUID, 0,
@@ -1395,8 +1399,12 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
1395 } 1399 }
1396 1400
1397 cmd = mgmt_pending_add(sk, MGMT_OP_ADD_UUID, hdev, data, len); 1401 cmd = mgmt_pending_add(sk, MGMT_OP_ADD_UUID, hdev, data, len);
1398 if (!cmd) 1402 if (!cmd) {
1399 err = -ENOMEM; 1403 err = -ENOMEM;
1404 goto failed;
1405 }
1406
1407 err = 0;
1400 1408
1401failed: 1409failed:
1402 hci_dev_unlock(hdev); 1410 hci_dev_unlock(hdev);
@@ -1424,6 +1432,7 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
1424 struct pending_cmd *cmd; 1432 struct pending_cmd *cmd;
1425 struct bt_uuid *match, *tmp; 1433 struct bt_uuid *match, *tmp;
1426 u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 1434 u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1435 struct hci_request req;
1427 int err, found; 1436 int err, found;
1428 1437
1429 BT_DBG("request for %s", hdev->name); 1438 BT_DBG("request for %s", hdev->name);
@@ -1466,13 +1475,12 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
1466 } 1475 }
1467 1476
1468update_class: 1477update_class:
1469 err = update_class(hdev); 1478 hci_req_init(&req, hdev);
1470 if (err < 0)
1471 goto unlock;
1472 1479
1473 err = update_eir(hdev); 1480 update_class(&req);
1474 if (err < 0) 1481 update_eir(&req);
1475 goto unlock; 1482
1483 hci_req_run(&req, NULL);
1476 1484
1477 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) { 1485 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) {
1478 err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_UUID, 0, 1486 err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_UUID, 0,
@@ -1481,8 +1489,12 @@ update_class:
1481 } 1489 }
1482 1490
1483 cmd = mgmt_pending_add(sk, MGMT_OP_REMOVE_UUID, hdev, data, len); 1491 cmd = mgmt_pending_add(sk, MGMT_OP_REMOVE_UUID, hdev, data, len);
1484 if (!cmd) 1492 if (!cmd) {
1485 err = -ENOMEM; 1493 err = -ENOMEM;
1494 goto unlock;
1495 }
1496
1497 err = 0;
1486 1498
1487unlock: 1499unlock:
1488 hci_dev_unlock(hdev); 1500 hci_dev_unlock(hdev);
@@ -1494,6 +1506,7 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,
1494{ 1506{
1495 struct mgmt_cp_set_dev_class *cp = data; 1507 struct mgmt_cp_set_dev_class *cp = data;
1496 struct pending_cmd *cmd; 1508 struct pending_cmd *cmd;
1509 struct hci_request req;
1497 int err; 1510 int err;
1498 1511
1499 BT_DBG("request for %s", hdev->name); 1512 BT_DBG("request for %s", hdev->name);
@@ -1521,16 +1534,18 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,
1521 goto unlock; 1534 goto unlock;
1522 } 1535 }
1523 1536
1537 hci_req_init(&req, hdev);
1538
1524 if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) { 1539 if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
1525 hci_dev_unlock(hdev); 1540 hci_dev_unlock(hdev);
1526 cancel_delayed_work_sync(&hdev->service_cache); 1541 cancel_delayed_work_sync(&hdev->service_cache);
1527 hci_dev_lock(hdev); 1542 hci_dev_lock(hdev);
1528 update_eir(hdev); 1543 update_eir(&req);
1529 } 1544 }
1530 1545
1531 err = update_class(hdev); 1546 update_class(&req);
1532 if (err < 0) 1547
1533 goto unlock; 1548 hci_req_run(&req, NULL);
1534 1549
1535 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) { 1550 if (!test_bit(HCI_PENDING_CLASS, &hdev->dev_flags)) {
1536 err = cmd_complete(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, 0, 1551 err = cmd_complete(sk, hdev->id, MGMT_OP_SET_DEV_CLASS, 0,
@@ -1539,8 +1554,12 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,
1539 } 1554 }
1540 1555
1541 cmd = mgmt_pending_add(sk, MGMT_OP_SET_DEV_CLASS, hdev, data, len); 1556 cmd = mgmt_pending_add(sk, MGMT_OP_SET_DEV_CLASS, hdev, data, len);
1542 if (!cmd) 1557 if (!cmd) {
1543 err = -ENOMEM; 1558 err = -ENOMEM;
1559 goto unlock;
1560 }
1561
1562 err = 0;
1544 1563
1545unlock: 1564unlock:
1546 hci_dev_unlock(hdev); 1565 hci_dev_unlock(hdev);
@@ -2268,13 +2287,13 @@ static int user_passkey_neg_reply(struct sock *sk, struct hci_dev *hdev,
2268 HCI_OP_USER_PASSKEY_NEG_REPLY, 0); 2287 HCI_OP_USER_PASSKEY_NEG_REPLY, 0);
2269} 2288}
2270 2289
2271static int update_name(struct hci_dev *hdev, const char *name) 2290static void update_name(struct hci_request *req, const char *name)
2272{ 2291{
2273 struct hci_cp_write_local_name cp; 2292 struct hci_cp_write_local_name cp;
2274 2293
2275 memcpy(cp.name, name, sizeof(cp.name)); 2294 memcpy(cp.name, name, sizeof(cp.name));
2276 2295
2277 return hci_send_cmd(hdev, HCI_OP_WRITE_LOCAL_NAME, sizeof(cp), &cp); 2296 hci_req_add(req, HCI_OP_WRITE_LOCAL_NAME, sizeof(cp), &cp);
2278} 2297}
2279 2298
2280static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data, 2299static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data,
@@ -2282,6 +2301,7 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data,
2282{ 2301{
2283 struct mgmt_cp_set_local_name *cp = data; 2302 struct mgmt_cp_set_local_name *cp = data;
2284 struct pending_cmd *cmd; 2303 struct pending_cmd *cmd;
2304 struct hci_request req;
2285 int err; 2305 int err;
2286 2306
2287 BT_DBG(""); 2307 BT_DBG("");
@@ -2310,7 +2330,9 @@ static int set_local_name(struct sock *sk, struct hci_dev *hdev, void *data,
2310 goto failed; 2330 goto failed;
2311 } 2331 }
2312 2332
2313 err = update_name(hdev, cp->name); 2333 hci_req_init(&req, hdev);
2334 update_name(&req, cp->name);
2335 err = hci_req_run(&req, NULL);
2314 if (err < 0) 2336 if (err < 0)
2315 mgmt_pending_remove(cmd); 2337 mgmt_pending_remove(cmd);
2316 2338
@@ -2698,6 +2720,7 @@ static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data,
2698 u16 len) 2720 u16 len)
2699{ 2721{
2700 struct mgmt_cp_set_device_id *cp = data; 2722 struct mgmt_cp_set_device_id *cp = data;
2723 struct hci_request req;
2701 int err; 2724 int err;
2702 __u16 source; 2725 __u16 source;
2703 2726
@@ -2718,7 +2741,9 @@ static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data,
2718 2741
2719 err = cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_ID, 0, NULL, 0); 2742 err = cmd_complete(sk, hdev->id, MGMT_OP_SET_DEVICE_ID, 0, NULL, 0);
2720 2743
2721 update_eir(hdev); 2744 hci_req_init(&req, hdev);
2745 update_eir(&req);
2746 hci_req_run(&req, NULL);
2722 2747
2723 hci_dev_unlock(hdev); 2748 hci_dev_unlock(hdev);
2724 2749
@@ -3043,8 +3068,9 @@ static void settings_rsp(struct pending_cmd *cmd, void *data)
3043 mgmt_pending_free(cmd); 3068 mgmt_pending_free(cmd);
3044} 3069}
3045 3070
3046static int set_bredr_scan(struct hci_dev *hdev) 3071static void set_bredr_scan(struct hci_request *req)
3047{ 3072{
3073 struct hci_dev *hdev = req->hdev;
3048 u8 scan = 0; 3074 u8 scan = 0;
3049 3075
3050 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags)) 3076 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
@@ -3052,21 +3078,22 @@ static int set_bredr_scan(struct hci_dev *hdev)
3052 if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags)) 3078 if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
3053 scan |= SCAN_INQUIRY; 3079 scan |= SCAN_INQUIRY;
3054 3080
3055 if (!scan) 3081 if (scan)
3056 return 0; 3082 hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
3057
3058 return hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
3059} 3083}
3060 3084
3061static int powered_update_hci(struct hci_dev *hdev) 3085static int powered_update_hci(struct hci_dev *hdev)
3062{ 3086{
3087 struct hci_request req;
3063 u8 link_sec; 3088 u8 link_sec;
3064 3089
3090 hci_req_init(&req, hdev);
3091
3065 if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && 3092 if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
3066 !lmp_host_ssp_capable(hdev)) { 3093 !lmp_host_ssp_capable(hdev)) {
3067 u8 ssp = 1; 3094 u8 ssp = 1;
3068 3095
3069 hci_send_cmd(hdev, HCI_OP_WRITE_SSP_MODE, 1, &ssp); 3096 hci_req_add(&req, HCI_OP_WRITE_SSP_MODE, 1, &ssp);
3070 } 3097 }
3071 3098
3072 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 3099 if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {
@@ -3080,23 +3107,23 @@ static int powered_update_hci(struct hci_dev *hdev)
3080 */ 3107 */
3081 if (cp.le != lmp_host_le_capable(hdev) || 3108 if (cp.le != lmp_host_le_capable(hdev) ||
3082 cp.simul != lmp_host_le_br_capable(hdev)) 3109 cp.simul != lmp_host_le_br_capable(hdev))
3083 hci_send_cmd(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED, 3110 hci_req_add(&req, HCI_OP_WRITE_LE_HOST_SUPPORTED,
3084 sizeof(cp), &cp); 3111 sizeof(cp), &cp);
3085 } 3112 }
3086 3113
3087 link_sec = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags); 3114 link_sec = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
3088 if (link_sec != test_bit(HCI_AUTH, &hdev->flags)) 3115 if (link_sec != test_bit(HCI_AUTH, &hdev->flags))
3089 hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE, 3116 hci_req_add(&req, HCI_OP_WRITE_AUTH_ENABLE,
3090 sizeof(link_sec), &link_sec); 3117 sizeof(link_sec), &link_sec);
3091 3118
3092 if (lmp_bredr_capable(hdev)) { 3119 if (lmp_bredr_capable(hdev)) {
3093 set_bredr_scan(hdev); 3120 set_bredr_scan(&req);
3094 update_class(hdev); 3121 update_class(&req);
3095 update_name(hdev, hdev->dev_name); 3122 update_name(&req, hdev->dev_name);
3096 update_eir(hdev); 3123 update_eir(&req);
3097 } 3124 }
3098 3125
3099 return 0; 3126 return hci_req_run(&req, NULL);
3100} 3127}
3101 3128
3102int mgmt_powered(struct hci_dev *hdev, u8 powered) 3129int mgmt_powered(struct hci_dev *hdev, u8 powered)
@@ -3561,23 +3588,25 @@ int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status)
3561 return err; 3588 return err;
3562} 3589}
3563 3590
3564static int clear_eir(struct hci_dev *hdev) 3591static void clear_eir(struct hci_request *req)
3565{ 3592{
3593 struct hci_dev *hdev = req->hdev;
3566 struct hci_cp_write_eir cp; 3594 struct hci_cp_write_eir cp;
3567 3595
3568 if (!lmp_ext_inq_capable(hdev)) 3596 if (!lmp_ext_inq_capable(hdev))
3569 return 0; 3597 return;
3570 3598
3571 memset(hdev->eir, 0, sizeof(hdev->eir)); 3599 memset(hdev->eir, 0, sizeof(hdev->eir));
3572 3600
3573 memset(&cp, 0, sizeof(cp)); 3601 memset(&cp, 0, sizeof(cp));
3574 3602
3575 return hci_send_cmd(hdev, HCI_OP_WRITE_EIR, sizeof(cp), &cp); 3603 hci_req_add(req, HCI_OP_WRITE_EIR, sizeof(cp), &cp);
3576} 3604}
3577 3605
3578int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status) 3606int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status)
3579{ 3607{
3580 struct cmd_lookup match = { NULL, hdev }; 3608 struct cmd_lookup match = { NULL, hdev };
3609 struct hci_request req;
3581 bool changed = false; 3610 bool changed = false;
3582 int err = 0; 3611 int err = 0;
3583 3612
@@ -3610,10 +3639,14 @@ int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status)
3610 if (match.sk) 3639 if (match.sk)
3611 sock_put(match.sk); 3640 sock_put(match.sk);
3612 3641
3642 hci_req_init(&req, hdev);
3643
3613 if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) 3644 if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags))
3614 update_eir(hdev); 3645 update_eir(&req);
3615 else 3646 else
3616 clear_eir(hdev); 3647 clear_eir(&req);
3648
3649 hci_req_run(&req, NULL);
3617 3650
3618 return err; 3651 return err;
3619} 3652}
@@ -3701,8 +3734,12 @@ send_event:
3701 * adapter so only update them here if this is a name change 3734 * adapter so only update them here if this is a name change
3702 * unrelated to power on. 3735 * unrelated to power on.
3703 */ 3736 */
3704 if (!test_bit(HCI_INIT, &hdev->flags)) 3737 if (!test_bit(HCI_INIT, &hdev->flags)) {
3705 update_eir(hdev); 3738 struct hci_request req;
3739 hci_req_init(&req, hdev);
3740 update_eir(&req);
3741 hci_req_run(&req, NULL);
3742 }
3706 3743
3707failed: 3744failed:
3708 if (cmd) 3745 if (cmd)