aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/prism54
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias@kaehlcke.net>2008-02-15 14:56:59 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:17 -0500
commitf8139218b32e9a68fc6779fa0ce45c5078c23c8a (patch)
treea469cc72903dc998fce586e27fed863ea3c81449 /drivers/net/wireless/prism54
parent6f865c0ab9318cd4c357654e460cb4c9aaf23a92 (diff)
prism54: Convert stats_sem in a mutex
The semaphore stats_sem is used as mutex, convert it to the mutex API Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/prism54')
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c8
-rw-r--r--drivers/net/wireless/prism54/islpci_dev.c2
-rw-r--r--drivers/net/wireless/prism54/islpci_dev.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index df1594ea942c..3fb6a7b54038 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -165,7 +165,7 @@ prism54_update_stats(struct work_struct *work)
165 struct obj_bss bss, *bss2; 165 struct obj_bss bss, *bss2;
166 union oid_res_t r; 166 union oid_res_t r;
167 167
168 down(&priv->stats_sem); 168 mutex_lock(&priv->stats_lock);
169 169
170/* Noise floor. 170/* Noise floor.
171 * I'm not sure if the unit is dBm. 171 * I'm not sure if the unit is dBm.
@@ -207,7 +207,7 @@ prism54_update_stats(struct work_struct *work)
207 mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r); 207 mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r);
208 priv->local_iwstatistics.discard.retries = r.u; 208 priv->local_iwstatistics.discard.retries = r.u;
209 209
210 up(&priv->stats_sem); 210 mutex_unlock(&priv->stats_lock);
211 211
212 return; 212 return;
213} 213}
@@ -218,12 +218,12 @@ prism54_get_wireless_stats(struct net_device *ndev)
218 islpci_private *priv = netdev_priv(ndev); 218 islpci_private *priv = netdev_priv(ndev);
219 219
220 /* If the stats are being updated return old data */ 220 /* If the stats are being updated return old data */
221 if (down_trylock(&priv->stats_sem) == 0) { 221 if (mutex_trylock(&priv->stats_lock) == 0) {
222 memcpy(&priv->iwstatistics, &priv->local_iwstatistics, 222 memcpy(&priv->iwstatistics, &priv->local_iwstatistics,
223 sizeof (struct iw_statistics)); 223 sizeof (struct iw_statistics));
224 /* They won't be marked updated for the next time */ 224 /* They won't be marked updated for the next time */
225 priv->local_iwstatistics.qual.updated = 0; 225 priv->local_iwstatistics.qual.updated = 0;
226 up(&priv->stats_sem); 226 mutex_unlock(&priv->stats_lock);
227 } else 227 } else
228 priv->iwstatistics.qual.updated = 0; 228 priv->iwstatistics.qual.updated = 0;
229 229
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index dbb538ccb4ec..eb7c1c6bcd8a 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -864,7 +864,7 @@ islpci_setup(struct pci_dev *pdev)
864 mutex_init(&priv->mgmt_lock); 864 mutex_init(&priv->mgmt_lock);
865 priv->mgmt_received = NULL; 865 priv->mgmt_received = NULL;
866 init_waitqueue_head(&priv->mgmt_wqueue); 866 init_waitqueue_head(&priv->mgmt_wqueue);
867 sema_init(&priv->stats_sem, 1); 867 mutex_init(&priv->stats_lock);
868 spin_lock_init(&priv->slock); 868 spin_lock_init(&priv->slock);
869 869
870 /* init state machine with off#1 state */ 870 /* init state machine with off#1 state */
diff --git a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h
index b03a2ab0009b..85ddf89967af 100644
--- a/drivers/net/wireless/prism54/islpci_dev.h
+++ b/drivers/net/wireless/prism54/islpci_dev.h
@@ -88,7 +88,7 @@ typedef struct {
88 88
89 /* Take care of the wireless stats */ 89 /* Take care of the wireless stats */
90 struct work_struct stats_work; 90 struct work_struct stats_work;
91 struct semaphore stats_sem; 91 struct mutex stats_lock;
92 /* remember when we last updated the stats */ 92 /* remember when we last updated the stats */
93 unsigned long stats_timestamp; 93 unsigned long stats_timestamp;
94 /* The first is accessed under semaphore locking. 94 /* The first is accessed under semaphore locking.