diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2012-01-11 04:59:46 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:25 -0500 |
commit | 0ef3ef0f676e3c7aaab4a936635f503770fd38b2 (patch) | |
tree | e591de219bed8957eeb0a4dfafd0ee211370f42d /net/bluetooth/l2cap_core.c | |
parent | 75b93b59ad625d734b1c7d7e05bf6b9898c8c28f (diff) |
Bluetooth: Set P-bit for SREJ frame only if there are I-frames to ack
SREJ frame with P-bit set acknowledges I-frames numbered up to
(ReqSeq - 1). With this patch P-bit in SREJ is set only when there are
some I-frames to ack.
This fixes ambiguous situation when lost of I-frame with TxSeq=0 would
result in sending SREJ acking all previous I-frames.
Consider following scenario:
TxWindow=3
HostA: sent I-frame TxSeq=0
HostA: sent I-frame TxSeq=1
HostA: sent I-frame TxSeq=2
HostB: missed I-frame TxSeq=0
HostB: received I-frame TxSeq=1
HostB: sent SREJ ReqSeq=0 Pbit=1
HostA: received SREJ ReqSeq=0 Pbit=1 <- All I-frames acked or not?
...
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index dcccae04ae08..0d5bb45e7be7 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -3927,15 +3927,15 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u32 rx_cont | |||
3927 | __skb_queue_head_init(&chan->srej_q); | 3927 | __skb_queue_head_init(&chan->srej_q); |
3928 | l2cap_add_to_srej_queue(chan, skb, tx_seq, sar); | 3928 | l2cap_add_to_srej_queue(chan, skb, tx_seq, sar); |
3929 | 3929 | ||
3930 | set_bit(CONN_SEND_PBIT, &chan->conn_state); | 3930 | /* Set P-bit only if there are some I-frames to ack. */ |
3931 | if (__clear_ack_timer(chan)) | ||
3932 | set_bit(CONN_SEND_PBIT, &chan->conn_state); | ||
3931 | 3933 | ||
3932 | err = l2cap_send_srejframe(chan, tx_seq); | 3934 | err = l2cap_send_srejframe(chan, tx_seq); |
3933 | if (err < 0) { | 3935 | if (err < 0) { |
3934 | l2cap_send_disconn_req(chan->conn, chan, -err); | 3936 | l2cap_send_disconn_req(chan->conn, chan, -err); |
3935 | return err; | 3937 | return err; |
3936 | } | 3938 | } |
3937 | |||
3938 | __clear_ack_timer(chan); | ||
3939 | } | 3939 | } |
3940 | return 0; | 3940 | return 0; |
3941 | 3941 | ||