usbdResetDevice

Purpose

Resets an open USB logical device.

Syntax

#include <usbdi.h>
USBstatus usbdResetDevice(handle)
USBhandle handle;

Parameter

Item Description
handle Handle of open USB logical device that is returned by the USBD_OPEN_DEVICE fp_ioctl.

Description

The USB client driver calls this function to reset an open USB logical device. The function is completed as the last step of the error recovery procedure. For example, a certain keyboard hub do not assert the port reset signal long enough to properly reset some USB mouse. On these hubs, the port to which the mouse is connected must be reset a second time before the mouse begins to work.

This function returns to the caller immediately. The USBD then proceeds to logically disconnect and reconnect the device that includes making disconnect and reconnect call backs to the client driver if they are enabled. Except for the device handle, this function invalidates all other USB handles such as buffer map handles and pipe handles. These handles must be reacquired after the reconnect call back is made to the client driver.

This function then calls the client driver's disconnect callback routine to free any client-driver level resources that are associated with this device and puts all the luns that is associated with this device in a disconnected state. Finally, the protocol driver logically reconnects the device and attempts to associate the device with the most suitable client. This process is completed by running through all the client handles that are registered with USBD and tries to match the device's class, subclass, and protocol with the client handle. If it finds the matching client handle with this information, it starts the reconnect callback routine that is associated with the client handle. The reconnect callback routine brings back the previously disconnected luns into the available state.

Execution Environment

This function might be called from interrupt (USBDINTRLEVEL priority or lower) or process environment.

Return Values

Value Description
USBD_SUCCESS Success