summaryrefslogtreecommitdiff
path: root/wct4xxp.c
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-04-01 18:19:29 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-04-01 18:19:29 +0000
commit9afbefef75a4345fc5d3280b29fae87ae8f972ee (patch)
tree982c357b83a9260112ee272a4d124bba56011b51 /wct4xxp.c
parent40686d7c2ef4657d514769df38f48148654b8324 (diff)
J1 support on the TE4XXP. Needs to be tested.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@613 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-xwct4xxp.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 6606fc9..2ee615e 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -61,6 +61,7 @@ static int debug;
static int timingcable;
static int highestorder;
static int t1e1override = -1;
+static int j1mode = 0;
static int loopback = 0;
static int alarmdebounce = 0;
static int noburst = 0;
@@ -80,6 +81,7 @@ static int altab[] = {
#define TYPE_T1 1 /* is a T1 card */
#define TYPE_E1 2 /* is an E1 card */
+#define TYPE_J1 3 /* is a running J1 */
#define CANARY 0xc0de
@@ -138,7 +140,7 @@ struct t4 {
int txerrors;
struct tasklet_struct t4xxp_tlet;
#endif
- int spantype[4]; /* card type, T1 or E1 */
+ int spantype[4]; /* card type, T1 or E1 or J1 */
unsigned int passno; /* number of interrupt passes */
char *variety;
int last0; /* for detecting double-missed IRQ */
@@ -576,7 +578,7 @@ static void init_spans(struct t4 *wc)
wc->spans[x].maint = t4_maint;
wc->spans[x].open = t4_open;
wc->spans[x].close = t4_close;
- if (wc->spantype[x] == TYPE_T1) {
+ if (wc->spantype[x] == TYPE_T1 || wc->spantype[x] == TYPE_J1) {
wc->spans[x].channels = 24;
wc->spans[x].deflaw = ZT_LAW_MULAW;
} else {
@@ -629,12 +631,15 @@ static void t4_serial_setup(struct t4 *wc, int unit)
t4_framer_out(wc, unit, 0x3f, unit << 1); /* SIC2: No FFS, no center receive eliastic buffer, phase */
t4_framer_out(wc, unit, 0x40, 0x04); /* SIC3: Edges for capture */
t4_framer_out(wc, unit, 0x45, 0x00); /* CMR2: We provide sync and clock for tx and rx. */
- if (!wc->t1e1) {
+ if (!wc->t1e1) { /* T1 mode */
t4_framer_out(wc, unit, 0x22, 0x03); /* XC0: Normal operation of Sa-bits */
t4_framer_out(wc, unit, 0x23, 0x84); /* XC1: 0 offset */
- t4_framer_out(wc, unit, 0x24, 0x03); /* RC0: Just shy of 1023 */
+ if (wc->spantype[unit] == TYPE_J1)
+ t4_framer_out(wc, unit, 0x24, 0x83); /* RC0: Just shy of 1023 */
+ else
+ t4_framer_out(wc, unit, 0x24, 0x03); /* RC0: Just shy of 1023 */
t4_framer_out(wc, unit, 0x25, 0x84); /* RC1: The rest of RC0 */
- } else {
+ } else { /* E1 mode */
t4_framer_out(wc, unit, 0x22, 0x00); /* XC0: Normal operation of Sa-bits */
t4_framer_out(wc, unit, 0x23, 0x04); /* XC1: 0 offset */
t4_framer_out(wc, unit, 0x24, 0x04); /* RC0: Just shy of 1023 */
@@ -1600,7 +1605,10 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
wc->chans[x] = kmalloc(sizeof(struct zt_chan) * 31,GFP_KERNEL);
memset(wc->chans[x],0,sizeof(struct zt_chan) * 31);
} else {
- wc->spantype[x] = TYPE_T1;
+ if (j1mode)
+ wc->spantype[x] = TYPE_J1;
+ else
+ wc->spantype[x] = TYPE_T1;
wc->chans[x] = kmalloc(sizeof(struct zt_chan) * 24,GFP_KERNEL);
memset(wc->chans[x],0,sizeof(struct zt_chan) * 24);
}
@@ -1750,6 +1758,7 @@ module_param(noburst, int, 0600);
module_param(timingcable, int, 0600);
module_param(t1e1override, int, 0600);
module_param(alarmdebounce, int, 0600);
+module_param(j1mode, int, 0600);
#else
MODULE_PARM(debug, "i");
MODULE_PARM(loopback, "i");
@@ -1757,6 +1766,7 @@ MODULE_PARM(noburst, "i");
MODULE_PARM(timingcable, "i");
MODULE_PARM(t1e1override, "i");
MODULE_PARM(alarmdebounce, "i");
+MODULE_PARM(j1mode, "i");
#endif
MODULE_DEVICE_TABLE(pci, t4_pci_tbl);