aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl8187_rtl8225.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtl8187_rtl8225.c')
-rw-r--r--drivers/net/wireless/rtl8187_rtl8225.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/wireless/rtl8187_rtl8225.c b/drivers/net/wireless/rtl8187_rtl8225.c
index b713de17ba0a..9146387b4c5e 100644
--- a/drivers/net/wireless/rtl8187_rtl8225.c
+++ b/drivers/net/wireless/rtl8187_rtl8225.c
@@ -283,8 +283,8 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
283 u32 reg; 283 u32 reg;
284 int i; 284 int i;
285 285
286 cck_power = priv->channels[channel - 1].val & 0xF; 286 cck_power = priv->channels[channel - 1].hw_value & 0xF;
287 ofdm_power = priv->channels[channel - 1].val >> 4; 287 ofdm_power = priv->channels[channel - 1].hw_value >> 4;
288 288
289 cck_power = min(cck_power, (u8)11); 289 cck_power = min(cck_power, (u8)11);
290 ofdm_power = min(ofdm_power, (u8)35); 290 ofdm_power = min(ofdm_power, (u8)35);
@@ -500,8 +500,8 @@ static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
500 u32 reg; 500 u32 reg;
501 int i; 501 int i;
502 502
503 cck_power = priv->channels[channel - 1].val & 0xF; 503 cck_power = priv->channels[channel - 1].hw_value & 0xF;
504 ofdm_power = priv->channels[channel - 1].val >> 4; 504 ofdm_power = priv->channels[channel - 1].hw_value >> 4;
505 505
506 cck_power = min(cck_power, (u8)15); 506 cck_power = min(cck_power, (u8)15);
507 cck_power += priv->txpwr_base & 0xF; 507 cck_power += priv->txpwr_base & 0xF;
@@ -735,13 +735,14 @@ static void rtl8225_rf_set_channel(struct ieee80211_hw *dev,
735 struct ieee80211_conf *conf) 735 struct ieee80211_conf *conf)
736{ 736{
737 struct rtl8187_priv *priv = dev->priv; 737 struct rtl8187_priv *priv = dev->priv;
738 int chan = ieee80211_frequency_to_channel(conf->channel->center_freq);
738 739
739 if (priv->rf->init == rtl8225_rf_init) 740 if (priv->rf->init == rtl8225_rf_init)
740 rtl8225_rf_set_tx_power(dev, conf->channel); 741 rtl8225_rf_set_tx_power(dev, chan);
741 else 742 else
742 rtl8225z2_rf_set_tx_power(dev, conf->channel); 743 rtl8225z2_rf_set_tx_power(dev, chan);
743 744
744 rtl8225_write(dev, 0x7, rtl8225_chan[conf->channel - 1]); 745 rtl8225_write(dev, 0x7, rtl8225_chan[chan - 1]);
745 msleep(10); 746 msleep(10);
746} 747}
747 748