aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-01-24 03:37:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-01-30 20:35:35 -0500
commit4644151b7208bec9522cad928a7105e0fc04a2b2 (patch)
tree9771f6008d3a20b673a3203ae2aa0a7f2a3734bc /drivers/net/wireless
parent2638bc394195f27801d1c184c4358ce25599146b (diff)
[PATCH] ipw2200: Semaphore to mutexes conversion
The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Ronald Bultje <rbultje@ronald.bitfreak.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Yi Zhu <yi.zhu@intel.com> Cc: James Ketrenos <jketreno@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ipw2200.c294
-rw-r--r--drivers/net/wireless/ipw2200.h3
2 files changed, 149 insertions, 148 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index f793cd8f8d71..fdb8065a8088 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -812,9 +812,9 @@ static void ipw_led_link_on(struct ipw_priv *priv)
812static void ipw_bg_led_link_on(void *data) 812static void ipw_bg_led_link_on(void *data)
813{ 813{
814 struct ipw_priv *priv = data; 814 struct ipw_priv *priv = data;
815 down(&priv->sem); 815 mutex_lock(&priv->mutex);
816 ipw_led_link_on(data); 816 ipw_led_link_on(data);
817 up(&priv->sem); 817 mutex_unlock(&priv->mutex);
818} 818}
819 819
820static void ipw_led_link_off(struct ipw_priv *priv) 820static void ipw_led_link_off(struct ipw_priv *priv)
@@ -856,9 +856,9 @@ static void ipw_led_link_off(struct ipw_priv *priv)
856static void ipw_bg_led_link_off(void *data) 856static void ipw_bg_led_link_off(void *data)
857{ 857{
858 struct ipw_priv *priv = data; 858 struct ipw_priv *priv = data;
859 down(&priv->sem); 859 mutex_lock(&priv->mutex);
860 ipw_led_link_off(data); 860 ipw_led_link_off(data);
861 up(&priv->sem); 861 mutex_unlock(&priv->mutex);
862} 862}
863 863
864static void __ipw_led_activity_on(struct ipw_priv *priv) 864static void __ipw_led_activity_on(struct ipw_priv *priv)
@@ -935,9 +935,9 @@ static void ipw_led_activity_off(struct ipw_priv *priv)
935static void ipw_bg_led_activity_off(void *data) 935static void ipw_bg_led_activity_off(void *data)
936{ 936{
937 struct ipw_priv *priv = data; 937 struct ipw_priv *priv = data;
938 down(&priv->sem); 938 mutex_lock(&priv->mutex);
939 ipw_led_activity_off(data); 939 ipw_led_activity_off(data);
940 up(&priv->sem); 940 mutex_unlock(&priv->mutex);
941} 941}
942 942
943static void ipw_led_band_on(struct ipw_priv *priv) 943static void ipw_led_band_on(struct ipw_priv *priv)
@@ -2094,9 +2094,9 @@ static void ipw_adapter_restart(void *adapter)
2094static void ipw_bg_adapter_restart(void *data) 2094static void ipw_bg_adapter_restart(void *data)
2095{ 2095{
2096 struct ipw_priv *priv = data; 2096 struct ipw_priv *priv = data;
2097 down(&priv->sem); 2097 mutex_lock(&priv->mutex);
2098 ipw_adapter_restart(data); 2098 ipw_adapter_restart(data);
2099 up(&priv->sem); 2099 mutex_unlock(&priv->mutex);
2100} 2100}
2101 2101
2102#define IPW_SCAN_CHECK_WATCHDOG (5 * HZ) 2102#define IPW_SCAN_CHECK_WATCHDOG (5 * HZ)
@@ -2115,9 +2115,9 @@ static void ipw_scan_check(void *data)
2115static void ipw_bg_scan_check(void *data) 2115static void ipw_bg_scan_check(void *data)
2116{ 2116{
2117 struct ipw_priv *priv = data; 2117 struct ipw_priv *priv = data;
2118 down(&priv->sem); 2118 mutex_lock(&priv->mutex);
2119 ipw_scan_check(data); 2119 ipw_scan_check(data);
2120 up(&priv->sem); 2120 mutex_unlock(&priv->mutex);
2121} 2121}
2122 2122
2123static int ipw_send_scan_request_ext(struct ipw_priv *priv, 2123static int ipw_send_scan_request_ext(struct ipw_priv *priv,
@@ -3735,9 +3735,9 @@ static int ipw_disassociate(void *data)
3735static void ipw_bg_disassociate(void *data) 3735static void ipw_bg_disassociate(void *data)
3736{ 3736{
3737 struct ipw_priv *priv = data; 3737 struct ipw_priv *priv = data;
3738 down(&priv->sem); 3738 mutex_lock(&priv->mutex);
3739 ipw_disassociate(data); 3739 ipw_disassociate(data);
3740 up(&priv->sem); 3740 mutex_unlock(&priv->mutex);
3741} 3741}
3742 3742
3743static void ipw_system_config(void *data) 3743static void ipw_system_config(void *data)
@@ -4097,9 +4097,9 @@ static void ipw_gather_stats(struct ipw_priv *priv)
4097static void ipw_bg_gather_stats(void *data) 4097static void ipw_bg_gather_stats(void *data)
4098{ 4098{
4099 struct ipw_priv *priv = data; 4099 struct ipw_priv *priv = data;
4100 down(&priv->sem); 4100 mutex_lock(&priv->mutex);
4101 ipw_gather_stats(data); 4101 ipw_gather_stats(data);
4102 up(&priv->sem); 4102 mutex_unlock(&priv->mutex);
4103} 4103}
4104 4104
4105/* Missed beacon behavior: 4105/* Missed beacon behavior:
@@ -4931,9 +4931,9 @@ static void ipw_rx_queue_replenish(void *data)
4931static void ipw_bg_rx_queue_replenish(void *data) 4931static void ipw_bg_rx_queue_replenish(void *data)
4932{ 4932{
4933 struct ipw_priv *priv = data; 4933 struct ipw_priv *priv = data;
4934 down(&priv->sem); 4934 mutex_lock(&priv->mutex);
4935 ipw_rx_queue_replenish(data); 4935 ipw_rx_queue_replenish(data);
4936 up(&priv->sem); 4936 mutex_unlock(&priv->mutex);
4937} 4937}
4938 4938
4939/* Assumes that the skb field of the buffers in 'pool' is kept accurate. 4939/* Assumes that the skb field of the buffers in 'pool' is kept accurate.
@@ -5390,7 +5390,7 @@ static void ipw_merge_adhoc_network(void *data)
5390 return; 5390 return;
5391 } 5391 }
5392 5392
5393 down(&priv->sem); 5393 mutex_lock(&priv->mutex);
5394 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) { 5394 if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) {
5395 IPW_DEBUG_MERGE("remove network %s\n", 5395 IPW_DEBUG_MERGE("remove network %s\n",
5396 escape_essid(priv->essid, 5396 escape_essid(priv->essid,
@@ -5400,7 +5400,7 @@ static void ipw_merge_adhoc_network(void *data)
5400 5400
5401 ipw_disassociate(priv); 5401 ipw_disassociate(priv);
5402 priv->assoc_network = match.network; 5402 priv->assoc_network = match.network;
5403 up(&priv->sem); 5403 mutex_unlock(&priv->mutex);
5404 return; 5404 return;
5405 } 5405 }
5406} 5406}
@@ -5835,9 +5835,9 @@ static void ipw_adhoc_check(void *data)
5835static void ipw_bg_adhoc_check(void *data) 5835static void ipw_bg_adhoc_check(void *data)
5836{ 5836{
5837 struct ipw_priv *priv = data; 5837 struct ipw_priv *priv = data;
5838 down(&priv->sem); 5838 mutex_lock(&priv->mutex);
5839 ipw_adhoc_check(data); 5839 ipw_adhoc_check(data);
5840 up(&priv->sem); 5840 mutex_unlock(&priv->mutex);
5841} 5841}
5842 5842
5843#ifdef CONFIG_IPW2200_DEBUG 5843#ifdef CONFIG_IPW2200_DEBUG
@@ -6064,7 +6064,7 @@ static int ipw_request_scan(struct ipw_priv *priv)
6064 (priv->status & STATUS_EXIT_PENDING)) 6064 (priv->status & STATUS_EXIT_PENDING))
6065 return 0; 6065 return 0;
6066 6066
6067 down(&priv->sem); 6067 mutex_lock(&priv->mutex);
6068 6068
6069 if (priv->status & STATUS_SCANNING) { 6069 if (priv->status & STATUS_SCANNING) {
6070 IPW_DEBUG_HC("Concurrent scan requested. Ignoring.\n"); 6070 IPW_DEBUG_HC("Concurrent scan requested. Ignoring.\n");
@@ -6172,16 +6172,16 @@ static int ipw_request_scan(struct ipw_priv *priv)
6172 queue_delayed_work(priv->workqueue, &priv->scan_check, 6172 queue_delayed_work(priv->workqueue, &priv->scan_check,
6173 IPW_SCAN_CHECK_WATCHDOG); 6173 IPW_SCAN_CHECK_WATCHDOG);
6174 done: 6174 done:
6175 up(&priv->sem); 6175 mutex_unlock(&priv->mutex);
6176 return err; 6176 return err;
6177} 6177}
6178 6178
6179static void ipw_bg_abort_scan(void *data) 6179static void ipw_bg_abort_scan(void *data)
6180{ 6180{
6181 struct ipw_priv *priv = data; 6181 struct ipw_priv *priv = data;
6182 down(&priv->sem); 6182 mutex_lock(&priv->mutex);
6183 ipw_abort_scan(data); 6183 ipw_abort_scan(data);
6184 up(&priv->sem); 6184 mutex_unlock(&priv->mutex);
6185} 6185}
6186 6186
6187static int ipw_wpa_enable(struct ipw_priv *priv, int value) 6187static int ipw_wpa_enable(struct ipw_priv *priv, int value)
@@ -6256,7 +6256,7 @@ static int ipw_wx_set_genie(struct net_device *dev,
6256 (wrqu->data.length && extra == NULL)) 6256 (wrqu->data.length && extra == NULL))
6257 return -EINVAL; 6257 return -EINVAL;
6258 6258
6259 //down(&priv->sem); 6259 //mutex_lock(&priv->mutex);
6260 6260
6261 //if (!ieee->wpa_enabled) { 6261 //if (!ieee->wpa_enabled) {
6262 // err = -EOPNOTSUPP; 6262 // err = -EOPNOTSUPP;
@@ -6282,7 +6282,7 @@ static int ipw_wx_set_genie(struct net_device *dev,
6282 6282
6283 ipw_wpa_assoc_frame(priv, ieee->wpa_ie, ieee->wpa_ie_len); 6283 ipw_wpa_assoc_frame(priv, ieee->wpa_ie, ieee->wpa_ie_len);
6284 out: 6284 out:
6285 //up(&priv->sem); 6285 //mutex_unlock(&priv->mutex);
6286 return err; 6286 return err;
6287} 6287}
6288 6288
@@ -6295,7 +6295,7 @@ static int ipw_wx_get_genie(struct net_device *dev,
6295 struct ieee80211_device *ieee = priv->ieee; 6295 struct ieee80211_device *ieee = priv->ieee;
6296 int err = 0; 6296 int err = 0;
6297 6297
6298 //down(&priv->sem); 6298 //mutex_lock(&priv->mutex);
6299 6299
6300 //if (!ieee->wpa_enabled) { 6300 //if (!ieee->wpa_enabled) {
6301 // err = -EOPNOTSUPP; 6301 // err = -EOPNOTSUPP;
@@ -6316,7 +6316,7 @@ static int ipw_wx_get_genie(struct net_device *dev,
6316 memcpy(extra, ieee->wpa_ie, ieee->wpa_ie_len); 6316 memcpy(extra, ieee->wpa_ie, ieee->wpa_ie_len);
6317 6317
6318 out: 6318 out:
6319 //up(&priv->sem); 6319 //mutex_unlock(&priv->mutex);
6320 return err; 6320 return err;
6321} 6321}
6322 6322
@@ -6976,12 +6976,12 @@ static void ipw_bg_qos_activate(void *data)
6976 if (priv == NULL) 6976 if (priv == NULL)
6977 return; 6977 return;
6978 6978
6979 down(&priv->sem); 6979 mutex_lock(&priv->mutex);
6980 6980
6981 if (priv->status & STATUS_ASSOCIATED) 6981 if (priv->status & STATUS_ASSOCIATED)
6982 ipw_qos_activate(priv, &(priv->assoc_network->qos_data)); 6982 ipw_qos_activate(priv, &(priv->assoc_network->qos_data));
6983 6983
6984 up(&priv->sem); 6984 mutex_unlock(&priv->mutex);
6985} 6985}
6986 6986
6987static int ipw_handle_probe_response(struct net_device *dev, 6987static int ipw_handle_probe_response(struct net_device *dev,
@@ -7283,9 +7283,9 @@ static void ipw_roam(void *data)
7283static void ipw_bg_roam(void *data) 7283static void ipw_bg_roam(void *data)
7284{ 7284{
7285 struct ipw_priv *priv = data; 7285 struct ipw_priv *priv = data;
7286 down(&priv->sem); 7286 mutex_lock(&priv->mutex);
7287 ipw_roam(data); 7287 ipw_roam(data);
7288 up(&priv->sem); 7288 mutex_unlock(&priv->mutex);
7289} 7289}
7290 7290
7291static int ipw_associate(void *data) 7291static int ipw_associate(void *data)
@@ -7380,9 +7380,9 @@ static int ipw_associate(void *data)
7380static void ipw_bg_associate(void *data) 7380static void ipw_bg_associate(void *data)
7381{ 7381{
7382 struct ipw_priv *priv = data; 7382 struct ipw_priv *priv = data;
7383 down(&priv->sem); 7383 mutex_lock(&priv->mutex);
7384 ipw_associate(data); 7384 ipw_associate(data);
7385 up(&priv->sem); 7385 mutex_unlock(&priv->mutex);
7386} 7386}
7387 7387
7388static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv, 7388static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv,
@@ -8131,7 +8131,7 @@ static int ipw_wx_get_name(struct net_device *dev,
8131 union iwreq_data *wrqu, char *extra) 8131 union iwreq_data *wrqu, char *extra)
8132{ 8132{
8133 struct ipw_priv *priv = ieee80211_priv(dev); 8133 struct ipw_priv *priv = ieee80211_priv(dev);
8134 down(&priv->sem); 8134 mutex_lock(&priv->mutex);
8135 if (priv->status & STATUS_RF_KILL_MASK) 8135 if (priv->status & STATUS_RF_KILL_MASK)
8136 strcpy(wrqu->name, "radio off"); 8136 strcpy(wrqu->name, "radio off");
8137 else if (!(priv->status & STATUS_ASSOCIATED)) 8137 else if (!(priv->status & STATUS_ASSOCIATED))
@@ -8140,7 +8140,7 @@ static int ipw_wx_get_name(struct net_device *dev,
8140 snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c", 8140 snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c",
8141 ipw_modes[priv->assoc_request.ieee_mode]); 8141 ipw_modes[priv->assoc_request.ieee_mode]);
8142 IPW_DEBUG_WX("Name: %s\n", wrqu->name); 8142 IPW_DEBUG_WX("Name: %s\n", wrqu->name);
8143 up(&priv->sem); 8143 mutex_unlock(&priv->mutex);
8144 return 0; 8144 return 0;
8145} 8145}
8146 8146
@@ -8209,9 +8209,9 @@ static int ipw_wx_set_freq(struct net_device *dev,
8209 8209
8210 if (fwrq->m == 0) { 8210 if (fwrq->m == 0) {
8211 IPW_DEBUG_WX("SET Freq/Channel -> any\n"); 8211 IPW_DEBUG_WX("SET Freq/Channel -> any\n");
8212 down(&priv->sem); 8212 mutex_lock(&priv->mutex);
8213 ret = ipw_set_channel(priv, 0); 8213 ret = ipw_set_channel(priv, 0);
8214 up(&priv->sem); 8214 mutex_unlock(&priv->mutex);
8215 return ret; 8215 return ret;
8216 } 8216 }
8217 /* if setting by freq convert to channel */ 8217 /* if setting by freq convert to channel */
@@ -8239,9 +8239,9 @@ static int ipw_wx_set_freq(struct net_device *dev,
8239 } 8239 }
8240 8240
8241 IPW_DEBUG_WX("SET Freq/Channel -> %d \n", fwrq->m); 8241 IPW_DEBUG_WX("SET Freq/Channel -> %d \n", fwrq->m);
8242 down(&priv->sem); 8242 mutex_lock(&priv->mutex);
8243 ret = ipw_set_channel(priv, channel); 8243 ret = ipw_set_channel(priv, channel);
8244 up(&priv->sem); 8244 mutex_unlock(&priv->mutex);
8245 return ret; 8245 return ret;
8246} 8246}
8247 8247
@@ -8255,14 +8255,14 @@ static int ipw_wx_get_freq(struct net_device *dev,
8255 8255
8256 /* If we are associated, trying to associate, or have a statically 8256 /* If we are associated, trying to associate, or have a statically
8257 * configured CHANNEL then return that; otherwise return ANY */ 8257 * configured CHANNEL then return that; otherwise return ANY */
8258 down(&priv->sem); 8258 mutex_lock(&priv->mutex);
8259 if (priv->config & CFG_STATIC_CHANNEL || 8259 if (priv->config & CFG_STATIC_CHANNEL ||
8260 priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) 8260 priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED))
8261 wrqu->freq.m = priv->channel; 8261 wrqu->freq.m = priv->channel;
8262 else 8262 else
8263 wrqu->freq.m = 0; 8263 wrqu->freq.m = 0;
8264 8264
8265 up(&priv->sem); 8265 mutex_unlock(&priv->mutex);
8266 IPW_DEBUG_WX("GET Freq/Channel -> %d \n", priv->channel); 8266 IPW_DEBUG_WX("GET Freq/Channel -> %d \n", priv->channel);
8267 return 0; 8267 return 0;
8268} 8268}
@@ -8292,7 +8292,7 @@ static int ipw_wx_set_mode(struct net_device *dev,
8292 if (wrqu->mode == priv->ieee->iw_mode) 8292 if (wrqu->mode == priv->ieee->iw_mode)
8293 return 0; 8293 return 0;
8294 8294
8295 down(&priv->sem); 8295 mutex_lock(&priv->mutex);
8296 8296
8297 ipw_sw_reset(priv, 0); 8297 ipw_sw_reset(priv, 0);
8298 8298
@@ -8315,7 +8315,7 @@ static int ipw_wx_set_mode(struct net_device *dev,
8315 priv->ieee->iw_mode = wrqu->mode; 8315 priv->ieee->iw_mode = wrqu->mode;
8316 8316
8317 queue_work(priv->workqueue, &priv->adapter_restart); 8317 queue_work(priv->workqueue, &priv->adapter_restart);
8318 up(&priv->sem); 8318 mutex_unlock(&priv->mutex);
8319 return err; 8319 return err;
8320} 8320}
8321 8321
@@ -8324,10 +8324,10 @@ static int ipw_wx_get_mode(struct net_device *dev,
8324 union iwreq_data *wrqu, char *extra) 8324 union iwreq_data *wrqu, char *extra)
8325{ 8325{
8326 struct ipw_priv *priv = ieee80211_priv(dev); 8326 struct ipw_priv *priv = ieee80211_priv(dev);
8327 down(&priv->sem); 8327 mutex_lock(&priv->mutex);
8328 wrqu->mode = priv->ieee->iw_mode; 8328 wrqu->mode = priv->ieee->iw_mode;
8329 IPW_DEBUG_WX("Get MODE -> %d\n", wrqu->mode); 8329 IPW_DEBUG_WX("Get MODE -> %d\n", wrqu->mode);
8330 up(&priv->sem); 8330 mutex_unlock(&priv->mutex);
8331 return 0; 8331 return 0;
8332} 8332}
8333 8333
@@ -8374,7 +8374,7 @@ static int ipw_wx_get_range(struct net_device *dev,
8374 range->avg_qual.level = 0; /* FIXME to real average level */ 8374 range->avg_qual.level = 0; /* FIXME to real average level */
8375 range->avg_qual.noise = 0; 8375 range->avg_qual.noise = 0;
8376 range->avg_qual.updated = 7; /* Updated all three */ 8376 range->avg_qual.updated = 7; /* Updated all three */
8377 down(&priv->sem); 8377 mutex_lock(&priv->mutex);
8378 range->num_bitrates = min(priv->rates.num_rates, (u8) IW_MAX_BITRATES); 8378 range->num_bitrates = min(priv->rates.num_rates, (u8) IW_MAX_BITRATES);
8379 8379
8380 for (i = 0; i < range->num_bitrates; i++) 8380 for (i = 0; i < range->num_bitrates; i++)
@@ -8416,7 +8416,7 @@ static int ipw_wx_get_range(struct net_device *dev,
8416 range->num_channels = i; 8416 range->num_channels = i;
8417 range->num_frequency = i; 8417 range->num_frequency = i;
8418 8418
8419 up(&priv->sem); 8419 mutex_unlock(&priv->mutex);
8420 8420
8421 /* Event capability (kernel + driver) */ 8421 /* Event capability (kernel + driver) */
8422 range->event_capa[0] = (IW_EVENT_CAPA_K_0 | 8422 range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
@@ -8443,7 +8443,7 @@ static int ipw_wx_set_wap(struct net_device *dev,
8443 8443
8444 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 8444 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
8445 return -EINVAL; 8445 return -EINVAL;
8446 down(&priv->sem); 8446 mutex_lock(&priv->mutex);
8447 if (!memcmp(any, wrqu->ap_addr.sa_data, ETH_ALEN) || 8447 if (!memcmp(any, wrqu->ap_addr.sa_data, ETH_ALEN) ||
8448 !memcmp(off, wrqu->ap_addr.sa_data, ETH_ALEN)) { 8448 !memcmp(off, wrqu->ap_addr.sa_data, ETH_ALEN)) {
8449 /* we disable mandatory BSSID association */ 8449 /* we disable mandatory BSSID association */
@@ -8452,14 +8452,14 @@ static int ipw_wx_set_wap(struct net_device *dev,
8452 IPW_DEBUG_ASSOC("Attempting to associate with new " 8452 IPW_DEBUG_ASSOC("Attempting to associate with new "
8453 "parameters.\n"); 8453 "parameters.\n");
8454 ipw_associate(priv); 8454 ipw_associate(priv);
8455 up(&priv->sem); 8455 mutex_unlock(&priv->mutex);
8456 return 0; 8456 return 0;
8457 } 8457 }
8458 8458
8459 priv->config |= CFG_STATIC_BSSID; 8459 priv->config |= CFG_STATIC_BSSID;
8460 if (!memcmp(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN)) { 8460 if (!memcmp(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN)) {
8461 IPW_DEBUG_WX("BSSID set to current BSSID.\n"); 8461 IPW_DEBUG_WX("BSSID set to current BSSID.\n");
8462 up(&priv->sem); 8462 mutex_unlock(&priv->mutex);
8463 return 0; 8463 return 0;
8464 } 8464 }
8465 8465
@@ -8473,7 +8473,7 @@ static int ipw_wx_set_wap(struct net_device *dev,
8473 if (!ipw_disassociate(priv)) 8473 if (!ipw_disassociate(priv))
8474 ipw_associate(priv); 8474 ipw_associate(priv);
8475 8475
8476 up(&priv->sem); 8476 mutex_unlock(&priv->mutex);
8477 return 0; 8477 return 0;
8478} 8478}
8479 8479
@@ -8484,7 +8484,7 @@ static int ipw_wx_get_wap(struct net_device *dev,
8484 struct ipw_priv *priv = ieee80211_priv(dev); 8484 struct ipw_priv *priv = ieee80211_priv(dev);
8485 /* If we are associated, trying to associate, or have a statically 8485 /* If we are associated, trying to associate, or have a statically
8486 * configured BSSID then return that; otherwise return ANY */ 8486 * configured BSSID then return that; otherwise return ANY */
8487 down(&priv->sem); 8487 mutex_lock(&priv->mutex);
8488 if (priv->config & CFG_STATIC_BSSID || 8488 if (priv->config & CFG_STATIC_BSSID ||
8489 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { 8489 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) {
8490 wrqu->ap_addr.sa_family = ARPHRD_ETHER; 8490 wrqu->ap_addr.sa_family = ARPHRD_ETHER;
@@ -8494,7 +8494,7 @@ static int ipw_wx_get_wap(struct net_device *dev,
8494 8494
8495 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", 8495 IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n",
8496 MAC_ARG(wrqu->ap_addr.sa_data)); 8496 MAC_ARG(wrqu->ap_addr.sa_data));
8497 up(&priv->sem); 8497 mutex_unlock(&priv->mutex);
8498 return 0; 8498 return 0;
8499} 8499}
8500 8500
@@ -8505,7 +8505,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8505 struct ipw_priv *priv = ieee80211_priv(dev); 8505 struct ipw_priv *priv = ieee80211_priv(dev);
8506 char *essid = ""; /* ANY */ 8506 char *essid = ""; /* ANY */
8507 int length = 0; 8507 int length = 0;
8508 down(&priv->sem); 8508 mutex_lock(&priv->mutex);
8509 if (wrqu->essid.flags && wrqu->essid.length) { 8509 if (wrqu->essid.flags && wrqu->essid.length) {
8510 length = wrqu->essid.length - 1; 8510 length = wrqu->essid.length - 1;
8511 essid = extra; 8511 essid = extra;
@@ -8520,7 +8520,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8520 priv->config &= ~CFG_STATIC_ESSID; 8520 priv->config &= ~CFG_STATIC_ESSID;
8521 ipw_associate(priv); 8521 ipw_associate(priv);
8522 } 8522 }
8523 up(&priv->sem); 8523 mutex_unlock(&priv->mutex);
8524 return 0; 8524 return 0;
8525 } 8525 }
8526 8526
@@ -8530,7 +8530,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8530 8530
8531 if (priv->essid_len == length && !memcmp(priv->essid, extra, length)) { 8531 if (priv->essid_len == length && !memcmp(priv->essid, extra, length)) {
8532 IPW_DEBUG_WX("ESSID set to current ESSID.\n"); 8532 IPW_DEBUG_WX("ESSID set to current ESSID.\n");
8533 up(&priv->sem); 8533 mutex_unlock(&priv->mutex);
8534 return 0; 8534 return 0;
8535 } 8535 }
8536 8536
@@ -8545,7 +8545,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
8545 if (!ipw_disassociate(priv)) 8545 if (!ipw_disassociate(priv))
8546 ipw_associate(priv); 8546 ipw_associate(priv);
8547 8547
8548 up(&priv->sem); 8548 mutex_unlock(&priv->mutex);
8549 return 0; 8549 return 0;
8550} 8550}
8551 8551
@@ -8557,7 +8557,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
8557 8557
8558 /* If we are associated, trying to associate, or have a statically 8558 /* If we are associated, trying to associate, or have a statically
8559 * configured ESSID then return that; otherwise return ANY */ 8559 * configured ESSID then return that; otherwise return ANY */
8560 down(&priv->sem); 8560 mutex_lock(&priv->mutex);
8561 if (priv->config & CFG_STATIC_ESSID || 8561 if (priv->config & CFG_STATIC_ESSID ||
8562 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { 8562 priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) {
8563 IPW_DEBUG_WX("Getting essid: '%s'\n", 8563 IPW_DEBUG_WX("Getting essid: '%s'\n",
@@ -8570,7 +8570,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
8570 wrqu->essid.length = 0; 8570 wrqu->essid.length = 0;
8571 wrqu->essid.flags = 0; /* active */ 8571 wrqu->essid.flags = 0; /* active */
8572 } 8572 }
8573 up(&priv->sem); 8573 mutex_unlock(&priv->mutex);
8574 return 0; 8574 return 0;
8575} 8575}
8576 8576
@@ -8583,12 +8583,12 @@ static int ipw_wx_set_nick(struct net_device *dev,
8583 IPW_DEBUG_WX("Setting nick to '%s'\n", extra); 8583 IPW_DEBUG_WX("Setting nick to '%s'\n", extra);
8584 if (wrqu->data.length > IW_ESSID_MAX_SIZE) 8584 if (wrqu->data.length > IW_ESSID_MAX_SIZE)
8585 return -E2BIG; 8585 return -E2BIG;
8586 down(&priv->sem); 8586 mutex_lock(&priv->mutex);
8587 wrqu->data.length = min((size_t) wrqu->data.length, sizeof(priv->nick)); 8587 wrqu->data.length = min((size_t) wrqu->data.length, sizeof(priv->nick));
8588 memset(priv->nick, 0, sizeof(priv->nick)); 8588 memset(priv->nick, 0, sizeof(priv->nick));
8589 memcpy(priv->nick, extra, wrqu->data.length); 8589 memcpy(priv->nick, extra, wrqu->data.length);
8590 IPW_DEBUG_TRACE("<<\n"); 8590 IPW_DEBUG_TRACE("<<\n");
8591 up(&priv->sem); 8591 mutex_unlock(&priv->mutex);
8592 return 0; 8592 return 0;
8593 8593
8594} 8594}
@@ -8599,11 +8599,11 @@ static int ipw_wx_get_nick(struct net_device *dev,
8599{ 8599{
8600 struct ipw_priv *priv = ieee80211_priv(dev); 8600 struct ipw_priv *priv = ieee80211_priv(dev);
8601 IPW_DEBUG_WX("Getting nick\n"); 8601 IPW_DEBUG_WX("Getting nick\n");
8602 down(&priv->sem); 8602 mutex_lock(&priv->mutex);
8603 wrqu->data.length = strlen(priv->nick) + 1; 8603 wrqu->data.length = strlen(priv->nick) + 1;
8604 memcpy(extra, priv->nick, wrqu->data.length); 8604 memcpy(extra, priv->nick, wrqu->data.length);
8605 wrqu->data.flags = 1; /* active */ 8605 wrqu->data.flags = 1; /* active */
8606 up(&priv->sem); 8606 mutex_unlock(&priv->mutex);
8607 return 0; 8607 return 0;
8608} 8608}
8609 8609
@@ -8696,7 +8696,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
8696 apply: 8696 apply:
8697 IPW_DEBUG_WX("Setting rate mask to 0x%08X [%s]\n", 8697 IPW_DEBUG_WX("Setting rate mask to 0x%08X [%s]\n",
8698 mask, fixed ? "fixed" : "sub-rates"); 8698 mask, fixed ? "fixed" : "sub-rates");
8699 down(&priv->sem); 8699 mutex_lock(&priv->mutex);
8700 if (mask == IEEE80211_DEFAULT_RATES_MASK) { 8700 if (mask == IEEE80211_DEFAULT_RATES_MASK) {
8701 priv->config &= ~CFG_FIXED_RATE; 8701 priv->config &= ~CFG_FIXED_RATE;
8702 ipw_set_fixed_rate(priv, priv->ieee->mode); 8702 ipw_set_fixed_rate(priv, priv->ieee->mode);
@@ -8705,7 +8705,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
8705 8705
8706 if (priv->rates_mask == mask) { 8706 if (priv->rates_mask == mask) {
8707 IPW_DEBUG_WX("Mask set to current mask.\n"); 8707 IPW_DEBUG_WX("Mask set to current mask.\n");
8708 up(&priv->sem); 8708 mutex_unlock(&priv->mutex);
8709 return 0; 8709 return 0;
8710 } 8710 }
8711 8711
@@ -8716,7 +8716,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
8716 if (!ipw_disassociate(priv)) 8716 if (!ipw_disassociate(priv))
8717 ipw_associate(priv); 8717 ipw_associate(priv);
8718 8718
8719 up(&priv->sem); 8719 mutex_unlock(&priv->mutex);
8720 return 0; 8720 return 0;
8721} 8721}
8722 8722
@@ -8725,9 +8725,9 @@ static int ipw_wx_get_rate(struct net_device *dev,
8725 union iwreq_data *wrqu, char *extra) 8725 union iwreq_data *wrqu, char *extra)
8726{ 8726{
8727 struct ipw_priv *priv = ieee80211_priv(dev); 8727 struct ipw_priv *priv = ieee80211_priv(dev);
8728 down(&priv->sem); 8728 mutex_lock(&priv->mutex);
8729 wrqu->bitrate.value = priv->last_rate; 8729 wrqu->bitrate.value = priv->last_rate;
8730 up(&priv->sem); 8730 mutex_unlock(&priv->mutex);
8731 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); 8731 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value);
8732 return 0; 8732 return 0;
8733} 8733}
@@ -8737,20 +8737,20 @@ static int ipw_wx_set_rts(struct net_device *dev,
8737 union iwreq_data *wrqu, char *extra) 8737 union iwreq_data *wrqu, char *extra)
8738{ 8738{
8739 struct ipw_priv *priv = ieee80211_priv(dev); 8739 struct ipw_priv *priv = ieee80211_priv(dev);
8740 down(&priv->sem); 8740 mutex_lock(&priv->mutex);
8741 if (wrqu->rts.disabled) 8741 if (wrqu->rts.disabled)
8742 priv->rts_threshold = DEFAULT_RTS_THRESHOLD; 8742 priv->rts_threshold = DEFAULT_RTS_THRESHOLD;
8743 else { 8743 else {
8744 if (wrqu->rts.value < MIN_RTS_THRESHOLD || 8744 if (wrqu->rts.value < MIN_RTS_THRESHOLD ||
8745 wrqu->rts.value > MAX_RTS_THRESHOLD) { 8745 wrqu->rts.value > MAX_RTS_THRESHOLD) {
8746 up(&priv->sem); 8746 mutex_unlock(&priv->mutex);
8747 return -EINVAL; 8747 return -EINVAL;
8748 } 8748 }
8749 priv->rts_threshold = wrqu->rts.value; 8749 priv->rts_threshold = wrqu->rts.value;
8750 } 8750 }
8751 8751
8752 ipw_send_rts_threshold(priv, priv->rts_threshold); 8752 ipw_send_rts_threshold(priv, priv->rts_threshold);
8753 up(&priv->sem); 8753 mutex_unlock(&priv->mutex);
8754 IPW_DEBUG_WX("SET RTS Threshold -> %d \n", priv->rts_threshold); 8754 IPW_DEBUG_WX("SET RTS Threshold -> %d \n", priv->rts_threshold);
8755 return 0; 8755 return 0;
8756} 8756}
@@ -8760,11 +8760,11 @@ static int ipw_wx_get_rts(struct net_device *dev,
8760 union iwreq_data *wrqu, char *extra) 8760 union iwreq_data *wrqu, char *extra)
8761{ 8761{
8762 struct ipw_priv *priv = ieee80211_priv(dev); 8762 struct ipw_priv *priv = ieee80211_priv(dev);
8763 down(&priv->sem); 8763 mutex_lock(&priv->mutex);
8764 wrqu->rts.value = priv->rts_threshold; 8764 wrqu->rts.value = priv->rts_threshold;
8765 wrqu->rts.fixed = 0; /* no auto select */ 8765 wrqu->rts.fixed = 0; /* no auto select */
8766 wrqu->rts.disabled = (wrqu->rts.value == DEFAULT_RTS_THRESHOLD); 8766 wrqu->rts.disabled = (wrqu->rts.value == DEFAULT_RTS_THRESHOLD);
8767 up(&priv->sem); 8767 mutex_unlock(&priv->mutex);
8768 IPW_DEBUG_WX("GET RTS Threshold -> %d \n", wrqu->rts.value); 8768 IPW_DEBUG_WX("GET RTS Threshold -> %d \n", wrqu->rts.value);
8769 return 0; 8769 return 0;
8770} 8770}
@@ -8776,7 +8776,7 @@ static int ipw_wx_set_txpow(struct net_device *dev,
8776 struct ipw_priv *priv = ieee80211_priv(dev); 8776 struct ipw_priv *priv = ieee80211_priv(dev);
8777 int err = 0; 8777 int err = 0;
8778 8778
8779 down(&priv->sem); 8779 mutex_lock(&priv->mutex);
8780 if (ipw_radio_kill_sw(priv, wrqu->power.disabled)) { 8780 if (ipw_radio_kill_sw(priv, wrqu->power.disabled)) {
8781 err = -EINPROGRESS; 8781 err = -EINPROGRESS;
8782 goto out; 8782 goto out;
@@ -8799,7 +8799,7 @@ static int ipw_wx_set_txpow(struct net_device *dev,
8799 priv->tx_power = wrqu->power.value; 8799 priv->tx_power = wrqu->power.value;
8800 err = ipw_set_tx_power(priv); 8800 err = ipw_set_tx_power(priv);
8801 out: 8801 out:
8802 up(&priv->sem); 8802 mutex_unlock(&priv->mutex);
8803 return err; 8803 return err;
8804} 8804}
8805 8805
@@ -8808,12 +8808,12 @@ static int ipw_wx_get_txpow(struct net_device *dev,
8808 union iwreq_data *wrqu, char *extra) 8808 union iwreq_data *wrqu, char *extra)
8809{ 8809{
8810 struct ipw_priv *priv = ieee80211_priv(dev); 8810 struct ipw_priv *priv = ieee80211_priv(dev);
8811 down(&priv->sem); 8811 mutex_lock(&priv->mutex);
8812 wrqu->power.value = priv->tx_power; 8812 wrqu->power.value = priv->tx_power;
8813 wrqu->power.fixed = 1; 8813 wrqu->power.fixed = 1;
8814 wrqu->power.flags = IW_TXPOW_DBM; 8814 wrqu->power.flags = IW_TXPOW_DBM;
8815 wrqu->power.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; 8815 wrqu->power.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0;
8816 up(&priv->sem); 8816 mutex_unlock(&priv->mutex);
8817 8817
8818 IPW_DEBUG_WX("GET TX Power -> %s %d \n", 8818 IPW_DEBUG_WX("GET TX Power -> %s %d \n",
8819 wrqu->power.disabled ? "OFF" : "ON", wrqu->power.value); 8819 wrqu->power.disabled ? "OFF" : "ON", wrqu->power.value);
@@ -8826,13 +8826,13 @@ static int ipw_wx_set_frag(struct net_device *dev,
8826 union iwreq_data *wrqu, char *extra) 8826 union iwreq_data *wrqu, char *extra)
8827{ 8827{
8828 struct ipw_priv *priv = ieee80211_priv(dev); 8828 struct ipw_priv *priv = ieee80211_priv(dev);
8829 down(&priv->sem); 8829 mutex_lock(&priv->mutex);
8830 if (wrqu->frag.disabled) 8830 if (wrqu->frag.disabled)
8831 priv->ieee->fts = DEFAULT_FTS; 8831 priv->ieee->fts = DEFAULT_FTS;
8832 else { 8832 else {
8833 if (wrqu->frag.value < MIN_FRAG_THRESHOLD || 8833 if (wrqu->frag.value < MIN_FRAG_THRESHOLD ||
8834 wrqu->frag.value > MAX_FRAG_THRESHOLD) { 8834 wrqu->frag.value > MAX_FRAG_THRESHOLD) {
8835 up(&priv->sem); 8835 mutex_unlock(&priv->mutex);
8836 return -EINVAL; 8836 return -EINVAL;
8837 } 8837 }
8838 8838
@@ -8840,7 +8840,7 @@ static int ipw_wx_set_frag(struct net_device *dev,
8840 } 8840 }
8841 8841
8842 ipw_send_frag_threshold(priv, wrqu->frag.value); 8842 ipw_send_frag_threshold(priv, wrqu->frag.value);
8843 up(&priv->sem); 8843 mutex_unlock(&priv->mutex);
8844 IPW_DEBUG_WX("SET Frag Threshold -> %d \n", wrqu->frag.value); 8844 IPW_DEBUG_WX("SET Frag Threshold -> %d \n", wrqu->frag.value);
8845 return 0; 8845 return 0;
8846} 8846}
@@ -8850,11 +8850,11 @@ static int ipw_wx_get_frag(struct net_device *dev,
8850 union iwreq_data *wrqu, char *extra) 8850 union iwreq_data *wrqu, char *extra)
8851{ 8851{
8852 struct ipw_priv *priv = ieee80211_priv(dev); 8852 struct ipw_priv *priv = ieee80211_priv(dev);
8853 down(&priv->sem); 8853 mutex_lock(&priv->mutex);
8854 wrqu->frag.value = priv->ieee->fts; 8854 wrqu->frag.value = priv->ieee->fts;
8855 wrqu->frag.fixed = 0; /* no auto select */ 8855 wrqu->frag.fixed = 0; /* no auto select */
8856 wrqu->frag.disabled = (wrqu->frag.value == DEFAULT_FTS); 8856 wrqu->frag.disabled = (wrqu->frag.value == DEFAULT_FTS);
8857 up(&priv->sem); 8857 mutex_unlock(&priv->mutex);
8858 IPW_DEBUG_WX("GET Frag Threshold -> %d \n", wrqu->frag.value); 8858 IPW_DEBUG_WX("GET Frag Threshold -> %d \n", wrqu->frag.value);
8859 8859
8860 return 0; 8860 return 0;
@@ -8875,7 +8875,7 @@ static int ipw_wx_set_retry(struct net_device *dev,
8875 if (wrqu->retry.value < 0 || wrqu->retry.value > 255) 8875 if (wrqu->retry.value < 0 || wrqu->retry.value > 255)
8876 return -EINVAL; 8876 return -EINVAL;
8877 8877
8878 down(&priv->sem); 8878 mutex_lock(&priv->mutex);
8879 if (wrqu->retry.flags & IW_RETRY_MIN) 8879 if (wrqu->retry.flags & IW_RETRY_MIN)
8880 priv->short_retry_limit = (u8) wrqu->retry.value; 8880 priv->short_retry_limit = (u8) wrqu->retry.value;
8881 else if (wrqu->retry.flags & IW_RETRY_MAX) 8881 else if (wrqu->retry.flags & IW_RETRY_MAX)
@@ -8887,7 +8887,7 @@ static int ipw_wx_set_retry(struct net_device *dev,
8887 8887
8888 ipw_send_retry_limit(priv, priv->short_retry_limit, 8888 ipw_send_retry_limit(priv, priv->short_retry_limit,
8889 priv->long_retry_limit); 8889 priv->long_retry_limit);
8890 up(&priv->sem); 8890 mutex_unlock(&priv->mutex);
8891 IPW_DEBUG_WX("SET retry limit -> short:%d long:%d\n", 8891 IPW_DEBUG_WX("SET retry limit -> short:%d long:%d\n",
8892 priv->short_retry_limit, priv->long_retry_limit); 8892 priv->short_retry_limit, priv->long_retry_limit);
8893 return 0; 8893 return 0;
@@ -8899,11 +8899,11 @@ static int ipw_wx_get_retry(struct net_device *dev,
8899{ 8899{
8900 struct ipw_priv *priv = ieee80211_priv(dev); 8900 struct ipw_priv *priv = ieee80211_priv(dev);
8901 8901
8902 down(&priv->sem); 8902 mutex_lock(&priv->mutex);
8903 wrqu->retry.disabled = 0; 8903 wrqu->retry.disabled = 0;
8904 8904
8905 if ((wrqu->retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { 8905 if ((wrqu->retry.flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) {
8906 up(&priv->sem); 8906 mutex_unlock(&priv->mutex);
8907 return -EINVAL; 8907 return -EINVAL;
8908 } 8908 }
8909 8909
@@ -8917,7 +8917,7 @@ static int ipw_wx_get_retry(struct net_device *dev,
8917 wrqu->retry.flags = IW_RETRY_LIMIT; 8917 wrqu->retry.flags = IW_RETRY_LIMIT;
8918 wrqu->retry.value = priv->short_retry_limit; 8918 wrqu->retry.value = priv->short_retry_limit;
8919 } 8919 }
8920 up(&priv->sem); 8920 mutex_unlock(&priv->mutex);
8921 8921
8922 IPW_DEBUG_WX("GET retry -> %d \n", wrqu->retry.value); 8922 IPW_DEBUG_WX("GET retry -> %d \n", wrqu->retry.value);
8923 8923
@@ -8934,7 +8934,7 @@ static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid,
8934 (priv->status & STATUS_EXIT_PENDING)) 8934 (priv->status & STATUS_EXIT_PENDING))
8935 return 0; 8935 return 0;
8936 8936
8937 down(&priv->sem); 8937 mutex_lock(&priv->mutex);
8938 8938
8939 if (priv->status & STATUS_RF_KILL_MASK) { 8939 if (priv->status & STATUS_RF_KILL_MASK) {
8940 IPW_DEBUG_HC("Aborting scan due to RF kill activation\n"); 8940 IPW_DEBUG_HC("Aborting scan due to RF kill activation\n");
@@ -8986,7 +8986,7 @@ static int ipw_request_direct_scan(struct ipw_priv *priv, char *essid,
8986 priv->status |= STATUS_SCANNING; 8986 priv->status |= STATUS_SCANNING;
8987 8987
8988 done: 8988 done:
8989 up(&priv->sem); 8989 mutex_unlock(&priv->mutex);
8990 return err; 8990 return err;
8991} 8991}
8992 8992
@@ -9029,7 +9029,7 @@ static int ipw_wx_set_encode(struct net_device *dev,
9029 int ret; 9029 int ret;
9030 u32 cap = priv->capability; 9030 u32 cap = priv->capability;
9031 9031
9032 down(&priv->sem); 9032 mutex_lock(&priv->mutex);
9033 ret = ieee80211_wx_set_encode(priv->ieee, info, wrqu, key); 9033 ret = ieee80211_wx_set_encode(priv->ieee, info, wrqu, key);
9034 9034
9035 /* In IBSS mode, we need to notify the firmware to update 9035 /* In IBSS mode, we need to notify the firmware to update
@@ -9039,7 +9039,7 @@ static int ipw_wx_set_encode(struct net_device *dev,
9039 priv->status & STATUS_ASSOCIATED) 9039 priv->status & STATUS_ASSOCIATED)
9040 ipw_disassociate(priv); 9040 ipw_disassociate(priv);
9041 9041
9042 up(&priv->sem); 9042 mutex_unlock(&priv->mutex);
9043 return ret; 9043 return ret;
9044} 9044}
9045 9045
@@ -9057,17 +9057,17 @@ static int ipw_wx_set_power(struct net_device *dev,
9057{ 9057{
9058 struct ipw_priv *priv = ieee80211_priv(dev); 9058 struct ipw_priv *priv = ieee80211_priv(dev);
9059 int err; 9059 int err;
9060 down(&priv->sem); 9060 mutex_lock(&priv->mutex);
9061 if (wrqu->power.disabled) { 9061 if (wrqu->power.disabled) {
9062 priv->power_mode = IPW_POWER_LEVEL(priv->power_mode); 9062 priv->power_mode = IPW_POWER_LEVEL(priv->power_mode);
9063 err = ipw_send_power_mode(priv, IPW_POWER_MODE_CAM); 9063 err = ipw_send_power_mode(priv, IPW_POWER_MODE_CAM);
9064 if (err) { 9064 if (err) {
9065 IPW_DEBUG_WX("failed setting power mode.\n"); 9065 IPW_DEBUG_WX("failed setting power mode.\n");
9066 up(&priv->sem); 9066 mutex_unlock(&priv->mutex);
9067 return err; 9067 return err;
9068 } 9068 }
9069 IPW_DEBUG_WX("SET Power Management Mode -> off\n"); 9069 IPW_DEBUG_WX("SET Power Management Mode -> off\n");
9070 up(&priv->sem); 9070 mutex_unlock(&priv->mutex);
9071 return 0; 9071 return 0;
9072 } 9072 }
9073 9073
@@ -9079,7 +9079,7 @@ static int ipw_wx_set_power(struct net_device *dev,
9079 default: /* Otherwise we don't support it */ 9079 default: /* Otherwise we don't support it */
9080 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n", 9080 IPW_DEBUG_WX("SET PM Mode: %X not supported.\n",
9081 wrqu->power.flags); 9081 wrqu->power.flags);
9082 up(&priv->sem); 9082 mutex_unlock(&priv->mutex);
9083 return -EOPNOTSUPP; 9083 return -EOPNOTSUPP;
9084 } 9084 }
9085 9085
@@ -9092,12 +9092,12 @@ static int ipw_wx_set_power(struct net_device *dev,
9092 err = ipw_send_power_mode(priv, IPW_POWER_LEVEL(priv->power_mode)); 9092 err = ipw_send_power_mode(priv, IPW_POWER_LEVEL(priv->power_mode));
9093 if (err) { 9093 if (err) {
9094 IPW_DEBUG_WX("failed setting power mode.\n"); 9094 IPW_DEBUG_WX("failed setting power mode.\n");
9095 up(&priv->sem); 9095 mutex_unlock(&priv->mutex);
9096 return err; 9096 return err;
9097 } 9097 }
9098 9098
9099 IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); 9099 IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode);
9100 up(&priv->sem); 9100 mutex_unlock(&priv->mutex);
9101 return 0; 9101 return 0;
9102} 9102}
9103 9103
@@ -9106,13 +9106,13 @@ static int ipw_wx_get_power(struct net_device *dev,
9106 union iwreq_data *wrqu, char *extra) 9106 union iwreq_data *wrqu, char *extra)
9107{ 9107{
9108 struct ipw_priv *priv = ieee80211_priv(dev); 9108 struct ipw_priv *priv = ieee80211_priv(dev);
9109 down(&priv->sem); 9109 mutex_lock(&priv->mutex);
9110 if (!(priv->power_mode & IPW_POWER_ENABLED)) 9110 if (!(priv->power_mode & IPW_POWER_ENABLED))
9111 wrqu->power.disabled = 1; 9111 wrqu->power.disabled = 1;
9112 else 9112 else
9113 wrqu->power.disabled = 0; 9113 wrqu->power.disabled = 0;
9114 9114
9115 up(&priv->sem); 9115 mutex_unlock(&priv->mutex);
9116 IPW_DEBUG_WX("GET Power Management Mode -> %02X\n", priv->power_mode); 9116 IPW_DEBUG_WX("GET Power Management Mode -> %02X\n", priv->power_mode);
9117 9117
9118 return 0; 9118 return 0;
@@ -9125,7 +9125,7 @@ static int ipw_wx_set_powermode(struct net_device *dev,
9125 struct ipw_priv *priv = ieee80211_priv(dev); 9125 struct ipw_priv *priv = ieee80211_priv(dev);
9126 int mode = *(int *)extra; 9126 int mode = *(int *)extra;
9127 int err; 9127 int err;
9128 down(&priv->sem); 9128 mutex_lock(&priv->mutex);
9129 if ((mode < 1) || (mode > IPW_POWER_LIMIT)) { 9129 if ((mode < 1) || (mode > IPW_POWER_LIMIT)) {
9130 mode = IPW_POWER_AC; 9130 mode = IPW_POWER_AC;
9131 priv->power_mode = mode; 9131 priv->power_mode = mode;
@@ -9138,11 +9138,11 @@ static int ipw_wx_set_powermode(struct net_device *dev,
9138 9138
9139 if (err) { 9139 if (err) {
9140 IPW_DEBUG_WX("failed setting power mode.\n"); 9140 IPW_DEBUG_WX("failed setting power mode.\n");
9141 up(&priv->sem); 9141 mutex_unlock(&priv->mutex);
9142 return err; 9142 return err;
9143 } 9143 }
9144 } 9144 }
9145 up(&priv->sem); 9145 mutex_unlock(&priv->mutex);
9146 return 0; 9146 return 0;
9147} 9147}
9148 9148
@@ -9191,7 +9191,7 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9191 IPW_WARNING("Attempt to set invalid wireless mode: %d\n", mode); 9191 IPW_WARNING("Attempt to set invalid wireless mode: %d\n", mode);
9192 return -EINVAL; 9192 return -EINVAL;
9193 } 9193 }
9194 down(&priv->sem); 9194 mutex_lock(&priv->mutex);
9195 if (priv->adapter == IPW_2915ABG) { 9195 if (priv->adapter == IPW_2915ABG) {
9196 priv->ieee->abg_true = 1; 9196 priv->ieee->abg_true = 1;
9197 if (mode & IEEE_A) { 9197 if (mode & IEEE_A) {
@@ -9203,7 +9203,7 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9203 if (mode & IEEE_A) { 9203 if (mode & IEEE_A) {
9204 IPW_WARNING("Attempt to set 2200BG into " 9204 IPW_WARNING("Attempt to set 2200BG into "
9205 "802.11a mode\n"); 9205 "802.11a mode\n");
9206 up(&priv->sem); 9206 mutex_unlock(&priv->mutex);
9207 return -EINVAL; 9207 return -EINVAL;
9208 } 9208 }
9209 9209
@@ -9240,7 +9240,7 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9240 IPW_DEBUG_WX("PRIV SET MODE: %c%c%c\n", 9240 IPW_DEBUG_WX("PRIV SET MODE: %c%c%c\n",
9241 mode & IEEE_A ? 'a' : '.', 9241 mode & IEEE_A ? 'a' : '.',
9242 mode & IEEE_B ? 'b' : '.', mode & IEEE_G ? 'g' : '.'); 9242 mode & IEEE_B ? 'b' : '.', mode & IEEE_G ? 'g' : '.');
9243 up(&priv->sem); 9243 mutex_unlock(&priv->mutex);
9244 return 0; 9244 return 0;
9245} 9245}
9246 9246
@@ -9249,7 +9249,7 @@ static int ipw_wx_get_wireless_mode(struct net_device *dev,
9249 union iwreq_data *wrqu, char *extra) 9249 union iwreq_data *wrqu, char *extra)
9250{ 9250{
9251 struct ipw_priv *priv = ieee80211_priv(dev); 9251 struct ipw_priv *priv = ieee80211_priv(dev);
9252 down(&priv->sem); 9252 mutex_lock(&priv->mutex);
9253 switch (priv->ieee->mode) { 9253 switch (priv->ieee->mode) {
9254 case IEEE_A: 9254 case IEEE_A:
9255 strncpy(extra, "802.11a (1)", MAX_WX_STRING); 9255 strncpy(extra, "802.11a (1)", MAX_WX_STRING);
@@ -9280,7 +9280,7 @@ static int ipw_wx_get_wireless_mode(struct net_device *dev,
9280 IPW_DEBUG_WX("PRIV GET MODE: %s\n", extra); 9280 IPW_DEBUG_WX("PRIV GET MODE: %s\n", extra);
9281 9281
9282 wrqu->data.length = strlen(extra) + 1; 9282 wrqu->data.length = strlen(extra) + 1;
9283 up(&priv->sem); 9283 mutex_unlock(&priv->mutex);
9284 9284
9285 return 0; 9285 return 0;
9286} 9286}
@@ -9291,7 +9291,7 @@ static int ipw_wx_set_preamble(struct net_device *dev,
9291{ 9291{
9292 struct ipw_priv *priv = ieee80211_priv(dev); 9292 struct ipw_priv *priv = ieee80211_priv(dev);
9293 int mode = *(int *)extra; 9293 int mode = *(int *)extra;
9294 down(&priv->sem); 9294 mutex_lock(&priv->mutex);
9295 /* Switching from SHORT -> LONG requires a disassociation */ 9295 /* Switching from SHORT -> LONG requires a disassociation */
9296 if (mode == 1) { 9296 if (mode == 1) {
9297 if (!(priv->config & CFG_PREAMBLE_LONG)) { 9297 if (!(priv->config & CFG_PREAMBLE_LONG)) {
@@ -9310,11 +9310,11 @@ static int ipw_wx_set_preamble(struct net_device *dev,
9310 priv->config &= ~CFG_PREAMBLE_LONG; 9310 priv->config &= ~CFG_PREAMBLE_LONG;
9311 goto done; 9311 goto done;
9312 } 9312 }
9313 up(&priv->sem); 9313 mutex_unlock(&priv->mutex);
9314 return -EINVAL; 9314 return -EINVAL;
9315 9315
9316 done: 9316 done:
9317 up(&priv->sem); 9317 mutex_unlock(&priv->mutex);
9318 return 0; 9318 return 0;
9319} 9319}
9320 9320
@@ -9323,12 +9323,12 @@ static int ipw_wx_get_preamble(struct net_device *dev,
9323 union iwreq_data *wrqu, char *extra) 9323 union iwreq_data *wrqu, char *extra)
9324{ 9324{
9325 struct ipw_priv *priv = ieee80211_priv(dev); 9325 struct ipw_priv *priv = ieee80211_priv(dev);
9326 down(&priv->sem); 9326 mutex_lock(&priv->mutex);
9327 if (priv->config & CFG_PREAMBLE_LONG) 9327 if (priv->config & CFG_PREAMBLE_LONG)
9328 snprintf(wrqu->name, IFNAMSIZ, "long (1)"); 9328 snprintf(wrqu->name, IFNAMSIZ, "long (1)");
9329 else 9329 else
9330 snprintf(wrqu->name, IFNAMSIZ, "auto (0)"); 9330 snprintf(wrqu->name, IFNAMSIZ, "auto (0)");
9331 up(&priv->sem); 9331 mutex_unlock(&priv->mutex);
9332 return 0; 9332 return 0;
9333} 9333}
9334 9334
@@ -9340,7 +9340,7 @@ static int ipw_wx_set_monitor(struct net_device *dev,
9340 struct ipw_priv *priv = ieee80211_priv(dev); 9340 struct ipw_priv *priv = ieee80211_priv(dev);
9341 int *parms = (int *)extra; 9341 int *parms = (int *)extra;
9342 int enable = (parms[0] > 0); 9342 int enable = (parms[0] > 0);
9343 down(&priv->sem); 9343 mutex_lock(&priv->mutex);
9344 IPW_DEBUG_WX("SET MONITOR: %d %d\n", enable, parms[1]); 9344 IPW_DEBUG_WX("SET MONITOR: %d %d\n", enable, parms[1]);
9345 if (enable) { 9345 if (enable) {
9346 if (priv->ieee->iw_mode != IW_MODE_MONITOR) { 9346 if (priv->ieee->iw_mode != IW_MODE_MONITOR) {
@@ -9355,13 +9355,13 @@ static int ipw_wx_set_monitor(struct net_device *dev,
9355 ipw_set_channel(priv, parms[1]); 9355 ipw_set_channel(priv, parms[1]);
9356 } else { 9356 } else {
9357 if (priv->ieee->iw_mode != IW_MODE_MONITOR) { 9357 if (priv->ieee->iw_mode != IW_MODE_MONITOR) {
9358 up(&priv->sem); 9358 mutex_unlock(&priv->mutex);
9359 return 0; 9359 return 0;
9360 } 9360 }
9361 priv->net_dev->type = ARPHRD_ETHER; 9361 priv->net_dev->type = ARPHRD_ETHER;
9362 queue_work(priv->workqueue, &priv->adapter_restart); 9362 queue_work(priv->workqueue, &priv->adapter_restart);
9363 } 9363 }
9364 up(&priv->sem); 9364 mutex_unlock(&priv->mutex);
9365 return 0; 9365 return 0;
9366} 9366}
9367 9367
@@ -9391,7 +9391,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9391 9391
9392 IPW_DEBUG_WX("SW_RESET\n"); 9392 IPW_DEBUG_WX("SW_RESET\n");
9393 9393
9394 down(&priv->sem); 9394 mutex_lock(&priv->mutex);
9395 9395
9396 ret = ipw_sw_reset(priv, 0); 9396 ret = ipw_sw_reset(priv, 0);
9397 if (!ret) { 9397 if (!ret) {
@@ -9403,9 +9403,9 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9403 * module parameter, so take appropriate action */ 9403 * module parameter, so take appropriate action */
9404 ipw_radio_kill_sw(priv, priv->status & STATUS_RF_KILL_SW); 9404 ipw_radio_kill_sw(priv, priv->status & STATUS_RF_KILL_SW);
9405 9405
9406 up(&priv->sem); 9406 mutex_unlock(&priv->mutex);
9407 ieee80211_wx_set_encode(priv->ieee, info, &wrqu_sec, NULL); 9407 ieee80211_wx_set_encode(priv->ieee, info, &wrqu_sec, NULL);
9408 down(&priv->sem); 9408 mutex_lock(&priv->mutex);
9409 9409
9410 if (!(priv->status & STATUS_RF_KILL_MASK)) { 9410 if (!(priv->status & STATUS_RF_KILL_MASK)) {
9411 /* Configuration likely changed -- force [re]association */ 9411 /* Configuration likely changed -- force [re]association */
@@ -9415,7 +9415,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9415 ipw_associate(priv); 9415 ipw_associate(priv);
9416 } 9416 }
9417 9417
9418 up(&priv->sem); 9418 mutex_unlock(&priv->mutex);
9419 9419
9420 return 0; 9420 return 0;
9421} 9421}
@@ -9612,11 +9612,11 @@ static int ipw_net_open(struct net_device *dev)
9612 struct ipw_priv *priv = ieee80211_priv(dev); 9612 struct ipw_priv *priv = ieee80211_priv(dev);
9613 IPW_DEBUG_INFO("dev->open\n"); 9613 IPW_DEBUG_INFO("dev->open\n");
9614 /* we should be verifying the device is ready to be opened */ 9614 /* we should be verifying the device is ready to be opened */
9615 down(&priv->sem); 9615 mutex_lock(&priv->mutex);
9616 if (!(priv->status & STATUS_RF_KILL_MASK) && 9616 if (!(priv->status & STATUS_RF_KILL_MASK) &&
9617 (priv->status & STATUS_ASSOCIATED)) 9617 (priv->status & STATUS_ASSOCIATED))
9618 netif_start_queue(dev); 9618 netif_start_queue(dev);
9619 up(&priv->sem); 9619 mutex_unlock(&priv->mutex);
9620 return 0; 9620 return 0;
9621} 9621}
9622 9622
@@ -9895,13 +9895,13 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
9895 struct sockaddr *addr = p; 9895 struct sockaddr *addr = p;
9896 if (!is_valid_ether_addr(addr->sa_data)) 9896 if (!is_valid_ether_addr(addr->sa_data))
9897 return -EADDRNOTAVAIL; 9897 return -EADDRNOTAVAIL;
9898 down(&priv->sem); 9898 mutex_lock(&priv->mutex);
9899 priv->config |= CFG_CUSTOM_MAC; 9899 priv->config |= CFG_CUSTOM_MAC;
9900 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 9900 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
9901 printk(KERN_INFO "%s: Setting MAC to " MAC_FMT "\n", 9901 printk(KERN_INFO "%s: Setting MAC to " MAC_FMT "\n",
9902 priv->net_dev->name, MAC_ARG(priv->mac_addr)); 9902 priv->net_dev->name, MAC_ARG(priv->mac_addr));
9903 queue_work(priv->workqueue, &priv->adapter_restart); 9903 queue_work(priv->workqueue, &priv->adapter_restart);
9904 up(&priv->sem); 9904 mutex_unlock(&priv->mutex);
9905 return 0; 9905 return 0;
9906} 9906}
9907 9907
@@ -9945,9 +9945,9 @@ static int ipw_ethtool_get_eeprom(struct net_device *dev,
9945 9945
9946 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE) 9946 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
9947 return -EINVAL; 9947 return -EINVAL;
9948 down(&p->sem); 9948 mutex_lock(&p->mutex);
9949 memcpy(bytes, &p->eeprom[eeprom->offset], eeprom->len); 9949 memcpy(bytes, &p->eeprom[eeprom->offset], eeprom->len);
9950 up(&p->sem); 9950 mutex_unlock(&p->mutex);
9951 return 0; 9951 return 0;
9952} 9952}
9953 9953
@@ -9959,12 +9959,12 @@ static int ipw_ethtool_set_eeprom(struct net_device *dev,
9959 9959
9960 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE) 9960 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
9961 return -EINVAL; 9961 return -EINVAL;
9962 down(&p->sem); 9962 mutex_lock(&p->mutex);
9963 memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len); 9963 memcpy(&p->eeprom[eeprom->offset], bytes, eeprom->len);
9964 for (i = IPW_EEPROM_DATA; 9964 for (i = IPW_EEPROM_DATA;
9965 i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++) 9965 i < IPW_EEPROM_DATA + IPW_EEPROM_IMAGE_SIZE; i++)
9966 ipw_write8(p, i, p->eeprom[i]); 9966 ipw_write8(p, i, p->eeprom[i]);
9967 up(&p->sem); 9967 mutex_unlock(&p->mutex);
9968 return 0; 9968 return 0;
9969} 9969}
9970 9970
@@ -10059,9 +10059,9 @@ static void ipw_rf_kill(void *adapter)
10059static void ipw_bg_rf_kill(void *data) 10059static void ipw_bg_rf_kill(void *data)
10060{ 10060{
10061 struct ipw_priv *priv = data; 10061 struct ipw_priv *priv = data;
10062 down(&priv->sem); 10062 mutex_lock(&priv->mutex);
10063 ipw_rf_kill(data); 10063 ipw_rf_kill(data);
10064 up(&priv->sem); 10064 mutex_unlock(&priv->mutex);
10065} 10065}
10066 10066
10067static void ipw_link_up(struct ipw_priv *priv) 10067static void ipw_link_up(struct ipw_priv *priv)
@@ -10094,9 +10094,9 @@ static void ipw_link_up(struct ipw_priv *priv)
10094static void ipw_bg_link_up(void *data) 10094static void ipw_bg_link_up(void *data)
10095{ 10095{
10096 struct ipw_priv *priv = data; 10096 struct ipw_priv *priv = data;
10097 down(&priv->sem); 10097 mutex_lock(&priv->mutex);
10098 ipw_link_up(data); 10098 ipw_link_up(data);
10099 up(&priv->sem); 10099 mutex_unlock(&priv->mutex);
10100} 10100}
10101 10101
10102static void ipw_link_down(struct ipw_priv *priv) 10102static void ipw_link_down(struct ipw_priv *priv)
@@ -10122,9 +10122,9 @@ static void ipw_link_down(struct ipw_priv *priv)
10122static void ipw_bg_link_down(void *data) 10122static void ipw_bg_link_down(void *data)
10123{ 10123{
10124 struct ipw_priv *priv = data; 10124 struct ipw_priv *priv = data;
10125 down(&priv->sem); 10125 mutex_lock(&priv->mutex);
10126 ipw_link_down(data); 10126 ipw_link_down(data);
10127 up(&priv->sem); 10127 mutex_unlock(&priv->mutex);
10128} 10128}
10129 10129
10130static int ipw_setup_deferred_work(struct ipw_priv *priv) 10130static int ipw_setup_deferred_work(struct ipw_priv *priv)
@@ -10801,9 +10801,9 @@ static int ipw_up(struct ipw_priv *priv)
10801static void ipw_bg_up(void *data) 10801static void ipw_bg_up(void *data)
10802{ 10802{
10803 struct ipw_priv *priv = data; 10803 struct ipw_priv *priv = data;
10804 down(&priv->sem); 10804 mutex_lock(&priv->mutex);
10805 ipw_up(data); 10805 ipw_up(data);
10806 up(&priv->sem); 10806 mutex_unlock(&priv->mutex);
10807} 10807}
10808 10808
10809static void ipw_deinit(struct ipw_priv *priv) 10809static void ipw_deinit(struct ipw_priv *priv)
@@ -10872,23 +10872,23 @@ static void ipw_down(struct ipw_priv *priv)
10872static void ipw_bg_down(void *data) 10872static void ipw_bg_down(void *data)
10873{ 10873{
10874 struct ipw_priv *priv = data; 10874 struct ipw_priv *priv = data;
10875 down(&priv->sem); 10875 mutex_lock(&priv->mutex);
10876 ipw_down(data); 10876 ipw_down(data);
10877 up(&priv->sem); 10877 mutex_unlock(&priv->mutex);
10878} 10878}
10879 10879
10880/* Called by register_netdev() */ 10880/* Called by register_netdev() */
10881static int ipw_net_init(struct net_device *dev) 10881static int ipw_net_init(struct net_device *dev)
10882{ 10882{
10883 struct ipw_priv *priv = ieee80211_priv(dev); 10883 struct ipw_priv *priv = ieee80211_priv(dev);
10884 down(&priv->sem); 10884 mutex_lock(&priv->mutex);
10885 10885
10886 if (ipw_up(priv)) { 10886 if (ipw_up(priv)) {
10887 up(&priv->sem); 10887 mutex_unlock(&priv->mutex);
10888 return -EIO; 10888 return -EIO;
10889 } 10889 }
10890 10890
10891 up(&priv->sem); 10891 mutex_unlock(&priv->mutex);
10892 return 0; 10892 return 0;
10893} 10893}
10894 10894
@@ -10978,7 +10978,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
10978 for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) 10978 for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++)
10979 INIT_LIST_HEAD(&priv->ibss_mac_hash[i]); 10979 INIT_LIST_HEAD(&priv->ibss_mac_hash[i]);
10980 10980
10981 init_MUTEX(&priv->sem); 10981 mutex_init(&priv->mutex);
10982 if (pci_enable_device(pdev)) { 10982 if (pci_enable_device(pdev)) {
10983 err = -ENODEV; 10983 err = -ENODEV;
10984 goto out_free_ieee80211; 10984 goto out_free_ieee80211;
@@ -11036,7 +11036,7 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
11036 SET_MODULE_OWNER(net_dev); 11036 SET_MODULE_OWNER(net_dev);
11037 SET_NETDEV_DEV(net_dev, &pdev->dev); 11037 SET_NETDEV_DEV(net_dev, &pdev->dev);
11038 11038
11039 down(&priv->sem); 11039 mutex_lock(&priv->mutex);
11040 11040
11041 priv->ieee->hard_start_xmit = ipw_net_hard_start_xmit; 11041 priv->ieee->hard_start_xmit = ipw_net_hard_start_xmit;
11042 priv->ieee->set_security = shim__set_security; 11042 priv->ieee->set_security = shim__set_security;
@@ -11069,11 +11069,11 @@ static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
11069 err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group); 11069 err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group);
11070 if (err) { 11070 if (err) {
11071 IPW_ERROR("failed to create sysfs device attributes\n"); 11071 IPW_ERROR("failed to create sysfs device attributes\n");
11072 up(&priv->sem); 11072 mutex_unlock(&priv->mutex);
11073 goto out_release_irq; 11073 goto out_release_irq;
11074 } 11074 }
11075 11075
11076 up(&priv->sem); 11076 mutex_unlock(&priv->mutex);
11077 err = register_netdev(net_dev); 11077 err = register_netdev(net_dev);
11078 if (err) { 11078 if (err) {
11079 IPW_ERROR("failed to register network device\n"); 11079 IPW_ERROR("failed to register network device\n");
@@ -11110,13 +11110,13 @@ static void ipw_pci_remove(struct pci_dev *pdev)
11110 if (!priv) 11110 if (!priv)
11111 return; 11111 return;
11112 11112
11113 down(&priv->sem); 11113 mutex_lock(&priv->mutex);
11114 11114
11115 priv->status |= STATUS_EXIT_PENDING; 11115 priv->status |= STATUS_EXIT_PENDING;
11116 ipw_down(priv); 11116 ipw_down(priv);
11117 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); 11117 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group);
11118 11118
11119 up(&priv->sem); 11119 mutex_unlock(&priv->mutex);
11120 11120
11121 unregister_netdev(priv->net_dev); 11121 unregister_netdev(priv->net_dev);
11122 11122
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index eedd347b892e..5405ba105abf 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -33,6 +33,7 @@
33#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
34#include <linux/config.h> 34#include <linux/config.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/mutex.h>
36 37
37#include <linux/pci.h> 38#include <linux/pci.h>
38#include <linux/netdevice.h> 39#include <linux/netdevice.h>
@@ -1121,7 +1122,7 @@ struct ipw_priv {
1121 struct ieee80211_device *ieee; 1122 struct ieee80211_device *ieee;
1122 1123
1123 spinlock_t lock; 1124 spinlock_t lock;
1124 struct semaphore sem; 1125 struct mutex mutex;
1125 1126
1126 /* basic pci-network driver stuff */ 1127 /* basic pci-network driver stuff */
1127 struct pci_dev *pci_dev; 1128 struct pci_dev *pci_dev;