mdio_mux_mul...er_switch_fn(9)
πΈ mdio_mux_mul...er_switch_fn(9) β the Kernel API Manual, bestie edition πΈ
okay so real talk, this is a page from the Linux Kernel API manual, and the whole vibe is "callback function that the mdio-mux layer calls when it thinks the mux needs to switch." That's the name up top, mdio_mux_mul...er_switch_fn(9) β yes the kernel truncated it, no we're not gonna fix it, it's iconic as-is. π
β¨ NAME β¨
mdio_mux_multiplexer_switch_fn β the function that the mdio-mux layer literally calls up when it thinks the mdio bus multiplexer needs to switch. it's giving "hey bestie, time to flip the switch" π¦
β¨ SYNOPSIS β¨
int mdio_mux_multiplexer_switch_fn (int current_child , int
desired_child , void *data );
that's the whole signature, no cap. three args, one int coming back at ya. β¨
β¨ ARGUMENTS β¨
current_childβ the current value of the mux register. like, what the mux is currently serving. the before pic. πdesired_childβ the value of the'reg'property of the target child MDIO node. i.e. where we want to be. the glow-up pic. π₯dataβ private data used by thisswitch_fn, passed to themdio_mux_initfunction viamdio_mux_init(.., .., .., .., data, ..). yep, that's the exact call, dots and all β we do not edit the dots, the dots are load-bearing. π
β¨ DESCRIPTION β¨
the first time this function gets called, current_child == -1. that's your little "hiii, we just met" moment β the mux hasn't been set to anything yet, so -1 is the flag for "brand new, no thoughts, head empty." π
and if current_child == desired_child? then the mux is already set to the correct bus. nothing to do, no switch needed, she's already slaying in the right lane. β
so basically: compare current_child to desired_child, and remember that the first-ever call shows up as current_child == -1. iykyk. π
β¨ SEE ALSO β¨
- Kernel file
./drivers/net/mdio/mdio-mux-multiplexer.cβ go read the source bestie, it's all there π«Ά
lowkey important: when current_child == desired_child, the mux is already on the correct bus β so don't go switching things that are already switched. main character energy is knowing when to do nothing. π
and that's the page!! π manual name mdio_mux_mul...er_switch_fn(9), straight out of ./drivers/net/mdio, dated October 2026 β mwah, go forth and multiplex, bestie πβ¨π
π¦ 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