Projekat

Općenito

Profil

Akcije

Nove funkcije #14858

Zatvoren

misdn za fritz PCI ?

Dodano od Ernad Husremović prije oko 17 godina. Izmjenjeno prije više od 16 godina.

Status:
Odbačeno
Prioritet:
Normalan
Odgovorna osoba:
-
Kategorija:
-
Početak:
10.07.2008
Završetak:
% završeno:

0%

Procjena vremena:


Povezani tiketi 2 (0 otvoreno2 zatvorenih)

korelira sa voip - Nove funkcije #14861: asterisk sa fritzpci + capiZatvorenoErnad Husremović10.07.2008

Akcije
korelira sa voip - Podrška #15380: asterish chan-capi from source 1.1.1ZatvorenoSaša Vranić18.09.2008

Akcije
Akcije #1

Izmjenjeno od Ernad Husremović prije oko 17 godina

Linux 2.6 and mISDN HowTo

The howto is provided `as is'. Any express or implied warranties, including, but not limited to, the implied warranties for
merchantability and fitness to a particular purpose are disclaimed. Simon Čahuk will not be liable for any lost profits, lost
savings,incident, special, or indirect damages or other economic consequential damages, even if Simon Čahuk has been
advised of the possibility of such damages.

This is a howto for Linux 2.6 and mISDN. mISDN stands for modular ISDN. mISDN is developed by Karsten Keil
<> from SUSE. mISDN supports some passive ISDN (see supported ISDN cards) cards under Linux 2.6.
mISDN uses CAPI mISDN is a beta code and experimental.

UPDATE (20022004): you can use kernel 2.6 and isdn4linux now. Andrew Morton had put in the new isdn4linux code in his
- mm patches. Isdn4linux works in linux 2.6.3-rc2-mm1 or later. You must use - mm patches, otherwise isdn4linux won't
work. But if you want to use mISDN, you can do it as described.

1. What do you need?

  1. minimum Linux-2.6.0-test9bk22
  2. mISDN source (CVS tarball or downloaded with cvs)
  3. capi4k-utils
  4. I4L patch (i4l-t9bk22.gz)
  5. supported ISDN card ( AVM Fritz!Card PCI and PnP, Cologne Chips Design HFC PCI based cards, Sedlbauer Speedfax+, Winbond 6692 PCI chip based cards;
    digital audio processing is supported, too)

2. Linux kernel

You need Linux-2.6.0-test9bk22. The patch was made against Linux-2.6.0-test9bk22, but you can patch it against
Linux-2.6.0-test10, -test11 and 2.6.0 also.

Patching the kernel:

  # cd /usr/src
  # ln -sf  <your_kernel_source> linux
  # cd linux
  # zcat <path_to_the_i4l-t9bk22.gz_patch> | patch -p1
  patching file drivers/isdn/capi/capi.c
  patching file drivers/isdn/capi/capifs.c
  patching file drivers/isdn/capi/kcapi.c
  patching file drivers/isdn/hisax/callc.c
  patching file drivers/isdn/hisax/config.c
  patching file drivers/isdn/hisax/tei.c
  patching file drivers/isdn/i4l/isdn_common.c

3. mISDN source
You can get the mISDN source from CVS tarballs or via cvs.

CVS tarball

Download and extract the mISDN-CVS tarball from ftp://ftp.isdn4linux.de/snapshots.

  # cd /home/user
  # tar -xvjf mISDN-CVS-yyyy-mm-dd.tar.bz2
  # cd mISDN-CVS-yyyy-mm-dd
  # ./std2kern

Std2kern will copy the needed files into your /usr/src/linux. Don't forget to make a symlink ln -sf <your_kernel_source> linux.

CVS source from CVS server

  # cd /home/user
  # cvs -d :pserver:anonymous@cvs.isdn4linux.de:/i4ldev login
  # for password type readonly
  # cvs -z3 co mISDN
  # cd mISDN
  # ./std2kern

Here is a bash script to get the mISDN source:

  #!/bin/bash
  export CVSROOT=:pserver:anonymous@cvs.isdn4linux.de:/i4ldev
  cvs login
  cvs -z9 co mISDN # <-comment out after you made a checkout
  #cvs -q -z9 update -dPA # <- and uncomment this for updating

4. PPP and CAPI

Install ppp and capi4k-utils. You need capi for using the capiplugin. Your distribution should have it.
You can get ppp from http://www.samba.org/ppp and capi4k-utils from here ftp://ftp.in-berlin.de/pub/capi4k-utils-2003-06-16.tar.gz.
Install ppd first and after that capi4k-utils. ppp-2.4.1 should work fine.
After installing both capi and ppp your /usr/lib/pppd/your_version should look like this:

  ls -l /usr/lib/pppd/2.4.1
  total 124
  -rwxr-xr-x    1 root     root        65425 Nov 28 16:01 capiplugin.so
  -rwxr-xr-x    1 root     root         5578 Nov  6 01:18 minconn.so
  -rwxr-xr-x    1 root     root         8016 Nov  6 01:18 passprompt.so
  -rwxr-xr-x    1 root     root         2995 Nov 28 16:01 userpass.so

5. Kernel configuration

UPDATE!!! (30012004): If you don't see the option Modular ISDN driver in menuconfig or CONFIG_MISDN_DRV in config, then edit drivers/isdn/hardware/mISDN/Kconfig:

menu "Modular ISDN driver" 
        depends on NET && ISDN && ISDN_CAPI!=n

to

menu "Modular ISDN driver" 
        depends on NET && ISDN_CAPI!=n

Reason: in the newest mISDN source was considered the newest changes in the I4L code (branch kernel26). There also exists a I4L patch from this branch, but I don't have it.
When I will have it, will put it here.

You must enable support for mISDN. Run make menuconfig or make config.
If you run config, enable the following:

  CONFIG_ISDN_BOOL=y
  CONFIG_ISDN_CAPI=m
  CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
  CONFIG_ISDN_CAPI_MIDDLEWARE=y
  CONFIG_ISDN_CAPI_CAPI20=m
  CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
  CONFIG_ISDN_CAPI_CAPIFS=m
  CONFIG_MISDN_DRV=m
  CONFIG_MISDN_MEMDEBUG=y
  CONFIG_MISDN_AVM_FRITZ=y # if you have an AVM Fritz card
  CONFIG_MISDN_HFCPCI=y # if you have a HFPCI card
  CONFIG_MISDN_SPEEDFAX=y # if you have a SPEEDFAX card
  CONFIG_MISDN_W6692=y # if you have a  W6692 card
  CONFIG_MISDN_DSP=y

If you run menuconfig, enable the following:

  Device Drivers  --->
  ISDN subsystem  --->
  [*] ISDN support                                                
  │ │           Old ISDN4Linux  --->                                      │ │
  │ │     ---   CAPI subsystem                                            │ │
  │ │     <M>   CAPI2.0 support                                           │ │
  │ │     [*]     Verbose reason code reporting (kernel size +=7K)        │ │
  │ │     [*]     CAPI2.0 Middleware support (EXPERIMENTAL)               │ │
  │ │     <M>     CAPI2.0 /dev/capi support                               │ │
  │ │     [*]       CAPI2.0 filesystem support                            │ │
  │ │     ---     CAPI hardware drivers                                   │ │
  │ │             Active AVM cards  --->                                  │ │
  │ │             Active Eicon DIVA Server cards  --->                    │ │
  │ │             Modular ISDN driver  --->

  Modular ISDN driver  --->
  <M> Support modular ISDN driver                                         │ │
  │ │        [*]   Enable memory leak debug for mISDN                     │ │
  │ │        [*]   Support for AVM Fritz!Cards                            │ │
  │ │        [ ]   Support for HFC PCI cards                              │ │
  │ │        [ ]   Support for Sedlbauer Speedfax+                        │ │
  │ │        [ ]   Support for Winbond 6692 based cards                   │ │
  │ │        [ ]   Digital Audio Processing of transparent data

You must set CONFIG_MISDN_DRV=m, otherwise compilation will fail.
Now compile and install your kernel and modules.
Reboot your computer with the new kernel and mISDN support.

6. Modules loading
I got a bash script from Karsten Keil for modules loading:

  #!/bin/sh
  if [ $# -ge 1 ]; then
        DEBUG=$1
  else
        DEBUG=0
  fi
  #INSMOD_PARA=-m
  MEXT=.ko
  cd /lib/modules/`uname -r`/kernel/drivers/isdn/hardware/mISDN
  #modprobe capidrv
  modprobe capi
  insmod ${INSMOD_PARA} mISDN_core${MEXT} debug=${DEBUG} >/tmp/m_core.mod
  insmod ${INSMOD_PARA} mISDN_l1${MEXT} debug=${DEBUG} >/tmp/m_l1.mod
  insmod ${INSMOD_PARA} mISDN_l2${MEXT} debug=${DEBUG} >/tmp/m_l2.mod
  insmod ${INSMOD_PARA} l3udss1${MEXT} debug=${DEBUG} >/tmp/m_l3u.mod
  insmod ${INSMOD_PARA} mISDN_capi${MEXT} debug=${DEBUG} >/tmp/m_capi.mod
  insmod ${INSMOD_PARA} mISDN_isac${MEXT} >/tmp/m_isac.mod
  insmod ${INSMOD_PARA} avmfritz${MEXT} debug=${DEBUG} protocol=2 > /tmp/avmfritz.mod

You can also load the modules by hand.

Then mount capifs:

  # mkdir -p /dev/capi
  # mount -t capifs capifs /dev/capi

Adding /dev/capi to /etc/fstab:

  capifs              /dev/capi       capifs          defaults                0 0

7. Connecting
Edit your /etc/ppp/peers/isdn/arcor file:

 sync
noauth
user <username>
plugin userpass.so
password <password>
defaultroute
plugin capiplugin.so
number <ISP-PHONE-NUMER>
protocol hdlc
ipcp-accept-local
ipcp-accept-remote
/dev/null

You don't need /etc/ppp/pap-secrets and chap-secrets.

And now connect to your ISP:


  # pppd call isdn/arcor

Check e.g in gkrellm if you are connected.

You can check the connection with ps ax:


  # ps ax
  <PID> ?        S      0:00 pppd call isdn/arcor

If you get the line above, you are not connected.

You must get this:


  # ps ax
  <PID> capi/0   S      0:00 pppd call isdn/arcor

You can watch in gkrellm if you are connected. The timer button must be set to ppp0 (Builtins --- Net --- Timer Button).

I have any troubles or get an oops, kill pppd with this:


  # kill -9 <PID>

8. Troubles
Some users with AVM Fritz PCI v2 reported some problems. After insmod avmfritz protocol the computer hung.
So please make backup of your data, otherwise you can loose your data.

In your kernel configuration disable preemption (CONFIG_PREEMPT). Some users got an oops when establishing the connection:


  capifs: Rev 1.14.6.8 
  eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 
  CAPI Subsystem Rev 1.21.6.8 
  capi20: Rev 1.1.4.1.2.2: started up with major 68 (middleware+capifs) 
  Modular ISDN Stack core $Revision: 1.20 $ 
  mISDNd: kernel daemon started 
  ISDN L1 driver version 1.8 
  mISDNd: test event done 
  ISDN L2 driver version 1.16 
  mISDN: DSS1 Rev. 1.19 
  mISDN Capi 2.0 driver file version 1.11 
  ISAC module $Revision: 1.13 $ 
  Winbond W6692 PCI driver Rev. 1.6 
  mISDN_w6692: found adapter Winbond W6692 at 0000:00:0b.0 
  W6692: Winbond W6692 version (0): W6692 V00 
  kcapi: Controller 1: mISDN1 attached 
  w6692: IRQ 10 count 4 
  kcapi: card 1 "mISDN1" ready. 
  kcapi: notify up contr 1 
  w6692 1 cards installed 
  capi20_register: 
  Debug: sleeping function called from invalid context at mm/slab.c:1868 
  in_atomic():1, irqs_disabled():1 
  Call Trace: 
  [<c012a01b>] __might_sleep+0xab/0xd0 
  [<c01601f9>] __kmalloc+0x279/0x290 
  [<e4a11a61>] __mid_kmalloc+0x21/0x80 [mISDN_core] 
  [<e4976673>] ApplicationConstr+0x33/0x130 [mISDN_capi] 
  [<e4974887>] RegisterApplication+0xe7/0x230 [mISDN_capi] 
  [<e492a062>] register_appl+0x62/0x80 [kernelcapi] 
  [<e492b1d4>] capi20_register+0xd4/0xe0 [kernelcapi] 
  [<e4939714>] capi_ioctl+0x154/0x800 [capi] 
  [<c0217220>] devfs_open+0x0/0x250 
  [<c0180c25>] dentry_open+0x145/0x210 
  [<c0124781>] kernel_map_pages+0x31/0x70 
  [<c019cb55>] sys_ioctl+0x205/0x3f0 
  [<c0181306>] sys_open+0x76/0x90 
  [<c04f24e7>] syscall_call+0x7/0xb 
  kcapi: appl 1 up 
  capi20_put_message: applid 0x1 
  capi20_put_message: applid 0x1 
  Unable to handle kernel paging request at virtual address daf2cf04 
  printing eip: 
  e497828f 
  *pde = 00069063 
  Oops: 0000 [#1] 
  PREEMPT DEBUG_PAGEALLOC 
  CPU: 0 
  EIP: 0060:[<e497828f>] Not tainted VLI 
  EFLAGS: 00010292 
  EIP is at plci_connect_conf+0xf/0x50 [mISDN_capi] 
  eax: daf2ce84 ebx: 00000001 ecx: e498cf14 edx: dad077d0 
  esi: dad077d0 edi: 00000001 ebp: db463e40 esp: db463e34 
  ds: 007b es: 007b ss: 0068 
  Process pppd (pid: 3372, threadinfo=db462000 task=dadfd950) 
  Stack: daa05f60 daf2ce84 00000001 db463e6c e4973104 dad077d0 00000001 daf2ce84 
  daff8e38 dad077a8 e4978280 00000000 dad077d0 00000000 db463e98 e4973104 
  dad077d0 00000001 daf2ce84 daf2ce84 daf2ae00 e4978180 daf2ce84 dad077a8 
  Call Trace: 
  [<e4973104>] FsmEvent+0x84/0xf0 [mISDN_capi] 
  [<e4978280>] plci_connect_conf+0x0/0x50 [mISDN_capi] 
  [<e4973104>] FsmEvent+0x84/0xf0 [mISDN_capi] 
  [<e4978180>] plci_connect_req+0x0/0x100 [mISDN_capi] 
  [<e497abc2>] AppPlciGetCmsg+0xd2/0x180 [mISDN_capi] 
  [<e497acbd>] AppPlciSendMessage+0x4d/0xa0 [mISDN_capi] 
  [<e4976b8b>] ApplicationSendMessage+0x11b/0x360 [mISDN_capi] 
  [<c0124781>] kernel_map_pages+0x31/0x70 
  [<e4974ce6>] SendMessage+0x46/0x80 [mISDN_capi] 
  [<e492b40d>] capi20_put_message+0x19d/0x250 [kernelcapi] 
  [<e4939436>] capi_write+0x146/0x270 [capi] 
  [<e49392f0>] capi_write+0x0/0x270 [capi] 
  [<c01822f0>] vfs_write+0xa0/0x120 
  [<c018240f>] sys_write+0x3f/0x60 
  [<c04f24e7>] syscall_call+0x7/0xb 
  Code: 5d 10 c7 45 0c 01 00 00 00 89 45 08 83 c4 1c 5b 5e 5f c9 e9 04 ae
  ff ff 8d 74 26 00 55 89 e5 83 ec 0c 8b 45 10 89 5d fc 8b 55 08
  <66> 83 b8 80 00 00 00 00 8b 5a 0c 75 10 c7 45 0c 02 00 00 00 8b 
  <7>capi20_release: applid 0x1 
  release_appl: applid 0x1 
  kcapi: appl 1 down 
  capi20_register: 
  Debug: sleeping function called from invalid context at mm/slab.c:1868 
  in_atomic():1, irqs_disabled():1 
  Call Trace: 
  [<c012a01b>] __might_sleep+0xab/0xd0 
  [<c012e728>] __call_console_drivers+0x58/0x60 
  [<c01601f9>] __kmalloc+0x279/0x290 
  [<e4a11a61>] __mid_kmalloc+0x21/0x80 [mISDN_core] 
  [<e4976673>] ApplicationConstr+0x33/0x130 [mISDN_capi] 
  [<e4974887>] RegisterApplication+0xe7/0x230 [mISDN_capi] 
  [<e492a062>] register_appl+0x62/0x80 [kernelcapi] 
  [<e492b1d4>] capi20_register+0xd4/0xe0 [kernelcapi] 
  [<e4939714>] capi_ioctl+0x154/0x800 [capi] 
  [<c0217220>] devfs_open+0x0/0x250 
  [<c0180c25>] dentry_open+0x145/0x210 
  [<c0124781>] kernel_map_pages+0x31/0x70 
  [<c019cb55>] sys_ioctl+0x205/0x3f0 
  [<c0181306>] sys_open+0x76/0x90 
  [<c04f24e7>] syscall_call+0x7/0xb 
  kcapi: appl 1 up 
  capi20_put_message: applid 0x1 
  capi20_put_message: applid 0x1 
  Unable to handle kernel paging request at virtual address dbd12f04 
  printing eip: 
  e497828f 
  *pde = 0006d063 
  Oops: 0000 [#2] 
  PREEMPT DEBUG_PAGEALLOC 
  CPU: 0 
  EIP: 0060:[<e497828f>] Not tainted VLI 
  EFLAGS: 00010292 
  EIP is at plci_connect_conf+0xf/0x50 [mISDN_capi] 
  eax: dbd12e84 ebx: 00000001 ecx: e498cf14 edx: dd1fc7d0 
  esi: dd1fc7d0 edi: 00000001 ebp: daf97e40 esp: daf97e34 
  ds: 007b es: 007b ss: 0068 
  Process pppd (pid: 3385, threadinfo=daf96000 task=dae0b950) 
  Stack: db359f60 dbd12e84 00000001 daf97e6c e4973104 dd1fc7d0 00000001 dbd12e84 
  daff8e38 dd1fc7a8 e4978280 00000000 dd1fc7d0 00000000 daf97e98 e4973104 
  dd1fc7d0 00000001 dbd12e84 dbd12e84 daec6e00 e4978180 dbd12e84 dd1fc7a8 
  Call Trace: 
  [<e4973104>] FsmEvent+0x84/0xf0 [mISDN_capi] 
  [<e4978280>] plci_connect_conf+0x0/0x50 [mISDN_capi] 
  [<e4973104>] FsmEvent+0x84/0xf0 [mISDN_capi] 
  [<e4978180>] plci_connect_req+0x0/0x100 [mISDN_capi] 
  [<e497abc2>] AppPlciGetCmsg+0xd2/0x180 [mISDN_capi] 
  [<e497acbd>] AppPlciSendMessage+0x4d/0xa0 [mISDN_capi] 
  [<e4976b8b>] ApplicationSendMessage+0x11b/0x360 [mISDN_capi] 
  [<c0124781>] kernel_map_pages+0x31/0x70 
  [<e4974ce6>] SendMessage+0x46/0x80 [mISDN_capi] 
  [<e492b40d>] capi20_put_message+0x19d/0x250 [kernelcapi] 
  [<e4939436>] capi_write+0x146/0x270 [capi] 
  [<e49392f0>] capi_write+0x0/0x270 [capi] 
  [<c01822f0>] vfs_write+0xa0/0x120 
  [<c018240f>] sys_write+0x3f/0x60 
  [<c04f24e7>] syscall_call+0x7/0xb 
  Code: 5d 10 c7 45 0c 01 00 00 00 89 45 08 83 c4 1c 5b 5e 5f c9 e9 04 ae
  ff ff 8d 74 26 00 55 89 e5 83 ec 0c 8b 45 10 89 5d fc 8b 55 08
  <66> 83 b8 80 00 00 00 00 8b 5a 0c 75 10 c7 45 0c 02 00 00 00 8b 
  <7>capi20_release: applid 0x1 
  release_appl: applid 0x1 
  kcapi: appl 1 down

Also enable plug and play in your kernel config (CONFIG_PNP=y). Otherwise your card won't work.

I got a message from Christoph Hellwig. Hey says:
"Of course disable PREEMPT does not fix the allocation under spinlock
problems. I'd suggest running a kernel with PREEMPT and all debuging
options for a while to shake out this type of bugs..".

9. Copyright

Copyright 2003 Simon Čahuk <>

Modified: 20-02-2004 21:36 CET

Akcije #2

Izmjenjeno od Ernad Husremović prije skoro 17 godina

ubuntu gutsy chan-misdn

root@m1:~# aptitude search misdn

p   asterisk-app-misdn-v110         - V.110 protocol handler for Asterisk       
p   asterisk-chan-misdn             - mISDN support for Asterisk                
p   libmisdn-dev                    - mISDN interface library                   
p   misdn-utils                     - mISDN userspace utilities                

root@m1:~# aptitude show asterisk-chan-misdn

Paket: asterisk-chan-misdn
State: not installed
Verzija: 0.1.1-1
Prioritet: extra
Sekcija: universe/comm
Održavatelj: Simon Richter <sjr@debian.org>
Dekompresovana veličina: 397k
Zavisi: libc6 (>= 2.3.4-1), debconf (>= 0.5) | debconf-2.0
Description: mISDN support for Asterisk
 This module adds mISDN support to the Asterisk PBX. 

 mISDN is the (experimental) new ISDN4Linux stack, which adds support for
 driving cards in NT mode and thus connecting an ISDN phone to your computer.

treba li patchirati kernel ?

Akcije #3

Izmjenjeno od Ernad Husremović prije skoro 17 godina

interesantno hardy ovaj paket ne sadrži

root@hp-smraka-1:~# aptitude show asterisk-chan-misdn

E: Unable to locate package asterisk-chan-misdn

ima u launchpad-u bug report vezan za to

Akcije #4

Izmjenjeno od Ernad Husremović prije više od 16 godina

  • Status promijenjeno iz Novo u Odbačeno

išli smo na capi

Akcije

Također dostupno kao Atom PDF