Skip to contentSkip to conversation

bt: HCI Reset returns a Cmd Complete event.

PATCH New Andrzej Zaborowski 1 participant 2 messages Jun 7, 2012

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 bt: Fix the bitmask in event masked check.

In reply to Andrzej Zaborowski
---
 hw/bt-hci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/bt-hci.c +1 -1
index 8c717f9..48cbbb5 100644
@@ -442,7 +442,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci,
     }
 
     mask_byte = (evt - 1) >> 3;
-    mask = 1 << ((evt - 1) & 3);
+    mask = 1 << ((evt - 1) & 7);
     if (mask & bt_event_reserved_mask[mask_byte] & ~hci->event_mask[mask_byte])
         return NULL;
 
Signature · 1 line
1.7.4.4
#0 lore raw

PATCH 1/1 bt: HCI Reset returns a Cmd Complete event.

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.

---
 hw/bt-hci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/bt-hci.c +2 -1
index a3a7fb4..8c717f9 100644
@@ -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):
Signature · 1 line
1.7.4.4