Commit Graph

1009 Commits

Author SHA1 Message Date
Shaun Ruffell
5c840cf438 Kbuild: Rename 'hostprogs-y' to 'hostprogs'
Quiets the following warnings that are a result of commit ("kbuild: rename
hostprogs-y/always to hostprogs/always-y"
5f2fb52fac15a8a8e10ce020dd532504a8abfc4e) [1]:

  scripts/Makefile.lib:8: 'always' is deprecated. Please use 'always-y' instead
  scripts/Makefile.lib:12: 'hostprogs-y' is deprecated. Please use 'hostprogs' instead

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f2fb52fac15a8a8e10ce02

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-11-16 22:01:24 -06:00
Shaun Ruffell
d228a12f1c vpmadt032: Create .o.cmd file for the shipped object file.
Kernel version 5.8, in commit "modpost: use read_text_file() and
get_line() for reading text files" [1] made it an error if the .o.cmd
file is missing. However, this file is not generated for shipped .o
files.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=70f30cfe5b892fcb7f98e7df72ed6ccfe3225628

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-11-16 22:01:23 -06:00
Shaun Ruffell
6d4c748e04 Remove checks for HAVE_UNLOCKED_IOCTL for kernel >= 5.9
In upstream commit (4e24566a134ea1674 "fs: remove the HAVE_UNLOCKED_IOCTL and
HAVE_COMPAT_IOCTL defines") [1] the kernel removed these defines.

All supported kernels include support for the unlocked_ioctl now, so
DAHDI can also remove these checks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e24566a134ea167441a1ffa3d439a27c

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-11-16 22:01:22 -06:00
Shaun Ruffell
4df746fe3f Remove support for 32-bit userspace with 64-bit kernel
I am not aware of anyone who tests in this configuration, and I'm not
sure if it currently works. I'll remove any support for the time being
and can add it back in if someone comes forward needing support for it.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-11-16 22:01:21 -06:00
Shaun Ruffell
97e744ad96 test: Need to add -y flags to (dnf|yum) update
Without this, the containers will hang if an update is available.
2020-02-26 08:56:44 -06:00
Shaun Ruffell
90e8a54e3a Add docker-compose.yml to be used for compile tests
Ideally this will be expanded in order to simplify compilation tests of
DAHDI on supported distributions.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-02-23 19:39:26 -06:00
Shaun Ruffell
26fb7c34cb wctdm24xxp: Fix uninitialized variable warning.
gcc 10.x detected the following use of an uninitialized variable:

  ../drivers/dahdi/wctdm24xxp/xhfc.c: In function 'wctdm_init_b400m':
  ../drivers/dahdi/wctdm24xxp/xhfc.c:624:5: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
    624 |  if (*lastreg != (unsigned char)addr) {
        |     ^
  ../drivers/dahdi/wctdm24xxp/xhfc.c:2557:20: note: 'x' was declared here
   2557 |  unsigned char id, x;
        |

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-02-23 19:39:25 -06:00
Shaun Ruffell
34b9c77c9a Use proc_ops on kernels >= 5.6
In commit (d56c0d45f0e27 "proc: decouple proc from VFS with "struct proc_ops"")
[1], proc_create_data no longer takes a file_operations structure, but instead
takes a struct proc_ops in order to conserve memory in the kernel.

This change is necessary for DAHDI to work with kernels >= 5.6

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d56c0d45f0e27f814e87a1676b6bd

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2020-02-23 19:39:24 -06:00
Shaun Ruffell
c98f59eead Makefile: 'M=' is preferred to 'KBUILD_EXTMOD=' for external modules.
I should have used 'M=' in (e93c53ce05 "Makefile: SUBDIRS ->
KBUILD_EXTMOD") originally.

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/modules.rst?h=v5.3#n77
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-11-20 22:53:18 -06:00
Shaun Ruffell
ac300cd895 wcte13xp: Fix unintended fall through in t13x_set_linemode for J1
Found by GCC with -Wimplicit-fallthrough.

Also fix the log message to report that the mode was switched to J1 mode.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-09-24 20:18:31 -05:00
Shaun Ruffell
6e5197fed4 Annotate switch-case fall through
Quiets warnings like:
  drivers/dahdi/dahdi-base.c:8494:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
     if (chan->txstate != DAHDI_TXSTATE_OFFHOOK) break;
        ^

Needed since Linux 5.4 commit (a035d552a93bb9ef60487, "Makefile: Globally enable
fall-33bb9f2a0dc857ff869through warning") [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a035d552a93bb9ef6048733bb9f2a0dc857

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-09-24 20:12:36 -05:00
Shaun Ruffell
45ac6a30f9 voicebus, wcaxx, wct4xxp: Remove include of pci-aspm.h
Linux 5.4, in commit  (7ce2e76a0420801fb4b53b9e685094 "PCI: Move ASPM
declarations to linux/pci.h") [1], removed pci-aspm.h.

This commit removes the global include of pci-aspm.h in include/dahdi/kernel.h
(because it only pertains to certain drivers), and moves the conditional include
into only the drivers that need it.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ce2e76a0420801fb4b53b9e685094

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-09-24 19:51:22 -05:00
Shaun Ruffell
d07c4545ec dahdi: Store the span registration time as a ktime_t value as well.
Ideally we want to standardize on storing all timestamps derivied from the
system clock as ktime_t values.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
ffcd08205c xpp: Convert struct timeval -> ktime_t.
`struct timeval` has been removed from the kernel interface in 5.0 as
part of fixing the 2038 problem. ktime_t is the preferred kernel time
interface now.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
8468250328 dahdi: define dahdi_ktime_equal()
Older kernels (2.6.32) are unable to do a direct comparison of ktime
values, while kernels post 4.10 have removed the comparison function.
Therefore we need to make our own compatibility interface for comparing
the ktime values.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
3e2eb9ca32 dahdi_dummy: 'struct timespec' -> ktime_t
Use the new ktime_t based interface for dahdi_dummy as well. dahdi_dummy
is still useful to keep around for testing purposes.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
9991c959ef dahdi_dummy: Fix timer_setup API usage.
It looked like the recent change to add support for timer_setup was not
completely implemented / tested with dahdi_dummy. I was using it to
check some changes to the timekeeping API when I noticed this.

This does not really affect anyone since, by default, dahdi_dummy is no
longer built and even if it was built, it would not use the standard
timer interface by default on newer kernels.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
ac50b368aa dahdi: Update coretimer to use ktime instead of 'struct timespec'
Since this is only used internally, and ktime is the basis for
timekeeping in the kernel, this allows this interface to be validated,
before converting the other internal timekeeping to it.

This is part of the changes necessary to remove the use of 'struct
timeval' from the driver suite for compatibility with Linux 5.0, which
is updating the internal timekeeping interfaces to fix the 2038 problem.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
db9c5f5c89 oct612x: timeval -> ktime
The timeval structure is removed in Linux kernel 5.0 since it is not
year 2038 safe. Standardize on the ktime values.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
95fccc653c Backport ktime_ms_delta().
This function will return the number of milliseconds between two ktime
values, but it was only introduced in kernel version 4.0

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
e93c53ce05 Makefile: SUBDIRS -> KBUILD_EXTMOD
The SUBDIRS environment variable is scheduled to be removed in version
5.0 of the Linux Kernel.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
d9cf68685e Remove CLASS_DEV_CREATE / CLASS_DEV_DESTROY macros.
All supported kernel versions use the same signature for device_create /
device_destroy so we no longer need these macros.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
4f3a724036 wct4xxp: Remove unnused ENABLE_WORKQUEUE code paths
ENABLE_WORKQUEUE was only defined for kernels that were older than the
currently supported kernels. Instead of forward porting support for
workqueues in the wct4xxp driver, I think it better just to remove
support for them since they are not longer used.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
4af6f69fff Remove unnecessary dahdi_pci_module macro.
All supported kernel variations support the same signature for
registering a PCI module, so we can eliminate the macro.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
cdd6ddd0fd Remove unnecessary DAHDI_IRQ_HANDLER macro.
All supported kernels now use the same signature for the IRQ handler.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
02d30ab799 Remove support for kernels older than 2.6.27
There are not any major distributions that are still supporting kernels
older than 2.6.27 so we can remove many typedefs. The primary motivator
for this change is that kernel 5.0 is dropping support for timeval and
it would be ideal if the in-kernel time representation can
standardize on ktime_t, but 2.6.18 did not support the ktime
interface that was needed.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Shaun Ruffell
8c8b9b6df0 dahdi: timer_setup was backported in RHEL 7.6
Since Red Hat Linux backported the new timer_setup definition in 7.6, we
need to make sure to not define it ourselves when building against this
kernel.

Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
2019-05-08 11:33:05 -05:00
Keith Morgan
60aaff1289 DAHLIN-365 Added install-xpp-firm target back in the Makefile after it was left out. 2018-11-27 19:02:37 +00:00
Keith Morgan
75620dd9ef Remove struct devtype for unsupported drivers. 2018-10-05 19:42:50 +00:00
Keith Morgan
f47c9bd928 Changed readme to reflect driver support changes. 2018-10-04 19:03:00 +00:00
Keith Morgan
40f4f86ffa Revert "Remove support for xpp drivers."
add them back.
This reverts commit a36d266254.
2018-10-04 17:51:54 +00:00
Keith Morgan
29cb229cd3 Remove support for all but wcb41xp wcb43xp and wcb23xp. 2018-10-04 17:34:21 +00:00
Keith Morgan
a66e88e666 Remove support for wctdm800, wcaex800, wctdm410, wcaex410. 2018-10-03 17:02:56 +00:00
Keith Morgan
a36d266254 Remove support for xpp drivers. 2018-10-03 15:31:08 +00:00
Keith Morgan
3697450317 Remove support for driver wcte12xp. 2018-10-03 15:18:39 +00:00
Keith Morgan
3748456d22 Remove support for driver wcte11xp. 2018-10-03 15:01:04 +00:00
Keith Morgan
04e759f9c5 Remove support for driver wctdm. 2018-10-03 14:13:59 +00:00
Keith Morgan
dade6ac615 Remove support for wct1xxp driver. 2018-10-03 14:09:01 +00:00
Keith Morgan
14198aee85 Remove support for wcfxo driver. 2018-10-03 14:04:04 +00:00
Keith Morgan
60d058cc7a Remove support for tor2 driver. 2018-10-03 13:58:11 +00:00
Keith Morgan
bfdfc4728c Remove support for pciradio driver. 2018-10-03 13:50:39 +00:00
Keith Morgan
f95fff6588 Description: Remove a bodus "test" target
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Bug: https://issues.asterisk.org/jira/browse/DAHLIN-364
2018-10-01 19:33:50 +00:00
Shaun Ruffell
6667f1c8d8 DAHDI in kernel 4.15: Switch to new timer_setup interface.
Upstream kernel 4.14, in commit (686fef928bba6b "timer: Prepare to change timer
callback argument type") [1], introduced the timer_setup interface to replace
the init_timer/setup_timer interfaces. The primary change is that the timer
callback functions now follow the standard kernel pattern where the structure
the callback sits in is passed to the callback instead of storing a pointer to
an unassociated data type.

The setup_timer functions were removed in upstream kernel v4.15, and therefore
this change is needed in order to compile DAHDI for kernels >= 4.15.

This change follows the same strategy that was done in the kernel to while the
existing users of setup_timer were migrated to the new interface.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=686fef928bba6b
2018-09-03 10:27:18 -05:00
Shaun Ruffell
20328895a2 Disable -Wformat-truncation and prevent potential string overflows.
GCC 7.3.0 complained about the potential to overflow the fixed size span and
channel names and descriptions. It also flagged potential truncations of the
strings.

The sprintf calls are now changed to snprintf to prevent the potential
overflows, but the warning about truncations are now disabled globally.
2018-09-03 10:27:18 -05:00
Shaun Ruffell
7ecdf370bc voicebus: Initialize stack buffer.
Quiets the following (valid) warning from gcc 7.3.0:

drivers/dahdi/voicebus/GpakApi.c:1648:22: warning: ‘MsgBuffer[1]’ may be used
   uninitialized in this function [-Wmaybe-uninitialized]
         MsgBuffer[1] |= DTMF_UPDATE_MASK;
2018-09-03 10:26:43 -05:00
Shaun Ruffell
ea2d67414a xpp: fxs: Do not increment boolean.
This quiets the following warning from gcc 7.3.0:

  drivers/dahdi/xpp/card_fxs.c:1344:17: warning: increment of a boolean
  	expression [-Wbool-operation]
2018-09-03 10:26:29 -05:00
Shaun Ruffell
14d8754e34 Completely clear out conference buffers.
This fixes an error and quiets the following warning pointed out by gcc 7.3.0:

  warning: ‘memset’ used with length equal to number of elements without
    multiplication by element size [-Wmemset-elt-size] memset(chan->conflast, 0,
    DAHDI_MAX_CHUNKSIZE);

Previously only the first half of the conference buffers were cleared out.
2018-08-09 09:56:21 -05:00
Oron Peled
d3c9e43437 xpp: Support FXS module with 4 ports and no I/O
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2018-05-10 12:18:35 +03:00
Tzafrir Cohen
9a4d2fce48 xpp: init_card: eeprom_release_201 applies to any 20x
* The variable eeprom_release_201 was added in the initialization
  script of the FXS module to add a case where it is different from
  101 mains.
* However, it tests for "201" and it should apply for any 20x.
* Remove the variable from the init script of module type 6 (new FXS)
  as it was not used.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2018-02-20 19:07:50 +02:00
Tzafrir Cohen
26597a5cac Ignore quilt .pc directory, used in deb packaging
Debian packaging uses quilt to manage patches. Book-keeping for them is
done using quilt (either directly, or in a compatible format), and
tracked in the directory .pc .

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2018-01-11 15:23:55 +02:00