USBD_ENUMERATE_DEVICE

Purpose

Gets a list of USB logical devices (excluding hubs) that are connected to a host controller.

Syntax

int ioctl (file, USBD_ENUMERATE_DEVICE, arg)

Parameters

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.

Description

This ioctl operation returns a description of each logical USB device that is connected to the specified host controllers without any hubs. The description is returned in the form of a 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 started, the devno and buffSize fields within the USBENUM structure must be initialized. The devno field must contain the 32-bit devno value of the host controller to be enumerated while the buffSize field must indicate the number of bytes that are available to buffer the returned array of usb_device_t structures. If the area is too 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 usb_device_t structures is less than the number of discovered logical devices.

Execution environment

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

Return values

Value Description
0 Success.
-1 Failure. Check the errno value for specific failure causes.