ksz_irq_phy_setup(9)
π 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 β
0on 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 π:
- Kernel file
./drivers/net/dsa/microchip/ksz_common.c ksz_phylink_mac_disable_tx_lpi(9)ksz_phylink_mac_enable_tx_lpi(9)ksz_update_port_member(9)ksz_parent_mdio_read(9)ksz_parent_mdio_write(9)ksz_phy_addr_to_port(9)ksz_irq_phy_free(9)ksz_parse_dt_phy_config(9)ksz_mdio_register(9)ksz_handle_wake_reason(9)ksz_is_port_mac_global_usable(9)ksz_get_wol(9)ksz_set_wol(9)ksz_wol_pre_shutdown(9)ksz_switch_macaddr_get(9)ksz_switch_shutdown(9)ksz_drive_strength_to_reg(9)ksz_drive_strength_error(9)ksz_drive_strength_write(9)
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
- 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