mac_enable_tx_lpi(9)
β¨ mac_enable_tx_lpi β from the Kernel API Manual, section 9, bestie π
Okay so picture this: you're in the 9 section of the Kernel API Manual (the driver-dev one, iykyk) and you need to make a MAC actually generate LPI. That's this function. She's the one who configures the LPI timeout and flips generation on. Main character energy fr fr πΈ
π SYNOPSIS
int mac_enable_tx_lpi(struct phylink_config *config, u32 timer, bool tx_clk_stop);
Three args, no drama. Let's meet them π«Ά
π¦ ARGUMENTS
configβ a pointer to astruct phylink_config. Yeah, that one. She's your ticket in π«timerβ the LPI timeout, measured in microseconds. Little numbers, big job β±οΈtx_clk_stopβ aboolthat says whether the xMII transmit clock is allowed to be stopped while LPI is happening. Stopping clocks = iconic but also very much a whole thing π
π DESCRIPTION
So first thing: she configures the LPI timeout accordingly. Easy.
Now the important little caveat that lives rent-free in my head: this is only called when the link is already up. Not before, not during, only after. Why? Because some hardware needs to be programmed according to the link speed, and you can't know the speed until the link is up. It's giving "don't ask me to pick an outfit before I know where we're going" π
Then, the actual job: enable LPI generation at the MAC, and configure whether the xMII transmit clock may be stopped. That's it, that's the vibe. She ate and left no crumbs π₯
ngl the "already up" part is not a suggestion, it's the contract. Respect it or the hardware will simply not cooperate.
π RETURN
Returns 0 on success. Periodt.
And um β if you were thinking about returning an error? Please consult with rmk before returning an error. That's not me being dramatic, that's literally in the docs. Ask rmk first. π
π SEE ALSO
The whole group chat, in order, and I'm not skipping a single one of them because they're all invited to the function π
- Kernel file
./include/linux/phylink.h, andstruct phylink_link_state(9) struct phylink_config(9)struct phylink_mac_ops(9)mac_get_caps(9)mac_select_pcs(9)mac_prepare(9)mac_config(9)mac_finish(9)mac_link_down(9)mac_link_up(9)mac_disable_tx_lpi(9)β yeah, the other one, they're a matching set β¨mac_wol_set(9)struct phylink_pcs(9)struct phylink_pcs_ops(9)pcs_validate(9)pcs_inband_caps(9)pcs_enable(9)pcs_disable(9)pcs_get_state(9)pcs_config(9)pcs_an_restart(9)pcs_link_up(9)pcs_disable_eee(9)pcs_enable_eee(9)pcs_pre_init(9)phylink_get_link_timer_ns(9)phylink_mac_implements_lpi(9)
π real talk though: 27 manpage refs in one SEE ALSO is a lot of links and honestly, study them, that's the whole PHYLINK extended universe and it goes hard.
and that's the page!! mwah π this one lives at ./include/linux, stamped October 2026, section 9 β catch you in the next manpage, 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