dwc2_calc_frame_interval(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dwc2_calc_frame_interval(9) β€” from the Kernel API Manual, bestie πŸ’–

okay so picture this: you're deep in the dwc2 USB driver, the vibes are immaculate, and you need the correct frame interval value for the HFIR register. That's literally this function. It's giving "I know what speed your PHY is running at" energy, and honestly? iconic.


✨ NAME ✨

dwc2_calc_frame_interval β€” calculates the correct frame Interval value for the HFIR register according to PHY type and speed πŸŽ€

like, it does the math so you don't have to, no cap.


🌸 SYNOPSIS 🌸

u32 dwc2_calc_frame_interval (struct dwc2_hsotg *hsotg );

returns a u32, takes one pointer to a struct dwc2_hsotg, that's the whole vibe check. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • hsotg β€” Programming view of DWC_otg controller πŸ‘‘ (yes that's the whole description, and yes it's carrying the whole function on its back)

⚠️ NOTE ⚠️

bestie listen to me carefully 🫢 the caller can modify the value of the HFIR register only after the Port Enable bit of the Host Port Control and Status register (HPRT.EnaPort) has been set. Only then. Do not come for that register early, it will not slay, it will simply not work. 😭

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/usb/dwc2/hcd.c β€” and like, the entire extended friend group:

dwc2_enable_common_interrupts(9), dwc2_enable_host_interrupts(9), dwc2_disable_host_interrupts(9), dwc2_read_packet(9), dwc2_dump_channel_info(9), dwc2_hc_init(9), dwc2_hc_halt(9), dwc2_hc_cleanup(9), dwc2_hc_set_even_odd_frame(9), dwc2_hc_write_packet(9), dwc2_hc_do_ping(9), dwc2_hc_start_transfer(9), dwc2_hc_start_transfer_ddma(9), dwc2_hc_continue_transfer(9), dwc2_hcd_start(9), dwc2_hcd_connect(9), dwc2_hcd_disconnect(9), dwc2_hcd_rem_wakeup(9), dwc2_hcd_stop(9), dwc2_core_init(9), dwc2_core_host_init(9), dwc2_assign_and_init_hc(9), dwc2_hcd_select_transactions(9), dwc2_queue_transaction(9), dwc2_hcd_queue_transactions(9), dwc2_port_suspend(9), dwc2_port_resume(9), dwc2_host_get_tt_info(9), dwc2_host_put_tt_info(9), dwc2_backup_host_registers(9), dwc2_restore_host_registers(9), dwc2_host_enter_hibernation(9), dwc2_host_enter_partial_power_down(9), dwc2_host_enter_clock_gating(9), dwc2_host_exit_clock_gating(9)

every single one of them, accounted for, we do not leave a member of the group chat on read πŸ’€πŸ’œ


and that's the whole page, bestie!! this masterpiece lives in ./drivers/usb/dwc2, dated October 2026, and honestly it ate. go calculate some frame intervals, you gorgeous creature 🌈✨

πŸ“¦ where this page comes from