ath9k_hw: Fix calculation of PAPRD training power at 5Ghz
authorMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Tue, 21 Jun 2011 09:21:46 +0000 (14:51 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Jun 2011 20:09:48 +0000 (16:09 -0400)
higher the chainmask, lesser the power_delta to be added
to the paprd_training_power

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_paprd.c

index fc9c08f513cf4eb2eb797b3dc22a773cc2b3e254..8f6d11dfa371fa57d01e9b70fe356ed0209fe82a 100644 (file)
@@ -83,7 +83,23 @@ static int ar9003_get_training_power_5g(struct ath_hw *ah)
        if (delta > scale)
                return -1;
 
-       power += 2 * get_streams(common->tx_chainmask);
+       switch (get_streams(common->tx_chainmask)) {
+       case 1:
+               delta = 6;
+               break;
+       case 2:
+               delta = 4;
+               break;
+       case 3:
+               delta = 2;
+               break;
+       default:
+               delta = 0;
+               ath_dbg(common, ATH_DBG_CALIBRATE,
+               "Invalid tx-chainmask: %u\n", common->tx_chainmask);
+       }
+
+       power += delta;
        return power;
 }