summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMat Martineau2012-05-18 05:53:51 +0200
committerJohan Hedberg2012-06-05 05:34:05 +0200
commit0362520bf9d35f09c2693e14352f4b0ad07397fa (patch)
tree38e56e17724f20c767866009c0d89c3639f01492 /net
parentBluetooth: Use the ERTM transmit state machine from timeout handlers (diff)
downloadkernel-qcow2-linux-0362520bf9d35f09c2693e14352f4b0ad07397fa.tar.gz
kernel-qcow2-linux-0362520bf9d35f09c2693e14352f4b0ad07397fa.tar.xz
kernel-qcow2-linux-0362520bf9d35f09c2693e14352f4b0ad07397fa.zip
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: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3c5ae0e4c569..293b78a6c644 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -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)
{
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);
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);
}