ar9003_hw_set_channel(9)
โจ ar9003_hw_set_channel(9) โจ
okay bestie, welcome to the Kernel API Manual โ yes that's the manual name, and yes we're reading it together, grab a boba ๐ง because this one's about setting channels on a single-chip device and it's honestly kinda iconic ๐
๐ NAME ๐
ar9003_hw_set_channel โ set channel on single-chip device. that's it, that's the whole vibe, short and slay โจ
๐ธ SYNOPSIS ๐ธ
int ar9003_hw_set_channel (struct ath_hw *ah , struct ath9k_channel
*chan );
not me pasting this exactly as-is because we do not touch the signatures in this house ๐ซถ
๐ฆ ARGUMENTS ๐ฆ
ahโ the atheros hardware structure, your main character struct fr fr ๐chanโ literally just here existing ๐ญ the original gives it no description at all, so no cap, we're not inventing one. it's thestruct ath9k_channel *, bestie, that's all we know from the signature ๐
๐ DESCRIPTION ๐
so this is the function for changing the channel on single-chip devices โ meaning the AR9300 family of chipsets, iykyk ๐ฅ
it takes the channel value in MHz and sets the hardware channel value. oh and important caveat: it assumes writes have been enabled to the analog bus โ like, that's a prerequisite, not a suggestion, so make sure that's already handled before you come calling ๐
now the actual expressions, and these are giving math class but make it hardware ๐งฎโจ
for a 2GHz channel, the channel frequency is:
Channel Frequency = (3/4) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
with (freq_ref = 40MHz) โญ
for a 5GHz channel, the channel frequency is:
Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^10)
with (freq_ref = 40MHz/(24>>amodeRefSel)) โ yes that bit-shift is in there, it's not a typo, we keep it exactly as the page says ๐
and for 5GHz channels which are 5MHz spaced, the channel frequency is:
Channel Frequency = (3/2) * freq_ref * (chansel[8:0] + chanfrac[16:0]/2^17)
with (freq_ref = 40MHz) ๐
heads up bestie, notice the 5MHz-spaced one uses/2^17like the 2GHz formula, while the regular 5GHz one uses/2^10โ that's not me being chaotic, that's literally what the page says, so copy it carefully ๐
๐ SEE ALSO ๐
- the kernel file
./drivers/net/wireless/ath/ath9k/ar9003_phy.cโ go read the source, it ate ๐ ar9003_hw_spur_mitigate_mrc_cck(9)โ the friend of a friend, also important ๐ซถ
and that's the whole page, bestie ๐๐ this gem comes from ./drivers/net/wireless/ath/ath9k, dated October 2026, and its title is of course ar9003_hw_set_channel(9) โ slay, periodt, go set some channels responsibly โจ๐๐ธ
๐ฆ 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