]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath9k: Store the chip chainmask in HW capabilities
authorSujith Manoharan <c_manoha@qca.qualcomm.com>
Sun, 16 Nov 2014 00:41:04 +0000 (06:11 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Nov 2014 20:32:16 +0000 (15:32 -0500)
Cc: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h

index 19004dd260921e3f1849b1f11d92552874fd87e0..fbc78d80c559c3676cea7bb6d29533c4edf2b8e4 100644 (file)
@@ -2341,7 +2341,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
        struct ath9k_hw_capabilities *pCap = &ah->caps;
        struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
        struct ath_common *common = ath9k_hw_common(ah);
-       unsigned int chip_chainmask;
 
        u16 eeval;
        u8 ant_div_ctl1, tx_chainmask, rx_chainmask;
@@ -2385,15 +2384,16 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
            AR_SREV_9285(ah) ||
            AR_SREV_9330(ah) ||
            AR_SREV_9565(ah))
-               chip_chainmask = 1;
-       else if (AR_SREV_9462(ah))
-               chip_chainmask = 3;
+               pCap->chip_chainmask = 1;
        else if (!AR_SREV_9280_20_OR_LATER(ah))
-               chip_chainmask = 7;
-       else if (!AR_SREV_9300_20_OR_LATER(ah) || AR_SREV_9340(ah))
-               chip_chainmask = 3;
+               pCap->chip_chainmask = 7;
+       else if (!AR_SREV_9300_20_OR_LATER(ah) ||
+                AR_SREV_9340(ah) ||
+                AR_SREV_9462(ah) ||
+                AR_SREV_9531(ah))
+               pCap->chip_chainmask = 3;
        else
-               chip_chainmask = 7;
+               pCap->chip_chainmask = 7;
 
        pCap->tx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_TX_MASK);
        /*
@@ -2411,8 +2411,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
                /* Use rx_chainmask from EEPROM. */
                pCap->rx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_RX_MASK);
 
-       pCap->tx_chainmask = fixup_chainmask(chip_chainmask, pCap->tx_chainmask);
-       pCap->rx_chainmask = fixup_chainmask(chip_chainmask, pCap->rx_chainmask);
+       pCap->tx_chainmask = fixup_chainmask(pCap->chip_chainmask, pCap->tx_chainmask);
+       pCap->rx_chainmask = fixup_chainmask(pCap->chip_chainmask, pCap->rx_chainmask);
        ah->txchainmask = pCap->tx_chainmask;
        ah->rxchainmask = pCap->rx_chainmask;
 
index 893584b37bcaaae8766d6ee491fdbf87dde44d81..4cf9e0ac07439c3dc29aa5502b2c4c3543bfaa09 100644 (file)
@@ -276,6 +276,7 @@ struct ath9k_hw_capabilities {
        u16 rts_aggr_limit;
        u8 tx_chainmask;
        u8 rx_chainmask;
+       u8 chip_chainmask;
        u8 max_txchains;
        u8 max_rxchains;
        u8 num_gpio_pins;