ksz8_w_phy_bmcr(9)
π ksz8_w_phy_bmcr β kernel API manual, but make it make sense
okay so bestie, welcome to ksz8_w_phy_bmcr(9) β it's a kernel function, it's giving "translator energy," and it's genuinely iconic. Let's get into it. π¦
β¨ NAME β¨
ksz8_w_phy_bmcr β this one translates stuff and then writes to the SMI interface based on a MIIM PHY Basic mode control register (that's Reg. 0, bestie, write it down). π
πΈ SYNOPSIS πΈ
int ksz8_w_phy_bmcr (struct ksz_device *dev , u16 port , u16 val );
that's the whole signature. look at her. gorgeous. π
π ARGUMENTS π
devβ the KSZ device instance. your main character struct, basically. πportβ which port number you're configuring. pick one, bestie. π―valβ the register value you want written. fr fr, that's the payload. π¦
π§ DESCRIPTION π§
okay so here's the vibe: this function takes control settings from a MIIM PHY Basic mode control register and translates them into their corresponding hardware register bit values for the SMI interface. it's literally a glow-up translator. the bits go in one side looking like MIIM and come out the other side speaking fluent hardware. β¨
π MIIM Bit Mapping Comparison between KSZ8794 and KSZ8873 π
this is the part everyone screenshots and sends to the group chat. KSZ8794 in one column, KSZ8873 in the other, and the middle column is doing the actual work. no cap, every single bit matters here:
- Bit 15 β Soft Reset β KSZ8794:
0xF/4Β· KSZ8873: Not supported - Bit 14 β Loopback β KSZ8794:
0xD/0(MAC),0xF/7(PHY) Β· KSZ8873:~ 0xD/0(PHY) - Bit 13 β Force 100 β KSZ8794:
0xC/6Β· KSZ8873:= 0xC/6 - Bit 12 β AN Enable β KSZ8794:
0xC/7(reverse logic, ok note that π) Β· KSZ8873:~ 0xC/7 - Bit 11 β Power Down β KSZ8794:
0xD/3Β· KSZ8873:= 0xD/3 - Bit 10 β PHY Isolate β KSZ8794:
0xF/5Β· KSZ8873: Not supported - Bit 9 β Restart AN β KSZ8794:
0xD/5Β· KSZ8873:= 0xD/5 - Bit 8 β Force Full-Duplex β KSZ8794:
0xC/5Β· KSZ8873:= 0xC/5 - Bit 7 β Collision Test/Res. β KSZ8794: Not supported Β· KSZ8873: Not supported
- Bit 6 β Reserved β KSZ8794: Not supported Β· KSZ8873: Not supported
- Bit 5 β Hp_mdix β KSZ8794:
0x9/7Β· KSZ8873:~ 0xF/7 - Bit 4 β Force MDI β KSZ8794:
0xD/1Β· KSZ8873:= 0xD/1 - Bit 3 β Disable MDIX β KSZ8794:
0xD/2Β· KSZ8873:= 0xD/2 - Bit 2 β Disable Far-End F. β KSZ8794:
????(yeah, literally????, don't come for me, that's what the page says π) Β· KSZ8873:0xD/4 - Bit 1 β Disable Transmit β KSZ8794:
0xD/6Β· KSZ8873:= 0xD/6 - Bit 0 β Disable LED β KSZ8794:
0xD/7Β· KSZ8873:= 0xD/7
the=,~and????bits are doing a lot of heavy lifting here, so read them carefully before you assume the two chips behave the same. they do not all behave the same. π
π₯ RETURN π₯
0on success β slay. β- error code on failure β not slay, but at least you know. π
β SEE ALSO β
the whole friend group, in order, no one gets left out:
- Kernel file
./drivers/net/dsa/microchip/ksz8.c ksz8_ind_write8(9)ksz8_ind_read8(9)ksz879x_get_loopback(9)ksz879x_set_loopback(9)ksz8_r_phy_ctrl(9)ksz8_r_phy_bmcr(9)ksz8_w_phy_ctrl(9)ksz88x3_tc_ets_add(9)ksz88x3_tc_ets_del(9)ksz8_phy_port_link_up(9)ksz8_cpu_port_link_up(9)ksz88x3_drive_strength_write(9)ksz8_parse_drive_strength(9)
and obviously the directory they all live in: ./drivers/net/dsa/microchip π
okay that's the whole page, bestie. this one ships from ./drivers/net/dsa/microchip, dated October 2026, and it's ksz8_w_phy_bmcr(9) β go translate some bits and be iconic about it. 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