usb_find_endpoint(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… usb_find_endpoint(9) β€” the kernel API manual, bestie edition πŸ¦‹

okay so this is a page from the Kernel API Manual, and it's about usb_find_endpoint. strap in, it's literally one function and it's iconic.


✨ NAME ✨

usb_find_endpoint β€” bestie, you give it an endpoint address and it goes digging through an interface's current altsetting to find that endpoint's usb_host_endpoint structure. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

const struct usb_host_endpoint * usb_find_endpoint (const struct
usb_interface *intf , unsigned int ep_addr );

like, look at that signature. const-correct. returns a pointer. we love to see it. πŸ‘‘


🫢 ARGUMENTS 🫢

  • intf β€” the interface whose current altsetting should be searched. (current. altsetting. not all of them, bestie, just the current one πŸ’…)
  • ep_addr β€” the endpoint address (that's the number and the direction) you're trying to find. πŸ”

πŸ’– DESCRIPTION πŸ’–

so what it does is: it searches the altsetting's list of endpoints for one with the specified address. that's it. that's the whole function. no cap. ✨


⭐ RETURN ⭐

pointer to the usb_host_endpoint if it's found β€” and NULL otherwise. so like. check it. please. πŸ™ˆ


🌈 SEE ALSO 🌈

it lives in the kernel file ./drivers/usb/core/usb.c, and here's the whole friend group:

usb_find_common_endpoints(9), usb_find_common_endpoints_reverse(9), usb_check_bulk_endpoints(9), usb_check_int_endpoints(9), usb_find_alt_setting(9), usb_ifnum_to_if(9), usb_altnum_to_altsetting(9), usb_find_interface(9), usb_for_each_dev(9), usb_release_dev(9), usb_alloc_dev(9), usb_get_dev(9), usb_put_dev(9), usb_get_intf(9), usb_put_intf(9), usb_intf_get_dma_device(9), usb_lock_device_for_reset(9), usb_get_current_frame_number(9), usb_alloc_coherent(9), usb_free_coherent(9), usb_alloc_noncoherent(9), usb_free_noncoherent(9), usb_endpoint_max_periodic_payload(9), usb_endpoint_is_hs_isoc_double(9)


🧚 friendly reminder from your local kernel bestie: NULL is a real possible answer here, so don't go dereferencing it and then acting surprised. πŸ’€

and that's the page!! it lives in ./drivers/usb/core, dated October 2026, in the Kernel API Manual. mwah, go find those endpoints, you're doing amazing sweetie πŸ“πŸ’œ

πŸ“¦ where this page comes from