aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-01-24 00:49:32 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-01-30 17:41:35 -0500
commitb6e4da72342cb075a2742c79e693c8edc1d55389 (patch)
treec21c089c15328273ceb350ea0d71c928e4c0277f
parent3c5eca542d19cd50e9a028dc32897cd698dcc33e (diff)
[PATCH] ipw2100: Fix setting txpower failed problem
The ipw2100 driver misunderstood the parameter of txpower. Tx Power off means turn off the radio, but the driver interpret it as "can't set txpower". So when getting the txpower, it sets disabled=1 to the iwconifg tool in managed mode. And the tool will display "Tx Power off" when disabled=1. Now, in managed mode, iwconfig will not show "TX Power" if the radio is not switched off. It will only display "Tx Power off" only if the radio is killed. Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ipw2100.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 027352a84dce..6290c9f7e939 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -7114,11 +7114,17 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7114{ 7114{
7115 struct ipw2100_priv *priv = ieee80211_priv(dev); 7115 struct ipw2100_priv *priv = ieee80211_priv(dev);
7116 int err = 0, value; 7116 int err = 0, value;
7117
7118 if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled))
7119 return -EINPROGRESS;
7117 7120
7118 if (priv->ieee->iw_mode != IW_MODE_ADHOC) 7121 if (priv->ieee->iw_mode != IW_MODE_ADHOC)
7122 return 0;
7123
7124 if ((wrqu->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
7119 return -EINVAL; 7125 return -EINVAL;
7120 7126
7121 if (wrqu->txpower.disabled == 1 || wrqu->txpower.fixed == 0) 7127 if (wrqu->txpower.fixed == 0)
7122 value = IPW_TX_POWER_DEFAULT; 7128 value = IPW_TX_POWER_DEFAULT;
7123 else { 7129 else {
7124 if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || 7130 if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM ||
@@ -7153,24 +7159,19 @@ static int ipw2100_wx_get_txpow(struct net_device *dev,
7153 7159
7154 struct ipw2100_priv *priv = ieee80211_priv(dev); 7160 struct ipw2100_priv *priv = ieee80211_priv(dev);
7155 7161
7156 if (priv->ieee->iw_mode != IW_MODE_ADHOC) { 7162 wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0;
7157 wrqu->power.disabled = 1;
7158 return 0;
7159 }
7160 7163
7161 if (priv->tx_power == IPW_TX_POWER_DEFAULT) { 7164 if (priv->tx_power == IPW_TX_POWER_DEFAULT) {
7162 wrqu->power.fixed = 0; 7165 wrqu->txpower.fixed = 0;
7163 wrqu->power.value = IPW_TX_POWER_MAX_DBM; 7166 wrqu->txpower.value = IPW_TX_POWER_MAX_DBM;
7164 wrqu->power.disabled = 1;
7165 } else { 7167 } else {
7166 wrqu->power.disabled = 0; 7168 wrqu->txpower.fixed = 1;
7167 wrqu->power.fixed = 1; 7169 wrqu->txpower.value = priv->tx_power;
7168 wrqu->power.value = priv->tx_power;
7169 } 7170 }
7170 7171
7171 wrqu->power.flags = IW_TXPOW_DBM; 7172 wrqu->txpower.flags = IW_TXPOW_DBM;
7172 7173
7173 IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->power.value); 7174 IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->txpower.value);
7174 7175
7175 return 0; 7176 return 0;
7176} 7177}