# # spec file for package dahdi-linux # # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2019-2020 LISA GmbH, Bingen, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define origversion 3.1.0 Name: dahdi-linux Summary: Digium Asterisk Hardware Device Interface driver Version: 3.1.0 Release: 5.10.31 Url: http://asterisk.org/ License: GPL-2.0 Group: Productivity/Telephony/Utilities #Git-Clone: git://git.asterisk.org/dahdi/linux.git (branch: next) Source: http://downloads.asterisk.org/pub/telephony/dahdi-linux/%name-%origversion.tar.gz Source3: %name-preamble # tarball made from http://downloads.digium.com/pub/telephony/firmware/releases/ Source4: firmware-20150813.tar.xz # include dahdi_hfc driver from git://git.code.sf.net/p/dahdi-hfcs/code Source7: dahdi-hfcs.tar.xz Patch7: dahdi-disable-xpp.patch Patch8: dahdi-warn-on-once.diff Patch9: dahdi-oslec.diff Patch10: dahdi-slab.diff Patch11: dahdi-fix-leap-15.1.diff Patch12: 0001-voicebus-wcaxx-wct4xxp-Remove-include-of-pci-aspm.h.patch Patch13: 0002-Annotate-switch-case-fall-through.patch Patch14: 0003-wcte13xp-Fix-unintended-fall-through-in-t13x_set_lin.patch Patch15: 0004-Makefile-M-is-preferred-to-KBUILD_EXTMOD-for-externa.patch Patch16: 0005-Use-proc_ops-on-kernels-5.6.patch Patch17: 0006-wctdm24xxp-Fix-uninitialized-variable-warning.patch Patch18: 0009-Remove-support-for-32-bit-userspace-with-64-bit-kern.patch Patch19: 0010-Remove-checks-for-HAVE_UNLOCKED_IOCTL-for-kernel-5.9.patch Patch20: 0011-vpmadt032-Create-.o.cmd-file-for-the-shipped-object-.patch Patch21: 0012-Kbuild-Rename-hostprogs-y-to-hostprogs.patch Patch22: 0001-dahdi-base.c-remove-netdev-trans_start-kerne-4.7.patch Patch23: 0002-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch Patch24: 0003-dahdi_config.h-Enable-CONFIG_DAHDI_NET.patch Patch25: 0004-dahdi_config-Enable-DAHDI_DYNAMIC-DAHDI_DYNAMIC_LOC.patch Patch26: 0007-Revert-Remove-support-for-driver-wcte11xp.patch Patch27: 0008-adapt-te11xp-to-DAHDI-API-changes-since-its-removal.patch Patch28: 0009-DAHDI_NET-Report-alarms-as-lost-carrier-to-net_devic.patch Patch29: 0010-Introduce-ioctl-for-simulating-alarms-under-userspac.patch BuildRequires: fdupes BuildRequires: kernel-syms >= 2.6.17 BuildRequires: modutils BuildRequires: udev BuildRequires: xz Provides: dahdi = %version-%release Obsoletes: dahdi < %version-%release # EC2 and UM have no PCI, but DAHDI is all about PCI device drivers %kernel_module_package -p %name-preamble -x ec2 um %description This package contains configuration files, header files, and setup tools needed for the zapata telephony interface drivers. See %_datadir/doc/packages/dahdi/README for a list of supported hardware. %package KMP Summary: Digium Asterisk Hardware Device Interface driver Group: System/Kernel %description KMP This package contains the kernel modules of the Zapata Telephony Interface. For details see the dahdi package. %package devel Summary: Development files for the Digium Asterisk Hardware Device Interface Group: Development/Libraries/Other License: GPL-2.0 and LGPL-2.1 Requires: %name = %version-%release Provides: dahdi-devel = %version-%release Provides: dahdi-linux-syms = %version-%release %description devel This package contains the header files and libraries necessary for developing applications which use zaptel. Install dahdi-devel if you want to develop applications which depend on asterisk. %prep %setup -qa4 -n%name-%origversion %patch -P8 -p1 -P 9 -p1 -P 10 -p1 -P 12 -p1 -P 13 -p1 -P 14 -p1 -P 15 -p1 -P 16 -p1 -P 17 -p1 -P 18 -p1 -P 19 -p1 -P 20 -p1 -P 21 -p1 -P 22 -p1 -P 23 -p1 -P 24 -p1 -P 25 -P 26 -p1 -P 27 -p1 -p1 -P 28 -p1 -P 29 -p1 %if 0%{?sle_version} == 150100 && 0%{?is_opensuse} %patch -P11 -p1 %endif %if %{__isa_bits} == 32 %patch7 -p1 %endif pushd drivers/dahdi/firmware/ for i in *.tar*; do tar -xf "$i" done popd # prepare dahdi_hfcs module tar xf %{S:7} #sed -i 's|#obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY)|obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY)|' drivers/dahdi/Kbuild %build export CFLAGS="%optflags" export MODULES_EXTRA="dahdi_dummy" rm -rf ../obj mkdir -p ../obj for flavor in %flavors_to_build; do cp -a . "../obj/$flavor" pushd "../obj/$flavor" %make_build KSRC="/usr/src/linux-obj/%_target_cpu/$flavor" \ DAHDI_MODULES_EXTRA='hfcs/' popd done %install export MODULES_EXTRA="dahdi_dummy" b="%buildroot" for flavor in %flavors_to_build; do pushd "../obj/$flavor" %make_install INSTALL_MOD_PATH="$b" \ KSRC="/usr/src/linux-obj/%_target_cpu/$flavor" \ DAHDI_MODULES_EXTRA='hfcs/' # wanpipe-kmp wants this dahdi_dir="%_includedir/dahdi/obj/%_target_cpu/$flavor" mkdir -p "$b/$dahdi_dir" cp -a include "$b/$dahdi_dir/" ln -s "%_includedir/dahdi" "$b/$dahdi_dir/include/dahdi" mkdir -p "$b/$dahdi_dir/drivers/dahdi" cp -a drivers/dahdi/Module*.symvers "$b/$dahdi_dir/drivers/dahdi" # wanted by voicesync/wanpipe-voicetime cp -a drivers/dahdi/ecdis.h "$b/$dahdi_dir/drivers/dahdi" cp -a drivers/dahdi/biquad.h "$b/$dahdi_dir/drivers/dahdi" echo "%version" >"$b/$dahdi_dir/.version" popd done # remove pointless double copy rm -Rfv "$b/usr/lib/hotplug" %fdupes %buildroot/%_prefix %files %license LICENSE* %doc README /lib/firmware/* /lib/firmware/.dahdi* %_datadir/dahdi/ %files devel %_includedir/dahdi/ %changelog * Sat Jan 16 2021 Martin Hauke - Set MODULES_EXTRA="dahdi_dummy" to build the dahdi_dummy driver. * Fri Dec 25 2020 Martin Hauke - Disable XPP on 32bit systems (compilation errors) * dahdi-disable-xpp.patch * Tue Dec 15 2020 Martin Hauke - Add some patches from https://github.com/osmocom/dahdi-linux - Enable CONFIG_DAHDI_NET * 0003-dahdi_config.h-Enable-CONFIG_DAHDI_NET.patch * 0001-dahdi-base.c-remove-netdev-trans_start-kerne-4.7.patch - Enable DAHDI_DYNAMIC and DAHDI_DYNAMIC_LOC * 0004-dahdi_config-Enable-DAHDI_DYNAMIC-DAHDI_DYNAMIC_LOC.patch - Readd wcte11xp driver (those cards still working fine !) * 0007-Revert-Remove-support-for-driver-wcte11xp.patch * 0008-adapt-te11xp-to-DAHDI-API-changes-since-its-removal.patch - Fix HDLC encapsulation, netdev: send frame via protocol handlers * 0002-dahdi-base-netdev-send-frame-via-protocol-handlers-f.patch - DAHDI_NET: Report alarms as lost carrier to net_device * 0009-DAHDI_NET-Report-alarms-as-lost-carrier-to-net_devic.patch - Introduce ioctl() for simulating alarms under userspace control * 0010-Introduce-ioctl-for-simulating-alarms-under-userspac.patch * Tue Dec 15 2020 Martin Hauke - Add patches to fix builds with Kernel >= 5.9 and gcc >= 10 * 0001-voicebus-wcaxx-wct4xxp-Remove-include-of-pci-aspm.h.patch * 0002-Annotate-switch-case-fall-through.patch * 0003-wcte13xp-Fix-unintended-fall-through-in-t13x_set_lin.patch * 0004-Makefile-M-is-preferred-to-KBUILD_EXTMOD-for-externa.patch * 0005-Use-proc_ops-on-kernels-5.6.patch * 0006-wctdm24xxp-Fix-uninitialized-variable-warning.patch * 0009-Remove-support-for-32-bit-userspace-with-64-bit-kern.patch * 0010-Remove-checks-for-HAVE_UNLOCKED_IOCTL-for-kernel-5.9.patch * 0011-vpmadt032-Create-.o.cmd-file-for-the-shipped-object-.patch * 0012-Kbuild-Rename-hostprogs-y-to-hostprogs.patch - Drop not longer needed patches * dahdi-pmake.diff * dahdi-moddir.diff * dahdi-fix-kernel-5.4.diff * Sun Sep 6 2020 Jan Engelhardt - Update to release 3.1.0 * Thu Feb 6 2020 Hans-Peter Jansen - Add patch to fix build with Kernel >= 5.4.0: dahdi-fix-kernel-5.4.diff * Thu Jul 25 2019 Hans-Peter Jansen - Update to 3.1.0-rc1 in order to build with kernel >= 5.0 - Apply dahdi-fix-leap-15.1.diff for Leap 15.1 kernels Funfact: timer_setup was backported, but definition of TIMER_DATA_TYPE, as being used from its callback, not adjusted accordingly... * Tue Jan 8 2019 Jan Engelhardt - Update to new upstream release 3.0.0 * Removed drivers wcte12xp, wcte11xp, wct1xxp, wcb4xxp drivers. Cards affected: TE120P, TE121, TE122, TE110P, T100P, E100P, B410, Tormenta. - Drop 0001-signal_pending-is-now-in-linux-sched-signal.h-includ.patch, 0002-atomic_read-refcount_read.patch (merged), dahdi-kill-xpp_h.diff (obsolete) * Mon Sep 4 2017 jengelh@inai.de - Add 0001-signal_pending-is-now-in-linux-sched-signal.h-includ.patch, 0002-atomic_read-refcount_read.patch. * Wed Mar 30 2016 jengelh@inai.de - Update to new upstream release 2.11.1 * Fri Jan 22 2016 jengelh@inai.de - Update to new upstream release 2.11.0 * Thu Aug 13 2015 jengelh@inai.de - Update to new upstream release 2.10.2 * Mon Mar 16 2015 jengelh@inai.de - Update to new upstream release 2.10.1 * Thu Nov 20 2014 joop.boonen@opensuse.org - Added a slab include patch to build the package for armv7l * Mon Oct 13 2014 jengelh@inai.de - Update to new upstream release 2.10.0.1 * Set no_read, no_write methods for devices * Fri Aug 22 2014 jengelh@inai.de - Update to new upstream release 2.10.0 * Support for Linux 3.17 - Reenable OSLEC echo canceller module again - Update firmwares to 20140822: * te436 was added * Tue May 27 2014 jengelh@inai.de - Update to new upstream release 2.9.1 - Update firmwares to 20140527 * Wed Feb 26 2014 joop.boonen@opensuse.org - Update to new upstream release 2.9.0 * Fri Dec 27 2013 jengelh@inai.de - Install all header files * Tue Dec 24 2013 jengelh@inai.de - Update to new upstream release 2.8.0.1 * No upstream changelog was provided * Thu Oct 3 2013 jengelh@inai.de - Update to new upstream release 2.7.0.1 * No upstream changelog was provided * Thu Aug 15 2013 jengelh@inai.de - Update to new upstream release 2.7.0 * Support for Linux 3.10 * Support for te133, te134, vpmoct032 * Thu Jan 24 2013 jengelh@inai.de - Add package signature verification - Kernels older than 2.6.17 are in fact no longer supported, so remove SLES10 patch * Mon Aug 27 2012 jamesp@vicidial.com - Added extra header files needed by third party drivers to compile - Added obsoletes for older 'dahdi' packages * Mon Jun 25 2012 jengelh@inai.de - Update to new upstream release 2.6.1 * support for Linux 3.4 * misc crash and race fixes on unload * Sun Feb 5 2012 chris@computersalat.de - update to 2.6.0 * a lot of changes, please see the ChangeLog file for more info * Thu Dec 15 2011 jengelh@medozas.de - Update to new upstream release 2.6.0-rc1, changelog is at http://downloads.asterisk.org/pub/telephony/dahdi-linux/ChangeLog-2.6.0-rc1 * Mon Oct 31 2011 jengelh@medozas.de - Ship Module.symvers for use by "wanpipe" package * Mon Oct 17 2011 jengelh@medozas.de - Add patch to add missing WARN_ON_ONCE define to wctdm24xxp for kernels < 2.6.18 * Tue Oct 4 2011 jengelh@medozas.de - Update to new upstream release 2.5.0.1, for changelog see http://downloads.asterisk.org/pub/telephony/dahdi-linux/ChangeLog-2.5.0.1 - Update to firmware-20111005 (2.5.0.1 depends on it), and reduce its size by removing redundant files in the archive. - Remove redundant/unwanted tags/sections (cf. specfile guidelines) - Remove duplicate copy of firmware files - Put building commands into %%build, not %%install; replace convoluted installation by single-shot installation - Enable parallel make - Build for all kernel flavors - Exclude EC2 flavor due to lack of PCI which DAHDI requires - Set the minimum kernel version required (currently: 2.6.18-rc1 due to use of WARN_ON_ONCE in source code) - Add Provides: dahdi/dahdi-devel to cater for BuildRequires of other packages - Avoid compiling echo.ko again, allows to drop kernel-source - dahdi-linux should not require KMP (gives "have choice"), rather, KMPs should Require dahdi-linux (for firmware) * Tue Apr 12 2011 chris@computersalat.de - update to 2.4.1.2 * include/dahdi/kernel.h: dahdi: Do not define dev_name if already backported. RHEL 5.6 has backported dev_name in include/dahdi/devices.h. We now need to check for a back ported definition before defining our own version on pre 2.6.26 kernels. (closes issue #18992) Reported by: ndupeux, AlexCeli Tested by: elguero Signed-off-by: Tzafrir Cohen Acked-by: Shaun Ruffell Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9894 * wctdm24xxp: Fix regression with LEDS on TDM410. - remove Author from Description * Tue Mar 8 2011 chris@computersalat.de - update to 2.4.1 * build_tools/make_version: make_version: Use 'git rev-parse' if only looking for a sha5. Different versions of git have variability in how the log output looks. Instead of git log, we can use git rev-parse directly. Signed-off-by: Shaun Ruffell Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9475 * build_tools/make_version: make_version: svn and git metadata directory not checked properly. (closes issue #16143) Reported by: Max Khon Signed-off-by: Kinsey Moore Signed-off-by: Shaun Ruffell Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9418 * build_tools/make_version: make_version: '[[' -> '[' since it's not a bash script. '[[' is a bash construct specifically, yet [#]!/bin/sh is at the top of the file. Signed-off-by: Shaun Ruffell Acked-by: Kinsey Moore Acked-by: Russ Meyerriecks Acked-by: Tzafrir Cohen Review: https://reviewboard.asterisk.org/r/940/ Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9408 * Makefile, build_tools/make_version: dahdi: Generate include/dahdi/version.h when building in a git repository. If building within a git repository search the last log message for a 'git-svn-id'. If found, the commit has a corresponding svn revision number and we will use the SVN-xxx-rxxx revision form. Otherwise use the output of 'git describe --long --always --tags - -dirty=M' as the version. Signed-off-by: Shaun Ruffell Acked-by: Tzafrir Cohen Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9396 - for further changes please see ChangeLog file * Sat Nov 6 2010 chris@computersalat.de - spec cleanup o macros * Fri Nov 5 2010 toganm@opensuse.org - enable echo_oslec for opensuse >11.1 more info regarding oslec is at http://www.rowetel.com/blog/?page_id=454 * Thu Nov 4 2010 chris@computersalat.de - update to 2.4.0 o lot of changes please see ChangeLog file - reworked firmware o added dahdi-fwload-vpmadt032-1.25.0.tar.gz * Wed Jun 16 2010 chris@computersalat.de - fix build for Factory (11.3) - removed obsolete patches o dahdi, rtc, kzalloc * Tue Jun 15 2010 chris@computersalat.de - update to 2.3.0.1 * drivers/dahdi/voicebus/GpakCust.h, /, drivers/dahdi/voicebus/GpakApi.c, drivers/dahdi/voicebus/voicebus.c, drivers/dahdi/voicebus/GpakCust.c: Merged revisions 8560,8575-8576 via svnmerge from https://origsvn.digium.com/svn/dahdi/linux/trunk ........ r8560 | sruffell | 2010-04-22 16:36:16 -0500 (Thu, 22 Apr 2010) | 11 lines wcte12xp, wctdm24xxp: Ensure writes to I/O registers are flushed. In revision 8176 I changed register access from I/O space to memory mapped registers. Unfortunately, when I made that change, I didn't account for posted writes. This change makes sure all the registers are read back to ensure that they are posted through any intermediate bridges. The most readily observable symptom were cards that were taking 2000 interrupts/second. The card reported that it handled an interrupt but the write to silence the card wasn't flushed through until the second time the interrupt handler run. DAHDI-602. ........ r8575 | sruffell | 2010-04-26 18:29:16 -0500 (Mon, 26 Apr 2010) | 4 lines wcte12xp, wctdm24xxp: Do not allow interruptible sleep on VPM lock. If the sleep is ever interrupted, 'up' will still be called in the GpakApi, essentially making the lock useless after that point. ........ r8576 | sruffell | 2010-04-26 18:29:17 -0500 (Mon, 26 Apr 2010) | 9 lines wcte12xp, wctdm24xxp: Retry if the VPMADT032 reports not ready. CheckDspReset can return -1 if the DSP is not ready to process any new commands. In this case we should retry a few times to give the DSP a chance to become ready. While I'm not ready to say this definitely fixes recently reported cases when the wcte12xp driver constantly resets, it eliminated communication failures to the DSP module when under stress (via the vpm_firmware_version sysfs attribute). However, I haven't let it run long enough to say that the issue is resolved. DAHDI-603. ........ * /, drivers/dahdi/dahdi_echocan_jpah.c: missing #include: fixes building with 2.6.34-rc5 With kernel 2.6.34-rc5 an explicit '#include ' is required for using kzalloc() and friends. Merged revisions 8550 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * drivers/dahdi/xpp/xpp_debug, /, drivers/dahdi/xpp/card_pri.c, drivers/dahdi/wcb4xxp/Makefile, drivers/dahdi/xpp/card_bri.c, drivers/dahdi/xpp/card_global.c, drivers/dahdi/dahdi-base.c: typos, mostly unkown Merged revisions 8539 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * Makefile, /: Remove generation of kernel-doc API docs It's not really useful, and it breaks building 'docs' without a kernel tree. Merged revisions 8538 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * /: initialize svnmerge * Thu Apr 22 2010 chris@computersalat.de - fix build for kernel > 2.6.34 o added kzalloc patch * Wed Apr 21 2010 chris@computersalat.de - update to 2.3.0 * lot of changes see ChangeLog - updated firmware - remove obsolete patches * dahdi-linux-2.2.1.1-autoconf_h.patch * dahdi-driver.patch * Sat Mar 27 2010 chris@computersalat.de - update to 2.2.1.1 * wct4xxp: Added support for for qfalc v3.1 framer. * wct4xxp: Added ID tags for generation 5 firmware updates - added autoconf.h patch o fix build for kernel > 2.6.31 autoconf.h moved from linux/ to generated - rpmlint o fixed group for devel pkg Development/Libraries/Other - clenup spec * Fri Jan 22 2010 chris@computersalat.de - update to 2.2.1 * dahdi-linux version 2.2.1 released. * drivers/dahdi/xpp/xbus-pcm.c, /: xpp: demote a message that generates some false alarms. Merged revisions 7843 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * /, drivers/dahdi/xpp/firmwares/USB_FW.hex: xpp: USB_FW rev 7578 Fixes various minor twinstar-related bugs. Merged revisions 7815 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * drivers/dahdi/xpp/xbus-pcm.c, /: xpp: fixes for drift calculation. Should help for the case of multiple quad-PRI Astribanks on a single system. xpp rev: 7666. Merged revisions 7807 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * drivers/dahdi/xpp/xbus-pcm.c, /, drivers/dahdi/xpp/xbus-pcm.h, drivers/dahdi/xpp/xbus-sysfs.c: xpp: Improved inter-Astribank drift calculation. Merged revisions 7625 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk * drivers/dahdi/dahdi-base.c: dahdi-base: change dahdi_kernel_fpu_end to kernel_fpu_end dahdi_kernel_fpu_end is part of the MMX changes in trunk that was not committed into the 2.2 branch. This change snuck in as part of revision 6864 with the master span processing changes. * voicebus, wcte12xp: Only define SLAB_STORE_USER when CONFIG_SLUB is defined. On 2.6.22, there is was a bug in the SLUB allocator that required defining SLAB_STORE_USER, however this setting is only valid when CONFIG_SLUB is defined and not when using the previous slab allocator. DAHDI-424. - added ChangeLog, LICENSE*, README to doc * Thu Jan 14 2010 chris@computersalat.de - include actual tarball version in package version - cleanup source o updated tarball to its upstream version * it is an rc release * Sat Jan 9 2010 chris@computersalat.de - fix build-/deps - moved changelog to changes file - removed pre/-un post/-un * Mon Jan 4 2010 chris@computersalat.de - cleanup spec o added header o sort TAGS o fix deps o some rpmlint stuff - cleanup source o added .changes file - kernel modules to "updates" * Mon Dec 21 2009 vittorio@vitsoft.bz - dahdi-linux 2.2.1 * Wed Aug 19 2009 vittorio@vitsoft.bz - dahdi-linux 2.2.0.2 * Fri Jul 3 2009 vittorio@vitsoft.bz - dahdi-linux 2.2.0.1 * Wed Jul 1 2009 vittorio@vitsoft.bz - dahdi-linux 2.2.0 * Wed Dec 10 2008 vittorio@vitsoft.bz - dahdi-linux 2.1.0 * Sat Oct 4 2008 vittorio@vitsoft.bz - dahdi-linux 2.0.0 * Mon Sep 15 2008 vittorio@vitsoft.bz - dahdi-linux 2.0.0 rc4