.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "USB_RESET_DEVICE" "9" "09 October 2005" "" "" .SH NAME usb_reset_device \- perform a USB port reset to reinitialize a device .SH SYNOPSIS "SYNOPSIS" .sp \fB .sp int usb_reset_device (struct usb_device * \fIudev\fB); \fR .SH "ARGUMENTS" .TP \fB\fIudev\fB\fR device to reset (not in SUSPENDED or NOTATTACHED state) .SH "DESCRIPTION" .PP WARNING - don't reset any device unless drivers for all of its interfaces are expecting that reset! Maybe some driver->\fBreset\fR method should eventually help ensure sufficient cooperation. .PP Do a port reset, reassign the device's address, and establish its former operating configuration. If the reset fails, or the device's descriptors change from their values before the reset, or the original configuration and altsettings cannot be restored, a flag will be set telling khubd to pretend the device has been disconnected and then re-connected. All drivers will be unbound, and the device will be re-enumerated and probed all over again. .PP Returns 0 if the reset succeeded, -ENODEV if the device has been flagged for logical disconnection, or some other negative error code if the reset wasn't even attempted. .PP The caller must own the device lock. For example, it's safe to use this from a driver \fBprobe\fR routine after downloading new firmware. For calls that might not occur during \fBprobe\fR, drivers should lock the device using \fBusb_lock_device_for_reset\fR\&.