From: Mohammed Shafi Shajakhan Date: Tue, 29 Nov 2011 15:00:35 +0000 (+0530) Subject: ath9k: change the default antenna settings based on diversity X-Git-Tag: firefly_0821_release~3680^2~3834^2~44^2~268 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb840a80d2e5f446ad58a6d4f14dcaa3d877a362;p=firefly-linux-kernel-4.4.55.git ath9k: change the default antenna settings based on diversity change the AR_DEF_ANTENNA register settings i.e setting default antenna setting only for antenna diversity enabled chipsets. no point in doing this for MIMO chipsets Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 4c8e296f663b..b1b0ec76157b 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -1923,15 +1923,20 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) skb = hdr_skb; } - /* - * change the default rx antenna if rx diversity chooses the - * other antenna 3 times in a row. - */ - if (sc->rx.defant != rs.rs_antenna) { - if (++sc->rx.rxotherant >= 3) - ath_setdefantenna(sc, rs.rs_antenna); - } else { - sc->rx.rxotherant = 0; + + if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) { + + /* + * change the default rx antenna if rx diversity + * chooses the other antenna 3 times in a row. + */ + if (sc->rx.defant != rs.rs_antenna) { + if (++sc->rx.rxotherant >= 3) + ath_setdefantenna(sc, rs.rs_antenna); + } else { + sc->rx.rxotherant = 0; + } + } if (rxs->flag & RX_FLAG_MMIC_STRIPPED)