diff options
author | Mat Martineau <mathewm@codeaurora.org> | 2012-05-17 23:53:51 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:05 -0400 |
commit | 0362520bf9d35f09c2693e14352f4b0ad07397fa (patch) | |
tree | 38e56e17724f20c767866009c0d89c3639f01492 /net/bluetooth/l2cap_core.c | |
parent | 80909e04de4dbbe76a220ccd5f9b32d8d5a8c22c (diff) |
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/bluetooth/l2cap_core.c')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 3c5ae0e4c56..293b78a6c64 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) | |||
2761 | static void l2cap_ack_timeout(struct work_struct *work) | 2761 | static void l2cap_ack_timeout(struct work_struct *work) |
2762 | { | 2762 | { |
2763 | struct l2cap_chan *chan = container_of(work, struct l2cap_chan, | 2763 | struct l2cap_chan *chan = container_of(work, struct l2cap_chan, |
2764 | ack_timer.work); | 2764 | ack_timer.work); |
2765 | u16 frames_to_ack; | ||
2765 | 2766 | ||
2766 | BT_DBG("chan %p", chan); | 2767 | BT_DBG("chan %p", chan); |
2767 | 2768 | ||
2768 | l2cap_chan_lock(chan); | 2769 | l2cap_chan_lock(chan); |
2769 | 2770 | ||
2770 | l2cap_send_ack(chan); | 2771 | frames_to_ack = __seq_offset(chan, chan->buffer_seq, |
2772 | chan->last_acked_seq); | ||
2771 | 2773 | ||
2772 | l2cap_chan_unlock(chan); | 2774 | if (frames_to_ack) |
2775 | l2cap_send_rr_or_rnr(chan, 0); | ||
2773 | 2776 | ||
2777 | l2cap_chan_unlock(chan); | ||
2774 | l2cap_chan_put(chan); | 2778 | l2cap_chan_put(chan); |
2775 | } | 2779 | } |
2776 | 2780 | ||