Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291082
b: refs/heads/master
c: 75fb0e3
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg committed Mar 1, 2012
1 parent 2c61c58 commit e51901a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b90129cc5789a4c65547c91c9a7b1fd3a4d56a4
refs/heads/master: 75fb0e324daa48ec458fb5c2960eb07b80cfad9d
22 changes: 21 additions & 1 deletion trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,28 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result)
/* If this is the init phase check if the completed command matches
* the last init command, and if not just return.
*/
if (test_bit(HCI_INIT, &hdev->flags) && hdev->init_last_cmd != cmd)
if (test_bit(HCI_INIT, &hdev->flags) && hdev->init_last_cmd != cmd) {
struct hci_command_hdr *sent = (void *) hdev->sent_cmd->data;
struct sk_buff *skb;

/* Some CSR based controllers generate a spontaneous
* reset complete event during init and any pending
* command will never be completed. In such a case we
* need to resend whatever was the last sent
* command.
*/

if (cmd != HCI_OP_RESET || sent->opcode == HCI_OP_RESET)
return;

skb = skb_clone(hdev->sent_cmd, GFP_ATOMIC);
if (skb) {
skb_queue_head(&hdev->cmd_q, skb);
queue_work(hdev->workqueue, &hdev->cmd_work);
}

return;
}

if (hdev->req_status == HCI_REQ_PEND) {
hdev->req_result = result;
Expand Down

0 comments on commit e51901a

Please sign in to comment.