aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
-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}