Bluetooth: L2CAP: Document cases where -EAGAIN is returned

This documents the special cases where -EAGAIN is returned which leads
the buffer to be queued.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2019-12-03 16:22:41 +02:00 committed by Johan Hedberg
parent b8911a8d35
commit 1a7f85cb53

View file

@ -1255,6 +1255,16 @@ static void l2cap_chan_seg_sent(struct bt_conn *conn, void *user_data)
l2cap_chan_tx_resume(BT_L2CAP_LE_CHAN(chan));
}
/* This returns -EAGAIN whenever a segment cannot be send immediately which can
* happen under the following circuntances:
*
* 1. There are no credits
* 2. There are no buffers
* 3. There are no TX contexts
*
* In all cases the original buffer is unaffected so it can be pushed back to
* be sent later.
*/
static int l2cap_chan_le_send(struct bt_l2cap_le_chan *ch,
struct net_buf *buf, u16_t sdu_hdr_len)
{