aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2013-03-27 19:04:55 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-04-04 04:12:33 -0400
commit33720450bb811a0cec1f0147bf8a1801113fa94d (patch)
tree1b7e518959f0c0cff850569c2ed40d5084535e80
parent0fc110f4e4f569e12c472f73f0af485e05631403 (diff)
Bluetooth: Fix HCI request framework
Some HCI commands don't send a Command Complete Event once the HCI command has completed so they require some special handling from the HCI request framework. These HCI commands, however, send a Command Status Event to indicate that the command has been received, and that the controller is currently performing the task for the command. So, in order to properly handle those HCI commands, the HCI request framework should consider the HCI command has completed once the Command Status Event is received. This way, we fix some issues regarding the Inquiry command support, as well as add support for all those HCI commands which would require some special handling from the HCI request framework. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_event.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 138580745c2c..8efb9c0d9b2c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -53,8 +53,6 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
53 hci_discovery_set_state(hdev, DISCOVERY_STOPPED); 53 hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
54 hci_dev_unlock(hdev); 54 hci_dev_unlock(hdev);
55 55
56 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status);
57
58 hci_conn_check_pending(hdev); 56 hci_conn_check_pending(hdev);
59} 57}
60 58
@@ -1600,8 +1598,6 @@ static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
1600 1598
1601 BT_DBG("%s status 0x%2.2x", hdev->name, status); 1599 BT_DBG("%s status 0x%2.2x", hdev->name, status);
1602 1600
1603 hci_req_cmd_complete(hdev, HCI_OP_INQUIRY, status);
1604
1605 hci_conn_check_pending(hdev); 1601 hci_conn_check_pending(hdev);
1606 1602
1607 if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) 1603 if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
@@ -2462,7 +2458,7 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
2462 if (opcode != HCI_OP_NOP) 2458 if (opcode != HCI_OP_NOP)
2463 del_timer(&hdev->cmd_timer); 2459 del_timer(&hdev->cmd_timer);
2464 2460
2465 hci_req_cmd_status(hdev, opcode, ev->status); 2461 hci_req_cmd_complete(hdev, opcode, ev->status);
2466 2462
2467 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { 2463 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
2468 atomic_set(&hdev->cmd_cnt, 1); 2464 atomic_set(&hdev->cmd_cnt, 1);