From 187cb9291bb514b4b713717923912a7674c8ca48 Mon Sep 17 00:00:00 2001 From: Ganesh Ganapathi Batta Date: Fri, 28 Sep 2012 12:22:31 -0700 Subject: Fix HCI Timeout issue on Mako Root cause: HCI RX path event sometimes gets received at host HCI and the num_hci_cmd_pkts counter gets updated before the TX path returned from hci_mct_send_msg function. This results in next HCI command not being sent to controller and eventually resulting in HCI command timeout Bug 7223945, 7073814, 7150111 Change-Id: Idc6ea48d316385f99f95d9d9015d41b66cded5c8 --- hci/src/hci_mct.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 hci/src/hci_mct.c diff --git a/hci/src/hci_mct.c b/hci/src/hci_mct.c old mode 100644 new mode 100755 index e5febc9..4e70063 --- a/hci/src/hci_mct.c +++ b/hci/src/hci_mct.c @@ -666,10 +666,11 @@ void hci_mct_send_msg(HC_BT_HDR *p_msg) } p = ((uint8_t *)(p_msg + 1)) + p_msg->offset; - userial_write(event, (uint8_t *) p, p_msg->len); if (event == MSG_STACK_TO_HC_HCI_CMD) { + uint8_t *p_tmp = p; + utils_lock(); num_hci_cmd_pkts--; utils_unlock(); @@ -678,10 +679,13 @@ void hci_mct_send_msg(HC_BT_HDR *p_msg) * have stored with the opcode of HCI command. * Retrieve the opcode from the Cmd packet. */ - p++; - STREAM_TO_UINT16(lay_spec, p); + p_tmp++; + STREAM_TO_UINT16(lay_spec, p_tmp); } + userial_write(event, (uint8_t *) p, p_msg->len); + + /* generate snoop trace message */ btsnoop_capture(p_msg, FALSE); -- cgit v1.1