diff --git a/sys/dev/ath/ath_hal/ah_debug.h b/sys/dev/ath/ath_hal/ah_debug.h index 47b86888d063..f31eec04acdf 100644 --- a/sys/dev/ath/ath_hal/ah_debug.h +++ b/sys/dev/ath/ath_hal/ah_debug.h @@ -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 }; diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c b/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c index 29019091e4bc..d19e3def1900 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c @@ -371,6 +371,9 @@ ar9285_ant_comb_scan(struct ath_hal *ah, struct ath_rx_status *rs, 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, struct ath_rx_status *rs, 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;