summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2015-11-30 06:26:59 +0000
committeradrian <adrian@FreeBSD.org>2015-11-30 06:26:59 +0000
commit7be92c60b623b2a4a5db94cb5dd156fb4f8856d2 (patch)
tree1b4cc32f46eb65d0f03652736218021a06084242 /sys/contrib/dev
parentd871b42ae4d6c9656f44d8e8fb97a770bfcabd69 (diff)
downloadFreeBSD-src-7be92c60b623b2a4a5db94cb5dd156fb4f8856d2.zip
FreeBSD-src-7be92c60b623b2a4a5db94cb5dd156fb4f8856d2.tar.gz
fix ht/40 configuration for ar9331 (hornet).
The synth programming here requires the real centre frequency, which for HT20 channels is the normal channel, but HT40 is /not/ the primary channel. Everything else was using 'freq', which is the correct centre frequency, but the hornet config was using 'ichan' to do the lookup which was also the primary channel. So, modify the HAL call that does the mapping to take a frequency in MHz and return the channel number. Tested: * Carambola 2, AR9331, tested both HT/20 and HT/40 operation.
Diffstat (limited to 'sys/contrib/dev')
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c15
1 files changed, 13 insertions, 2 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 f3dbe06..9a40c44 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
@@ -99,7 +99,6 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
ar9300_get_channel_centers(ah, chan, &centers);
freq = centers.synth_center;
-
if (freq < 4800) { /* 2 GHz, fractional mode */
b_mode = 1; /* 2 GHz */
@@ -116,7 +115,19 @@ ar9300_set_channel(struct ath_hal *ah, struct ieee80211_channel *chan)
#endif
uint32_t i;
- i = ath_hal_mhz2ieee_2ghz(ah, ichan);
+ /*
+ * Pay close attention to this bit!
+ *
+ * We need to map the actual desired synth frequency to
+ * one of the channel select array entries.
+ *
+ * For HT20, it'll align with the channel we select.
+ *
+ * For HT40 though it won't - the centre frequency
+ * will not be the frequency of chan->ic_freq or ichan->freq;
+ * it needs to be whatever frequency maps to 'freq'.
+ */
+ i = ath_hal_mhz2ieee_2ghz(ah, freq);
HALASSERT(i > 0 && i <= 14);
if (clk_25mhz) {
channel_sel = ar9300_chansel_xtal_25M[i - 1];
OpenPOWER on IntegriCloud