ksz_drive_strength_to_reg(9)
π ksz_drive_strength_to_reg(9) β from the Kernel API Manual, bestie π
okay so picture this: you're deep in the kernel, the ksz_drive_strength_to_reg function is right there in the Kernel API Manual, and you're like "what does this even dooo" β don't worry, I got you. This is literally the function that takes your cute little drive strength number and turns it into the register value the hardware actually wants. iconic behavior tbh β¨
πΈ SYNOPSIS πΈ
int ksz_drive_strength_to_reg (const struct ksz_drive_strength *array ,
size_t array_size , int microamp );
like, that's the whole signature. no cap. π«Ά
β¨ ARGUMENTS β¨
arrayβ the array of drive strength values you want to search through. it's the lookup table, bestie, and it'sconstso hands off π₯array_sizeβ how big that array is. yes you have to tell it. it's not psychic πmicroampβ the drive strength value, in microamp, that you wanna convert. this is the number you're hunting for π
π¦ DESCRIPTION π¦
so the way this works: ksz_drive_strength_to_reg searches through the array of drive strength values looking for the microamp value you passed in, and then it returns the corresponding register value for that drive. that's it. that's the whole vibe. it's giving "translator between the human-friendly number and the hardware-friendly number" π
literally just a lookup. matching your microamp to a register value. slay π
π RETURN π
- if it finds it β you get the corresponding register value for that drive strength back. win. π
- otherwise β
-EINVALcomes back, which is the fancy way of saying "invalid value, bestie, that one's not in the list" π
ngl, -EINVAL is like the group chat when you send a message nobody can react to. it means your value wasn't valid for this lookup. don't take it personally π
π§ SEE ALSO π§
kernel file ./drivers/net/dsa/microchip/ksz_common.c β that's the source file, go look at it if you're curious π
and the whole friend group of related functions, all of them, no skips:
ksz_phylink_mac_disable_tx_lpi(9)ksz_phylink_mac_enable_tx_lpi(9)ksz_update_port_member(9)ksz_parent_mdio_read(9)ksz_parent_mdio_write(9)ksz_phy_addr_to_port(9)ksz_irq_phy_setup(9)ksz_irq_phy_free(9)ksz_parse_dt_phy_config(9)ksz_mdio_register(9)ksz_handle_wake_reason(9)ksz_is_port_mac_global_usable(9)ksz_get_wol(9)ksz_set_wol(9)ksz_wol_pre_shutdown(9)ksz_switch_macaddr_get(9)ksz_switch_shutdown(9)ksz_drive_strength_error(9)ksz_drive_strength_write(9)
okay and before I go β little sign-off moment π«Ά this one lives in ./drivers/net/dsa/microchip, dated October 2026, and the page itself is ksz_drive_strength_to_reg(9). go forth and convert those drive strengths, bestie, you're gonna ate ππ
π¦ 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