USB queued receive
Posted: Sat Oct 31, 2015 5:59 pm
I'm using usbPrepareQueuedReceiveI to receive isochronous OUT data. Let's say that for some reason the data consume stalls, it means the queue will become full.
Since usb_packet_read_to_queue doesn't check for enough space in the queue, I do check myself before calling usbPrepareQueuedReceiveI, the question is what do I do when there is not enough space. I've tried to call usbStallReceiveI to no avail, data keeps coming in and the USB driver keeps pumping that data into the queue.
Question: how do I keep the driver from accepting more data from the host? because as of now, for every received packet the driver will either call usb_read_packet_to_queue or usb_read_packet_to_buffer. Maybe there should be a third choice to just drop the data.
Since usb_packet_read_to_queue doesn't check for enough space in the queue, I do check myself before calling usbPrepareQueuedReceiveI, the question is what do I do when there is not enough space. I've tried to call usbStallReceiveI to no avail, data keeps coming in and the USB driver keeps pumping that data into the queue.
Question: how do I keep the driver from accepting more data from the host? because as of now, for every received packet the driver will either call usb_read_packet_to_queue or usb_read_packet_to_buffer. Maybe there should be a third choice to just drop the data.