[Home]

Summary:DAHLIN-00203: [patch] patch for wcb4xxp with openvox/Junghanns B800P+NT mode
Reporter:james.zhu james.zhu (zhulizhong)Labels:
Date Opened:2010-07-24 05:09:36Date Closed:2019-05-31 09:41:40
Priority:MinorRegression?No
Status:Closed/CompleteComponents:wcb4xxp
Versions:2.3.0.1 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) dahdi-channels.conf
( 1) patch_wcb4xxp_te_nt_override
( 2) patch_wcb4xxp_te_nt_override_v2
( 3) system.conf
( 4) te_nt_override.2100.patch
( 5) te_nt_override.2111.patch
( 6) te_nt_override.240.patch
( 7) te_nt_override.240a.patch
( 8) te_nt_override.240b.patch
Description:as we test with dahdi-linux, currently the Openvox/Junghanns B800P(NT) does not work properly due to the jumper setting. so, the patch is need to set NT mode in software way. after patching that, users load the driver in this way: modprobe wcb4xxp te_nt_override=0xFC, set port 1/2 as NT mode. make sure apply the patch
for chan_dahdi.c
============================================
--- channels/chan_dahdi.c       2009-09-29 09:53:36.000000000 +0200
+++ channels/chan_dahdi.patched 2009-09-29 09:43:07.000000000 +0200
@@ -14364,7 +14364,8 @@
                                       confp->chan.sig = SIG_BRI_PTMP;
                                       confp->pri.nodetype = PRI_CPE;
                               } else if (!strcasecmp(v->value, "bri_net_ptmp")) {
-                                       ast_log(LOG_WARNING, "How cool would it be if someone implemented this mode!  For now, sucks for you. (line %d)\n", v->lineno);
+                                       confp->chan.sig = SIG_BRI_PTMP;
+                                       confp->pri.nodetype = PRI_NETWORK;
                               } else if (!strcasecmp(v->value, "gr303fxoks_net")) {
                                       confp->chan.sig = SIG_GR303FXOKS;

======================================
the test environments:
1) dahdi-linux-2.3.0.1/dahdi-tools-2.3.0/libpri-1.4.11.2/asterisk-1.6.1.18
2) OpenVox B800P NT
3) Centos-5.4  
 
Comments:By: james.zhu james.zhu (zhulizhong) 2010-07-24 05:16:01

I test OpenVox B800P with NT, please add test more.some message are here:
=============dmesg after loading the driver=========
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.8
dahdi: Telephony Interface Registered on major 196
dahdi: Version: 2.3.0.1
wcb4xxp 0000:01:03.0: probe called for b4xx...
ACPI: PCI Interrupt 0000:01:03.0[A] -> GSI 20 (level, low) -> IRQ 201
wcb4xxp 0000:01:03.0: Identified OpenVox B800P (controller rev 1) at 0001d800, IRQ 201
wcb4xxp 0000:01:03.0: NOTE: hardware echo cancellation has been disabled
wcb4xxp 0000:01:03.0: Port 1: NT mode manually set
wcb4xxp 0000:01:03.0: Port 2: NT mode manually set
wcb4xxp 0000:01:03.0: Port 3: NT mode manually set
wcb4xxp 0000:01:03.0: Port 4: NT mode manually set
wcb4xxp 0000:01:03.0: Port 5: NT mode manually set
wcb4xxp 0000:01:03.0: Port 6: NT mode manually set
wcb4xxp 0000:01:03.0: Port 7: NT mode manually set
wcb4xxp 0000:01:03.0: Port 8: NT mode manually set
wcb4xxp 0000:01:03.0: Did not do the highestorder stuff
wcb4xxp 0000:01:03.0: new card sync source: port 3
dahdi_transcode: Loaded.
INFO-xpp: revision Unknown MAX_XPDS=64 (8*8)
============pri show spans====================
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.1.18 currently running on localhost (pid = 2784)
Verbosity is at least 16
localhost*CLI> pri show spans
PRI span 1/0: Provisioned, In Alarm, Up, Active
PRI span 2/0: Provisioned, In Alarm, Up, Active
PRI span 3/0: Provisioned, Up, Active
PRI span 4/0: Provisioned, Up, Active
PRI span 5/0: Provisioned, In Alarm, Up, Active
PRI span 6/0: Provisioned, Up, Active
PRI span 7/0: Provisioned, In Alarm, Up, Active
PRI span 8/0: Provisioned, In Alarm, Up, Active

