USB System Device Driver Programming Interface

The USB Protocol Driver (USBD) supports the standard UNIX I/O functions such as open( ), close( ), and ioctl( ). It does not support read( ), write( ), or poll( ) functions.

In addition to the standard UNIX interfaces, the driver provides a direct interface by using call vectors. The call vectors are used by a USB client driver to interact with the USBD. The call vectors are started by using the following macros:
Macros Description
usbdCloseDevice The client driver calls this function to close an open USB logical device.
usbdResetDevice The client driver calls this function to reset an open USB logical device.
usbdPipeConnect The client driver calls this function to allocate and initialize the resources for a pipe before starting I/O on the pipe.
usbdPipeDisconnect The client driver calls this function to close a device.
usbdPipeIO The client driver calls this function when it performs an I/O. This function is also called internally by the USB system driver during enumeration, topology discovery, and device configuration.
usbdPipeIOWait The client driver and the USB system driver call this function when the caller waits for an outstanding I/O.
usbdPipeStatus The client driver calls this function to obtain the status of a pipe. The status of the pipe might be either the pipe is halted or the pipe is active.
usbdPipeAbort The client driver calls this function to stop some previously started I/O. If called from an interrupt environment, a request is sent to config proc function to stop a specific I/O and the control is returned to the caller immediately.
usbdPipeClear The client driver calls this function to activate a previously halted pipe from the host perspective. This service can be started only after issuing CLEAR FEATURE command to clear the endpoint halt from the device's perspective.
usbdMapMemory The client driver uses this function to map host memory so that the host controller can read from or write to the memory by using bus mastered DMA. The USBDMAP_USER flag must be specified whether the memory to be mapped is located in user address space.
usbdUnmapMemory The client driver uses this function to unmap previously mapped memory. All I/O referencing the memory block must be completed before this function is called. This function can be called from process environment only.
usbdGetDescriptors The client driver uses this function to read the list of descriptors from the device. A pointer to buffer containing the list of descriptors is returned.
usbdGetDevselector After reconnect, the hcdevno and addr values of the device might change from the previous values before disconnect. This can occur when two or more USB logical devices with identical class, subclass, protocol, and devtype values are used. This function might be called from process environment only.
usbdGetFrame This function is called by the client driver to obtain the current frame number from the host controller to which the device is connected to. This function is used for isochronous pipes only.
usbdSetInterface The client driver calls this function when to change an interface to an alternative setting.