if (test_bit(CONF_NOT_COMPLETE, &chan->conf_state))
return;
- skb_queue_purge(&chan->tx_q);
+ switch(chan->mode) {
+ case L2CAP_MODE_BASIC:
+ break;
- if (chan->mode == L2CAP_MODE_ERTM) {
+ case L2CAP_MODE_ERTM:
__clear_retrans_timer(chan);
__clear_monitor_timer(chan);
__clear_ack_timer(chan);
l2cap_seq_list_free(&chan->srej_list);
l2cap_seq_list_free(&chan->retrans_list);
+
+ /* fall through */
+
+ case L2CAP_MODE_STREAMING:
+ skb_queue_purge(&chan->tx_q);
+ break;
}
+
+ return;
}
static void l2cap_chan_cleanup_listen(struct sock *parent)
return;
}
- l2cap_tx(chan, 0, 0, L2CAP_EV_MONITOR_TO);
+ l2cap_tx(chan, NULL, NULL, L2CAP_EV_MONITOR_TO);
l2cap_chan_unlock(chan);
l2cap_chan_put(chan);
return;
}
- l2cap_tx(chan, 0, 0, L2CAP_EV_RETRANS_TO);
+ l2cap_tx(chan, NULL, NULL, L2CAP_EV_RETRANS_TO);
l2cap_chan_unlock(chan);
l2cap_chan_put(chan);
}
BT_DBG("chan %p, skbs %p", chan, skbs);
- if (chan->state != BT_CONNECTED)
- return -ENOTCONN;
-
skb_queue_splice_tail_init(skbs, &chan->tx_q);
while (!skb_queue_empty(&chan->tx_q)) {
break;
if (chan->mode == L2CAP_MODE_ERTM)
- err = l2cap_tx(chan, 0, &seg_queue,
+ err = l2cap_tx(chan, NULL, &seg_queue,
L2CAP_EV_DATA_REQUEST);
else
err = l2cap_streaming_send(chan, &seg_queue);
struct l2cap_ctrl *control)
{
BT_DBG("chan %p, control %p", chan, control);
- l2cap_tx(chan, control, 0, L2CAP_EV_RECV_REQSEQ_AND_FBIT);
+ l2cap_tx(chan, control, NULL, L2CAP_EV_RECV_REQSEQ_AND_FBIT);
}
static void l2cap_pass_to_tx_fbit(struct l2cap_chan *chan,
struct l2cap_ctrl *control)
{
BT_DBG("chan %p, control %p", chan, control);
- l2cap_tx(chan, control, 0, L2CAP_EV_RECV_FBIT);
+ l2cap_tx(chan, control, NULL, L2CAP_EV_RECV_FBIT);
}
/* Copy frame to all raw sockets on that connection */
return;
event = busy ? L2CAP_EV_LOCAL_BUSY_DETECTED : L2CAP_EV_LOCAL_BUSY_CLEAR;
- l2cap_tx(chan, 0, 0, event);
+ l2cap_tx(chan, NULL, NULL, event);
}
static int l2cap_rx_queued_iframes(struct l2cap_chan *chan)