--- drivers/dahdi/wcb4xxp/base.c 2016-09-21 20:55:56.000000000 +0200 +++ drivers/dahdi/wcb4xxp/base.c 2017-08-22 11:38:04.503915133 +0200 @@ -85,6 +85,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 @@ -1887,7 +1888,9 @@ * 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 manually if software can't determine jumper position */ +if (te_nt_override == 0xFFFF) { if (IS_B410P(b4)) { nt = ((gpio & (1 << (i + 4))) == 0); } else if (IS_GEN2(b4)) { @@ -1907,12 +1910,15 @@ } else { nt = ((gpio & (1 << (i + 4))) != 0); } - - s->te_mode = !nt; - dev_info(&b4->pdev->dev, "Port %d: %s mode\n", i + 1, (nt ? "NT" : "TE")); - +} else { + nt = !((te_nt_override >> i) & 1); + dev_info(&b4->pdev->dev, + "Port %d: %s mode manually set\n", + i + 1, (nt ? "NT" : "TE")); +} + s->te_mode = !nt; } } @@ -3728,6 +3734,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_param(persistentlayer1, int, S_IRUGO | S_IWUSR); @@ -3743,6 +3750,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)");