Commit f8139218 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by John W. Linville

prism54: Convert stats_sem in a mutex

The semaphore stats_sem is used as mutex, convert it to the mutex API
Signed-off-by: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: default avatarLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6f865c0a
...@@ -165,7 +165,7 @@ prism54_update_stats(struct work_struct *work) ...@@ -165,7 +165,7 @@ prism54_update_stats(struct work_struct *work)
struct obj_bss bss, *bss2; struct obj_bss bss, *bss2;
union oid_res_t r; union oid_res_t r;
down(&priv->stats_sem); mutex_lock(&priv->stats_lock);
/* Noise floor. /* Noise floor.
* I'm not sure if the unit is dBm. * I'm not sure if the unit is dBm.
...@@ -207,7 +207,7 @@ prism54_update_stats(struct work_struct *work) ...@@ -207,7 +207,7 @@ prism54_update_stats(struct work_struct *work)
mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r); mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r);
priv->local_iwstatistics.discard.retries = r.u; priv->local_iwstatistics.discard.retries = r.u;
up(&priv->stats_sem); mutex_unlock(&priv->stats_lock);
return; return;
} }
...@@ -218,12 +218,12 @@ prism54_get_wireless_stats(struct net_device *ndev) ...@@ -218,12 +218,12 @@ prism54_get_wireless_stats(struct net_device *ndev)
islpci_private *priv = netdev_priv(ndev); islpci_private *priv = netdev_priv(ndev);
/* If the stats are being updated return old data */ /* If the stats are being updated return old data */
if (down_trylock(&priv->stats_sem) == 0) { if (mutex_trylock(&priv->stats_lock) == 0) {
memcpy(&priv->iwstatistics, &priv->local_iwstatistics, memcpy(&priv->iwstatistics, &priv->local_iwstatistics,
sizeof (struct iw_statistics)); sizeof (struct iw_statistics));
/* They won't be marked updated for the next time */ /* They won't be marked updated for the next time */
priv->local_iwstatistics.qual.updated = 0; priv->local_iwstatistics.qual.updated = 0;
up(&priv->stats_sem); mutex_unlock(&priv->stats_lock);
} else } else
priv->iwstatistics.qual.updated = 0; priv->iwstatistics.qual.updated = 0;
......
...@@ -864,7 +864,7 @@ islpci_setup(struct pci_dev *pdev) ...@@ -864,7 +864,7 @@ islpci_setup(struct pci_dev *pdev)
mutex_init(&priv->mgmt_lock); mutex_init(&priv->mgmt_lock);
priv->mgmt_received = NULL; priv->mgmt_received = NULL;
init_waitqueue_head(&priv->mgmt_wqueue); init_waitqueue_head(&priv->mgmt_wqueue);
sema_init(&priv->stats_sem, 1); mutex_init(&priv->stats_lock);
spin_lock_init(&priv->slock); spin_lock_init(&priv->slock);
/* init state machine with off#1 state */ /* init state machine with off#1 state */
......
...@@ -88,7 +88,7 @@ typedef struct { ...@@ -88,7 +88,7 @@ typedef struct {
/* Take care of the wireless stats */ /* Take care of the wireless stats */
struct work_struct stats_work; struct work_struct stats_work;
struct semaphore stats_sem; struct mutex stats_lock;
/* remember when we last updated the stats */ /* remember when we last updated the stats */
unsigned long stats_timestamp; unsigned long stats_timestamp;
/* The first is accessed under semaphore locking. /* The first is accessed under semaphore locking.
......
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