]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ath9k: change the default antenna settings based on diversity
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tue, 29 Nov 2011 15:00:35 +0000 (20:30 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 30 Nov 2011 20:08:34 +0000 (15:08 -0500)
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 <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/recv.c

index 4c8e296f663b7189fd8f172b287cebc99a870141..b1b0ec76157be4783c6638001c486b6aabf1c417 100644 (file)
@@ -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)