=================sip-isdn======================
== Using SIP RTP CoS mark 5
   -- Executing [3@from-openvox:1] Dial("SIP/100-00000005", "dahdi/7") in new stack
   -- Requested transfer capability: 0x00 - SPEECH
   -- Called 7
   -- DAHDI/7-1 is ringing
   -- DAHDI/7-1 answered SIP/100-00000005
[Jul 25 02:14:25] NOTICE[2820]: chan_sip.c:20435 handle_re
==============================
Under that testing the environments, some results are:
1) OpenVox B200P/B400P NT/TE work.
2) OpenVox B800P NT/TE work. Note, please adjust the physical jumper for NT
Please add more testing for wcb4xxp.



By: james.zhu james.zhu (zhulizhong) 2010-07-25 20:50:32

sorry, same code. the v2 is for license.

By: Tzafrir Cohen (tzafrir) 2010-08-08 11:37:29

What happens if the card is set to be TE and you try to set it to be NT (or vise versa)? Will it work well? Will the port fail to initialize? Will it pretend to work but fail in strange ways?

A few other minor notes regarding style:

1. Please use a #define for the magic value 0xFFFF .
2. Use '} else {' (in the same line. Generally, it is advised to make to test your patch with the checkpatch script (build_tools/kernel-cp ).

By: zhu_lizhong zhu_lizhong (james_zhu) 2010-08-10 21:24:33

to set to TE or NT(B800P), users have to set both: loading the parameter and adjusting the jumper. i do not test many cases. anyway, later, i will check that. code will be reviewed to close the style.

By: Birger "WIMPy" Harzenetter (wimpy) 2010-08-10 23:10:47

tzafrir:

The jumpers do not change behavior in any way.
They are only used to
a) change pin-out
b) supply phantom power if available

I always keep the jumpers as they are and use BRI Crossover adapters instead.

By: Tzafrir Cohen (tzafrir) 2010-08-11 02:14:01

If we say that this is completely software-settable, should we use the same approach as the one in the BRI module in the wctdm24xxp driver?

One thing I don't like aboutit is that setting from system.conf means that the device may be in an "unconfigured" state, which complicates things.

Still, this parameter does not work well if you have more than one card.

By: zhu_lizhong zhu_lizhong (james_zhu) 2010-08-11 21:32:30

yes, tzafir, you are right. if doing that in software way for all bri cards, it might be cause troubles. i think, there is not very necessary to set that for four port cards; currently ,the way working for four port cards is very correct and makes sense. but it is necessary only for B800P(Openvox or other manufacturers like Junghanns) due to chip set design.

By: Birger "WIMPy" Harzenetter (wimpy) 2010-12-01 12:06:18.000-0600

te_nt_override.240.patch
updated version of that patch for DAHDI 2.4.0 / TRUNK

By: Birger "WIMPy" Harzenetter (wimpy) 2011-01-13 17:09:25.000-0600

te_nt_override.240a.patch
updated version of that patch for current DAHDI TRUNK

By: Tzafrir Cohen (tzafrir) 2011-06-01 14:34:31

OK. Patch looks reasonable.

