aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-05-01 15:15:38 -0400
committerMarcel Holtmann <marcel@holtmann.org>2010-05-10 03:28:47 -0400
commit6e3a59819fac19006fe4255b87928e5a12c54532 (patch)
tree4eafeb1717fe678feb917f85dd2ea27e338b1956 /net/bluetooth
parent99b0d4b7b09edeacf4542bced5c01239375b51a9 (diff)
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: Gustavo F. Padovan <padovan@profusion.mobi> Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 8937a842347a..d096c7c11ab5 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -3494,7 +3494,9 @@ expected:
3494static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control) 3494static inline void l2cap_data_channel_rrframe(struct sock *sk, u16 rx_control)
3495{ 3495{
3496 struct l2cap_pinfo *pi = l2cap_pi(sk); 3496 struct l2cap_pinfo *pi = l2cap_pi(sk);
3497 u8 tx_seq = __get_reqseq(rx_control); 3497
3498 pi->expected_ack_seq = __get_reqseq(rx_control);
3499 l2cap_drop_acked_frames(sk);
3498 3500
3499 if (rx_control & L2CAP_CTRL_POLL) { 3501 if (rx_control & L2CAP_CTRL_POLL) {
3500 l2cap_send_i_or_rr_or_rnr(sk); 3502 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 3504
3503 } else if (rx_control & L2CAP_CTRL_FINAL) { 3505 } else if (rx_control & L2CAP_CTRL_FINAL) {
3504 pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY; 3506 pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY;
3505 pi->expected_ack_seq = tx_seq;
3506 l2cap_drop_acked_frames(sk);
3507 3507
3508 if (pi->conn_state & L2CAP_CONN_REJ_ACT) 3508 if (pi->conn_state & L2CAP_CONN_REJ_ACT)
3509 pi->conn_state &= ~L2CAP_CONN_REJ_ACT; 3509 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 } 3514 }
3515 3515
3516 } else { 3516 } else {
3517 pi->expected_ack_seq = tx_seq;
3518 l2cap_drop_acked_frames(sk);
3519
3520 if ((pi->conn_state & L2CAP_CONN_REMOTE_BUSY) && 3517 if ((pi->conn_state & L2CAP_CONN_REMOTE_BUSY) &&
3521 (pi->unacked_frames > 0)) 3518 (pi->unacked_frames > 0))
3522 __mod_retrans_timer(); 3519 __mod_retrans_timer();