Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2013 04:46:43 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252237 - head/sys/contrib/dev/ath/ath_hal/ar9300
Message-ID:  <201306260446.r5Q4khv5087386@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Jun 26 04:46:43 2013
New Revision: 252237
URL: http://svnweb.freebsd.org/changeset/base/252237

Log:
  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.

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c
==============================================================================
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c	Wed Jun 26 04:46:03 2013	(r252236)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_radio.c	Wed Jun 26 04:46:43 2013	(r252237)
@@ -86,9 +86,7 @@ ar9300_set_channel(struct ath_hal *ah, s
     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, s
         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, s
             } 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;
             /* 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306260446.r5Q4khv5087386>