b43: HT-PHY: store TX power state before disabling it
authorRafał Miłecki <zajec5@gmail.com>
Sun, 17 Mar 2013 18:49:08 +0000 (19:49 +0100)
committerRafał Miłecki <zajec5@gmail.com>
Tue, 23 Apr 2013 10:27:56 +0000 (12:27 +0200)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
drivers/net/wireless/b43/phy_ht.c

index 1caeedc8f6863f6a77269c89646a690a14a9e2a6..355651a1099e6b61446b66ce088e13b4d843135d 100644 (file)
@@ -497,15 +497,17 @@ static void b43_phy_ht_tx_power_ctl(struct b43_wldev *dev, bool enable)
        static const u16 cmd_regs[3] = { B43_PHY_HT_TXPCTL_CMD_C1,
                                         B43_PHY_HT_TXPCTL_CMD_C2,
                                         B43_PHY_HT_TXPCTL_CMD_C3 };
+       static const u16 status_regs[3] = { B43_PHY_HT_TX_PCTL_STATUS_C1,
+                                           B43_PHY_HT_TX_PCTL_STATUS_C2,
+                                           B43_PHY_HT_TX_PCTL_STATUS_C3 };
        int i;
 
        if (!enable) {
                if (b43_phy_read(dev, B43_PHY_HT_TXPCTL_CMD_C1) & en_bits) {
                        /* We disable enabled TX pwr ctl, save it's state */
-                       /*
-                        * TODO: find the registers. On N-PHY they were 0x1ed
-                        * and 0x1ee, we need 3 such a registers for HT-PHY
-                        */
+                       for (i = 0; i < 3; i++)
+                               phy_ht->tx_pwr_idx[i] =
+                                       b43_phy_read(dev, status_regs[i]);
                }
                b43_phy_mask(dev, B43_PHY_HT_TXPCTL_CMD_C1, ~en_bits);
        } else {