From: Adrian Chadd Date: Mon, 9 May 2011 18:23:01 +0800 Subject: [ath9k-devel] AR9285 antenna diversity algorithm and behaviour? Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Hi all, I'm debugging some strange behaviour with the AR9285 on FreeBSD. I've traced down my particular issue to the diversity code which I ported verbatim from ath9k. Has anyone seen the AR9285 diversity code make poor decisions about which LNA configurations to use? Here's an example: Here's the end of the sampling run just after initial interface reset, with good iperf performance (~ 25-27mbit on 11g TX): ar9285_ant_comb_scan: main: 58, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 ar9285_ant_comb_scan: main: 58, alt: 22, rx_ant_conf: 0, main_ant_conf: 2 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 0 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 2 ar9285_ant_comb_scan: main: 58, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 ar9285_ant_comb_scan: main: 57, alt: 22, rx_ant_conf: 0, main_ant_conf: 3 .. then the sampling run concludes, and it decides to switch over the LNA config: ar9285_ant_comb_scan: total_pkt_count=512 ar9285_ant_comb_scan: main_total_rssi=29420 ar9285_ant_comb_scan: alt_total_rssi=11264 ar9285_ant_comb_scan: main_rssi_avg=57 ar9285_ant_comb_scan: alt_alt_rssi_avg=22 .. notice here that it thinks most of the packets were received on the alt chain (rx_ant_conf != main_ant_conf): ar9285_ant_comb_scan: main_recv_cnt=31 ar9285_ant_comb_scan: alt_recv_cnt=481 .. so it adjusts the LNA configuration: ar9285_ant_comb_scan: lna_conf: 2 -> 1 ar9285_ant_comb_scan: main_lna_conf: 1 -> 2 ar9285_ant_comb_scan: fast_div_bias: 2 -> 0 .. and at this point, the main/alt RSSIs change and iperf throughput drops from 25mbit to 10mbit: ar9285_ant_comb_scan: main: 47, alt: 41, rx_ant_conf: 0, main_ant_conf: 1 ar9285_ant_comb_scan: main: 45, alt: 41, rx_ant_conf: 0, main_ant_conf: 2 ar9285_ant_comb_scan: main: 45, alt: 41, rx_ant_conf: 0, main_ant_conf: 0 ar9285_ant_comb_scan: main: 47, alt: 41, rx_ant_conf: 0, main_ant_conf: 1 ar9285_ant_comb_scan: main: 47, alt: 41, rx_ant_conf: 0, main_ant_conf: 2 ar9285_ant_comb_scan: main: 46, alt: 41, rx_ant_conf: 0, main_ant_conf: 1 ar9285_ant_comb_scan: main: 46, alt: 41, rx_ant_conf: 0, main_ant_conf: 3 Would someone clueful in the ways of Kite software antenna diversity care to give me a hand figuring out what's going on? Thanks, Adrian