Commit 0362520b authored by Mat Martineau's avatar Mat Martineau Committed by Johan Hedberg

Bluetooth: Simplify the ERTM ack timeout

Since l2cap_send_ack can trigger extra actions like sending iframes,
don't call it.  Just send an RR or RNR frame if an ack needs sending.
Signed-off-by: default avatarMat Martineau <mathewm@codeaurora.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent 80909e04
...@@ -2761,16 +2761,20 @@ static void l2cap_add_opt_efs(void **ptr, struct l2cap_chan *chan) ...@@ -2761,16 +2761,20 @@ static void l2cap_add_opt_efs(void **ptr, struct l2cap_chan *chan)
static void l2cap_ack_timeout(struct work_struct *work) static void l2cap_ack_timeout(struct work_struct *work)
{ {
struct l2cap_chan *chan = container_of(work, struct l2cap_chan, struct l2cap_chan *chan = container_of(work, struct l2cap_chan,
ack_timer.work); ack_timer.work);
u16 frames_to_ack;
BT_DBG("chan %p", chan); BT_DBG("chan %p", chan);
l2cap_chan_lock(chan); l2cap_chan_lock(chan);
l2cap_send_ack(chan); frames_to_ack = __seq_offset(chan, chan->buffer_seq,
chan->last_acked_seq);
l2cap_chan_unlock(chan); if (frames_to_ack)
l2cap_send_rr_or_rnr(chan, 0);
l2cap_chan_unlock(chan);
l2cap_chan_put(chan); l2cap_chan_put(chan);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment