USBDEVFS_RESET vs IOCTL_USB_RESET
Asked Answered
I

1

21

I seem tangled between different abstractions on the USB stack.. what is the difference betweeen IOCTL_USB_RESET and USBDEVFS_RESET fired against an USB device? Will both calls finally trigger the same low level actions on the interface, or is there a difference?

I noticed that USBDEVFS_RESET is sometimes described with 'equivalent of replugging and reenumerating the device', while I found by myself that firing IOCTL_USB_RESET (as done by libusb's usb_reset() call) does trigger a reset message in dmesg but no new 'enumeration', which would lead to the usual multi-line USB detection and identification messages I guess.

As IOCTL_USB_RESET is not feasable to solve my problems (stuck up usb devices), and even does not trigger reenumeration, is there any chance USBDEVFS_RESET would do better?

Interlude answered 25/5, 2015 at 11:11 Comment(0)
V
3

I think you are talking about IOCTL_USBFS_RESET instead of IOCTL_USB_RESET?

IOCTL_USBFS_RESET is specific to libusb. Indeed, libusb does not use structures nor ioctls defined in usbdevice_fs.h. Instead it redefine everything in os/linux_usbfs.h (I think for historical reasons). These two headers are binary compatible but, libusb does not use same names for structures and ioctls. For structures, prefix usbdevfs_ is replaced with usbfs_ (usbfs_ctrltransfer, usbfs_bulktransfer, ...). For ioctls, prefix USBDEVFS_ is replaced by IOCTL_USBFS_.

So, indeed, IOCTL_USBFS_RESET is the same than USBDEVFS_RESET (= _IO('U', 20)).

Vertigo answered 23/3, 2018 at 16:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.