Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to get DAHDI working with kernel 4.19
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 211
Location: Utility Muffin Research Kitchen

PostPosted: Fri Dec 14, 2018 7:44 am    Post subject: How to get DAHDI working with kernel 4.19 Reply with quote

UPDATE
Following on:
Code:
# uname -r
4.19.57-gentoo

Code:
cd /tmp
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1.tar.gz
tar -xf dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1.tar.gz
cd dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1/linux/
mkdir drivers/staging
cp -fR /usr/src/linux/drivers/misc/echo drivers/staging
sed -i "s|#obj-m += dahdi_echocan_oslec.o|obj-m += dahdi_echocan_oslec.o|" drivers/dahdi/Kbuild
sed -i "s|#obj-m += ../staging/echo/|obj-m += ../staging/echo/|" drivers/dahdi/Kbuild
echo 'obj-m += echo.o' > drivers/staging/echo/Kbuild

I could not build 3.1.
drivers/dahdi/wctdm.c was missing, which was needed for my TDM400P.
So I downloaded the old version:
Code:
cd /tmp
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1.tar.gz
tar -xf dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1.tar.gz
cp dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1/linux/drivers/dahdi/wctdm.c dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1/linux/drivers/dahdi/

And added in the required lines:
Code:
# grep DAHDI_WCTDM dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1/linux/drivers/dahdi/{Kconfig,Kbuild}
Kconfig:config DAHDI_WCTDM
Kconfig:config DAHDI_WCTDM24XXP
Kbuild:obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM)   += wctdm.o
Kbuild:obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP)   += wctdm24xxp/

I could then
Code:
cd /tmp/dahdi-linux-complete-3.0.0-rc1+3.0.0-rc1/linux
make
make install
reboot

Code:
# lsmod | grep -E 'oslec|dahdi'
dahdi_echocan_oslec    16384  2
echo                   16384  1 dahdi_echocan_oslec
dahdi                 221184  4 wctdm,dahdi_echocan_oslec
crc_ccitt              16384  1 dahdi


Last edited by Fog_Watch on Fri Nov 29, 2019 5:19 am; edited 1 time in total
Back to top
View user's profile Send private message
jcandle
n00b
n00b


Joined: 19 Nov 2019
Posts: 1

PostPosted: Tue Nov 19, 2019 3:03 am    Post subject: Reply with quote

I'm going to res this old thread only because somebody will find this useful and there's no other place on the webs that I could find anyone posting this.

To make wctdm working with DAHDI 3.1.0 the following changes need to be made in addition to the changes posted by @Fog_Watch

file: wctdm.c
line: 1135
< DAHDI_IRQ_HANDLER(wctdm_interrupt)
> static irqreturn_t wctdm_interrupt(int irq, void *dev_id)
line: 2853
< res = dahdi_pci_module(&wctdm_driver);
> res = pci_register_driver(&wctdm_driver);
Back to top
View user's profile Send private message
Fog_Watch
Apprentice
Apprentice


Joined: 24 Jul 2006
Posts: 211
Location: Utility Muffin Research Kitchen

PostPosted: Fri Nov 29, 2019 5:14 am    Post subject: Reply with quote

Code:
 # uname -r
4.19.82-gentoo

Code:
cd /tmp/
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-3.1.0+3.1.0.tar.gz
tar -xf dahdi-linux-complete-3.1.0+3.1.0.tar.gz
cd dahdi-linux-complete-3.1.0+3.1.0/linux
mkdir drivers/staging
cp -fR /usr/src/linux/drivers/misc/echo drivers/staging
sed -i "s|#obj-m += dahdi_echocan_oslec.o|obj-m += dahdi_echocan_oslec.o|" drivers/dahdi/Kbuild
sed -i "s|#obj-m += ../staging/echo/|obj-m += ../staging/echo/|" drivers/dahdi/Kbuild
echo 'obj-m += echo.o' > drivers/staging/echo/Kbuild

Include wctdm.c:
Code:
cd /tmp
wget https://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1.tar.gz
tar -xf dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1.tar.gz
cp dahdi-linux-complete-2.11.1-rc1+2.11.1-rc1/linux/drivers/dahdi/wctdm.c dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/

Code:
# grep DAHDI_WCTDM dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/{Kconfig,Kbuild}
dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/Kconfig:config DAHDI_WCTDM
dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/Kconfig:config DAHDI_WCTDM24XXP
dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/Kbuild:obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM) += wctdm.o
dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/Kbuild:obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp/

Edit wctdm.c:
Code:
cd dahdi-linux-complete-3.1.0+3.1.0/linux/drivers/dahdi/
# sed -n -e 1135p -e 2852p wctdm.c
static irqreturn_t wctdm_interrupt(int irq, void *dev_id)
   res = pci_register_driver(&wctdm_driver);

Build:
Code:
cd /tmp/dahdi-linux-complete-3.1.0+3.1.0/linux/
make
make install
reboot

Code:
hostname ~ # asterisk -rx "dahdi show version"
DAHDI Version: 3.1.0 Echo Canceller: OSLEC
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum