Commit 43fd6c7e authored by Andrea Merello's avatar Andrea Merello Committed by David S. Miller

rtl8187: fix tx power reading

CCK and OFDM power levels are stored in adjacent bytes, not nibbles.
Signed-off-by: default avatarMichael Wu <flamingice@sourmilk.net>
Signed-off-by: default avatarAndrea Merello <andreamrl@tiscali.it>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9ee1ba47
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment