Commit 752e377b authored by Ingo Molnar's avatar Ingo Molnar Committed by John W. Linville

[PATCH] ipw2100: semaphore to mutexes conversion

semaphore to mutexes conversion.

the conversion was generated via scripts, and the result was validated
automatically via a script as well.

build-tested.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cae16295
...@@ -194,6 +194,7 @@ static struct ipw2100_fw ipw2100_firmware; ...@@ -194,6 +194,7 @@ static struct ipw2100_fw ipw2100_firmware;
#endif #endif
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/mutex.h>
module_param(debug, int, 0444); module_param(debug, int, 0444);
module_param(mode, int, 0444); module_param(mode, int, 0444);
module_param(channel, int, 0444); module_param(channel, int, 0444);
...@@ -1418,7 +1419,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv) ...@@ -1418,7 +1419,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
if (priv->status & STATUS_ENABLED) if (priv->status & STATUS_ENABLED)
return 0; return 0;
down(&priv->adapter_sem); mutex_lock(&priv->adapter_mutex);
if (rf_kill_active(priv)) { if (rf_kill_active(priv)) {
IPW_DEBUG_HC("Command aborted due to RF kill active.\n"); 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,7 +1445,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv)
} }
fail_up: fail_up:
up(&priv->adapter_sem); mutex_unlock(&priv->adapter_mutex);
return err; return err;
} }
...@@ -1576,7 +1577,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv) ...@@ -1576,7 +1577,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
cancel_delayed_work(&priv->hang_check); cancel_delayed_work(&priv->hang_check);
} }
down(&priv->adapter_sem); mutex_lock(&priv->adapter_mutex);
err = ipw2100_hw_send_command(priv, &cmd); err = ipw2100_hw_send_command(priv, &cmd);
if (err) { if (err) {
...@@ -1595,7 +1596,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv) ...@@ -1595,7 +1596,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
IPW_DEBUG_INFO("TODO: implement scan state machine\n"); IPW_DEBUG_INFO("TODO: implement scan state machine\n");
fail_up: fail_up:
up(&priv->adapter_sem); mutex_unlock(&priv->adapter_mutex);
return err; return err;
} }
...@@ -1888,7 +1889,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv) ...@@ -1888,7 +1889,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
priv->status |= STATUS_RESET_PENDING; priv->status |= STATUS_RESET_PENDING;
spin_unlock_irqrestore(&priv->low_lock, flags); spin_unlock_irqrestore(&priv->low_lock, flags);
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
/* stop timed checks so that they don't interfere with reset */ /* stop timed checks so that they don't interfere with reset */
priv->stop_hang_check = 1; priv->stop_hang_check = 1;
cancel_delayed_work(&priv->hang_check); cancel_delayed_work(&priv->hang_check);
...@@ -1898,7 +1899,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv) ...@@ -1898,7 +1899,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
ipw2100_up(priv, 0); ipw2100_up(priv, 0);
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
} }
...@@ -4212,7 +4213,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) ...@@ -4212,7 +4213,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n", IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n",
disable_radio ? "OFF" : "ON"); disable_radio ? "OFF" : "ON");
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (disable_radio) { if (disable_radio) {
priv->status |= STATUS_RF_KILL_SW; priv->status |= STATUS_RF_KILL_SW;
...@@ -4230,7 +4231,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) ...@@ -4230,7 +4231,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
schedule_reset(priv); schedule_reset(priv);
} }
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return 1; return 1;
} }
...@@ -5534,7 +5535,7 @@ static void shim__set_security(struct net_device *dev, ...@@ -5534,7 +5535,7 @@ static void shim__set_security(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int i, force_update = 0; int i, force_update = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) if (!(priv->status & STATUS_INITIALIZED))
goto done; goto done;
...@@ -5607,7 +5608,7 @@ static void shim__set_security(struct net_device *dev, ...@@ -5607,7 +5608,7 @@ static void shim__set_security(struct net_device *dev,
if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)))
ipw2100_configure_security(priv, 0); ipw2100_configure_security(priv, 0);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
} }
static int ipw2100_adapter_setup(struct ipw2100_priv *priv) static int ipw2100_adapter_setup(struct ipw2100_priv *priv)
...@@ -5731,7 +5732,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p) ...@@ -5731,7 +5732,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data)) if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL; return -EADDRNOTAVAIL;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
priv->config |= CFG_CUSTOM_MAC; priv->config |= CFG_CUSTOM_MAC;
memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 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,12 +5742,12 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
goto done; goto done;
priv->reset_backoff = 0; priv->reset_backoff = 0;
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
ipw2100_reset_adapter(priv); ipw2100_reset_adapter(priv);
return 0; return 0;
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -6089,8 +6090,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, ...@@ -6089,8 +6090,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
strcpy(priv->nick, "ipw2100"); strcpy(priv->nick, "ipw2100");
spin_lock_init(&priv->low_lock); spin_lock_init(&priv->low_lock);
sema_init(&priv->action_sem, 1); mutex_init(&priv->action_mutex);
sema_init(&priv->adapter_sem, 1); mutex_init(&priv->adapter_mutex);
init_waitqueue_head(&priv->wait_command_queue); init_waitqueue_head(&priv->wait_command_queue);
...@@ -6255,7 +6256,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, ...@@ -6255,7 +6256,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
* member to call a function that then just turns and calls ipw2100_up. * member to call a function that then just turns and calls ipw2100_up.
* net_dev->init is called after name allocation but before the * net_dev->init is called after name allocation but before the
* notifier chain is called */ * notifier chain is called */
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
printk(KERN_WARNING DRV_NAME printk(KERN_WARNING DRV_NAME
...@@ -6291,12 +6292,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, ...@@ -6291,12 +6292,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
priv->status |= STATUS_INITIALIZED; priv->status |= STATUS_INITIALIZED;
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return 0; return 0;
fail_unlock: fail_unlock:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
fail: fail:
if (dev) { if (dev) {
...@@ -6336,7 +6337,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) ...@@ -6336,7 +6337,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
struct net_device *dev; struct net_device *dev;
if (priv) { if (priv) {
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
priv->status &= ~STATUS_INITIALIZED; priv->status &= ~STATUS_INITIALIZED;
...@@ -6351,9 +6352,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) ...@@ -6351,9 +6352,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
/* Take down the hardware */ /* Take down the hardware */
ipw2100_down(priv); ipw2100_down(priv);
/* Release the semaphore so that the network subsystem can /* Release the mutex so that the network subsystem can
* complete any needed calls into the driver... */ * complete any needed calls into the driver... */
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
/* Unregister the device first - this results in close() /* Unregister the device first - this results in close()
* being called if the device is open. If we free storage * 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,7 +6393,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name); IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name);
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (priv->status & STATUS_INITIALIZED) { if (priv->status & STATUS_INITIALIZED) {
/* Take down the device; powers it off, etc. */ /* Take down the device; powers it off, etc. */
ipw2100_down(priv); ipw2100_down(priv);
...@@ -6405,7 +6406,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) ...@@ -6405,7 +6406,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
pci_disable_device(pci_dev); pci_disable_device(pci_dev);
pci_set_power_state(pci_dev, PCI_D3hot); pci_set_power_state(pci_dev, PCI_D3hot);
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return 0; return 0;
} }
...@@ -6419,7 +6420,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev) ...@@ -6419,7 +6420,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
if (IPW2100_PM_DISABLED) if (IPW2100_PM_DISABLED)
return 0; return 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name);
...@@ -6445,7 +6446,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev) ...@@ -6445,7 +6446,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
if (!(priv->status & STATUS_RF_KILL_SW)) if (!(priv->status & STATUS_RF_KILL_SW))
ipw2100_up(priv, 0); ipw2100_up(priv, 0);
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return 0; return 0;
} }
...@@ -6609,7 +6610,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev, ...@@ -6609,7 +6610,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
if (priv->ieee->iw_mode == IW_MODE_INFRA) if (priv->ieee->iw_mode == IW_MODE_INFRA)
return -EOPNOTSUPP; return -EOPNOTSUPP;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -6640,7 +6641,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev, ...@@ -6640,7 +6641,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
} }
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -6681,7 +6682,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev, ...@@ -6681,7 +6682,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
if (wrqu->mode == priv->ieee->iw_mode) if (wrqu->mode == priv->ieee->iw_mode)
return 0; return 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -6704,7 +6705,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev, ...@@ -6704,7 +6705,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
} }
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -6886,7 +6887,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev, ...@@ -6886,7 +6887,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
return -EINVAL; return -EINVAL;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -6915,7 +6916,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev, ...@@ -6915,7 +6916,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
wrqu->ap_addr.sa_data[5] & 0xff); wrqu->ap_addr.sa_data[5] & 0xff);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -6951,7 +6952,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev, ...@@ -6951,7 +6952,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
int length = 0; int length = 0;
int err = 0; int err = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -6988,7 +6989,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev, ...@@ -6988,7 +6989,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
err = ipw2100_set_essid(priv, essid, length, 0); err = ipw2100_set_essid(priv, essid, length, 0);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7069,7 +7070,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev, ...@@ -7069,7 +7070,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
u32 rate; u32 rate;
int err = 0; int err = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7096,7 +7097,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev, ...@@ -7096,7 +7097,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
IPW_DEBUG_WX("SET Rate -> %04X \n", rate); IPW_DEBUG_WX("SET Rate -> %04X \n", rate);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7116,7 +7117,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev, ...@@ -7116,7 +7117,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
return 0; return 0;
} }
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7148,7 +7149,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev, ...@@ -7148,7 +7149,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7163,7 +7164,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev, ...@@ -7163,7 +7164,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
if (wrqu->rts.fixed == 0) if (wrqu->rts.fixed == 0)
return -EINVAL; return -EINVAL;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7183,7 +7184,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev, ...@@ -7183,7 +7184,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value); IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7234,7 +7235,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, ...@@ -7234,7 +7235,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
value = wrqu->txpower.value; value = wrqu->txpower.value;
} }
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7245,7 +7246,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, ...@@ -7245,7 +7246,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
IPW_DEBUG_WX("SET TX Power -> %d \n", value); IPW_DEBUG_WX("SET TX Power -> %d \n", value);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7337,7 +7338,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev, ...@@ -7337,7 +7338,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) if (!(wrqu->retry.flags & IW_RETRY_LIMIT))
return 0; return 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7364,7 +7365,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev, ...@@ -7364,7 +7365,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value); IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7407,7 +7408,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev, ...@@ -7407,7 +7408,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int err = 0; int err = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7422,7 +7423,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev, ...@@ -7422,7 +7423,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
} }
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7472,7 +7473,7 @@ static int ipw2100_wx_set_power(struct net_device *dev, ...@@ -7472,7 +7473,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int err = 0; int err = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7505,7 +7506,7 @@ static int ipw2100_wx_set_power(struct net_device *dev, ...@@ -7505,7 +7506,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7809,7 +7810,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev, ...@@ -7809,7 +7810,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
int enable = (parms[0] > 0); int enable = (parms[0] > 0);
int err = 0; int err = 0;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7827,7 +7828,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev, ...@@ -7827,7 +7828,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
err = ipw2100_switch_mode(priv, priv->last_mode); err = ipw2100_switch_mode(priv, priv->last_mode);
} }
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7850,7 +7851,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev, ...@@ -7850,7 +7851,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int err = 0, mode = *(int *)extra; int err = 0, mode = *(int *)extra;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7862,7 +7863,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev, ...@@ -7862,7 +7863,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
if (priv->power_mode != mode) if (priv->power_mode != mode)
err = ipw2100_set_power_mode(priv, mode); err = ipw2100_set_power_mode(priv, mode);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7914,7 +7915,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev, ...@@ -7914,7 +7915,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int err, mode = *(int *)extra; int err, mode = *(int *)extra;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7932,7 +7933,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev, ...@@ -7932,7 +7933,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
err = ipw2100_system_config(priv, 0); err = ipw2100_system_config(priv, 0);
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -7962,7 +7963,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev, ...@@ -7962,7 +7963,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
struct ipw2100_priv *priv = ieee80211_priv(dev); struct ipw2100_priv *priv = ieee80211_priv(dev);
int err, mode = *(int *)extra; int err, mode = *(int *)extra;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
if (!(priv->status & STATUS_INITIALIZED)) { if (!(priv->status & STATUS_INITIALIZED)) {
err = -EIO; err = -EIO;
goto done; goto done;
...@@ -7979,7 +7980,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev, ...@@ -7979,7 +7980,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
err = 0; err = 0;
done: done:
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
return err; return err;
} }
...@@ -8284,11 +8285,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) ...@@ -8284,11 +8285,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
if (priv->status & STATUS_STOPPING) if (priv->status & STATUS_STOPPING)
return; return;
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
IPW_DEBUG_WX("enter\n"); IPW_DEBUG_WX("enter\n");
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
...@@ -8311,7 +8312,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) ...@@ -8311,7 +8312,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
if (!(priv->status & STATUS_ASSOCIATED)) { if (!(priv->status & STATUS_ASSOCIATED)) {
IPW_DEBUG_WX("Configuring ESSID\n"); IPW_DEBUG_WX("Configuring ESSID\n");
down(&priv->action_sem); mutex_lock(&priv->action_mutex);
/* This is a disassociation event, so kick the firmware to /* This is a disassociation event, so kick the firmware to
* look for another AP */ * look for another AP */
if (priv->config & CFG_STATIC_ESSID) if (priv->config & CFG_STATIC_ESSID)
...@@ -8319,7 +8320,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) ...@@ -8319,7 +8320,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
0); 0);
else else
ipw2100_set_essid(priv, NULL, 0, 0); ipw2100_set_essid(priv, NULL, 0, 0);
up(&priv->action_sem); mutex_unlock(&priv->action_mutex);
} }
wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
......
...@@ -594,8 +594,8 @@ struct ipw2100_priv { ...@@ -594,8 +594,8 @@ struct ipw2100_priv {
int inta_other; int inta_other;
spinlock_t low_lock; spinlock_t low_lock;
struct semaphore action_sem; struct mutex action_mutex;
struct semaphore adapter_sem; struct mutex adapter_mutex;
wait_queue_head_t wait_command_queue; wait_queue_head_t wait_command_queue;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment