Patchwork bt: HCI Reset returns a Cmd Complete event.

login
register
mail settings
Submitter andrzej zaborowski
Date June 7, 2012, 1:43 p.m.
Message ID <1339076590-18909-1-git-send-email-balrogg@gmail.com>
Download mbox | patch
Permalink /patch/163634/
State New
Headers show

Comments

andrzej zaborowski - June 7, 2012, 1:43 p.m.
HCI Reset command returns a Command Complete event, not a Command Status
event.  We need to avoid resetting the stored last command code for the
response to be fully correct.

Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
---
 hw/bt-hci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/bt-hci.c b/hw/bt-hci.c
index a3a7fb4..8c717f9 100644
--- a/hw/bt-hci.c
+++ b/hw/bt-hci.c
@@ -1783,7 +1783,8 @@  static void bt_submit_hci(struct HCIInfo *info,
 
     case cmd_opcode_pack(OGF_HOST_CTL, OCF_RESET):
         bt_hci_reset(hci);
-        bt_hci_event_status(hci, HCI_SUCCESS);
+        hci->last_cmd = cpu_to_le16(cmd);
+        bt_hci_event_complete_status(hci, HCI_SUCCESS);
         break;
 
     case cmd_opcode_pack(OGF_HOST_CTL, OCF_SET_EVENT_FLT):