Bluetooth: Add unacked queue re-queueing

Change-Id: I2a12e6db72046d5ebc78c932ab5054eadbb4308c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2015-12-11 12:58:19 +02:00 committed by Anas Nashif
commit 3a415c6bfb

View file

@ -365,7 +365,28 @@ static void retx_fiber(int arg1, int arg2)
h5.retx_to = NULL;
/* TODO: Parse unacked queue and re-queue */
if (unack_queue_len) {
struct nano_fifo tmp_queue;
struct net_buf *buf;
nano_fifo_init(&tmp_queue);
/* Queue to temperary queue */
while ((buf = nano_fifo_get(&h5.tx_queue))) {
nano_fifo_put(&tmp_queue, buf);
};
/* Queue unack packets to the beginning of the queue */
while ((buf = nano_fifo_get(&h5.unack_queue))) {
nano_fifo_put(&h5.tx_queue, buf);
unack_queue_len--;
}
/* Queue saved packets from temp queue */
while ((buf = nano_fifo_get(&tmp_queue))) {
nano_fifo_put(&h5.tx_queue, buf);
}
}
}
static void ack_fiber(int arg1, int arg2)