(apart from trivial coding guideline issues: use:  svn diff | ./build-tools/kernel-cp -  #)

By: Birger "WIMPy" Harzenetter (wimpy) 2011-06-02 18:51:38

240b edited to comply with coding guidelines.

By: Olivier Krief (okrief) 2011-06-10 02:58:46.297-0500

Hi,
While building a system to test this patch, I failed while applying this patch.
My setup is :
Debian squeeze
dahdi-linux-2.3.0.1
dahdi-tools-2.3.0
libpri-1.4.11.2
Junghanns QuadBRI PCIe

As I'm not very familiar with patch cmd, please find bellow an extract from my installation script and console output :
cd /usr/src/dahdi-linux-2.3.0.1
wget 'http://issues.asterisk.org/file_download.php?file_id=29628&type=bug' -O - | patch -p0

...
patching file drivers/dahdi/wcb4xxp/base.c
Hunk #2 succeeded at 1472 with fuzz 1 (offset -114 lines).
Hunk #3 FAILED at 3124.
Hunk #4 FAILED at 3138.
2 out of 4 hunks FAILED -- saving rejects to file drivers/dahdi/wcb4xxp/base.c.rej


Suggestions ?


By: Birger "WIMPy" Harzenetter (wimpy) 2011-06-10 08:05:02.479-0500

One of the first patches should apply for you.
The ones I edited (with 240 in the name) apply to dahdi 2.4.0, as stated above.


By: Olivier Krief (okrief) 2011-06-14 06:18:19.064-0500

Now you're pointing at it, I should have guessed from file name that it applies to Dahdi 2.4.0.
As it seems more useful for all to focus testing on Dahdi 2.4.0, I'll upgrade my testing environment and report here.
Thanks for helping.

By: Olivier Krief (okrief) 2011-06-14 08:35:22.303-0500

Using Dahdi 2.4.0, I could successfully compile and modprobe wcb4xxp (with modprobe wcb4xxp te_nt_override=0xFC). See:

[ 7960.786479] wcb4xxp 0000:03:04.0: Identified HFC-4S Junghanns.NET quadBRI PCI (controller rev 1) at 0001dc00, IRQ 16
[ 7960.788262] IRQ 16/b4xxp: IRQF_DISABLED is not guaranteed on shared IRQs
[ 7960.788270] wcb4xxp 0000:03:04.0: NOTE: hardware echo cancellation has been disabled
[ 7960.788576] wcb4xxp 0000:03:04.0: Port 1: NT mode manually set
[ 7960.788578] wcb4xxp 0000:03:04.0: Port 1: NT mode
[ 7960.788693] wcb4xxp 0000:03:04.0: Port 2: NT mode manually set
[ 7960.788694] wcb4xxp 0000:03:04.0: Port 2: NT mode
[ 7960.788809] wcb4xxp 0000:03:04.0: Port 3: TE mode manually set
[ 7960.788811] wcb4xxp 0000:03:04.0: Port 3: TE mode
[ 7960.788926] wcb4xxp 0000:03:04.0: Port 4: TE mode manually set
[ 7960.788927] wcb4xxp 0000:03:04.0: Port 4: TE mode

Cheers

By: Olivier Krief (okrief) 2011-06-14 09:52:28.113-0500

Checking above installation, I'm getting this :

1. Junghanns port LED is green
Spans 1 and 2 onboard jumpers are set to NT.
Spans 3 and 4 jumpers are set to TE.


2. > pri show span 1
Primary D-channel: 3
Status: Provisioned, Down, Active
Switchtype: EuroISDN
Type: CPE
Overlap Dial: 0
Logical Channel Mapping: 0
Timer and counter settings:
 N200: 3
 N202: 3
 K: 7
 T200: 1000
 T202: 10000
 T203: 10000
 T303: 4000
 T305: 30000
 T308: 4000
 T309: 6000
 T313: 4000
 T-HOLD: 4000
 T-RETRIEVE: 4000
 T-RESPONSE: 4000
Overlap Recv: No


3. Here is an extract from /etc/asterisk/dahdi_channels.conf and dmesg
; Span 1: B4/0/1 "B4XXP (PCI) Card 0 Span 1" (MASTER) RED
group=1,11
context=remote
switchtype = euroisdn
signalling = bri_nt
channel => 1-2
context = default
group = 63

[   11.322578] wcb4xxp 0000:03:04.0: Identified HFC-4S Junghanns.NET quadBRI PCI (controller rev 1) at 0001dc00, IRQ 16
[   11.324232] IRQ 16/b4xxp: IRQF_DISABLED is not guaranteed on shared IRQs
[   11.324240] wcb4xxp 0000:03:04.0: NOTE: hardware echo cancellation has been disabled
[   11.324568] wcb4xxp 0000:03:04.0: Port 1: NT mode manually set
[   11.324570] wcb4xxp 0000:03:04.0: Port 1: NT mode


So it seems Asterisk 1.6.1.18 is considering span 1 to be down when this span is connected to a TE/ptp port (I alternatively used an external Patton gateway and the 4th span on the same Junghanns board).

How can I best check Asterisk is considering a BRI span to be in NT/point-to-point mode ?


By: Birger "WIMPy" Harzenetter (wimpy) 2015-07-22 11:07:01.866-0500

Updated patch for DAHDI 2.10

By: thomas hilber (thomas hilber) 2017-08-22 23:34:45.528-0500

updated patch for DAHDI 2.11