From owner-svn-src-all@FreeBSD.ORG Wed Apr 13 15:08:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEFAC1065670; Wed, 13 Apr 2011 15:08:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A11D78FC19; Wed, 13 Apr 2011 15:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3DF8pPS096165; Wed, 13 Apr 2011 15:08:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3DF8pFw096162; Wed, 13 Apr 2011 15:08:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104131508.p3DF8pFw096162@svn.freebsd.org> From: Adrian Chadd Date: Wed, 13 Apr 2011 15:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220599 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 15:08:51 -0000 Author: adrian Date: Wed Apr 13 15:08:51 2011 New Revision: 220599 URL: http://svn.freebsd.org/changeset/base/220599 Log: More kite diversity related changes. * add a diversity flag to the HAL debugging section * add a check to make sure the kite diversity code doesn't run on boards that don't require it, as not all Kite chips will implement it. * add some debug statements when the diversity code makes changes to the antenna diversity/combining setup. Modified: head/sys/dev/ath/ath_hal/ah_debug.h head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Wed Apr 13 14:51:07 2011 (r220598) +++ head/sys/dev/ath/ath_hal/ah_debug.h Wed Apr 13 15:08:51 2011 (r220599) @@ -44,6 +44,7 @@ enum { HAL_DEBUG_POWER = 0x00020000, /* power management */ HAL_DEBUG_GPIO = 0x00040000, /* GPIO debugging */ HAL_DEBUG_INTERRUPT = 0x00080000, /* interrupt handling */ + HAL_DEBUG_DIVERSITY = 0x00100000, /* diversity debugging */ HAL_DEBUG_ANY = 0xffffffff }; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Wed Apr 13 14:51:07 2011 (r220598) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Wed Apr 13 15:08:51 2011 (r220599) @@ -371,6 +371,9 @@ ar9285_ant_comb_scan(struct ath_hal *ah, int rx_ant_conf, main_ant_conf; HAL_BOOL short_scan = AH_FALSE; + if (! ar9285_check_div_comb(ah)) + return; + rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) & ATH_ANT_RX_MASK; main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) & @@ -415,7 +418,6 @@ ar9285_ant_comb_scan(struct ath_hal *ah, antcomb->total_pkt_count); } - ar9285_antdiv_comb_conf_get(ah, &div_ant_conf); curr_alt_set = div_ant_conf.alt_lna_conf; curr_main_set = div_ant_conf.main_lna_conf; @@ -585,6 +587,16 @@ div_comb_done: ar9285_antdiv_comb_conf_set(ah, &div_ant_conf); + if (curr_alt_set != div_ant_conf.alt_lna_conf) + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: lna_conf: %x -> %x\n", + __func__, curr_alt_set, div_ant_conf.alt_lna_conf); + if (curr_main_set != div_ant_conf.main_lna_conf) + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_lna_conf: %x -> %x\n", + __func__, curr_main_set, div_ant_conf.main_lna_conf); + if (curr_bias != div_ant_conf.fast_div_bias) + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: fast_div_bias: %x -> %x\n", + __func__, curr_bias, div_ant_conf.fast_div_bias); + antcomb->scan_start_time = ticks; antcomb->total_pkt_count = 0; antcomb->main_total_rssi = 0;