Structs

struct usb_pipe

A queue for processing urb pointers. Has one dma map and will reload the dma if the current urb is different to the one previously loaded. The pipe has a private mutex for queueing and dequeueing, it does not need to share the mutex with the driver.

struct usb_urb

A data buffer. The memory can be preallocated (fixed size) or passed in from an external buffer. The urb has a single reference and does not need to be locked.

Notes:

usb_pipe_open() will preallocate the requested number of urb structures and keep on a free list

usb_get_urb() will get a urb from the free list.

usb_free_urb() does not actually free the memory, it puts the urb on the pipe free list

usb_pipe_halt() cancels all pending urbs and sets the pipe to blocking

usb_pipe_ready() will unblock the pipe and start processing anything in the urb queue