IRP Structure

The IRP structure contains certain fields that are used to pass I/O commands and associated parameters to the USBD device driver. Other fields within this structure are used to pass returned status back to the client driver.

The IRP structure is defined in the /usr/include/sys/usbdi.h file.

Fields in the IRP structure are used as follows:
  • The pNext field is used to group together numerous IRPs from the client driver and it is pointing to next IRP in the chain.
  • The hPipe field refers to the pipe handle of the USBD internal data structure. The USBD uses the hPipe field of the IRP to identify the corresponding pipe that is associated with the endpoint of current USB device.
  • The pBuffer field refers to the virtual address of the buffer.
  • The IOCompleteCallBack routine refers to the callback that is called upon completion of the IRP from the bus driver standpoint.
  • The clientPriv data is passed as a parameter to the IOCompleteCallBack routine upon completion of the processing of the corresponding IRP. This pointer is opaque to the bus driver and the USBD will not use it.
  • The transSize field identifies the length of the transaction in bytes if there is a data transfer associated with the IRP.
  • The flags field identifies whether the short transfer from device is successful and if the buffer associated with the pBuffer field is already mapped.
  • The status field identifies the completion status that is associated with the IRP.
  • The frame field identifies the frame number that is associated with the isochronous transfer. It identifies the frame number for low and full speed endpoints and the micro frame number for high speed and super speed isochronous endpoints.