usb_buf: count number of elements in queue
This is in preparation for limiting the maximum queue length
Change-Id: I7cb184d7a1ccb519010a2f3e3295cc3a5fbf8052
Related: OS#4251
diff --git a/firmware/libcommon/source/host_communication.c b/firmware/libcommon/source/host_communication.c
index 1e15ada..0e496c5 100644
--- a/firmware/libcommon/source/host_communication.c
+++ b/firmware/libcommon/source/host_communication.c
@@ -76,7 +76,7 @@
bep->in_progress++;
- msg = msgb_dequeue(&bep->queue);
+ msg = msgb_dequeue_count(&bep->queue, &bep->queue_len);
local_irq_restore(x);
@@ -180,7 +180,7 @@
}
/* free all queued msgbs */
- while ((msg = msgb_dequeue(&bep->queue))) {
+ while ((msg = msgb_dequeue_count(&bep->queue, &bep->queue_len))) {
usb_buf_free(msg);
ret++;
}