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>
This commit is contained in:
committed by
Johan Hedberg
parent
0ef3ef0f67
commit
b17e73bb42
@@ -1478,7 +1478,7 @@ static int l2cap_retransmit_frames(struct l2cap_chan *chan)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void l2cap_send_ack(struct l2cap_chan *chan)
|
static void __l2cap_send_ack(struct l2cap_chan *chan)
|
||||||
{
|
{
|
||||||
u32 control = 0;
|
u32 control = 0;
|
||||||
|
|
||||||
@@ -1498,6 +1498,12 @@ static void l2cap_send_ack(struct l2cap_chan *chan)
|
|||||||
l2cap_send_sframe(chan, control);
|
l2cap_send_sframe(chan, control);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void l2cap_send_ack(struct l2cap_chan *chan)
|
||||||
|
{
|
||||||
|
__clear_ack_timer(chan);
|
||||||
|
__l2cap_send_ack(chan);
|
||||||
|
}
|
||||||
|
|
||||||
static void l2cap_send_srejtail(struct l2cap_chan *chan)
|
static void l2cap_send_srejtail(struct l2cap_chan *chan)
|
||||||
{
|
{
|
||||||
struct srej_list *tail;
|
struct srej_list *tail;
|
||||||
@@ -1988,7 +1994,7 @@ static void l2cap_ack_timeout(struct work_struct *work)
|
|||||||
BT_DBG("chan %p", chan);
|
BT_DBG("chan %p", chan);
|
||||||
|
|
||||||
lock_sock(chan->sk);
|
lock_sock(chan->sk);
|
||||||
l2cap_send_ack(chan);
|
__l2cap_send_ack(chan);
|
||||||
release_sock(chan->sk);
|
release_sock(chan->sk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user