aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-03-05 13:37:49 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-03-08 08:40:27 -0500
commit42c6b129cd8c2aa5012a78ec39672e7052cc677a (patch)
tree9deac79fe2bac41bf7695c0be6ec151f2afc55eb /net/bluetooth/hci_event.c
parent9238f36a5a5097018b90baa42c473d2f916a46f5 (diff)
Bluetooth: Use async requests internally in hci_req_sync
This patch converts the hci_req_sync() procedure to internaly use the asynchronous HCI requests. The hci_req_sync mechanism relies on hci_req_complete() calls from hci_event.c into hci_core.c whenever a HCI command completes. This is very similar to what asynchronous requests do and makes the conversion fairly straight forward by converting hci_req_complete into a request complete callback. By this change hci_req_complete (renamed to hci_req_sync_complete) becomes private to hci_core.c and all calls to it can be removed from hci_event.c. The commands in each hci_req_sync procedure are collected into their own request by passing the hci_request pointer to the request callback (instead of the hci_dev pointer). The one slight exception is the HCI init request which has the special handling of HCI driver specific initialization commands. These commands are run in their own request prior to the "main" init request. One other extra change that this patch must contain is the handling of spontaneous HCI reset complete events that some controllers exhibit. These were previously handled in the hci_req_complete function but the right place for them now becomes the hci_req_cmd_complete function. 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/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c78
1 files changed, 4 insertions, 74 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8b878a3bdf69..0dd85a0c05f4 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -54,7 +54,6 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
54 hci_dev_unlock(hdev); 54 hci_dev_unlock(hdev);
55 55
56 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status); 56 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status);
57 hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status);
58 57
59 hci_conn_check_pending(hdev); 58 hci_conn_check_pending(hdev);
60} 59}
@@ -184,8 +183,6 @@ static void hci_cc_write_def_link_policy(struct hci_dev *hdev,
184 183
185 if (!status) 184 if (!status)
186 hdev->link_policy = get_unaligned_le16(sent); 185 hdev->link_policy = get_unaligned_le16(sent);
187
188 hci_req_complete(hdev, HCI_OP_WRITE_DEF_LINK_POLICY, status);
189} 186}
190 187
191static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) 188static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
@@ -196,8 +193,6 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
196 193
197 clear_bit(HCI_RESET, &hdev->flags); 194 clear_bit(HCI_RESET, &hdev->flags);
198 195
199 hci_req_complete(hdev, HCI_OP_RESET, status);
200
201 /* Reset all non-persistent flags */ 196 /* Reset all non-persistent flags */
202 hdev->dev_flags &= ~(BIT(HCI_LE_SCAN) | BIT(HCI_PENDING_CLASS) | 197 hdev->dev_flags &= ~(BIT(HCI_LE_SCAN) | BIT(HCI_PENDING_CLASS) |
203 BIT(HCI_PERIODIC_INQ)); 198 BIT(HCI_PERIODIC_INQ));
@@ -232,8 +227,6 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
232 227
233 if (!status && !test_bit(HCI_INIT, &hdev->flags)) 228 if (!status && !test_bit(HCI_INIT, &hdev->flags))
234 hci_update_ad(hdev); 229 hci_update_ad(hdev);
235
236 hci_req_complete(hdev, HCI_OP_WRITE_LOCAL_NAME, status);
237} 230}
238 231
239static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb) 232static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
@@ -271,8 +264,6 @@ static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb)
271 264
272 if (test_bit(HCI_MGMT, &hdev->dev_flags)) 265 if (test_bit(HCI_MGMT, &hdev->dev_flags))
273 mgmt_auth_enable_complete(hdev, status); 266 mgmt_auth_enable_complete(hdev, status);
274
275 hci_req_complete(hdev, HCI_OP_WRITE_AUTH_ENABLE, status);
276} 267}
277 268
278static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb) 269static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb)
@@ -294,8 +285,6 @@ static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb)
294 else 285 else
295 clear_bit(HCI_ENCRYPT, &hdev->flags); 286 clear_bit(HCI_ENCRYPT, &hdev->flags);
296 } 287 }
297
298 hci_req_complete(hdev, HCI_OP_WRITE_ENCRYPT_MODE, status);
299} 288}
300 289
301static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb) 290static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb)
@@ -344,7 +333,6 @@ static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb)
344 333
345done: 334done:
346 hci_dev_unlock(hdev); 335 hci_dev_unlock(hdev);
347 hci_req_complete(hdev, HCI_OP_WRITE_SCAN_ENABLE, status);
348} 336}
349 337
350static void hci_cc_read_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) 338static void hci_cc_read_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb)
@@ -441,8 +429,6 @@ static void hci_cc_host_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
441 __u8 status = *((__u8 *) skb->data); 429 __u8 status = *((__u8 *) skb->data);
442 430
443 BT_DBG("%s status 0x%2.2x", hdev->name, status); 431 BT_DBG("%s status 0x%2.2x", hdev->name, status);
444
445 hci_req_complete(hdev, HCI_OP_HOST_BUFFER_SIZE, status);
446} 432}
447 433
448static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) 434static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
@@ -480,7 +466,7 @@ static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb)
480 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); 466 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
481 467
482 if (rp->status) 468 if (rp->status)
483 goto done; 469 return;
484 470
485 hdev->hci_ver = rp->hci_ver; 471 hdev->hci_ver = rp->hci_ver;
486 hdev->hci_rev = __le16_to_cpu(rp->hci_rev); 472 hdev->hci_rev = __le16_to_cpu(rp->hci_rev);
@@ -490,9 +476,6 @@ static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb)
490 476
491 BT_DBG("%s manufacturer 0x%4.4x hci ver %d:%d", hdev->name, 477 BT_DBG("%s manufacturer 0x%4.4x hci ver %d:%d", hdev->name,
492 hdev->manufacturer, hdev->hci_ver, hdev->hci_rev); 478 hdev->manufacturer, hdev->hci_ver, hdev->hci_rev);
493
494done:
495 hci_req_complete(hdev, HCI_OP_READ_LOCAL_VERSION, rp->status);
496} 479}
497 480
498static void hci_cc_read_local_commands(struct hci_dev *hdev, 481static void hci_cc_read_local_commands(struct hci_dev *hdev,
@@ -504,8 +487,6 @@ static void hci_cc_read_local_commands(struct hci_dev *hdev,
504 487
505 if (!rp->status) 488 if (!rp->status)
506 memcpy(hdev->commands, rp->commands, sizeof(hdev->commands)); 489 memcpy(hdev->commands, rp->commands, sizeof(hdev->commands));
507
508 hci_req_complete(hdev, HCI_OP_READ_LOCAL_COMMANDS, rp->status);
509} 490}
510 491
511static void hci_cc_read_local_features(struct hci_dev *hdev, 492static void hci_cc_read_local_features(struct hci_dev *hdev,
@@ -572,7 +553,7 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
572 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); 553 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
573 554
574 if (rp->status) 555 if (rp->status)
575 goto done; 556 return;
576 557
577 switch (rp->page) { 558 switch (rp->page) {
578 case 0: 559 case 0:
@@ -582,9 +563,6 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
582 memcpy(hdev->host_features, rp->features, 8); 563 memcpy(hdev->host_features, rp->features, 8);
583 break; 564 break;
584 } 565 }
585
586done:
587 hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
588} 566}
589 567
590static void hci_cc_read_flow_control_mode(struct hci_dev *hdev, 568static void hci_cc_read_flow_control_mode(struct hci_dev *hdev,
@@ -594,12 +572,8 @@ static void hci_cc_read_flow_control_mode(struct hci_dev *hdev,
594 572
595 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); 573 BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
596 574
597 if (rp->status) 575 if (!rp->status)
598 return; 576 hdev->flow_ctl_mode = rp->mode;
599
600 hdev->flow_ctl_mode = rp->mode;
601
602 hci_req_complete(hdev, HCI_OP_READ_FLOW_CONTROL_MODE, rp->status);
603} 577}
604 578
605static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb) 579static void hci_cc_read_buffer_size(struct hci_dev *hdev, struct sk_buff *skb)
@@ -636,8 +610,6 @@ static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb)
636 610
637 if (!rp->status) 611 if (!rp->status)
638 bacpy(&hdev->bdaddr, &rp->bdaddr); 612 bacpy(&hdev->bdaddr, &rp->bdaddr);
639
640 hci_req_complete(hdev, HCI_OP_READ_BD_ADDR, rp->status);
641} 613}
642 614
643static void hci_cc_read_data_block_size(struct hci_dev *hdev, 615static void hci_cc_read_data_block_size(struct hci_dev *hdev,
@@ -658,8 +630,6 @@ static void hci_cc_read_data_block_size(struct hci_dev *hdev,
658 630
659 BT_DBG("%s blk mtu %d cnt %d len %d", hdev->name, hdev->block_mtu, 631 BT_DBG("%s blk mtu %d cnt %d len %d", hdev->name, hdev->block_mtu,
660 hdev->block_cnt, hdev->block_len); 632 hdev->block_cnt, hdev->block_len);
661
662 hci_req_complete(hdev, HCI_OP_READ_DATA_BLOCK_SIZE, rp->status);
663} 633}
664 634
665static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb) 635static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb)
@@ -667,8 +637,6 @@ static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb)
667 __u8 status = *((__u8 *) skb->data); 637 __u8 status = *((__u8 *) skb->data);
668 638
669 BT_DBG("%s status 0x%2.2x", hdev->name, status); 639 BT_DBG("%s status 0x%2.2x", hdev->name, status);
670
671 hci_req_complete(hdev, HCI_OP_WRITE_CA_TIMEOUT, status);
672} 640}
673 641
674static void hci_cc_read_local_amp_info(struct hci_dev *hdev, 642static void hci_cc_read_local_amp_info(struct hci_dev *hdev,
@@ -692,8 +660,6 @@ static void hci_cc_read_local_amp_info(struct hci_dev *hdev,
692 hdev->amp_be_flush_to = __le32_to_cpu(rp->be_flush_to); 660 hdev->amp_be_flush_to = __le32_to_cpu(rp->be_flush_to);
693 hdev->amp_max_flush_to = __le32_to_cpu(rp->max_flush_to); 661 hdev->amp_max_flush_to = __le32_to_cpu(rp->max_flush_to);
694 662
695 hci_req_complete(hdev, HCI_OP_READ_LOCAL_AMP_INFO, rp->status);
696
697a2mp_rsp: 663a2mp_rsp:
698 a2mp_send_getinfo_rsp(hdev); 664 a2mp_send_getinfo_rsp(hdev);
699} 665}
@@ -741,8 +707,6 @@ static void hci_cc_delete_stored_link_key(struct hci_dev *hdev,
741 __u8 status = *((__u8 *) skb->data); 707 __u8 status = *((__u8 *) skb->data);
742 708
743 BT_DBG("%s status 0x%2.2x", hdev->name, status); 709 BT_DBG("%s status 0x%2.2x", hdev->name, status);
744
745 hci_req_complete(hdev, HCI_OP_DELETE_STORED_LINK_KEY, status);
746} 710}
747 711
748static void hci_cc_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb) 712static void hci_cc_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb)
@@ -750,8 +714,6 @@ static void hci_cc_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb)
750 __u8 status = *((__u8 *) skb->data); 714 __u8 status = *((__u8 *) skb->data);
751 715
752 BT_DBG("%s status 0x%2.2x", hdev->name, status); 716 BT_DBG("%s status 0x%2.2x", hdev->name, status);
753
754 hci_req_complete(hdev, HCI_OP_SET_EVENT_MASK, status);
755} 717}
756 718
757static void hci_cc_write_inquiry_mode(struct hci_dev *hdev, 719static void hci_cc_write_inquiry_mode(struct hci_dev *hdev,
@@ -760,8 +722,6 @@ static void hci_cc_write_inquiry_mode(struct hci_dev *hdev,
760 __u8 status = *((__u8 *) skb->data); 722 __u8 status = *((__u8 *) skb->data);
761 723
762 BT_DBG("%s status 0x%2.2x", hdev->name, status); 724 BT_DBG("%s status 0x%2.2x", hdev->name, status);
763
764 hci_req_complete(hdev, HCI_OP_WRITE_INQUIRY_MODE, status);
765} 725}
766 726
767static void hci_cc_read_inq_rsp_tx_power(struct hci_dev *hdev, 727static void hci_cc_read_inq_rsp_tx_power(struct hci_dev *hdev,
@@ -773,8 +733,6 @@ static void hci_cc_read_inq_rsp_tx_power(struct hci_dev *hdev,
773 733
774 if (!rp->status) 734 if (!rp->status)
775 hdev->inq_tx_power = rp->tx_power; 735 hdev->inq_tx_power = rp->tx_power;
776
777 hci_req_complete(hdev, HCI_OP_READ_INQ_RSP_TX_POWER, rp->status);
778} 736}
779 737
780static void hci_cc_set_event_flt(struct hci_dev *hdev, struct sk_buff *skb) 738static void hci_cc_set_event_flt(struct hci_dev *hdev, struct sk_buff *skb)
@@ -782,8 +740,6 @@ static void hci_cc_set_event_flt(struct hci_dev *hdev, struct sk_buff *skb)
782 __u8 status = *((__u8 *) skb->data); 740 __u8 status = *((__u8 *) skb->data);
783 741
784 BT_DBG("%s status 0x%2.2x", hdev->name, status); 742 BT_DBG("%s status 0x%2.2x", hdev->name, status);
785
786 hci_req_complete(hdev, HCI_OP_SET_EVENT_FLT, status);
787} 743}
788 744
789static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb) 745static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb)
@@ -845,8 +801,6 @@ static void hci_cc_le_read_buffer_size(struct hci_dev *hdev,
845 hdev->le_cnt = hdev->le_pkts; 801 hdev->le_cnt = hdev->le_pkts;
846 802
847 BT_DBG("%s le mtu %d:%d", hdev->name, hdev->le_mtu, hdev->le_pkts); 803 BT_DBG("%s le mtu %d:%d", hdev->name, hdev->le_mtu, hdev->le_pkts);
848
849 hci_req_complete(hdev, HCI_OP_LE_READ_BUFFER_SIZE, rp->status);
850} 804}
851 805
852static void hci_cc_le_read_local_features(struct hci_dev *hdev, 806static void hci_cc_le_read_local_features(struct hci_dev *hdev,
@@ -858,8 +812,6 @@ static void hci_cc_le_read_local_features(struct hci_dev *hdev,
858 812
859 if (!rp->status) 813 if (!rp->status)
860 memcpy(hdev->le_features, rp->features, 8); 814 memcpy(hdev->le_features, rp->features, 8);
861
862 hci_req_complete(hdev, HCI_OP_LE_READ_LOCAL_FEATURES, rp->status);
863} 815}
864 816
865static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev, 817static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev,
@@ -874,8 +826,6 @@ static void hci_cc_le_read_adv_tx_power(struct hci_dev *hdev,
874 if (!test_bit(HCI_INIT, &hdev->flags)) 826 if (!test_bit(HCI_INIT, &hdev->flags))
875 hci_update_ad(hdev); 827 hci_update_ad(hdev);
876 } 828 }
877
878 hci_req_complete(hdev, HCI_OP_LE_READ_ADV_TX_POWER, rp->status);
879} 829}
880 830
881static void hci_cc_le_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb) 831static void hci_cc_le_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb)
@@ -883,8 +833,6 @@ static void hci_cc_le_set_event_mask(struct hci_dev *hdev, struct sk_buff *skb)
883 __u8 status = *((__u8 *) skb->data); 833 __u8 status = *((__u8 *) skb->data);
884 834
885 BT_DBG("%s status 0x%2.2x", hdev->name, status); 835 BT_DBG("%s status 0x%2.2x", hdev->name, status);
886
887 hci_req_complete(hdev, HCI_OP_LE_SET_EVENT_MASK, status);
888} 836}
889 837
890static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb) 838static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb)
@@ -985,8 +933,6 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb)
985 933
986 if (!test_bit(HCI_INIT, &hdev->flags)) 934 if (!test_bit(HCI_INIT, &hdev->flags))
987 hci_update_ad(hdev); 935 hci_update_ad(hdev);
988
989 hci_req_complete(hdev, HCI_OP_LE_SET_ADV_ENABLE, status);
990} 936}
991 937
992static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb) 938static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb)
@@ -995,8 +941,6 @@ static void hci_cc_le_set_scan_param(struct hci_dev *hdev, struct sk_buff *skb)
995 941
996 BT_DBG("%s status 0x%2.2x", hdev->name, status); 942 BT_DBG("%s status 0x%2.2x", hdev->name, status);
997 943
998 hci_req_complete(hdev, HCI_OP_LE_SET_SCAN_PARAM, status);
999
1000 if (status) { 944 if (status) {
1001 hci_dev_lock(hdev); 945 hci_dev_lock(hdev);
1002 mgmt_start_discovery_failed(hdev, status); 946 mgmt_start_discovery_failed(hdev, status);
@@ -1019,8 +963,6 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev,
1019 963
1020 switch (cp->enable) { 964 switch (cp->enable) {
1021 case LE_SCANNING_ENABLED: 965 case LE_SCANNING_ENABLED:
1022 hci_req_complete(hdev, HCI_OP_LE_SET_SCAN_ENABLE, status);
1023
1024 if (status) { 966 if (status) {
1025 hci_dev_lock(hdev); 967 hci_dev_lock(hdev);
1026 mgmt_start_discovery_failed(hdev, status); 968 mgmt_start_discovery_failed(hdev, status);
@@ -1071,8 +1013,6 @@ static void hci_cc_le_read_white_list_size(struct hci_dev *hdev,
1071 1013
1072 if (!rp->status) 1014 if (!rp->status)
1073 hdev->le_white_list_size = rp->size; 1015 hdev->le_white_list_size = rp->size;
1074
1075 hci_req_complete(hdev, HCI_OP_LE_READ_WHITE_LIST_SIZE, rp->status);
1076} 1016}
1077 1017
1078static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb) 1018static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb)
@@ -1083,8 +1023,6 @@ static void hci_cc_le_ltk_reply(struct hci_dev *hdev, struct sk_buff *skb)
1083 1023
1084 if (rp->status) 1024 if (rp->status)
1085 return; 1025 return;
1086
1087 hci_req_complete(hdev, HCI_OP_LE_LTK_REPLY, rp->status);
1088} 1026}
1089 1027
1090static void hci_cc_le_ltk_neg_reply(struct hci_dev *hdev, struct sk_buff *skb) 1028static void hci_cc_le_ltk_neg_reply(struct hci_dev *hdev, struct sk_buff *skb)
@@ -1095,8 +1033,6 @@ static void hci_cc_le_ltk_neg_reply(struct hci_dev *hdev, struct sk_buff *skb)
1095 1033
1096 if (rp->status) 1034 if (rp->status)
1097 return; 1035 return;
1098
1099 hci_req_complete(hdev, HCI_OP_LE_LTK_NEG_REPLY, rp->status);
1100} 1036}
1101 1037
1102static void hci_cc_le_read_supported_states(struct hci_dev *hdev, 1038static void hci_cc_le_read_supported_states(struct hci_dev *hdev,
@@ -1108,8 +1044,6 @@ static void hci_cc_le_read_supported_states(struct hci_dev *hdev,
1108 1044
1109 if (!rp->status) 1045 if (!rp->status)
1110 memcpy(hdev->le_states, rp->le_states, 8); 1046 memcpy(hdev->le_states, rp->le_states, 8);
1111
1112 hci_req_complete(hdev, HCI_OP_LE_READ_SUPPORTED_STATES, rp->status);
1113} 1047}
1114 1048
1115static void hci_cc_write_le_host_supported(struct hci_dev *hdev, 1049static void hci_cc_write_le_host_supported(struct hci_dev *hdev,
@@ -1139,8 +1073,6 @@ static void hci_cc_write_le_host_supported(struct hci_dev *hdev,
1139 if (test_bit(HCI_MGMT, &hdev->dev_flags) && 1073 if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
1140 !test_bit(HCI_INIT, &hdev->flags)) 1074 !test_bit(HCI_INIT, &hdev->flags))
1141 mgmt_le_enable_complete(hdev, sent->le, status); 1075 mgmt_le_enable_complete(hdev, sent->le, status);
1142
1143 hci_req_complete(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED, status);
1144} 1076}
1145 1077
1146static void hci_cc_write_remote_amp_assoc(struct hci_dev *hdev, 1078static void hci_cc_write_remote_amp_assoc(struct hci_dev *hdev,
@@ -1162,7 +1094,6 @@ static void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
1162 BT_DBG("%s status 0x%2.2x", hdev->name, status); 1094 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1163 1095
1164 if (status) { 1096 if (status) {
1165 hci_req_complete(hdev, HCI_OP_INQUIRY, status);
1166 hci_conn_check_pending(hdev); 1097 hci_conn_check_pending(hdev);
1167 hci_dev_lock(hdev); 1098 hci_dev_lock(hdev);
1168 if (test_bit(HCI_MGMT, &hdev->dev_flags)) 1099 if (test_bit(HCI_MGMT, &hdev->dev_flags))
@@ -1694,7 +1625,6 @@ static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
1694 BT_DBG("%s status 0x%2.2x", hdev->name, status); 1625 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1695 1626
1696 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status); 1627 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status);
1697 hci_req_complete(hdev, HCI_OP_INQUIRY, status);
1698 1628
1699 hci_conn_check_pending(hdev); 1629 hci_conn_check_pending(hdev);
1700 1630