diff -uNr linux/drivers/dahdi/wcb4xxp/base.c dahdi-2.4.0+2.4.0_dev/linux/drivers/dahdi/wcb4xxp/base.c --- linux/drivers/dahdi/wcb4xxp/base.c 2011-02-16 19:05:28.000000000 +0100 +++ linux/drivers/dahdi/wcb4xxp/base.c 2011-02-16 19:35:14.000000000 +0100 @@ -84,6 +84,7 @@ static int debug = 0; static int spanfilter = 0xFF; /* Bitmap for ports 1-8 */ +static int te_nt_override=0xFFFF; /* Override settings */ #ifdef LOOPBACK_SUPPORTED static int loopback = 0; #endif @@ -1519,14 +1520,24 @@ * - In B410P: GPIO=0: NT * - In Junghanns: GPIO=0: TE */ - if (b4->card_type == B410P) + + if(b4->card_type == B800P_OV) { + int mode; + mode = !((te_nt_override >> i & 1)); nt = ((gpio & (1 << (i + 4))) == 0); - else - nt = ((gpio & (1 << (i + 4))) != 0); + dev_info(b4->dev, "Port %d: %s mode manually set\n", i + 1, (mode ? "NT" : "TE")); + } + else { + + if (b4->card_type == B410P) + nt = ((gpio & (1 << (i + 4))) == 0); + else + nt = ((gpio & (1 << (i + 4))) != 0); + } s->te_mode = !nt; - - dev_info(b4->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE")); + if(b4->card_type != B800P_OV) + dev_info(b4->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE")); hfc_reset_st(s); hfc_start_st(s); @@ -2402,7 +2413,15 @@ DAHDI_CONFIG_ESF | DAHDI_CONFIG_HDB3 | DAHDI_CONFIG_CCS | DAHDI_CONFIG_CRC4; - sprintf(bspan->span.name, "B4/%d/%d", b4->cardno, i+1); + if(b4->card_type == B800P_OV){ + int mode; + mode = !((te_nt_override >> i & 1)); + sprintf(bspan->span.desc, "B4XXP (PCI) Card %d Span %d Mode %s", b4->cardno, i+1, (mode ? "NT" : "TE")); + } + else { + sprintf(bspan->span.name, "B4/%d/%d", b4->cardno, i+1); + } + sprintf(bspan->span.desc, "B4XXP (PCI) Card %d Span %d", b4->cardno, i+1); bspan->span.manufacturer = "Digium"; dahdi_copy_string(bspan->span.devicetype, b4->variety, sizeof(bspan->span.devicetype)); @@ -3012,6 +3031,7 @@ module_param(timer_1_ms, int, S_IRUGO | S_IWUSR); module_param(timer_3_ms, int, S_IRUGO | S_IWUSR); module_param(companding, charp, S_IRUGO); +module_param(te_nt_override, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "bitmap: 1=general 2=dtmf 4=regops 8=fops 16=ec 32=st state 64=hdlc 128=alarm"); MODULE_PARM_DESC(spanfilter, "debug filter for spans. bitmap: 1=port 1, 2=port 2, 4=port 3, 8=port 4"); @@ -3027,6 +3047,9 @@ MODULE_PARM_DESC(timer_3_ms, "TE: msec to wait for link activation, NT: unused."); MODULE_PARM_DESC(companding, "Change the companding to \"alaw\" or \"ulaw\""\ "(alaw by default)"); +MODULE_PARM_DESC(te_nt_override, "Overrides driver mode for B800P.\n"\ + "You need a bitmap as follows 11111110 = 254 (all spans in TE except the 1st)\n"\ + "You must configure the jumpper and turn on the terminator for each port you expect to work in NT mode."); MODULE_AUTHOR("Digium Incorporated "); MODULE_DESCRIPTION("B410P & Similars multi-port BRI module driver.");