Commit 1b34fd39 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by David S. Miller

Prism54: Convert mgmt_sem to the mutex API

Signed-off-by: default avatarMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1e3428e9
...@@ -861,7 +861,7 @@ islpci_setup(struct pci_dev *pdev) ...@@ -861,7 +861,7 @@ islpci_setup(struct pci_dev *pdev)
init_waitqueue_head(&priv->reset_done); init_waitqueue_head(&priv->reset_done);
/* init the queue read locks, process wait counter */ /* init the queue read locks, process wait counter */
sema_init(&priv->mgmt_sem, 1); 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); sema_init(&priv->stats_sem, 1);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/mutex.h>
#include "isl_38xx.h" #include "isl_38xx.h"
#include "isl_oid.h" #include "isl_oid.h"
...@@ -164,7 +165,7 @@ typedef struct { ...@@ -164,7 +165,7 @@ typedef struct {
wait_queue_head_t reset_done; wait_queue_head_t reset_done;
/* used by islpci_mgt_transaction */ /* used by islpci_mgt_transaction */
struct semaphore mgmt_sem; /* serialize access to mailbox and wqueue */ struct mutex mgmt_lock; /* serialize access to mailbox and wqueue */
struct islpci_mgmtframe *mgmt_received; /* mbox for incoming frame */ struct islpci_mgmtframe *mgmt_received; /* mbox for incoming frame */
wait_queue_head_t mgmt_wqueue; /* waitqueue for mbox */ wait_queue_head_t mgmt_wqueue; /* waitqueue for mbox */
......
...@@ -460,7 +460,7 @@ islpci_mgt_transaction(struct net_device *ndev, ...@@ -460,7 +460,7 @@ islpci_mgt_transaction(struct net_device *ndev,
*recvframe = NULL; *recvframe = NULL;
if (down_interruptible(&priv->mgmt_sem)) if (mutex_lock_interruptible(&priv->mgmt_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE);
...@@ -504,7 +504,7 @@ islpci_mgt_transaction(struct net_device *ndev, ...@@ -504,7 +504,7 @@ islpci_mgt_transaction(struct net_device *ndev,
/* TODO: we should reset the device here */ /* TODO: we should reset the device here */
out: out:
finish_wait(&priv->mgmt_wqueue, &wait); finish_wait(&priv->mgmt_wqueue, &wait);
up(&priv->mgmt_sem); mutex_unlock(&priv->mgmt_lock);
return err; return err;
} }
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