component/bt : fix enable bug

1. enable will cause exception with list->head memory modify
2. gatt complete, timeout with HCI cmd timeout will cause exception
This commit is contained in:
Tian Hao
2016-12-14 21:45:18 +08:00
parent 5e87cdec7e
commit 69ee1de9fa
2 changed files with 5 additions and 5 deletions

View File

@@ -405,8 +405,8 @@ static void restart_comamnd_waiting_response_timer(
timeout = osi_alarm_time_diff(COMMAND_PENDING_TIMEOUT, timeout);
timeout = (timeout <= COMMAND_PENDING_TIMEOUT) ? timeout : COMMAND_PENDING_TIMEOUT;
osi_alarm_set(cmd_wait_q->command_response_timer, timeout);
cmd_wait_q->timer_is_set = true;
osi_alarm_set(cmd_wait_q->command_response_timer, timeout);
}
static void command_timed_out(void *context)
@@ -488,6 +488,8 @@ static bool filter_incoming_event(BT_HDR *packet)
return false;
intercepted:
restart_comamnd_waiting_response_timer(&hci_host_env.cmd_waiting_q, false);
/*Tell HCI Host Task to continue TX Pending commands*/
if (hci_host_env.command_credits &&
!fixed_queue_is_empty(hci_host_env.command_queue)) {
@@ -495,8 +497,6 @@ intercepted:
}
//ke_event_set(KE_EVENT_HCI_HOST_THREAD);
restart_comamnd_waiting_response_timer(&hci_host_env.cmd_waiting_q, false);
if (wait_entry) {
// If it has a callback, it's responsible for freeing the packet
if (event_code == HCI_COMMAND_STATUS_EVT ||

View File

@@ -44,7 +44,7 @@ enum {
};
#define HCI_HOST_TASK_STACK_SIZE 1500
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 3)
#define HCI_HOST_TASK_PRIO (configMAX_PRIORITIES - 2)
#define HCI_HOST_TASK_NAME "hciHostT"
#define HCI_HOST_QUEUE_NUM 40
@@ -54,7 +54,7 @@ enum {
#define HCI_H4_QUEUE_NUM 60
#define BTU_TASK_STACK_SIZE 4096
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 1)
#define BTU_TASK_PRIO (configMAX_PRIORITIES - 4)
#define BTU_TASK_NAME "btuT"
#define BTU_QUEUE_NUM 50