Skip to content

Commit d48e2bb

Browse files
lylezhu2012danieldegrasse
authored andcommitted
Bluetooth: Classic: L2CAP: Fix issue that pending chan cannot be sent
When the returned buffer is a `NULL` of the pull function, it means there is not any data needs to be sent. However maybe there is any frame pending on other L2CAP channel needs to be sent over the same ACL connection. Re-trigger the TX processor. It will call the pull function again and the pending buffer will be pulled from following L2CAP. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
1 parent d487601 commit d48e2bb

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

subsys/bluetooth/host/classic/l2cap_br.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,23 @@ struct net_buf *l2cap_br_data_pull(struct bt_conn *conn, size_t amount, size_t *
16001600

16011601
#if defined(CONFIG_BT_L2CAP_RET_FC)
16021602
if (br_chan->tx.mode != BT_L2CAP_BR_LINK_MODE_BASIC) {
1603-
return l2cap_br_ret_fc_data_pull(conn, amount, length);
1603+
struct net_buf *buf;
1604+
const sys_snode_t *next_pdu_ready;
1605+
1606+
buf = l2cap_br_ret_fc_data_pull(conn, amount, length);
1607+
1608+
/* When the returned buffer is a `NULL`, it means there is not any data needs to
1609+
* be sent. However maybe there is any frame pending on other L2CAP channel needs
1610+
* to be sent over the same ACL connection. Re-trigger the TX processor. It will
1611+
* call the function `l2cap_br_data_pull()` again and the pending buffer will be
1612+
* pulled from following L2CAP.
1613+
*/
1614+
next_pdu_ready = sys_slist_peek_head(&conn->l2cap_data_ready);
1615+
if ((buf == NULL) && (next_pdu_ready != NULL) && (next_pdu_ready != pdu_ready)) {
1616+
bt_tx_irq_raise();
1617+
}
1618+
1619+
return buf;
16041620
}
16051621
#endif /* CONFIG_BT_L2CAP_RET_FC */
16061622

0 commit comments

Comments
 (0)