diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c index fb86a39..cbe998e 100644 --- a/drivers/dahdi/wcb4xxp/base.c +++ b/drivers/dahdi/wcb4xxp/base.c @@ -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 @@ -1875,6 +1876,12 @@ static void hfc_init_all_st(struct b4xxp *b4) * - In B410P: GPIO=0: NT * - In Junghanns: GPIO=0: TE */ + if (te_nt_override != 0xFFFF) { + nt = !((te_nt_override >> i) & 1); + dev_info(&b4->pdev->dev, + "Port %d: %s mode set by module parameter\n", + i + 1, (nt ? "NT" : "TE")); + } else { if (IS_B410P(b4)) { nt = ((gpio & (1 << (i + 4))) == 0); } else if (IS_B430P(b4)) { @@ -1895,10 +1902,11 @@ static void hfc_init_all_st(struct b4xxp *b4) 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")); + "Port %d: %s mode set by jumper\n", i + 1, (nt ? "NT" : "TE")); + + } + s->te_mode = !nt; } } @@ -3549,6 +3557,7 @@ module_param(alarmdebounce, int, S_IRUGO | S_IWUSR); 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); @@ -3564,6 +3573,7 @@ MODULE_PARM_DESC(alarmdebounce, "msec to wait before set/clear alarm condition") 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)");