Skip to content

Commit b99e13a

Browse files
Mat MartineauGustavo Padovan
authored andcommitted
Bluetooth: Do not send data during channel move
Outgoing ERTM data is queued during a channel move. The ERTM state machine is partially reset at the start of a move, and must be resynchronized with the remote state machine at the end of the move. Data is not sent so that there are no state transitions between the partial reset and the resync. Streaming mode frames are dropped during a move. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
1 parent d5f8a75 commit b99e13a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎net/bluetooth/l2cap_core.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,9 @@ static void l2cap_send_sframe(struct l2cap_chan *chan,
947947
if (!control->sframe)
948948
return;
949949

950+
if (__chan_is_moving(chan))
951+
return;
952+
950953
if (test_and_clear_bit(CONN_SEND_FBIT, &chan->conn_state) &&
951954
!control->poll)
952955
control->final = 1;
@@ -1811,6 +1814,9 @@ static void l2cap_streaming_send(struct l2cap_chan *chan,
18111814

18121815
BT_DBG("chan %p, skbs %p", chan, skbs);
18131816

1817+
if (__chan_is_moving(chan))
1818+
return;
1819+
18141820
skb_queue_splice_tail_init(skbs, &chan->tx_q);
18151821

18161822
while (!skb_queue_empty(&chan->tx_q)) {
@@ -1853,6 +1859,9 @@ static int l2cap_ertm_send(struct l2cap_chan *chan)
18531859
if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state))
18541860
return 0;
18551861

1862+
if (__chan_is_moving(chan))
1863+
return 0;
1864+
18561865
while (chan->tx_send_head &&
18571866
chan->unacked_frames < chan->remote_tx_win &&
18581867
chan->tx_state == L2CAP_TX_STATE_XMIT) {
@@ -1918,6 +1927,9 @@ static void l2cap_ertm_resend(struct l2cap_chan *chan)
19181927
if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state))
19191928
return;
19201929

1930+
if (__chan_is_moving(chan))
1931+
return;
1932+
19211933
while (chan->retrans_list.head != L2CAP_SEQ_LIST_CLEAR) {
19221934
seq = l2cap_seq_list_pop(&chan->retrans_list);
19231935

0 commit comments

Comments
 (0)