rtl8187: fix tx power reading
authorAndrea Merello <andreamrl@tiscali.it>
Sun, 2 Dec 2007 22:17:51 +0000 (17:17 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:05:46 +0000 (15:05 -0800)
CCK and OFDM power levels are stored in adjacent bytes, not nibbles.

Signed-off-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: Andrea Merello <andreamrl@tiscali.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtl8187_rtl8225.c

index efc41207780eea5a7410caf72aab5410fa6decca..eade81f76510a44fd0dab4be6bf9551c2d06dded 100644 (file)
@@ -283,8 +283,8 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
        u32 reg;
        int i;
 
-       cck_power = priv->channels[channel - 1].val & 0xF;
-       ofdm_power = priv->channels[channel - 1].val >> 4;
+       cck_power = priv->channels[channel - 1].val & 0xFF;
+       ofdm_power = priv->channels[channel - 1].val >> 8;
 
        cck_power = min(cck_power, (u8)11);
        ofdm_power = min(ofdm_power, (u8)35);
@@ -500,8 +500,8 @@ static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
        u32 reg;
        int i;
 
-       cck_power = priv->channels[channel - 1].val & 0xF;
-       ofdm_power = priv->channels[channel - 1].val >> 4;
+       cck_power = priv->channels[channel - 1].val & 0xFF;
+       ofdm_power = priv->channels[channel - 1].val >> 8;
 
        cck_power = min(cck_power, (u8)15);
        cck_power += priv->txpwr_base & 0xF;