diff options
author | adrian <adrian@FreeBSD.org> | 2013-06-26 04:46:43 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-06-26 04:46:43 +0000 |
commit | f7f7ee703f502973c16e655ae3dde6437813679b (patch) | |
tree | 72a44caebf7608d15bd2c27cf5a1a0db52378308 /sys | |
parent | 42eb189c9886dfdb3c9aac003099c11b35cb478d (diff) | |
download | FreeBSD-src-f7f7ee703f502973c16e655ae3dde6437813679b.zip FreeBSD-src-f7f7ee703f502973c16e655ae3dde6437813679b.tar.gz |
Re-enable the channel set code for the AR933x.
This required a HAL change to map the 2GHz frequency back to an IEEE
channel number in order to fetch some value(s) to program in.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c index 1abdeb4..9b29471 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c @@ -86,9 +86,7 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan) u_int8_t clk_25mhz = AH9300(ah)->clk_25mhz; CHAN_CENTERS centers; int load_synth_channel; -#ifdef AH_DEBUG_ALQ HAL_CHANNEL_INTERNAL *ichan = ath_hal_checkchannel(ah, chan); -#endif /* * Put this behind AH_DEBUG_ALQ for now until the Hornet @@ -106,12 +104,6 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan) b_mode = 1; /* 2 GHz */ if (AR_SREV_HORNET(ah)) { - /* - * XXX TODO: this should call ieee80211_mhz2ieee which will - * take care of the up/down conversion and GSM mapping. - * However, the HAL _can't_ call that, so we'll need to - * introduce it in ah_osdep or something. - */ #if 0 u_int32_t ichan = ieee80211_mhz2ieee(ah, chan->ic_freq, chan->ic_flags); @@ -121,10 +113,16 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan) } else { channel_sel = ar9300_chansel_xtal_40M[ichan - 1]; } -#else - ath_hal_printf(ah, "%s: unimplemented, implement!\n", __func__); - return AH_FALSE; #endif + uint32_t i; + + i = ath_hal_mhz2ieee_2ghz(ah, ichan); + HALASSERT(i > 0 && i <= 14); + if (clk_25mhz) { + channel_sel = ar9300_chansel_xtal_25M[i - 1]; + } else { + channel_sel = ar9300_chansel_xtal_40M[i - 1]; + } } else if (AR_SREV_POSEIDON(ah) || AR_SREV_APHRODITE(ah)) { u_int32_t channel_frac; /* |