diff options
-rw-r--r-- | stack/l2cap/l2c_link.c | 22 | ||||
-rw-r--r-- | stack/l2cap/l2c_utils.c | 9 |
2 files changed, 20 insertions, 11 deletions
diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c index 4bb2be7..1974bb2 100644 --- a/stack/l2cap/l2c_link.c +++ b/stack/l2cap/l2c_link.c @@ -1394,19 +1394,19 @@ void l2c_link_process_num_completed_pkts (UINT8 *p) (*p_lcb->p_nocp_cb)(p_lcb->remote_bd_addr); } -#if (BLE_INCLUDED == TRUE) - if (p_lcb && p_lcb->is_ble_link) - l2cb.controller_le_xmit_window += num_sent; - else -#endif - { - - /* Maintain the total window to the controller */ - l2cb.controller_xmit_window += num_sent; - } - if (p_lcb) { +#if (BLE_INCLUDED == TRUE) + if (p_lcb->is_ble_link) + { + l2cb.controller_le_xmit_window += num_sent; + } + else +#endif + { + /* Maintain the total window to the controller */ + l2cb.controller_xmit_window += num_sent; + } /* If doing round-robin, adjust communal counts */ if (p_lcb->link_xmit_quota == 0) { diff --git a/stack/l2cap/l2c_utils.c b/stack/l2cap/l2c_utils.c index c684118..b911db2 100644 --- a/stack/l2cap/l2c_utils.c +++ b/stack/l2cap/l2c_utils.c @@ -183,6 +183,15 @@ void l2cu_release_lcb (tL2C_LCB *p_lcb) if (l2cb.num_links_active >= 1) l2cb.num_links_active--; + if (p_lcb->sent_not_acked > 0) + { + l2cb.controller_xmit_window += p_lcb->sent_not_acked; + if (l2cb.controller_xmit_window > l2cb.num_lm_acl_bufs) + { + l2cb.controller_xmit_window = l2cb.num_lm_acl_bufs; + } + } + l2c_link_adjust_allocation(); /* Check for ping outstanding */ |