summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-01-11 10:59:48 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 09:03:02 +0100
commit674eff1d2f80f4e34aef047b6e0ea44f225111f8 (patch)
treef87df9f5af8e988fca9a18289e189d3f5660afac /net
parentd0e667563b14f68beb40a3fe42bdec63d98e54fb (diff)
Bluetooth: Don't send RNR immediately when entering local busy
There is no need to send RNR immediately when entring local busy. Also upper layer might clear local busy condition before ack timer expires saving few cycles for sending RNR. This also prevents sending two RNRs in some cases where sending one would be enough i.e received N I-frame can trigger local busy (sending RNR acking up to N-1 I-frame) and later sending ack (RNR acking up to N I-frame). This was affecting TC_ERM_BV_07_C and TC_ERM_BV_22_C with some non default channel parameters (tx window and receiving buffer sizes). 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> Conflicts: net/bluetooth/l2cap_core.c Change-Id: I6f6b6f95d6bca4a5361e84e28d7c2740c5b991ae Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45123 Reviewed-by: SZYMON JANC <szymon.janc@tieto.com> Tested-by: SZYMON JANC <szymon.janc@tieto.com> Reviewed-by: QABUILD Reviewed-by: Andrzej KACZMAREK <andrzej.kaczmarek@tieto.com> Reviewed-by: Kanak GUPTA <kanak.gupta@stericsson.com> Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Anurag GUPTA-1 <anurag.gupta@stericsson.com> Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 9dab75d4fea..d0ad4325927 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3719,19 +3719,11 @@ static int l2cap_reassemble_sdu(struct l2cap_chan *chan, struct sk_buff *skb, u3
static void l2cap_ertm_enter_local_busy(struct l2cap_chan *chan)
{
- u32 control;
-
BT_DBG("chan %p, Enter local busy", chan);
set_bit(CONN_LOCAL_BUSY, &chan->conn_state);
- control = __set_reqseq(chan, chan->buffer_seq);
- control |= __set_ctrl_super(chan, L2CAP_SUPER_RNR);
- l2cap_send_sframe(chan, control);
-
- set_bit(CONN_RNR_SENT, &chan->conn_state);
-
- __clear_ack_timer(chan);
+ __set_ack_timer(chan);
}
static void l2cap_ertm_exit_local_busy(struct l2cap_chan *chan)
@@ -3871,8 +3863,11 @@ static inline int l2cap_data_channel_iframe(struct l2cap_chan *chan, u32 rx_cont
goto drop;
}
- if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state))
+ if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) {
+ if (!test_bit(CONN_RNR_SENT, &chan->conn_state))
+ l2cap_send_ack(chan);
goto drop;
+ }
if (tx_seq == chan->expected_tx_seq)
goto expected;