aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-01-11 04:59:47 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:26 -0500
commitb17e73bb4269f47e1ea2d64a834f1cfc8644fabb (patch)
treebb2a6d051d7df87a5e6fd5cc80378af8cbf41ddc /net/bluetooth/l2cap_core.c
parent0ef3ef0f676e3c7aaab4a936635f503770fd38b2 (diff)
Bluetooth: Clear ack_timer when sending ack
ack_timer should be cleared when sending ACK to avoid acking I-frames twice. This commit introduces helper function (only send ack, not clearing timer) which is used by l2cap_send_ack and l2cap_ack_timeout. This is to avoid clearing ack timer in timer function. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 0d5bb45e7be7..3b9e2813f1fc 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1478,7 +1478,7 @@ static int l2cap_retransmit_frames(struct l2cap_chan *chan)
1478 return ret; 1478 return ret;
1479} 1479}
1480 1480
1481static void l2cap_send_ack(struct l2cap_chan *chan) 1481static void __l2cap_send_ack(struct l2cap_chan *chan)
1482{ 1482{
1483 u32 control = 0; 1483 u32 control = 0;
1484 1484
@@ -1498,6 +1498,12 @@ static void l2cap_send_ack(struct l2cap_chan *chan)
1498 l2cap_send_sframe(chan, control); 1498 l2cap_send_sframe(chan, control);
1499} 1499}
1500 1500
1501static void l2cap_send_ack(struct l2cap_chan *chan)
1502{
1503 __clear_ack_timer(chan);
1504 __l2cap_send_ack(chan);
1505}
1506
1501static void l2cap_send_srejtail(struct l2cap_chan *chan) 1507static void l2cap_send_srejtail(struct l2cap_chan *chan)
1502{ 1508{
1503 struct srej_list *tail; 1509 struct srej_list *tail;
@@ -1988,7 +1994,7 @@ static void l2cap_ack_timeout(struct work_struct *work)
1988 BT_DBG("chan %p", chan); 1994 BT_DBG("chan %p", chan);
1989 1995
1990 lock_sock(chan->sk); 1996 lock_sock(chan->sk);
1991 l2cap_send_ack(chan); 1997 __l2cap_send_ack(chan);
1992 release_sock(chan->sk); 1998 release_sock(chan->sk);
1993} 1999}
1994 2000