USB_BufferMalloc (SWI&55389) — Allocates a URB for USB requests.
R0 | Pointer to pipe which the URB will be used with. |
R1 | Size of the buffer in bytes. |
R2 | NULL or pointer to driver supplied external buffer memory. |
R0 | Pointer to URB or NULL if an error occurred. |
R1 | Error code Table A.1, “Error codes used by the USB system” |
R2 | Preserved |
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.