USB_BufferMalloc (SWI&55389)

USB_BufferMalloc (SWI&55389) — Allocates a URB for USB requests.

On Entry

R0Pointer to pipe which the URB will be used with.
R1Size of the buffer in bytes.
R2NULL or pointer to driver supplied external buffer memory.

On Exit

R0Pointer to URB or NULL if an error occurred.
R1Error code Table A.1, “Error codes used by the USB system”
R2Preserved

Use

Allocates a USB Request Buffer(URB) for USB transactions. The URB allocated may only be used with the specified pipe. The size of data allocated will be rounded up to the next highest multiple of the pipes endpoint payload size. Because of this rounding drivers may have to change the returned URB used size field to the exact amount of data to transfer in the request.

The driver may pass an external area of memory to be used for the URB transfer data. This gives the ability to avoid unnecessary copying of data. The buffer supplied must be accessible from all operating system contexts i.e. RMA or a dynamic area. Note the URB system fields will not be placed in this buffer it is for transaction data only.

Related SWI's

USB_BufferFree (SWI&5538A)

Related Information

Chapter 5, Data Buffers