aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/meilhaus/me0600_ext_irq.h
diff options
context:
space:
mode:
authorDavid Kiliani <mail@davidkiliani.de>2008-11-01 00:39:12 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 13:52:29 -0800
commit3fedd14818592016f7ffd84dfe134881b3896ecf (patch)
tree22574873dc7d844d4cc33d04f7e6ba03f23c639e /drivers/staging/meilhaus/me0600_ext_irq.h
parent5ec5ec78060481e6a0cecc06ab0c6ec8b213ec80 (diff)
Staging: Add the Meilhaus ME-IDS driver package
Originally written by Guenter Gebhardt <g.gebhardt@meilhaus.de> and Krzysztof Gantzke <k.gantzke@meilhaus.de> This is the drv/lnx/mod directory of ME-IDS 1.2.9 tarball with some files from drv/lnx/include. Signed-off-by: David Kiliani <mail@davidkiliani.de> Cc: Guenter Gebhardt <g.gebhardt@meilhaus.de> Cc: Krzysztof Gantzke <k.gantzke@meilhaus.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/meilhaus/me0600_ext_irq.h')
-rw-r--r--drivers/staging/meilhaus/me0600_ext_irq.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/drivers/staging/meilhaus/me0600_ext_irq.h b/drivers/staging/meilhaus/me0600_ext_irq.h
new file mode 100644
index 00000000000..f5f2204b49a
--- /dev/null
+++ b/drivers/staging/meilhaus/me0600_ext_irq.h
@@ -0,0 +1,58 @@
+/**
+ * @file me0600_ext_irq.h
+ *
+ * @brief ME-630 external interrupt implementation.
+ * @note Copyright (C) 2006 Meilhaus Electronic GmbH (support@meilhaus.de)
+ * @author Guenter Gebhardt
+ */
+
+#ifndef _ME0600_EXT_IRQ_H_
+#define _ME0600_EXT_IRQ_H_
+
+#include <linux/sched.h>
+
+#include "mesubdevice.h"
+#include "meslock.h"
+
+#ifdef __KERNEL__
+
+/**
+ * @brief The ME-630 external interrupt subdevice class.
+ */
+typedef struct me0600_ext_irq_subdevice {
+ /* Inheritance */
+ me_subdevice_t base; /**< The subdevice base class. */
+
+ /* Attributes */
+ spinlock_t subdevice_lock; /**< Spin lock to protect the subdevice from concurrent access. */
+ spinlock_t *intcsr_lock; /**< Spin lock to protect #intcsr. */
+
+ wait_queue_head_t wait_queue; /**< Queue to put on threads waiting for an interrupt. */
+
+ int irq; /**< The irq number assigned by PCI BIOS. */
+ int rised; /**< If true an interrupt has occured. */
+ unsigned int n; /**< The number of interrupt since the driver was loaded. */
+ unsigned int lintno; /**< The number of the local PCI interrupt. */
+
+ uint32_t intcsr; /**< The PLX interrupt control and status register. */
+ uint32_t reset_reg; /**< The control register. */
+} me0600_ext_irq_subdevice_t;
+
+/**
+ * @brief The constructor to generate a ME-630 external interrupt instance.
+ *
+ * @param plx_reg_base The register base address of the PLX chip as returned by the PCI BIOS.
+ * @param me0600_reg_base The register base address of the ME-630 device as returned by the PCI BIOS.
+ * @param irq The irq assigned by the PCI BIOS.
+ *
+ * @return Pointer to new instance on success.\n
+ * NULL on error.
+ */
+me0600_ext_irq_subdevice_t *me0600_ext_irq_constructor(uint32_t plx_reg_base,
+ uint32_t me0600_reg_base,
+ spinlock_t * intcsr_lock,
+ unsigned int ext_irq_idx,
+ int irq);
+
+#endif
+#endif