USB_BufferMalloc (SWI&55389)
Prev | Chapter 2. Core SWI Calls | Next

## Name

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

## On Entry

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.

## On Exit

R0 | Pointer to URB or NULL if an error occurred.
R1 | Error code Table A.1
R2 | Preserved

## 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 6

Prev | Up | Next
USB_ManageDeviceAddresses (SWI&55388) | Home | USB_BufferFree (SWI&5538A)