mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(ble/bluedroid): allow osi_event re-post during POSTING window
Do not reject osi_thread_post_event() when only POSTING is set. QUEUED already prevents double-queueing; rejecting POSTING caused HCI downstream lost wakeup. Add generic osi_event and hci downstream diagnostics for post failures.
This commit is contained in:
@@ -155,11 +155,21 @@ void hci_shut_down(void)
|
||||
|
||||
bool hci_downstream_data_post(uint32_t timeout)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
if (hci_host_env.downstream_data_ready == NULL) {
|
||||
HCI_TRACE_WARNING("%s downstream_data_ready event not created", __func__);
|
||||
return false;
|
||||
}
|
||||
return osi_thread_post_event(hci_host_env.downstream_data_ready, timeout);
|
||||
|
||||
ret = osi_thread_post_event(hci_host_env.downstream_data_ready, timeout);
|
||||
if (!ret) {
|
||||
HCI_TRACE_DEBUG("%s post fail credits=%d cmdq=%u pktq=%u",
|
||||
__func__, hci_host_env.command_credits,
|
||||
(unsigned)fixed_pkt_queue_length(hci_host_env.command_queue),
|
||||
(unsigned)fixed_queue_length(hci_host_env.packet_queue));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hci_layer_init_env(void)
|
||||
@@ -249,6 +259,8 @@ static void hci_downstream_data_handler(void *arg)
|
||||
* All packets will be directly copied to single queue in driver layer with
|
||||
* H4 type header added (1 byte).
|
||||
*/
|
||||
UNUSED(arg);
|
||||
|
||||
while (hci_host_check_send_available()) {
|
||||
/*Now Target only allowed one packet per TX*/
|
||||
BT_HDR *pkt = packet_fragmenter->fragment_current_packet();
|
||||
@@ -264,6 +276,11 @@ static void hci_downstream_data_handler(void *arg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
HCI_TRACE_DEBUG("%s done credits=%d cmdq=%u pktq=%u",
|
||||
__func__, hci_host_env.command_credits,
|
||||
(unsigned)fixed_pkt_queue_length(hci_host_env.command_queue),
|
||||
(unsigned)fixed_queue_length(hci_host_env.packet_queue));
|
||||
}
|
||||
|
||||
static void transmit_command(
|
||||
|
||||
Reference in New Issue
Block a user