summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:03:38 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:03:38 +0000
commit42a8250410cd989c6daa35021601324cb7790f04 (patch)
tree6d9071687ff7492a9869c034f7e4c8ceb7d8bab3 /drivers/dahdi/wctdm24xxp/wctdm24xxp.h
parent81732cd4885889f89ecbf4e07448b151a9a4ad56 (diff)
wctdm24xxp: Use lists for SPI commands to the modules.
Saves time in the interrupt handler by eliminating the need to scan through all of the slots in the cmd arrays. Also allows the reads from ISR context to automatically grow as the latency grows. This ensures that battery and hook state is actually checked every frame like originally intended. Signed-off-by: Shaun Ruffell <sruffell@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9966 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/wctdm24xxp.h')
-rw-r--r--drivers/dahdi/wctdm24xxp/wctdm24xxp.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
index 453f9bc..802ec6b 100644
--- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
+++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
@@ -85,12 +85,9 @@
#define NUM_CAL_REGS 12
-#define USER_COMMANDS 8
#define ISR_COMMANDS 2
#define QRV_DEBOUNCETIME 20
-#define MAX_COMMANDS (USER_COMMANDS + ISR_COMMANDS)
-
#define VPM150M_HPI_CONTROL 0x00
#define VPM150M_HPI_ADDRESS 0x02
#define VPM150M_HPI_DATA 0x03
@@ -106,17 +103,19 @@ struct calregs {
unsigned char vals[NUM_CAL_REGS];
};
-struct cmdq {
- unsigned int cmds[MAX_COMMANDS];
- unsigned char isrshadow[ISR_COMMANDS];
-};
-
enum battery_state {
BATTERY_UNKNOWN = 0,
BATTERY_PRESENT,
BATTERY_LOST,
};
+struct wctdm_cmd {
+ struct list_head node;
+ struct completion *complete;
+ u32 cmd;
+ u8 ident;
+};
+
/**
* struct wctdm_span -
* @span: dahdi_span to register.
@@ -221,7 +220,10 @@ struct wctdm_module {
struct b400m *bri;
} mod;
- struct cmdq cmdq;
+ /* Protected by wctdm.reglock */
+ struct list_head pending_cmds;
+ struct list_head active_cmds;
+ u8 isrshadow[ISR_COMMANDS];
enum module_type type;
int sethook; /* pending hook state command */