ar9002_hw_set_channel(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ar9002_hw_set_channel β€” kernel API manual energy

okay so this page is ar9002_hw_set_channel(9) from the Kernel API Manual, and it's genuinely one of those little functions that's lowkey the main character of the whole chip πŸ”₯

✨ NAME ✨

ar9002_hw_set_channel β€” set channel on single-chip device 🎯

🌸 SYNOPSIS 🌸

int ar9002_hw_set_channel (struct ath_hw *ah , struct ath9k_channel
*chan );

πŸŽ€ ARGUMENTS πŸŽ€

  • ah β€” atheros hardware structure (this is the whole hardware vibe holder, bestie)
  • chan β€” ngl the original page literally gives this one zero description 😭 so we're just gonna hold space for it 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is the function to change channel on single-chip devices β€” and by "single-chip devices" we mean all devices after ar9280. periodt. πŸ‘‘

What it does: it takes the channel value in MHz and sets the hardware channel value. Simple, iconic, no notes. ✨

⚠️ heads up though β€” it assumes writes have been enabled to analog bus already. like, that's on you, it's not doing the vibe check for you πŸ’€

Actual Expression, (yes, the original page really says it like that, and honestly? slay 🌈)

For 2GHz channel:

Channel Frequency = (3/4) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)   (freq_ref = 40MHz)

For 5GHz channel:

Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^10)   (freq_ref = 40MHz/(24>>amodeRefSel))

the way those fractions are just sitting there being all math-y 🧚 iykyk πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/net/wireless/ath/ath9k/ar9002_phy.c
  • Programming Atheros 802.11n analog front end radios(9)
  • ar9002_hw_spur_mitigate(9)

and that's the whole page, bestie πŸŽ€ cute lil sign-off time: this one lives under ./drivers/net/wireless/ath/ath9k, it's dated October 2026, and the page itself is ar9002_hw_set_channel(9) πŸ’– go set some channels, ily 🫢✨

πŸ“¦ where this page comes from