usb_reset_configuration(9)
πΈ 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:
usb_control_msg(9)usb_control_msg_send(9)usb_control_msg_recv(9)usb_interrupt_msg(9)usb_bulk_msg(9)usb_bulk_msg_killable(9)usb_sg_init(9)usb_sg_wait(9)usb_sg_cancel(9)usb_get_descriptor(9)usb_get_string(9)usb_string(9)usb_cache_string(9)usb_get_status(9)usb_clear_halt(9)usb_disable_endpoint(9)usb_reset_endpoint(9)usb_disable_interface(9)usb_disable_device(9)usb_enable_endpoint(9)usb_enable_interface(9)usb_set_interface(9)usb_set_wireless_status(9)usb_driver_set_configuration(9)cdc_parse_cdc_header(9)
source/version: ./drivers/usb/core Β· date: October 2026 β mwah, go reset something cute ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms