USBD_ENUMERATE_DEVICE
Purpose
Gets a list of the USB logical devices (excluding hubs) connected to a host controller.
Syntax
int ioctl (file, USBD_ENUMERATE_DEVICE, arg)
Parameter
Item | Description |
---|---|
file | File descriptor that is obtained when the USBD special file was opened. |
arg | Address of the USBENUM structure that is aligned on a 4-byte boundary (see the USBENUM structure in the /usr/include/sys/usbdi.h file). |
Description
This ioctl returns a description of each logical USB device that is connected to the specified host controllers sans any hubs. The description is returned in the form of the usb_device_t structure. The array of returned structures is encapsulated within a USBENUM structure whose length is specified by the caller.
When this function is invoked, the devno and buffSize fields within the USBENUM structure must be initialized. The devno field must contain the 32-bit devno of the host controller to be enumerated while thebuffSize field must indicate the number of bytes that are available to buffer the returned array of usb_device_t structures. If the area is small, the number of returned structures is truncated to fit the available space. The caller can detect this condition by noting that the number of returned the usb_device_t structures is less than the number of discovered logical devices.
This operation returns a list of all logical devices that are connected behind a current host controller excluding any hubs. If the passed in buffer size is too small to contain the entire list, the list is truncated to fit the allocated buffer size. The numDevDisc parameter in the list specifies the total number of devices that are detected behind the host controller and the numDevEnum parameter specifies the total number of devices that are enumerated. This value can be smaller than numDevDisc parameter if the allocated buffer size is small to fit in the entire list.
Execution Environment
This function might be called from the user process environment only.
Return Values
Value | Description |
---|---|
0 | Indicates successful completion. |
ENODEV | Indicates that there is no host controller that is associated with the passed in device number. |
EFAULT | Indicates that the user has insufficient authority to access the data. |
EIO | Indicates that a permanent I/O error occurred while referencing data. |