A Typical USB Driver Transaction Sequence

A simplified sequence of events for a transaction through the USB driver stack is as follows.

  • The USB client or class driver calls the USBDI usbdPipeIO call vector with the IRP data structure as a parameter.
  • Each IRP is broken down into several page-sized IOBs by the USBD except the first and last IOBs whose transfer size might be less than page size. The IOBs are then built based on the pipe/endpoint transfer type that is associated with the IRP.
  • The IOBs are then chained together and are passed to adapter device driver by starting a Host controller driver call vector hcdPipeIO. The host controller driver is responsible for processing each IOB and building the corresponding command element that is accepted by the HC architecture. The host controller driver also handles the IO completion.
  • The adapter driver off level I/O completion handler then removes these completed IOBs and updates the status of each IOB with the completion status of the USB transfer.
  • It then calls the usbdPostIOB call vector to pass these completed IOBs to the USBD layer.
  • When the last IOB associated with a current IRP is completed, the USBD posts the status of the completed IRP to the USB Client Driver by calling the completion callback that is associated with the IRP.