ksz_switch_macaddr_get(9)
π ksz_switch_macaddr_get(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes we're in the kernel API manual era, it's giving "I read source code for fun" and honestly? iconic. this one's all about programming a switch's MAC address register, and it's lowkey important so let's get into it π«Ά
β¨ NAME β¨
ksz_switch_macaddr_get β bestie this one programs the switch's MAC address register π
periodt, that's the whole job.
πΈ SYNOPSIS πΈ
int ksz_switch_macaddr_get (struct dsa_switch *ds , int port , struct
netlink_ext_ack *extack );
π ARGUMENTS π
dsβ your DSA switch instance π like, the switch in question, the main character.portβ the port number π just the number of the port we're talking about.extackβ the netlink extended acknowledgment β¨ yes it's a whole thing, it carries the extra ack info.
π¦ DESCRIPTION π¦
so what does this actually do? it programs the switch's MAC address register with the MAC address of the requesting user port π« that's it, that's the vibe.
and here's the slay part: this single address gets used by the switch for multiple features β think HSR self-address filtering and WoL π iykyk, one address serving multiple looks, very efficient of her.
other user ports can totally share ownership of this address as long as their MAC address is the same π€ sharing is caring, but only if you match, no cap.
π¨ warning bestie, listen: the MAC addresses of user ports must not change while they have ownership of the switch MAC address. like, don't. seriously. don't do it π
π RETURN π
0on success π slay- or other error codes on failure π not slay, but that's how it goes
π SEE ALSO π
first up, the kernel file herself:
- Kernel file
./drivers/net/dsa/microchip/ksz_common.cπ
and the whole friend group π«Ά:
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_setup(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_shutdown(9)ksz_drive_strength_to_reg(9)ksz_drive_strength_error(9)ksz_drive_strength_write(9)
and that's the page bestie π this little gem lives in ./drivers/net/dsa/microchip, dated October 2026, and it's brought to you by the one and only ksz_switch_macaddr_get(9) π§ go program that register, you got this π
β¨
π¦ 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