ks8851_phy_read(9)
π ks8851_phy_read β from the Kernel API Manual
okay so bestie, welcome to ks8851_phy_read(9) β¨ this is the lil function that goes and reads a PHY register over the MII interface, and honestly? it's doing the most with the least. let's get into it π
β¨ NAME β¨
ks8851_phy_read β MII interface PHY register read. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
int ks8851_phy_read (struct net_device *dev , int phy_addr , int reg );
three args in, one int out, no cap π«Ά
π¦ ARGUMENTS π¦
devβ the network device the PHY is on. that's the whole context, she lives there πphy_addrβ address of the PHY, but like... it's ignored, because we only have one. so yeah, bestie, it's giving decorative parameter πregβ the register to read. this one actually matters π
π DESCRIPTION π
so this call reads data from the PHY register specified in reg. simple enough, right? except the device does not support all the MII registers, and for the ones that don't exist? the values come back as zero. always. every time. zero π«
and here's the tea on why we return zero for unsupported registers: the MII code does not check the value returned for any error status β it literally just hands it straight back to the caller, no vibe check, nothing. and the mii-tool that the driver was tested with? she takes any -ve error as real PHY capabilities, which means it'd display straight-up incorrect data to the user. we're not doing that to people. so, zero it is β¨
π₯ SEE ALSO π₯
kernel file: ./drivers/net/ethernet/micrel/ks8851_common.c
and the whole friend group, no one left out:
ks8851_lock(9), ks8851_unlock(9), ks8851_wrreg16(9), ks8851_rdreg16(9), ks8851_soft_reset(9), ks8851_set_powermode(9), ks8851_write_mac_addr(9), ks8851_read_mac_addr(9), ks8851_init_mac(9), ks8851_rx_pkts(9), ks8851_irq(9), ks8851_flush_tx_work(9), ks8851_net_open(9), ks8851_net_stop(9), ks8851_start_xmit(9), ks8851_rxctrl_work(9), ks8851_eeprom_claim(9), ks8851_eeprom_release(9), ks8851_phy_reg(9), ks8851_read_selftest(9)
okay that's the page!! this one lives in ./drivers/net/ethernet/micrel, dated October 2026, and it's filed under ks8851_phy_read(9) β mwah, go read some registers responsibly πβ¨
π¦ 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