From owner-svn-src-head@FreeBSD.ORG Wed Jun 26 04:46:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BB0F1C55; Wed, 26 Jun 2013 04:46:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1791D53; Wed, 26 Jun 2013 04:46:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5Q4khHL087387; Wed, 26 Jun 2013 04:46:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5Q4khv5087386; Wed, 26 Jun 2013 04:46:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201306260446.r5Q4khv5087386@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Jun 2013 04:46:43 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2013 04:46:43 -0000 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; /*