aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMat Martineau <mathewm@codeaurora.org>2012-05-17 23:53:45 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-04 23:34:04 -0400
commit63838725c6478102894cfb88feb2a9b1c331855d (patch)
treea7cde0b9217c7da75d38155490c87a3ddf5447ef
parentbed68bde7ebdb591cc67921261307626c8f37936 (diff)
Bluetooth: Reassemble all available data when retransmissions succeed.
As retransmitted packets arrive, attempt to reassemble SDUs. If all requested retransmissions have been received, acknowledge them and transition back to the RECV state. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r--net/bluetooth/l2cap_core.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 5823697cf9de..fd324d4cb217 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4504,8 +4504,36 @@ void l2cap_chan_busy(struct l2cap_chan *chan, int busy)
4504 4504
4505static int l2cap_rx_queued_iframes(struct l2cap_chan *chan) 4505static int l2cap_rx_queued_iframes(struct l2cap_chan *chan)
4506{ 4506{
4507 /* Placeholder */ 4507 int err = 0;
4508 return 0; 4508 /* Pass sequential frames to l2cap_reassemble_sdu()
4509 * until a gap is encountered.
4510 */
4511
4512 BT_DBG("chan %p", chan);
4513
4514 while (!test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) {
4515 struct sk_buff *skb;
4516 BT_DBG("Searching for skb with txseq %d (queue len %d)",
4517 chan->buffer_seq, skb_queue_len(&chan->srej_q));
4518
4519 skb = l2cap_ertm_seq_in_queue(&chan->srej_q, chan->buffer_seq);
4520
4521 if (!skb)
4522 break;
4523
4524 skb_unlink(skb, &chan->srej_q);
4525 chan->buffer_seq = __next_seq(chan, chan->buffer_seq);
4526 err = l2cap_reassemble_sdu(chan, skb, &bt_cb(skb)->control);
4527 if (err)
4528 break;
4529 }
4530
4531 if (skb_queue_empty(&chan->srej_q)) {
4532 chan->rx_state = L2CAP_RX_STATE_RECV;
4533 l2cap_send_ack(chan);
4534 }
4535
4536 return err;
4509} 4537}
4510 4538
4511static void l2cap_handle_srej(struct l2cap_chan *chan, 4539static void l2cap_handle_srej(struct l2cap_chan *chan,