| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
#ifndef _WCTE12XP_H |
| 31 |
#define _WCTE12XP_H |
| 32 |
|
| 33 |
|
| 34 |
#define VPM_SUPPORT 1 |
| 35 |
|
| 36 |
#define WC_MAX_IFACES 8 |
| 37 |
|
| 38 |
#ifdef VPM_SUPPORT |
| 39 |
#define MAX_TDM_CHAN 31 |
| 40 |
#endif |
| 41 |
|
| 42 |
#define SDI_CLK (0x00010000) |
| 43 |
#define SDI_DOUT (0x00020000) |
| 44 |
#define SDI_DREAD (0x00040000) |
| 45 |
#define SDI_DIN (0x00080000) |
| 46 |
|
| 47 |
#define EFRAME_SIZE 108 |
| 48 |
#define ERING_SIZE 16 |
| 49 |
#define EFRAME_GAP 20 |
| 50 |
#define SFRAME_SIZE ((EFRAME_SIZE * DAHDI_CHUNKSIZE) + (EFRAME_GAP * (DAHDI_CHUNKSIZE - 1))) |
| 51 |
|
| 52 |
#define PCI_WINDOW_SIZE ((2 * 2 * 2 * SFRAME_SIZE) + (2 * ERING_SIZE * 4)) |
| 53 |
|
| 54 |
#define MAX_COMMANDS 16 |
| 55 |
|
| 56 |
#define NUM_EC 4 |
| 57 |
|
| 58 |
#define __CMD_PINS (1 << 18) |
| 59 |
#define __CMD_LEDS (1 << 19) |
| 60 |
#define __CMD_RD (1 << 20) |
| 61 |
#define __CMD_WR (1 << 21) |
| 62 |
|
| 63 |
#define __LED_ORANGE (1<<3) |
| 64 |
#define __LED_GREEN (1<<2) |
| 65 |
#define __LED_RED (1<<1) |
| 66 |
|
| 67 |
#define SET_LED_ORANGE(a) (a | __LED_ORANGE) |
| 68 |
#define SET_LED_RED(a) ((a | __LED_RED) & ~__LED_GREEN) |
| 69 |
#define SET_LED_GREEN(a) ((a | __LED_GREEN) & ~__LED_RED) |
| 70 |
|
| 71 |
#define UNSET_LED_ORANGE(a) (a & ~__LED_ORANGE) |
| 72 |
#define UNSET_LED_REDGREEN(a) (a | __LED_RED | __LED_GREEN) |
| 73 |
|
| 74 |
#define CMD_BYTE(slot, a, is_vpm) (slot*6)+(a*2)+is_vpm |
| 75 |
|
| 76 |
|
| 77 |
enum linemode { |
| 78 |
T1 = 1, |
| 79 |
E1, |
| 80 |
J1, |
| 81 |
}; |
| 82 |
|
| 83 |
struct command { |
| 84 |
struct list_head node; |
| 85 |
struct completion complete; |
| 86 |
u8 data; |
| 87 |
u8 ident; |
| 88 |
u8 cs_slot; |
| 89 |
u16 address; |
| 90 |
u32 flags; |
| 91 |
}; |
| 92 |
|
| 93 |
struct vpm150m; |
| 94 |
|
| 95 |
struct t1 { |
| 96 |
spinlock_t reglock; |
| 97 |
unsigned char txident; |
| 98 |
unsigned char rxident; |
| 99 |
unsigned char statreg; |
| 100 |
struct { |
| 101 |
unsigned int nmf:1; |
| 102 |
unsigned int sendingyellow:1; |
| 103 |
} flags; |
| 104 |
unsigned char txsigs[16]; |
| 105 |
int alarmcount; |
| 106 |
int losalarmcount; |
| 107 |
int aisalarmcount; |
| 108 |
int yelalarmcount; |
| 109 |
const char *variety; |
| 110 |
char name[80]; |
| 111 |
unsigned long blinktimer; |
| 112 |
int loopupcnt; |
| 113 |
int loopdowncnt; |
| 114 |
#define INITIALIZED 1 |
| 115 |
#define SHUTDOWN 2 |
| 116 |
#define READY 3 |
| 117 |
#define IOERROR 4 |
| 118 |
unsigned long bit_flags; |
| 119 |
unsigned long alarmtimer; |
| 120 |
unsigned char ledstate; |
| 121 |
unsigned char vpm_check_count; |
| 122 |
struct dahdi_device *ddev; |
| 123 |
struct dahdi_span span; |
| 124 |
struct dahdi_chan *chans[32]; |
| 125 |
struct dahdi_echocan_state *ec[32]; |
| 126 |
#ifdef CONFIG_VOICEBUS_ECREFERENCE |
| 127 |
struct dahdi_fifo *ec_reference[32]; |
| 128 |
#else |
| 129 |
unsigned char ec_chunk1[32][DAHDI_CHUNKSIZE]; |
| 130 |
unsigned char ec_chunk2[32][DAHDI_CHUNKSIZE]; |
| 131 |
#endif |
| 132 |
unsigned long ctlreg; |
| 133 |
struct voicebus vb; |
| 134 |
atomic_t txints; |
| 135 |
struct vpmadt032 *vpmadt032; |
| 136 |
struct vpmoct *vpmoct; |
| 137 |
unsigned long vpm_check; |
| 138 |
struct work_struct vpm_check_work; |
| 139 |
|
| 140 |
|
| 141 |
struct list_head pending_cmds; |
| 142 |
struct list_head active_cmds; |
| 143 |
struct timer_list timer; |
| 144 |
struct work_struct timer_work; |
| 145 |
struct workqueue_struct *wq; |
| 146 |
unsigned int not_ready; |
| 147 |
}; |
| 148 |
|
| 149 |
#define t1_info(t1, format, arg...) \ |
| 150 |
dev_info(&t1->vb.pdev->dev , format , ## arg) |
| 151 |
|
| 152 |
#define t1_notice(t1, format, arg...) \ |
| 153 |
dev_notice(&t1->vb.pdev->dev , format , ## arg) |
| 154 |
|
| 155 |
|
| 156 |
#define LIM0 0x36 |
| 157 |
#define LIM0_LL (1<<1) |
| 158 |
#define LIM1 0x37 |
| 159 |
#define LIM1_RL (1<<1) |
| 160 |
#define LIM1_JATT (1<<2) |
| 161 |
|
| 162 |
|
| 163 |
#define CCB1 0x2f |
| 164 |
#define CCB2 0x30 |
| 165 |
#define CCB3 0x31 |
| 166 |
|
| 167 |
#endif |