usb_new_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 in ADDRESS state, 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:


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