USB_TransactionGetPending (SWI&55392)

USB_TransactionGetPending (SWI&55392) — Gets one of the remaining transactions of a request which consists of several transactions.

On Entry

R0Pointer to pipe structure.
R1Reserved. Must be set to zero.
R2Reserved. Must be set to zero.

On Exit

R0Pointer to transaction structure or zero if an error occurred or there are no following transactions to a request.
R1Error code Table A.1, “Error codes used by the USB system”
R2Preserved

Use

After USB host controller driver got the first transaction of a request by calling USB_RequestGetPending (SWI&55393) he must check whether the request consists of several transactions. This can be easily done by checking whether the pointer to the next transaction is not zero. If this is the case this must call USB_TransactionGetPending (SWI&55392) to get the following transactions belonging to this request one after the other. The last transaction can be detected if it has a zero value inside the pointer to the next transaction or a zero pointer is returned by USB_TransactionGetPending (SWI&55392).

There will be no further requests of a pipe notified to the USB host controller driver until he has got all transactions belonging to the actual request.

Note that a pipe may be cleared, dropped or something like this by another process at the time the USB host controller driver tries to get the remaining transactions. In this case the remaining transactions may be dropped before the USB host controller driver could get them. In this case a zero pointer will be returned and the USB host controller driver must drop all the transactions he has already got by finishing them calling USB_TransactionResult (SWI&55394) with a USB_TRANSACTION_RESULT_ABORTED result.

Related SWI's

USB_RequestGetPending (SWI&55393)
USB_TransactionResult (SWI&55394)