phylink_cap...speed_duplex(9)
π phylink_cap_from_speed_duplex (9) β Kernel API Manual, bestie edition π
okay so picture this: you're deep in the kernel, specifically in ./drivers/net/phy/phylink.c, and you've got a speed and a duplex just sitting there and you need the mac capability. yeah. that's the whole plot. this page is from the Kernel API Manual, section 9, and it's genuinely a little icon. β¨
πΈ NAME πΈ
phylink_cap_from_speed_duplex β bestie, this gets you the mac capability from speed/duplex. that's it. that's the function. no cap. π
β¨ SYNOPSIS β¨
unsigned long phylink_cap_from_speed_duplex (int speed , unsigned int duplex );
she returns an unsigned long, she takes two args, she's booked and busy. π«Ά
π¦ ARGUMENTS π¦
speedβ the speed to search for π like the number, the velocity, the vibeduplexβ the duplex to search for π₯ (it's anunsigned int, fyi)
π DESCRIPTION π
literally so simple: find the mac capability for a given speed and duplex. you hand it speed, you hand it duplex, it goes looking, it finds the mac capability. main character energy from a one-line function, honestly. π
π RETURN π
you get back a mask with the mac capability patching speed and duplex π
β or 0 if there were no matches. and yes, 0 means nothing matched, so don't go treating it like a real capability, bestie. π
π SEE ALSO π
the whole group chat, fr fr β start with the kernel file itself:
Kernel file ./drivers/net/phy/phylink.c
then the crew:
struct phylink(9)phylink_set_port_modes(9)phylink_interface_max_speed(9)phylink_caps_to_link_caps(9)phylink_caps_to_linkmodes(9)phylink_limit_mac_speed(9)phylink_get_capabilities(9)phylink_validate_mask_caps(9)phylink_pcs_neg_mode(9)phylink_set_fixed_link(9)phylink_create(9)phylink_destroy(9)phylink_expects_phy(9)phylink_connect_phy(9)phylink_of_phy_connect(9)phylink_fwnode_phy_connect(9)phylink_disconnect_phy(9)phylink_mac_change(9)phylink_pcs_change(9)phylink_start(9)phylink_stop(9)phylink_rx_clk_stop_block(9)phylink_rx_clk_stop_unblock(9)phylink_suspend(9)phylink_prepare_resume(9)phylink_resume(9)phylink_ethtool_get_wol(9)phylink_ethtool_set_wol(9)phylink_ethtool_ksettings_get(9)phylink_ethtool_ksettings_set(9)phylink_ethtool_nway_reset(9)phylink_ethtool_get_pauseparam(9)phylink_ethtool_set_pauseparam(9)phylink_get_eee_err(9)phylink_ethtool_get_eee(9)phylink_ethtool_set_eee(9)phylink_mii_ioctl(9)phylink_speed_down(9)phylink_speed_up(9)phylink_decode_usxgmii_word(9)phylink_decode_usgmii_word(9)phylink_mii_c22_pcs_decode_state(9)phylink_mii_c22_pcs_get_state(9)phylink_mii_c22_pcs_encode_advertisement(9)phylink_mii_c22_pcs_config(9)phylink_mii_c22_pcs_an_restart(9)phylink_replay_link_begin(9)phylink_replay_link_end(9)
like i said. the whole group chat. 47 links and every single one is invited. π§ββοΈ
ngl the only real gotcha here is the 0 return β no match means no capability mask, so check it before you assume you've got something. π«‘
okay that's the whole page!! π this one's brought to you by ./drivers/net/phy, dated October 2026, and it's literally phylink_cap...speed_duplex(9) from the Kernel API Manual β slay, go read your manpages, ily, bye ππ¦β¨
π¦ 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