usb_reset_configuration(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is usb_reset_configuration from the Kernel API Manual πŸ’… and it is literally a lightweight device reset. no cap.


✨ SYNOPSIS ✨

int usb_reset_configuration (struct usb_device *dev );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device whose configuration is being reset. that’s the one, bestie 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so what this does: it issues a standard SET_CONFIGURATION request to the device using the current configuration. The effect is to reset most USB-related state in the device, including:

  • interface altsettings β€” reset to zero
  • endpoint halts β€” cleared
  • endpoint state β€” only for bulk and interrupt endpoints

Other usbcore state is unchanged, including bindings of usb device drivers to interfaces. not me pointing that out, but yes πŸ’–

Because this affects multiple interfaces, avoid using this with composite (multi-interface) devices. Instead, the driver for each interface may use usb_set_interface on the interfaces it claims. Be careful though; some devices don’t support the SET_INTERFACE request, and others won’t reset all the interface state (notably endpoint state). Resetting the whole configuration would affect other drivers’ interfaces. πŸ’€

The caller must own the device lock. fr fr.

If this routine fails the device will probably be in an unusable state with endpoints disabled, and interfaces only partially enabled. 🫠 so yeah, that’s the dramatic part.

πŸ”₯ RETURN πŸ”₯

Zero on success, else a negative error code. that’s it, that’s the whole return vibe ✨


🌈 SEE ALSO 🌈

Kernel file ./drivers/usb/core/message.c β€” and these besties right here:


source/version: ./drivers/usb/core Β· date: October 2026 β€” mwah, go reset something cute πŸ’‹πŸ’–

πŸ“¦ where this page comes from