summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2012-09-28 12:22:31 -0700
committerMatthew Xie <mattx@google.com>2012-09-28 16:40:30 -0700
commit187cb9291bb514b4b713717923912a7674c8ca48 (patch)
treec7b6fb28121eddc3030cfc0b92a7691eec589c60
parentf8217980ebcc6a6800052d32f023ebd8f4fbf7fc (diff)
downloadexternal_bluetooth_bluedroid-187cb9291bb514b4b713717923912a7674c8ca48.zip
external_bluetooth_bluedroid-187cb9291bb514b4b713717923912a7674c8ca48.tar.gz
external_bluetooth_bluedroid-187cb9291bb514b4b713717923912a7674c8ca48.tar.bz2
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
-rwxr-xr-x[-rw-r--r--]hci/src/hci_mct.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hci/src/hci_mct.c b/hci/src/hci_mct.c
index e5febc9..4e70063 100644..100755
--- 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);