Index: drivers/dahdi/wcb4xxp/base.c =================================================================== --- drivers/dahdi/wcb4xxp/base.c (revision 9502) +++ drivers/dahdi/wcb4xxp/base.c (working copy) @@ -84,6 +84,7 @@ static int debug = 0; static int spanfilter = 0xFF; /* Bitmap for ports 1-8 */ +static int te_nt_override = 0xFFFF; #ifdef LOOPBACK_SUPPORTED static int loopback = 0; #endif @@ -1518,16 +1519,24 @@ * jumper is the oposite of how other HFC-4S cards do: * - In B410P: GPIO=0: NT * - In Junghanns: GPIO=0: TE + * - Set NT/TE mode(openvox/Junghanss B800P/) */ + if(te_nt_override == 0xFFFF) + { if (b4->card_type == B410P) + nt = ((gpio & (1 << (i + 4))) == 0); else nt = ((gpio & (1 << (i + 4))) != 0); - + dev_info(b4->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE")); + } + else + { + nt = !((te_nt_override >> i) & 1); + dev_info(b4->dev, "Port %d: %s mode manually set\n", i + 1, (nt ? "NT" : "TE")); + } s->te_mode = !nt; - dev_info(b4->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE")); - hfc_reset_st(s); hfc_start_st(s); } @@ -3011,6 +3020,7 @@ module_param(vpmsupport, int, S_IRUGO); module_param(timer_1_ms, int, S_IRUGO | S_IWUSR); module_param(timer_3_ms, int, S_IRUGO | S_IWUSR); +module_param(te_nt_override, int, S_IRUGO | S_IWUSR); module_param(companding, charp, S_IRUGO); MODULE_PARM_DESC(debug, "bitmap: 1=general 2=dtmf 4=regops 8=fops 16=ec 32=st state 64=hdlc 128=alarm"); @@ -3025,6 +3035,7 @@ MODULE_PARM_DESC(vpmsupport, "1=enable hardware EC, 0=disable hardware EC"); MODULE_PARM_DESC(timer_1_ms, "NT: msec to wait for link activation, TE: unused."); MODULE_PARM_DESC(timer_3_ms, "TE: msec to wait for link activation, NT: unused."); +MODULE_PARM_DESC(te_nt_override, "TE/NT mode override bitmap for spans. 1 - TE, 0 - NT"); MODULE_PARM_DESC(companding, "Change the companding to \"alaw\" or \"ulaw\""\ "(alaw by default)");