diff options
-rwxr-xr-x | wct4xxp.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -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); |