usb_new_device(9)
π
usb_new_device(9) β Kernel API Manual β¨
okay bestie, welcome to the usb_new_device(9) page, and yes the manual name is Kernel API Manual β we're in kernel land now π§
πΈ NAME πΈ
usb_new_device β perform initial device setup (usbcore-internal)
β¨ SYNOPSIS β¨
int usb_new_device (struct usb_device *udev );
π ARGUMENTS π
udevβ the newly addressed device, and it's sitting inADDRESSstate, periodt.
π¦ DESCRIPTION π¦
Okay so here's the vibe: this gets called for devices that have been detected but are not fully enumerated yet. The device descriptor is available, but descriptors for any device configuration are not available yet. Not me explaining it like this but yes.
The caller must have locked either the parent hub (if udev is a normal device) or else the usb_bus_idr_lock (if udev is a root hub). The parent's pointer to udev has already been installed, but udev is not yet visible through sysfs or other filesystem code. So close but not public yet, iykyk.
This call is synchronous, and it may not be used in an interrupt context.
Only the hub driver or root-hub registrar should ever call this. No random main character energy here, bestie π
π₯ RETURN π₯
It returns whether the device is configured properly or not. Zero if the interface was registered with the driver core; else a negative errno value. That's it, that's the return.
π SEE ALSO π
Kernel file ./drivers/usb/core/hub.c and these iconique functions:
usb_hub_set_port_power(9)usb_hub_clear_tt_buffer(9)usb_remove_device(9)usb_set_device_state(9)usb_disconnect(9)usb_enumerate_device_otg(9)usb_enumerate_device(9)usb_deauthorize_device(9)get_port_ssp_rate(9)usb_root_hub_lost_power(9)hub_hc_release_resources(9)usb_reset_and_verify_device(9)usb_reset_device(9)usb_queue_reset_device(9)usb_hub_find_child(9)usb_get_hub_port_acpi_handle(9)
Cute sign-off: this page lives with source ./drivers/usb/core, dated October 2026, and yes it's still the Kernel API Manual bestie. Mwah ππ«Ά
π¦ 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