ksz8_w_phy_bmcr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ”₯

  • 0 on 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:

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