usb_create_hcd(9)
π usb_create_hcd π
okay bestie, welcome to the usb_create_hcd page from the Kernel API Manual β¨ this one is all about making an HCD and getting it set up, and yes it's giving kernel-core main character energy π
β¨ NAME β¨
usb_create_hcd β create and initialize an HCD structure. That's the whole assignment, bestie: make the HCD, initialize it, slay π
π οΈ SYNOPSIS π οΈ
here's the exact signature, character for character, no cap:
struct usb_hcd * usb_create_hcd (const struct hc_driver *driver , struct device *dev , const char *bus_name );
π ARGUMENTS π
driverβ the HC driver that will use this hcd π«Ά like, this is the driver claiming the HCD for its own little world.devβ the device for this HC, stored inhcd->self.controllerβ¨ yep, that exact field, bestie.bus_nameβ the value to store inhcd->self.bus_nameπ just drop it right in there.
π΄ CONTEXT π΄
task context, and it might sleep π΄. Like, actually might sleep, so don't act surprised.
πΈ DESCRIPTION πΈ
So what it does: allocate a struct usb_hcd, with extra space at the end for the HC driver's private data π¦. Then initialize the generic members of the hcd structure. That's the glow-up: fresh HCD, generic bits set up, and room for the driver's private data chillin' at the end π.
π₯ RETURN π₯
On success, you get a pointer to the created and initialized HCD structure π. On failure (e.g. if memory is unavailable), you get NULL π. no cap.
π SEE ALSO π
Kernel file ./drivers/usb/core/hcd.c, plus these besties:
ascii2desc(9)rh_string(9)usb_bus_init(9)usb_register_bus(9)usb_deregister_bus(9)register_root_hub(9)usb_calc_bus_time(9)usb_hcd_link_urb_to_ep(9)usb_hcd_check_unlink_urb(9)usb_hcd_unlink_urb_from_ep(9)usb_hcd_giveback_urb(9)usb_hcd_alloc_bandwidth(9)usb_hcd_reset_endpoint(9)usb_alloc_streams(9)usb_free_streams(9)usb_hcd_resume_root_hub(9)usb_bus_start_enum(9)usb_hcd_irq(9)usb_hc_died(9)usb_create_shared_hcd(9)usb_stop_hcd(9)usb_add_hcd(9)usb_remove_hcd(9)
source check, bestie: this page lives under ./drivers/usb/core, dated October 2026, and it's the usb_create_hcd(9) page ππ«Άβ¨
π¦ 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