ksz_irq_phy_setup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ksz_irq_phy_setup(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so you found your way into the kernel API manual, specifically the page for ksz_irq_phy_setup, and honestly? iconic of you. this is the kind of low-level DSA switch lore that separates the girlies who read the source from the girlies who just hope it works. let's get into it ✨


🌸 NAME 🌸

ksz_irq_phy_setup β€” bestie, this is the function that configures IRQs for PHYs in the KSZ device. that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

int ksz_irq_phy_setup (struct ksz_device *dev );

that's it. that's the whole call. one argument, returns an int, no cap. πŸ’…


🫢 ARGUMENTS 🫢

  • dev β€” Pointer to the KSZ device structure. yeah she's just a pointer, but she's the pointer, main character energy fr fr.

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's what's actually happening, and it's kind of a lot but stay with me:

this function sets up IRQs for each active PHY connected to the KSZ switch. the way it does that is by mapping the appropriate IRQs for each PHY and then assigning them to the user_mii_bus in the DSA switch structure. and how does it know which IRQ goes where? each IRQ is mapped based on the port's IRQ domain. periodt. 🌈

that's the whole description, no filler, we love a concise queen πŸ’–


⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • a negative error code on failure 😭 (yes bestie, negative. it's giving "something went wrong and we're telling you in the return value" energy)

πŸ”₯ SEE ALSO πŸ”₯

the reading list, and it is long, so buckle up πŸ“:

like I said. a lot of cousins at this family reunion 😭 but every single one of them is in there, don't skip a single one or the kernel will know πŸ™ˆ


ngl the ksz_irq_phy_free(9) entry in SEE ALSO is doing the most β€” she's literally the cleanup counterpart, iykyk. if you're setting up IRQs you will be freeing them, so go read that one too 🧚

and that's the page, bestie!! you ate that. this gem lives in ./drivers/net/dsa/microchip, it's dated October 2026, and it's part of the Kernel API Manual β€” so go forth, map those IRQs per the port's IRQ domain, and slay πŸ’œπŸŽ€

πŸ“¦ where this page comes from