ksz8_phy_port_link_up(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the group chat for this one. we're in the Kernel API Manual section, and today's main character is ksz8_phy_port_link_up β€” she configures ports with integrated PHYs and honestly? she ate. ✨


✨ NAME ✨

ksz8_phy_port_link_up β€” configures ports with integrated PHYs 🫢


🌸 SYNOPSIS 🌸

void ksz8_phy_port_link_up (struct ksz_device *dev , int port , int
       duplex , bool tx_pause , bool rx_pause );

like, that's the whole signature. void function, four args plus the device. she does stuff and returns nothing, periodt. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the KSZ device instance. your whole lil switch baby. πŸ”₯
  • port β€” the port number you wanna configure. yes, that port.
  • duplex β€” the desired duplex mode. half or full, you decide, queen.
  • tx_pause β€” if true, turns transmit pause on. that's the sending-side pause. ✨
  • rx_pause β€” if true, turns receive pause on. that's the receiving-side pause. ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this function configures flow control settings for a given port, based on the desired settings and the current duplex mode. it's giving "settings matchmaker." 😭

According to the KSZ8873 datasheet, the PORT_FORCE_FLOW_CTRL bit in the Port Control 2 register β€” that's 0x1A for Port 1, 0x22 for Port 2, and 0x32 for Port 3, no cap β€” determines how flow control is handled on the port. the datasheet literally says:

"1 = will always enable full-duplex flow control on the port, regardless of AN result. 0 = full-duplex flow control is enabled based on AN result."

so yeah, this means the flow control behavior depends on the state of this bit, and it's kinda a whole vibe check:

  • if PORT_FORCE_FLOW_CTRL is set to 1, the switch will ignore AN results and force flow control on the port. she said "I'm not listening, I'm forcing it." πŸ’€
  • if PORT_FORCE_FLOW_CTRL is set to 0, the switch will enable or disable flow control based on the AN results. she's flexible like that. 🌈

πŸ™ˆ the limitation (read this part bestie)

However β€” and this is the part where we all go "hmm" β€” there's a potential limitation in this configuration. It is currently not possible to force disable flow control on a port if we still advertise pause support.

While such a configuration is not currently supported by Linux, and may not make practical sense, it's important to be aware of this limitation when working with the KSZ8873 and similar devices. 🫢

so like, lowkey not a problem right now, but highkey know it exists. iykyk. πŸ’œ


⭐ SEE ALSO ⭐

Kernel file ./drivers/net/dsa/microchip/ksz8.c and her whole friend group:


and that's the page!! πŸŽ€ this icon of a manpage lives in ./drivers/net/dsa/microchip, dated October 2026, and it's called ksz8_phy_port_link_up(9). slay, go configure some ports, ily, bye πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from