usb_find_endpoint(9)
π 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
- 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