Skip to content

Commit

Permalink
rtl8187: fix tx power reading
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrea Merello authored and David S. Miller committed Jan 28, 2008
1 parent 9ee1ba4 commit 43fd6c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/wireless/rtl8187_rtl8225.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 43fd6c7

Please sign in to comment.