diff options
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
-rw-r--r-- | drivers/net/wireless/ipw2100.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8bf02763b5c7..6290c9f7e939 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2201,6 +2201,17 @@ static int ipw2100_alloc_skb(struct ipw2100_priv *priv, | |||
2201 | #define SEARCH_SNAPSHOT 1 | 2201 | #define SEARCH_SNAPSHOT 1 |
2202 | 2202 | ||
2203 | #define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) | 2203 | #define SNAPSHOT_ADDR(ofs) (priv->snapshot[((ofs) >> 12) & 0xff] + ((ofs) & 0xfff)) |
2204 | static void ipw2100_snapshot_free(struct ipw2100_priv *priv) | ||
2205 | { | ||
2206 | int i; | ||
2207 | if (!priv->snapshot[0]) | ||
2208 | return; | ||
2209 | for (i = 0; i < 0x30; i++) | ||
2210 | kfree(priv->snapshot[i]); | ||
2211 | priv->snapshot[0] = NULL; | ||
2212 | } | ||
2213 | |||
2214 | #ifdef CONFIG_IPW2100_DEBUG_C3 | ||
2204 | static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) | 2215 | static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) |
2205 | { | 2216 | { |
2206 | int i; | 2217 | int i; |
@@ -2221,16 +2232,6 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) | |||
2221 | return 1; | 2232 | return 1; |
2222 | } | 2233 | } |
2223 | 2234 | ||
2224 | static void ipw2100_snapshot_free(struct ipw2100_priv *priv) | ||
2225 | { | ||
2226 | int i; | ||
2227 | if (!priv->snapshot[0]) | ||
2228 | return; | ||
2229 | for (i = 0; i < 0x30; i++) | ||
2230 | kfree(priv->snapshot[i]); | ||
2231 | priv->snapshot[0] = NULL; | ||
2232 | } | ||
2233 | |||
2234 | static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, | 2235 | static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, |
2235 | size_t len, int mode) | 2236 | size_t len, int mode) |
2236 | { | 2237 | { |
@@ -2269,6 +2270,7 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf, | |||
2269 | 2270 | ||
2270 | return ret; | 2271 | return ret; |
2271 | } | 2272 | } |
2273 | #endif | ||
2272 | 2274 | ||
2273 | /* | 2275 | /* |
2274 | * | 2276 | * |
@@ -7112,11 +7114,17 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, | |||
7112 | { | 7114 | { |
7113 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7115 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
7114 | int err = 0, value; | 7116 | int err = 0, value; |
7117 | |||
7118 | if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled)) | ||
7119 | return -EINPROGRESS; | ||
7115 | 7120 | ||
7116 | 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) | ||
7117 | return -EINVAL; | 7125 | return -EINVAL; |
7118 | 7126 | ||
7119 | if (wrqu->txpower.disabled == 1 || wrqu->txpower.fixed == 0) | 7127 | if (wrqu->txpower.fixed == 0) |
7120 | value = IPW_TX_POWER_DEFAULT; | 7128 | value = IPW_TX_POWER_DEFAULT; |
7121 | else { | 7129 | else { |
7122 | if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || | 7130 | if (wrqu->txpower.value < IPW_TX_POWER_MIN_DBM || |
@@ -7151,24 +7159,19 @@ static int ipw2100_wx_get_txpow(struct net_device *dev, | |||
7151 | 7159 | ||
7152 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7160 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
7153 | 7161 | ||
7154 | if (priv->ieee->iw_mode != IW_MODE_ADHOC) { | 7162 | wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; |
7155 | wrqu->power.disabled = 1; | ||
7156 | return 0; | ||
7157 | } | ||
7158 | 7163 | ||
7159 | if (priv->tx_power == IPW_TX_POWER_DEFAULT) { | 7164 | if (priv->tx_power == IPW_TX_POWER_DEFAULT) { |
7160 | wrqu->power.fixed = 0; | 7165 | wrqu->txpower.fixed = 0; |
7161 | wrqu->power.value = IPW_TX_POWER_MAX_DBM; | 7166 | wrqu->txpower.value = IPW_TX_POWER_MAX_DBM; |
7162 | wrqu->power.disabled = 1; | ||
7163 | } else { | 7167 | } else { |
7164 | wrqu->power.disabled = 0; | 7168 | wrqu->txpower.fixed = 1; |
7165 | wrqu->power.fixed = 1; | 7169 | wrqu->txpower.value = priv->tx_power; |
7166 | wrqu->power.value = priv->tx_power; | ||
7167 | } | 7170 | } |
7168 | 7171 | ||
7169 | wrqu->power.flags = IW_TXPOW_DBM; | 7172 | wrqu->txpower.flags = IW_TXPOW_DBM; |
7170 | 7173 | ||
7171 | IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->power.value); | 7174 | IPW_DEBUG_WX("GET TX Power -> %d \n", wrqu->txpower.value); |
7172 | 7175 | ||
7173 | return 0; | 7176 | return 0; |
7174 | } | 7177 | } |