Commit 6e3a5981 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan Committed by Marcel Holtmann

Bluetooth: Group the ack of I-frames into l2cap_data_channel_rrframe()

It also fix a bug: we weren't acknowledging I-frames when P=1.
Note that when F=1 we are acknowledging packets before setting
RemoteBusy to False. The spec says we should do that in the opposite
order, but acknowledment of packets doesn't care about RemoteBusy flag
so we can do that in the order we want.
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: default avatarJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 99b0d4b7
...@@ -3494,7 +3494,9 @@ static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, str ...@@ -3494,7 +3494,9 @@ static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, str
static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control) static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control)
{ {
struct l2cap_pinfo *pi = l2cap_pi(sk); struct l2cap_pinfo *pi = l2cap_pi(sk);
u8 tx_seq = __get_reqseq(rx_control);
pi->expected_ack_seq = __get_reqseq(rx_control);
l2cap_drop_acked_frames(sk);
if (rx_control & L2CAP_CTRL_POLL) { if (rx_control & L2CAP_CTRL_POLL) {
l2cap_send_i_or_rr_or_rnr(sk); l2cap_send_i_or_rr_or_rnr(sk);
...@@ -3502,8 +3504,6 @@ static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control) ...@@ -3502,8 +3504,6 @@ static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control)
} else if (rx_control & L2CAP_CTRL_FINAL) { } else if (rx_control & L2CAP_CTRL_FINAL) {
pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY; pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY;
pi->expected_ack_seq = tx_seq;
l2cap_drop_acked_frames(sk);
if (pi->conn_state & L2CAP_CONN_REJ_ACT) if (pi->conn_state & L2CAP_CONN_REJ_ACT)
pi->conn_state &= ~L2CAP_CONN_REJ_ACT; pi->conn_state &= ~L2CAP_CONN_REJ_ACT;
...@@ -3514,9 +3514,6 @@ static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control) ...@@ -3514,9 +3514,6 @@ static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control)
} }
} else { } else {
pi->expected_ack_seq = tx_seq;
l2cap_drop_acked_frames(sk);
if ((pi->conn_state & L2CAP_CONN_REMOTE_BUSY) && if ((pi->conn_state & L2CAP_CONN_REMOTE_BUSY) &&
(pi->unacked_frames > 0)) (pi->unacked_frames > 0))
__mod_retrans_timer(); __mod_retrans_timer();
......
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