mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
move flow control to btc layer
defer free slot in btc layer when receive BTA_JV_RFCOMM_CLOSE_EVT
This commit is contained in:
@@ -210,17 +210,17 @@ void port_release_port (tPORT *p_port)
|
||||
|
||||
osi_mutex_global_lock();
|
||||
RFCOMM_TRACE_DEBUG("port_release_port, p_port:%p", p_port);
|
||||
if (p_port->rx.queue) {
|
||||
if (p_port->rx.queue != NULL) {
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->rx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
osi_free(p_buf);
|
||||
}
|
||||
}
|
||||
p_port->rx.queue_size = 0;
|
||||
|
||||
if (p_port->tx.queue) {
|
||||
if (p_port->tx.queue != NULL) {
|
||||
while ((p_buf = (BT_HDR *)fixed_queue_dequeue(p_port->tx.queue, 0)) != NULL) {
|
||||
osi_free (p_buf);
|
||||
}
|
||||
osi_free(p_buf);
|
||||
}
|
||||
}
|
||||
p_port->tx.queue_size = 0;
|
||||
|
||||
@@ -514,10 +514,12 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
|
||||
&& (p_port->credit_rx_max > p_port->credit_rx)) {
|
||||
rfc_send_credit(p_port->rfc.p_mcb, p_port->dlci,
|
||||
(UINT8) (p_port->credit_rx_max - p_port->credit_rx));
|
||||
|
||||
RFCOMM_TRACE_DEBUG("send credit: max %d, rx %d, count %d", p_port->credit_rx_max, p_port->credit_rx, count);
|
||||
p_port->credit_rx = p_port->credit_rx_max;
|
||||
|
||||
p_port->rx.peer_fc = FALSE;
|
||||
} else {
|
||||
RFCOMM_TRACE_DEBUG("credit: max %d, rx %d, low %d", p_port->credit_rx_max, p_port->credit_rx, p_port->credit_rx_low);
|
||||
}
|
||||
}
|
||||
/* else want to disable flow from peer */
|
||||
|
Reference in New Issue
Block a user