ath5k_hw_set_power_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ ath5k_hw_set_power_mode(9) β€” the sleepover episode πŸ’€

Okay bestie, so this one is from the Kernel API Manual and it's literally about telling your wifi chip how to nap 😴✨ Not me getting emotional over a power mode function at 2am.


🌸 NAME 🌸

ath5k_hw_set_power_mode β€” set power mode. She sets the vibe, she sets the sleep. Simple as that πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int ath5k_hw_set_power_mode (struct ath5k_hw *ah , enum ath5k_power_mode
mode , bool set_chip , u16 sleep_duration );

That's the whole cast of characters right there, no cap 🫢


✨ ARGUMENTS ✨

  • ah β€” the struct ath5k_hw. It's the hardware struct, the main character of the whole operation πŸ‘‘
  • mode β€” one of enum ath5k_power_mode. Gotta pick your nap style from the official list, no improvising 🧚
  • set_chip β€” set this to true to write the sleep control register. Fr fr, true actually writes the thing, that's the whole point πŸ’–
  • sleep_duration β€” how much time the device is allowed to sleep when the sleep logic is enabled, measured in 128 microsecond increments. So like, do the math on that one πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

So the way that this works is: ath5k_hw_set_power_mode is the function you use to configure the sleep policy and the allowed sleep modes. It's giving bedtime-routine-for-hardware energy πŸ›οΈβœ¨

For more info, she says go check out the sleep control register on reg.h and STA_ID1. That's where the lore lives, iykyk πŸ“–

And the returns? Bestie, listen:

  • Returns 0 on success πŸŽ‰ slay
  • Returns -EIO if the chip didn't wake up 😭 lowkey tragic
  • Returns -EINVAL if an invalid mode is requested πŸ™ˆ like, girl, that mode doesn't exist
Heads up: that -EIO is the chip refusing to wake up situation β€” pay attention to that one, it's not just flavor text πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/net/wireless/ath/ath5k/reset.c β€” Reset function and helpers(9), plus the whole friend group:

That's the group chat and everyone is invited 🌈


🌸 sign-off 🌸

This icon lives in ./drivers/net/wireless/ath/ath5k, dated October 2026 β€” and the page is ath5k_hw_set_power_mode(9) in the Kernel API Manual. Periodt. Sleep tight bestie, don't let the -EIO bite πŸ“πŸ’€

πŸ“¦ where this page comes from