rgmii_clock(9)
π rgmii_clock(9) β a Kernel API Manual moment π
okay so bestie, you're reading the rgmii_clock page, and it's lowkey one of the most useful little guys in the PHY corner of the kernel. buckle up, it's short but it slaps π
β¨ NAME β¨
rgmii_clock β map link speed to the clock rate
like, speed goes in, clock rate comes out. iconic behavior, honestly π¦
πΈ SYNOPSIS πΈ
long rgmii_clock (int speed );
that's it. that's the whole call. one argument, no drama π
π ARGUMENTS π
speedβ the link speed value. that's the vibe you're feeding in, bestie β¨
π«Ά DESCRIPTION π«Ά
okay so what it does: it maps RGMII supported link speeds into the clock rates. simple, clean, ate π
and here's the fun part β you can also use it for MII, GMII, and RMII interface modes, because the clock rates are identical across all of them. slay!! π
but (and this is the important bit, don't skip it π) β the caller must be aware that errors for unsupported clock rates will not be signalled. like, it's not gonna yell at you, it's not gonna return an error, it just... won't signal. so you have to know what you're doing. main character responsibility, fr fr π
β RETURN β
clock rate, or a negative errno if things went sideways π
π SEE ALSO π
okay this part is a whole situation, there are so many friends here, but they're all valid and you should absolutely go meet them:
- Kernel file
./include/linux/phy.henum phy_interface_t(9) phy_modes(9)struct mdio_bus_stats(9)struct mii_bus(9)mdiobus_alloc(9)enum phy_state(9)struct phy_c45_device_ids(9)struct phy_oatc14_sqi_capability(9)struct phy_device(9)struct phy_tdr_config(9)enum link_inband_signalling(9)struct phy_plca_cfg(9)struct phy_plca_status(9)struct phy_led(9)struct phy_mse_capability(9)struct phy_mse_snapshot(9)struct phy_driver(9)phy_id_compare(9)phy_id_compare_vendor(9)phy_id_compare_model(9)phydev_id_compare(9)phy_is_started(9)phy_driver_is_genphy(9)phy_disable_eee_mode(9)phy_can_wakeup(9)phy_may_wakeup(9)phy_read(9)__phy_read(9)phy_write(9)__phy_write(9)__phy_modify_changed(9)phy_read_mmd_poll_timeout(9)__phy_set_bits(9)__phy_clear_bits(9)phy_set_bits(9)phy_clear_bits(9)__phy_set_bits_mmd(9)__phy_clear_bits_mmd(9)phy_set_bits_mmd(9)phy_clear_bits_mmd(9)phy_interrupt_is_valid(9)phy_polling_mode(9)phy_has_hwtstamp(9)phy_has_rxtstamp(9)phy_has_tsinfo(9)phy_has_txtstamp(9)phy_is_default_hwtstamp(9)phy_on_sfp(9)phy_interface_mode_is_rgmii(9)phy_interface_mode_is_8023z(9)phy_interface_is_rgmii(9)phy_is_pseudo_fixed_link(9)phy_module_driver(9)
real talk for a sec: the "unsupported clock rates won't be signalled" thing in DESCRIPTION is not a cute quirk, it's a genuine gotcha. validate your speeds, bestie π«Ά
that's the whole page!! go forth and clock responsibly, iykyk πβ¨
β source ./include/linux, dated October 2026 πΈ signing off, mwah π
π¦ 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