diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:41 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:50 -0400 |
commit | 803020c6fa63aa738cfda3329c9675b42023e9d2 (patch) | |
tree | 4fbe8adc8319193624931a2710bf5e46c541852f /net/bluetooth | |
parent | 14b5aa71ec506f4e38ca6a1dc02ecd668ecfd902 (diff) |
Bluetooth: Change acknowledgement to use the value of txWindow
Now that we can set the txWindow we need to change the acknowledgement
procedure to ack after each (pi->txWindow/6 + 1). The plus 1 is to avoid
the zero value.
It also renames pi->num_to_ack to a better name: pi->num_acked.
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.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 530079649b43..0b0b237bb786 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -2254,7 +2254,7 @@ static inline void l2cap_ertm_init(struct sock *sk) | |||
2254 | l2cap_pi(sk)->expected_ack_seq = 0; | 2254 | l2cap_pi(sk)->expected_ack_seq = 0; |
2255 | l2cap_pi(sk)->unacked_frames = 0; | 2255 | l2cap_pi(sk)->unacked_frames = 0; |
2256 | l2cap_pi(sk)->buffer_seq = 0; | 2256 | l2cap_pi(sk)->buffer_seq = 0; |
2257 | l2cap_pi(sk)->num_to_ack = 0; | 2257 | l2cap_pi(sk)->num_acked = 0; |
2258 | l2cap_pi(sk)->frames_sent = 0; | 2258 | l2cap_pi(sk)->frames_sent = 0; |
2259 | 2259 | ||
2260 | setup_timer(&l2cap_pi(sk)->retrans_timer, | 2260 | setup_timer(&l2cap_pi(sk)->retrans_timer, |
@@ -3466,6 +3466,7 @@ static inline int l2cap_data_channel_iframe(struct sock *sk, u16 rx_control, str | |||
3466 | u8 tx_seq = __get_txseq(rx_control); | 3466 | u8 tx_seq = __get_txseq(rx_control); |
3467 | u8 req_seq = __get_reqseq(rx_control); | 3467 | u8 req_seq = __get_reqseq(rx_control); |
3468 | u8 sar = rx_control >> L2CAP_CTRL_SAR_SHIFT; | 3468 | u8 sar = rx_control >> L2CAP_CTRL_SAR_SHIFT; |
3469 | int num_to_ack = (pi->tx_win/6) + 1; | ||
3469 | int err = 0; | 3470 | int err = 0; |
3470 | 3471 | ||
3471 | BT_DBG("sk %p rx_control 0x%4.4x len %d", sk, rx_control, skb->len); | 3472 | BT_DBG("sk %p rx_control 0x%4.4x len %d", sk, rx_control, skb->len); |
@@ -3553,8 +3554,8 @@ expected: | |||
3553 | 3554 | ||
3554 | __mod_ack_timer(); | 3555 | __mod_ack_timer(); |
3555 | 3556 | ||
3556 | pi->num_to_ack = (pi->num_to_ack + 1) % L2CAP_DEFAULT_NUM_TO_ACK; | 3557 | pi->num_acked = (pi->num_acked + 1) % num_to_ack; |
3557 | if (pi->num_to_ack == L2CAP_DEFAULT_NUM_TO_ACK - 1) | 3558 | if (pi->num_acked == num_to_ack - 1) |
3558 | l2cap_send_ack(pi); | 3559 | l2cap_send_ack(pi); |
3559 | 3560 | ||
3560 | return 0; | 3561 | return 0; |