aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/hermes.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2010-05-01 14:05:40 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-05-03 14:53:07 -0400
commitbcad6e80f3fb0d6724c3814cf32258bbcf1d67db (patch)
tree13fc2edae79405b7ae393099486153eefa3091d1 /drivers/net/wireless/orinoco/hermes.c
parent593ef09c9e70c92c0d76c67a1c03a5d44d3aec82 (diff)
downloadkernel_samsung_smdk4412-bcad6e80f3fb0d6724c3814cf32258bbcf1d67db.zip
kernel_samsung_smdk4412-bcad6e80f3fb0d6724c3814cf32258bbcf1d67db.tar.gz
kernel_samsung_smdk4412-bcad6e80f3fb0d6724c3814cf32258bbcf1d67db.tar.bz2
orinoco: encapsulate driver locking
Local bus and USB drivers will need to do locking differently. The original orinoco_usb patches had a boolean variable controlling whether spin_lock_bh was used, or irq based locking. This version provides wrappers for the lock functions and the drivers specify the functions pointers needed. This will introduce a performance penalty, but I'm not expecting it to be noticable. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/hermes.c')
-rw-r--r--drivers/net/wireless/orinoco/hermes.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/wireless/orinoco/hermes.c b/drivers/net/wireless/orinoco/hermes.c
index a7df524..845693f 100644
--- a/drivers/net/wireless/orinoco/hermes.c
+++ b/drivers/net/wireless/orinoco/hermes.c
@@ -529,6 +529,28 @@ static int hermes_write_ltv(hermes_t *hw, int bap, u16 rid,
return err;
}
+static void hermes_lock_irqsave(spinlock_t *lock,
+ unsigned long *flags) __acquires(lock)
+{
+ spin_lock_irqsave(lock, *flags);
+}
+
+static void hermes_unlock_irqrestore(spinlock_t *lock,
+ unsigned long *flags) __releases(lock)
+{
+ spin_unlock_irqrestore(lock, *flags);
+}
+
+static void hermes_lock_irq(spinlock_t *lock) __acquires(lock)
+{
+ spin_lock_irq(lock);
+}
+
+static void hermes_unlock_irq(spinlock_t *lock) __releases(lock)
+{
+ spin_unlock_irq(lock);
+}
+
/* Hermes operations for local buses */
static const struct hermes_ops hermes_ops_local = {
.init = hermes_init,
@@ -538,5 +560,9 @@ static const struct hermes_ops hermes_ops_local = {
.read_ltv = hermes_read_ltv,
.write_ltv = hermes_write_ltv,
.bap_pread = hermes_bap_pread,
- .bap_pwrite = hermes_bap_pwrite
+ .bap_pwrite = hermes_bap_pwrite,
+ .lock_irqsave = hermes_lock_irqsave,
+ .unlock_irqrestore = hermes_unlock_irqrestore,
+ .lock_irq = hermes_lock_irq,
+ .unlock_irq = hermes_unlock_irq,
};