aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ipw2100.c119
-rw-r--r--drivers/net/wireless/ipw2100.h4
2 files changed, 62 insertions, 61 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index b0e23a88250f..54437206f31e 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -194,6 +194,7 @@ static struct ipw2100_fw ipw2100_firmware;
194#endif 194#endif
195 195
196#include <linux/moduleparam.h> 196#include <linux/moduleparam.h>
197#include <linux/mutex.h>
197module_param(debug, int, 0444); 198module_param(debug, int, 0444);
198module_param(mode, int, 0444); 199module_param(mode, int, 0444);
199module_param(channel, int, 0444); 200module_param(channel, int, 0444);
@@ -1418,7 +1419,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
1418 if (priv->status & STATUS_ENABLED) 1419 if (priv->status & STATUS_ENABLED)
1419 return 0; 1420 return 0;
1420 1421
1421 down(&priv->adapter_sem); 1422 mutex_lock(&priv->adapter_mutex);
1422 1423
1423 if (rf_kill_active(priv)) { 1424 if (rf_kill_active(priv)) {
1424 IPW_DEBUG_HC("Command aborted due to RF kill active.\n"); 1425 IPW_DEBUG_HC("Command aborted due to RF kill active.\n");
@@ -1444,7 +1445,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
1444 } 1445 }
1445 1446
1446 fail_up: 1447 fail_up:
1447 up(&priv->adapter_sem); 1448 mutex_unlock(&priv->adapter_mutex);
1448 return err; 1449 return err;
1449} 1450}
1450 1451
@@ -1576,7 +1577,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
1576 cancel_delayed_work(&priv->hang_check); 1577 cancel_delayed_work(&priv->hang_check);
1577 } 1578 }
1578 1579
1579 down(&priv->adapter_sem); 1580 mutex_lock(&priv->adapter_mutex);
1580 1581
1581 err = ipw2100_hw_send_command(priv, &cmd); 1582 err = ipw2100_hw_send_command(priv, &cmd);
1582 if (err) { 1583 if (err) {
@@ -1595,7 +1596,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
1595 IPW_DEBUG_INFO("TODO: implement scan state machine\n"); 1596 IPW_DEBUG_INFO("TODO: implement scan state machine\n");
1596 1597
1597 fail_up: 1598 fail_up:
1598 up(&priv->adapter_sem); 1599 mutex_unlock(&priv->adapter_mutex);
1599 return err; 1600 return err;
1600} 1601}
1601 1602
@@ -1888,7 +1889,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
1888 priv->status |= STATUS_RESET_PENDING; 1889 priv->status |= STATUS_RESET_PENDING;
1889 spin_unlock_irqrestore(&priv->low_lock, flags); 1890 spin_unlock_irqrestore(&priv->low_lock, flags);
1890 1891
1891 down(&priv->action_sem); 1892 mutex_lock(&priv->action_mutex);
1892 /* stop timed checks so that they don't interfere with reset */ 1893 /* stop timed checks so that they don't interfere with reset */
1893 priv->stop_hang_check = 1; 1894 priv->stop_hang_check = 1;
1894 cancel_delayed_work(&priv->hang_check); 1895 cancel_delayed_work(&priv->hang_check);
@@ -1898,7 +1899,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
1898 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); 1899 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
1899 1900
1900 ipw2100_up(priv, 0); 1901 ipw2100_up(priv, 0);
1901 up(&priv->action_sem); 1902 mutex_unlock(&priv->action_mutex);
1902 1903
1903} 1904}
1904 1905
@@ -4212,7 +4213,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
4212 IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n", 4213 IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n",
4213 disable_radio ? "OFF" : "ON"); 4214 disable_radio ? "OFF" : "ON");
4214 4215
4215 down(&priv->action_sem); 4216 mutex_lock(&priv->action_mutex);
4216 4217
4217 if (disable_radio) { 4218 if (disable_radio) {
4218 priv->status |= STATUS_RF_KILL_SW; 4219 priv->status |= STATUS_RF_KILL_SW;
@@ -4230,7 +4231,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
4230 schedule_reset(priv); 4231 schedule_reset(priv);
4231 } 4232 }
4232 4233
4233 up(&priv->action_sem); 4234 mutex_unlock(&priv->action_mutex);
4234 return 1; 4235 return 1;
4235} 4236}
4236 4237
@@ -5534,7 +5535,7 @@ static void shim__set_security(struct net_device *dev,
5534 struct ipw2100_priv *priv = ieee80211_priv(dev); 5535 struct ipw2100_priv *priv = ieee80211_priv(dev);
5535 int i, force_update = 0; 5536 int i, force_update = 0;
5536 5537
5537 down(&priv->action_sem); 5538 mutex_lock(&priv->action_mutex);
5538 if (!(priv->status & STATUS_INITIALIZED)) 5539 if (!(priv->status & STATUS_INITIALIZED))
5539 goto done; 5540 goto done;
5540 5541
@@ -5607,7 +5608,7 @@ static void shim__set_security(struct net_device *dev,
5607 if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) 5608 if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)))
5608 ipw2100_configure_security(priv, 0); 5609 ipw2100_configure_security(priv, 0);
5609 done: 5610 done:
5610 up(&priv->action_sem); 5611 mutex_unlock(&priv->action_mutex);
5611} 5612}
5612 5613
5613static int ipw2100_adapter_setup(struct ipw2100_priv *priv) 5614static int ipw2100_adapter_setup(struct ipw2100_priv *priv)
@@ -5731,7 +5732,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
5731 if (!is_valid_ether_addr(addr->sa_data)) 5732 if (!is_valid_ether_addr(addr->sa_data))
5732 return -EADDRNOTAVAIL; 5733 return -EADDRNOTAVAIL;
5733 5734
5734 down(&priv->action_sem); 5735 mutex_lock(&priv->action_mutex);
5735 5736
5736 priv->config |= CFG_CUSTOM_MAC; 5737 priv->config |= CFG_CUSTOM_MAC;
5737 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 5738 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
@@ -5741,12 +5742,12 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
5741 goto done; 5742 goto done;
5742 5743
5743 priv->reset_backoff = 0; 5744 priv->reset_backoff = 0;
5744 up(&priv->action_sem); 5745 mutex_unlock(&priv->action_mutex);
5745 ipw2100_reset_adapter(priv); 5746 ipw2100_reset_adapter(priv);
5746 return 0; 5747 return 0;
5747 5748
5748 done: 5749 done:
5749 up(&priv->action_sem); 5750 mutex_unlock(&priv->action_mutex);
5750 return err; 5751 return err;
5751} 5752}
5752 5753
@@ -6089,8 +6090,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6089 strcpy(priv->nick, "ipw2100"); 6090 strcpy(priv->nick, "ipw2100");
6090 6091
6091 spin_lock_init(&priv->low_lock); 6092 spin_lock_init(&priv->low_lock);
6092 sema_init(&priv->action_sem, 1); 6093 mutex_init(&priv->action_mutex);
6093 sema_init(&priv->adapter_sem, 1); 6094 mutex_init(&priv->adapter_mutex);
6094 6095
6095 init_waitqueue_head(&priv->wait_command_queue); 6096 init_waitqueue_head(&priv->wait_command_queue);
6096 6097
@@ -6255,7 +6256,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6255 * member to call a function that then just turns and calls ipw2100_up. 6256 * member to call a function that then just turns and calls ipw2100_up.
6256 * net_dev->init is called after name allocation but before the 6257 * net_dev->init is called after name allocation but before the
6257 * notifier chain is called */ 6258 * notifier chain is called */
6258 down(&priv->action_sem); 6259 mutex_lock(&priv->action_mutex);
6259 err = register_netdev(dev); 6260 err = register_netdev(dev);
6260 if (err) { 6261 if (err) {
6261 printk(KERN_WARNING DRV_NAME 6262 printk(KERN_WARNING DRV_NAME
@@ -6291,12 +6292,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6291 6292
6292 priv->status |= STATUS_INITIALIZED; 6293 priv->status |= STATUS_INITIALIZED;
6293 6294
6294 up(&priv->action_sem); 6295 mutex_unlock(&priv->action_mutex);
6295 6296
6296 return 0; 6297 return 0;
6297 6298
6298 fail_unlock: 6299 fail_unlock:
6299 up(&priv->action_sem); 6300 mutex_unlock(&priv->action_mutex);
6300 6301
6301 fail: 6302 fail:
6302 if (dev) { 6303 if (dev) {
@@ -6336,7 +6337,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6336 struct net_device *dev; 6337 struct net_device *dev;
6337 6338
6338 if (priv) { 6339 if (priv) {
6339 down(&priv->action_sem); 6340 mutex_lock(&priv->action_mutex);
6340 6341
6341 priv->status &= ~STATUS_INITIALIZED; 6342 priv->status &= ~STATUS_INITIALIZED;
6342 6343
@@ -6351,9 +6352,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6351 /* Take down the hardware */ 6352 /* Take down the hardware */
6352 ipw2100_down(priv); 6353 ipw2100_down(priv);
6353 6354
6354 /* Release the semaphore so that the network subsystem can 6355 /* Release the mutex so that the network subsystem can
6355 * complete any needed calls into the driver... */ 6356 * complete any needed calls into the driver... */
6356 up(&priv->action_sem); 6357 mutex_unlock(&priv->action_mutex);
6357 6358
6358 /* Unregister the device first - this results in close() 6359 /* Unregister the device first - this results in close()
6359 * being called if the device is open. If we free storage 6360 * being called if the device is open. If we free storage
@@ -6392,7 +6393,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
6392 6393
6393 IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name); 6394 IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name);
6394 6395
6395 down(&priv->action_sem); 6396 mutex_lock(&priv->action_mutex);
6396 if (priv->status & STATUS_INITIALIZED) { 6397 if (priv->status & STATUS_INITIALIZED) {
6397 /* Take down the device; powers it off, etc. */ 6398 /* Take down the device; powers it off, etc. */
6398 ipw2100_down(priv); 6399 ipw2100_down(priv);
@@ -6405,7 +6406,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
6405 pci_disable_device(pci_dev); 6406 pci_disable_device(pci_dev);
6406 pci_set_power_state(pci_dev, PCI_D3hot); 6407 pci_set_power_state(pci_dev, PCI_D3hot);
6407 6408
6408 up(&priv->action_sem); 6409 mutex_unlock(&priv->action_mutex);
6409 6410
6410 return 0; 6411 return 0;
6411} 6412}
@@ -6419,7 +6420,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
6419 if (IPW2100_PM_DISABLED) 6420 if (IPW2100_PM_DISABLED)
6420 return 0; 6421 return 0;
6421 6422
6422 down(&priv->action_sem); 6423 mutex_lock(&priv->action_mutex);
6423 6424
6424 IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); 6425 IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name);
6425 6426
@@ -6445,7 +6446,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
6445 if (!(priv->status & STATUS_RF_KILL_SW)) 6446 if (!(priv->status & STATUS_RF_KILL_SW))
6446 ipw2100_up(priv, 0); 6447 ipw2100_up(priv, 0);
6447 6448
6448 up(&priv->action_sem); 6449 mutex_unlock(&priv->action_mutex);
6449 6450
6450 return 0; 6451 return 0;
6451} 6452}
@@ -6609,7 +6610,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
6609 if (priv->ieee->iw_mode == IW_MODE_INFRA) 6610 if (priv->ieee->iw_mode == IW_MODE_INFRA)
6610 return -EOPNOTSUPP; 6611 return -EOPNOTSUPP;
6611 6612
6612 down(&priv->action_sem); 6613 mutex_lock(&priv->action_mutex);
6613 if (!(priv->status & STATUS_INITIALIZED)) { 6614 if (!(priv->status & STATUS_INITIALIZED)) {
6614 err = -EIO; 6615 err = -EIO;
6615 goto done; 6616 goto done;
@@ -6640,7 +6641,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
6640 } 6641 }
6641 6642
6642 done: 6643 done:
6643 up(&priv->action_sem); 6644 mutex_unlock(&priv->action_mutex);
6644 return err; 6645 return err;
6645} 6646}
6646 6647
@@ -6681,7 +6682,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
6681 if (wrqu->mode == priv->ieee->iw_mode) 6682 if (wrqu->mode == priv->ieee->iw_mode)
6682 return 0; 6683 return 0;
6683 6684
6684 down(&priv->action_sem); 6685 mutex_lock(&priv->action_mutex);
6685 if (!(priv->status & STATUS_INITIALIZED)) { 6686 if (!(priv->status & STATUS_INITIALIZED)) {
6686 err = -EIO; 6687 err = -EIO;
6687 goto done; 6688 goto done;
@@ -6704,7 +6705,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
6704 } 6705 }
6705 6706
6706 done: 6707 done:
6707 up(&priv->action_sem); 6708 mutex_unlock(&priv->action_mutex);
6708 return err; 6709 return err;
6709} 6710}
6710 6711
@@ -6886,7 +6887,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6886 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 6887 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
6887 return -EINVAL; 6888 return -EINVAL;
6888 6889
6889 down(&priv->action_sem); 6890 mutex_lock(&priv->action_mutex);
6890 if (!(priv->status & STATUS_INITIALIZED)) { 6891 if (!(priv->status & STATUS_INITIALIZED)) {
6891 err = -EIO; 6892 err = -EIO;
6892 goto done; 6893 goto done;
@@ -6915,7 +6916,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6915 wrqu->ap_addr.sa_data[5] & 0xff); 6916 wrqu->ap_addr.sa_data[5] & 0xff);
6916 6917
6917 done: 6918 done:
6918 up(&priv->action_sem); 6919 mutex_unlock(&priv->action_mutex);
6919 return err; 6920 return err;
6920} 6921}
6921 6922
@@ -6951,7 +6952,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6951 int length = 0; 6952 int length = 0;
6952 int err = 0; 6953 int err = 0;
6953 6954
6954 down(&priv->action_sem); 6955 mutex_lock(&priv->action_mutex);
6955 if (!(priv->status & STATUS_INITIALIZED)) { 6956 if (!(priv->status & STATUS_INITIALIZED)) {
6956 err = -EIO; 6957 err = -EIO;
6957 goto done; 6958 goto done;
@@ -6988,7 +6989,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6988 err = ipw2100_set_essid(priv, essid, length, 0); 6989 err = ipw2100_set_essid(priv, essid, length, 0);
6989 6990
6990 done: 6991 done:
6991 up(&priv->action_sem); 6992 mutex_unlock(&priv->action_mutex);
6992 return err; 6993 return err;
6993} 6994}
6994 6995
@@ -7069,7 +7070,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
7069 u32 rate; 7070 u32 rate;
7070 int err = 0; 7071 int err = 0;
7071 7072
7072 down(&priv->action_sem); 7073 mutex_lock(&priv->action_mutex);
7073 if (!(priv->status & STATUS_INITIALIZED)) { 7074 if (!(priv->status & STATUS_INITIALIZED)) {
7074 err = -EIO; 7075 err = -EIO;
7075 goto done; 7076 goto done;
@@ -7096,7 +7097,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
7096 7097
7097 IPW_DEBUG_WX("SET Rate -> %04X \n", rate); 7098 IPW_DEBUG_WX("SET Rate -> %04X \n", rate);
7098 done: 7099 done:
7099 up(&priv->action_sem); 7100 mutex_unlock(&priv->action_mutex);
7100 return err; 7101 return err;
7101} 7102}
7102 7103
@@ -7116,7 +7117,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
7116 return 0; 7117 return 0;
7117 } 7118 }
7118 7119
7119 down(&priv->action_sem); 7120 mutex_lock(&priv->action_mutex);
7120 if (!(priv->status & STATUS_INITIALIZED)) { 7121 if (!(priv->status & STATUS_INITIALIZED)) {
7121 err = -EIO; 7122 err = -EIO;
7122 goto done; 7123 goto done;
@@ -7148,7 +7149,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
7148 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); 7149 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value);
7149 7150
7150 done: 7151 done:
7151 up(&priv->action_sem); 7152 mutex_unlock(&priv->action_mutex);
7152 return err; 7153 return err;
7153} 7154}
7154 7155
@@ -7163,7 +7164,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
7163 if (wrqu->rts.fixed == 0) 7164 if (wrqu->rts.fixed == 0)
7164 return -EINVAL; 7165 return -EINVAL;
7165 7166
7166 down(&priv->action_sem); 7167 mutex_lock(&priv->action_mutex);
7167 if (!(priv->status & STATUS_INITIALIZED)) { 7168 if (!(priv->status & STATUS_INITIALIZED)) {
7168 err = -EIO; 7169 err = -EIO;
7169 goto done; 7170 goto done;
@@ -7183,7 +7184,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
7183 7184
7184 IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value); 7185 IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value);
7185 done: 7186 done:
7186 up(&priv->action_sem); 7187 mutex_unlock(&priv->action_mutex);
7187 return err; 7188 return err;
7188} 7189}
7189 7190
@@ -7234,7 +7235,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7234 value = wrqu->txpower.value; 7235 value = wrqu->txpower.value;
7235 } 7236 }
7236 7237
7237 down(&priv->action_sem); 7238 mutex_lock(&priv->action_mutex);
7238 if (!(priv->status & STATUS_INITIALIZED)) { 7239 if (!(priv->status & STATUS_INITIALIZED)) {
7239 err = -EIO; 7240 err = -EIO;
7240 goto done; 7241 goto done;
@@ -7245,7 +7246,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7245 IPW_DEBUG_WX("SET TX Power -> %d \n", value); 7246 IPW_DEBUG_WX("SET TX Power -> %d \n", value);
7246 7247
7247 done: 7248 done:
7248 up(&priv->action_sem); 7249 mutex_unlock(&priv->action_mutex);
7249 return err; 7250 return err;
7250} 7251}
7251 7252
@@ -7337,7 +7338,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
7337 if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) 7338 if (!(wrqu->retry.flags & IW_RETRY_LIMIT))
7338 return 0; 7339 return 0;
7339 7340
7340 down(&priv->action_sem); 7341 mutex_lock(&priv->action_mutex);
7341 if (!(priv->status & STATUS_INITIALIZED)) { 7342 if (!(priv->status & STATUS_INITIALIZED)) {
7342 err = -EIO; 7343 err = -EIO;
7343 goto done; 7344 goto done;
@@ -7364,7 +7365,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
7364 IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value); 7365 IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value);
7365 7366
7366 done: 7367 done:
7367 up(&priv->action_sem); 7368 mutex_unlock(&priv->action_mutex);
7368 return err; 7369 return err;
7369} 7370}
7370 7371
@@ -7407,7 +7408,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7407 struct ipw2100_priv *priv = ieee80211_priv(dev); 7408 struct ipw2100_priv *priv = ieee80211_priv(dev);
7408 int err = 0; 7409 int err = 0;
7409 7410
7410 down(&priv->action_sem); 7411 mutex_lock(&priv->action_mutex);
7411 if (!(priv->status & STATUS_INITIALIZED)) { 7412 if (!(priv->status & STATUS_INITIALIZED)) {
7412 err = -EIO; 7413 err = -EIO;
7413 goto done; 7414 goto done;
@@ -7422,7 +7423,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7422 } 7423 }
7423 7424
7424 done: 7425 done:
7425 up(&priv->action_sem); 7426 mutex_unlock(&priv->action_mutex);
7426 return err; 7427 return err;
7427} 7428}
7428 7429
@@ -7472,7 +7473,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
7472 struct ipw2100_priv *priv = ieee80211_priv(dev); 7473 struct ipw2100_priv *priv = ieee80211_priv(dev);
7473 int err = 0; 7474 int err = 0;
7474 7475
7475 down(&priv->action_sem); 7476 mutex_lock(&priv->action_mutex);
7476 if (!(priv->status & STATUS_INITIALIZED)) { 7477 if (!(priv->status & STATUS_INITIALIZED)) {
7477 err = -EIO; 7478 err = -EIO;
7478 goto done; 7479 goto done;
@@ -7505,7 +7506,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
7505 IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); 7506 IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode);
7506 7507
7507 done: 7508 done:
7508 up(&priv->action_sem); 7509 mutex_unlock(&priv->action_mutex);
7509 return err; 7510 return err;
7510 7511
7511} 7512}
@@ -7809,7 +7810,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
7809 int enable = (parms[0] > 0); 7810 int enable = (parms[0] > 0);
7810 int err = 0; 7811 int err = 0;
7811 7812
7812 down(&priv->action_sem); 7813 mutex_lock(&priv->action_mutex);
7813 if (!(priv->status & STATUS_INITIALIZED)) { 7814 if (!(priv->status & STATUS_INITIALIZED)) {
7814 err = -EIO; 7815 err = -EIO;
7815 goto done; 7816 goto done;
@@ -7827,7 +7828,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
7827 err = ipw2100_switch_mode(priv, priv->last_mode); 7828 err = ipw2100_switch_mode(priv, priv->last_mode);
7828 } 7829 }
7829 done: 7830 done:
7830 up(&priv->action_sem); 7831 mutex_unlock(&priv->action_mutex);
7831 return err; 7832 return err;
7832} 7833}
7833 7834
@@ -7850,7 +7851,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
7850 struct ipw2100_priv *priv = ieee80211_priv(dev); 7851 struct ipw2100_priv *priv = ieee80211_priv(dev);
7851 int err = 0, mode = *(int *)extra; 7852 int err = 0, mode = *(int *)extra;
7852 7853
7853 down(&priv->action_sem); 7854 mutex_lock(&priv->action_mutex);
7854 if (!(priv->status & STATUS_INITIALIZED)) { 7855 if (!(priv->status & STATUS_INITIALIZED)) {
7855 err = -EIO; 7856 err = -EIO;
7856 goto done; 7857 goto done;
@@ -7862,7 +7863,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
7862 if (priv->power_mode != mode) 7863 if (priv->power_mode != mode)
7863 err = ipw2100_set_power_mode(priv, mode); 7864 err = ipw2100_set_power_mode(priv, mode);
7864 done: 7865 done:
7865 up(&priv->action_sem); 7866 mutex_unlock(&priv->action_mutex);
7866 return err; 7867 return err;
7867} 7868}
7868 7869
@@ -7914,7 +7915,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
7914 struct ipw2100_priv *priv = ieee80211_priv(dev); 7915 struct ipw2100_priv *priv = ieee80211_priv(dev);
7915 int err, mode = *(int *)extra; 7916 int err, mode = *(int *)extra;
7916 7917
7917 down(&priv->action_sem); 7918 mutex_lock(&priv->action_mutex);
7918 if (!(priv->status & STATUS_INITIALIZED)) { 7919 if (!(priv->status & STATUS_INITIALIZED)) {
7919 err = -EIO; 7920 err = -EIO;
7920 goto done; 7921 goto done;
@@ -7932,7 +7933,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
7932 err = ipw2100_system_config(priv, 0); 7933 err = ipw2100_system_config(priv, 0);
7933 7934
7934 done: 7935 done:
7935 up(&priv->action_sem); 7936 mutex_unlock(&priv->action_mutex);
7936 return err; 7937 return err;
7937} 7938}
7938 7939
@@ -7962,7 +7963,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
7962 struct ipw2100_priv *priv = ieee80211_priv(dev); 7963 struct ipw2100_priv *priv = ieee80211_priv(dev);
7963 int err, mode = *(int *)extra; 7964 int err, mode = *(int *)extra;
7964 7965
7965 down(&priv->action_sem); 7966 mutex_lock(&priv->action_mutex);
7966 if (!(priv->status & STATUS_INITIALIZED)) { 7967 if (!(priv->status & STATUS_INITIALIZED)) {
7967 err = -EIO; 7968 err = -EIO;
7968 goto done; 7969 goto done;
@@ -7979,7 +7980,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
7979 err = 0; 7980 err = 0;
7980 7981
7981 done: 7982 done:
7982 up(&priv->action_sem); 7983 mutex_unlock(&priv->action_mutex);
7983 return err; 7984 return err;
7984} 7985}
7985 7986
@@ -8284,11 +8285,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8284 if (priv->status & STATUS_STOPPING) 8285 if (priv->status & STATUS_STOPPING)
8285 return; 8286 return;
8286 8287
8287 down(&priv->action_sem); 8288 mutex_lock(&priv->action_mutex);
8288 8289
8289 IPW_DEBUG_WX("enter\n"); 8290 IPW_DEBUG_WX("enter\n");
8290 8291
8291 up(&priv->action_sem); 8292 mutex_unlock(&priv->action_mutex);
8292 8293
8293 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 8294 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
8294 8295
@@ -8311,7 +8312,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8311 8312
8312 if (!(priv->status & STATUS_ASSOCIATED)) { 8313 if (!(priv->status & STATUS_ASSOCIATED)) {
8313 IPW_DEBUG_WX("Configuring ESSID\n"); 8314 IPW_DEBUG_WX("Configuring ESSID\n");
8314 down(&priv->action_sem); 8315 mutex_lock(&priv->action_mutex);
8315 /* This is a disassociation event, so kick the firmware to 8316 /* This is a disassociation event, so kick the firmware to
8316 * look for another AP */ 8317 * look for another AP */
8317 if (priv->config & CFG_STATIC_ESSID) 8318 if (priv->config & CFG_STATIC_ESSID)
@@ -8319,7 +8320,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8319 0); 8320 0);
8320 else 8321 else
8321 ipw2100_set_essid(priv, NULL, 0, 0); 8322 ipw2100_set_essid(priv, NULL, 0, 0);
8322 up(&priv->action_sem); 8323 mutex_unlock(&priv->action_mutex);
8323 } 8324 }
8324 8325
8325 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); 8326 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
index 6f0b40f96abd..7d390f74160f 100644
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -594,8 +594,8 @@ struct ipw2100_priv {
594 int inta_other; 594 int inta_other;
595 595
596 spinlock_t low_lock; 596 spinlock_t low_lock;
597 struct semaphore action_sem; 597 struct mutex action_mutex;
598 struct semaphore adapter_sem; 598 struct mutex adapter_mutex;
599 599
600 wait_queue_head_t wait_command_queue; 600 wait_queue_head_t wait_command_queue;
601}; 601};