diff options
Diffstat (limited to 'kernel/wctdm24xxp/wctdm24xxp.h')
-rw-r--r-- | kernel/wctdm24xxp/wctdm24xxp.h | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/kernel/wctdm24xxp/wctdm24xxp.h b/kernel/wctdm24xxp/wctdm24xxp.h index fd7f39b..30e4fb9 100644 --- a/kernel/wctdm24xxp/wctdm24xxp.h +++ b/kernel/wctdm24xxp/wctdm24xxp.h @@ -27,20 +27,20 @@ #ifndef _WCTDM24XXP_H #define _WCTDM24XXP_H +#include "../zaptel.h" +#include "../voicebus.h" +#include <asm/semaphore.h> + #define NUM_FXO_REGS 60 #define WC_MAX_IFACES 128 /*! * \brief Default ringer debounce (in ms) - * - * \todo This value differs from that in wctdm. In that module, it is 64 ms - * instead of 128 ms. Which one is more appropriate? */ #define DEFAULT_RING_DEBOUNCE 128 -#define DEFAULT_BATT_DEBOUNCE 64 /* Battery debounce (in ms) */ -#define POLARITY_DEBOUNCE 64 /* Polarity debounce (in ms) */ -#define DEFAULT_BATT_THRESH 3 /* Anything under this is "no battery" */ + +#define POLARITY_DEBOUNCE 64 /* Polarity debounce (in ms) */ #define OHT_TIMER 6000 /* How long after RING to retain OHT */ @@ -173,9 +173,15 @@ struct cmdq { unsigned char isrshadow[ISR_COMMANDS]; }; +enum battery_state { + BATTERY_UNKNOWN = 0, + BATTERY_PRESENT, + BATTERY_LOST, +}; + struct wctdm { - struct pci_dev *dev; char *variety; + char board_name[80]; struct zt_span span; unsigned char ios; unsigned int sdi; @@ -183,16 +189,12 @@ struct wctdm { unsigned int intcount; unsigned int rxints; unsigned int txints; - unsigned int intmask; unsigned char txident; unsigned char rxident; int dead; int pos; int flags[NUM_CARDS]; - int freeregion; int alt; - int rdbl; - int tdbl; int curcard; unsigned char ctlreg; int cards; @@ -215,19 +217,19 @@ struct wctdm { wait_queue_head_t regq; /* FXO Stuff */ union { - struct { + struct fxo { int wasringing; int lastrdtx; int ringdebounce; int offhook; int battdebounce; - int nobatttimer; - int battery; + int battalarm; + enum battery_state battery; int lastpol; int polarity; int polaritydebounce; } fxo; - struct { + struct fxs { int oldrxhook; int debouncehook; int lastrxhook; @@ -261,14 +263,9 @@ struct wctdm { int blinktimer; #endif #endif - unsigned long iobase; - dma_addr_t readdma; - dma_addr_t writedma; - dma_addr_t descripdma; - volatile unsigned int *writechunk; /* Double-word aligned write memory */ - volatile unsigned int *readchunk; /* Double-word aligned read memory */ - volatile unsigned int *descripchunk; /* Descriptors */ + struct voicebus *vb; struct zt_chan chans[NUM_CARDS]; + int initialized; }; |