USBD_OPEN_DEVICE

Purpose

Opens a specific Universal Serial Bus (USB) logical device.

Syntax

int fp_ioctl (file, USBD_OPEN_DEVICE, arg, ext)

Parameters

Item Description
file File descriptor that is obtained when the USB system driver (USBD) special file was opened.
arg Address of an initialized DEVOPEN structure.
ext Not used and must be set to zero.

Description

The client driver uses this fp_ioctl operation to establish a connection to a specific USB logical device that is identified by the information within the DEVSELECTOR structure. A USB logical device can be opened by only one client driver at a time. If a client opens the device, it must connect to a pipe before the data can flow to or from the device. This data includes, but is not limited to, the default control pipe. The client driver must close any device that it opened by calling the usbdCloseDevice operation when it no longer wants to manage the device. Typically, a client driver must open the USBD, issue a USBD_OPEN_DEVICE ioctl operation to open a specific USB device, and close the USBD. Then, the client must communicate with the USBD by using the handle that is returned by the USBD_OPEN_DEVICE ioctl operation and the interface macros that are located within the usbdi.h file. To properly track the USB device when the device needs to be moved or replaced, the client must open the device when the client is configured, and the client must close the USB device when the client is unconfigured.

Execution environment

This function can be called from the kernel process environment only.

Return values

Value Description
0 Success.
Nonzero values Failure.