aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Hong <hong.liu@intel.com>2005-07-13 13:29:21 -0400
committerJames Ketrenos <jketreno@linux.intel.com>2005-11-07 18:50:06 -0500
commitf75459e6f64ca0632f23029e2ca47b424dd33373 (patch)
tree4476b0f6df484ed3905de6e12b8802bdfc3c16d4
parent25b645be1e25e16ea7a25678ac195a0e7595c629 (diff)
[Bug 339] Fix ipw2100 iwconfig set/get txpower.
Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
-rw-r--r--drivers/net/wireless/ipw2100.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index cf5da20d1d45..73287ab7bff1 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5102,6 +5102,10 @@ static int ipw2100_set_tx_power(struct ipw2100_priv *priv, u32 tx_power)
5102 }; 5102 };
5103 int err = 0; 5103 int err = 0;
5104 5104
5105 if (tx_power != IPW_TX_POWER_DEFAULT)
5106 tx_power = (tx_power - IPW_TX_POWER_MIN_DBM) * 16 /
5107 (IPW_TX_POWER_MAX_DBM - IPW_TX_POWER_MIN_DBM);
5108
5105 cmd.host_command_parameters[0] = tx_power; 5109 cmd.host_command_parameters[0] = tx_power;
5106 5110
5107 if (priv->ieee->iw_mode == IW_MODE_ADHOC) 5111 if (priv->ieee->iw_mode == IW_MODE_ADHOC)
@@ -7523,8 +7527,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7523 wrqu->txpower.value > IPW_TX_POWER_MAX_DBM) 7527 wrqu->txpower.value > IPW_TX_POWER_MAX_DBM)
7524 return -EINVAL; 7528 return -EINVAL;
7525 7529
7526 value = (wrqu->txpower.value - IPW_TX_POWER_MIN_DBM) * 16 / 7530 value = wrqu->txpower.value;
7527 (IPW_TX_POWER_MAX_DBM - IPW_TX_POWER_MIN_DBM);
7528 } 7531 }
7529 7532
7530 down(&priv->action_sem); 7533 down(&priv->action_sem);
@@ -7564,11 +7567,7 @@ static int ipw2100_wx_get_txpow(struct net_device *dev,
7564 } else { 7567 } else {
7565 wrqu->power.disabled = 0; 7568 wrqu->power.disabled = 0;
7566 wrqu->power.fixed = 1; 7569 wrqu->power.fixed = 1;
7567 wrqu->power.value = 7570 wrqu->power.value = priv->tx_power;
7568 (priv->tx_power *
7569 (IPW_TX_POWER_MAX_DBM - IPW_TX_POWER_MIN_DBM)) /
7570 (IPW_TX_POWER_MAX - IPW_TX_POWER_MIN) +
7571 IPW_TX_POWER_MIN_DBM;
7572 } 7571 }
7573 7572
7574 wrqu->power.flags = IW_TXPOW_DBM; 7573 wrqu->power.flags = IW_TXPOW_DBM;