Commit Graph

908 Commits

Author SHA1 Message Date
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
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
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
Keith Morgan
75620dd9ef Remove struct devtype for unsupported drivers. 2018-10-05 19:42:50 +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
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
Jean-Denis Girard
d4e232a776 DAHDI in kernel 4.13: dev_attr to dev_groups
dev_attrs was removed from struct bus_type on kernel 4.13, need to
convert to dev_groups, see
http://lkml.iu.edu/hypermail/linux/kernel/1706.0/04578.html.

DAHLIN-356 #close

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2018-01-01 14:25:39 +02:00
Tzafrir Cohen
52f2c19769 xpp: mark init_card_6_30 as executable
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-09-17 08:25:31 +03:00
Dima Stoliarov
960472ed35 xpp: fxs: restore linefeed (for e.g. thermal alarm)
The si32260 chip may enter a state of thermal alarm to avoid
overheating. This disables the channel.

This commit allows automatic restoring of the channel after a certain
timeout (poll_chan_linefeed, by default 30 seconds).

Adds a per-channel counter ("overheats") in
/proc/xpp/XBUS-<n>/XPD-<m>0/fxs_info to count such events.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-09-13 15:37:24 +03:00
Dima Stoliarov
9c9029d0b6 xpp: fxs: reduce loop current to reduce heating 2017-09-13 15:33:31 +03:00
Tzafrir Cohen
39cd184c29 xpp: FPGA_1161.202.hex now alias for 201
We no longer need to maintain a separate firmware type 2.2: newer
versions of firmware types 2.1 will do.
2017-07-17 14:49:02 +03:00
Tzafrir Cohen
e2ee1eb30b xpp: card_pri: fix clocking initialization
Fix PCM synchronization between PRI module and the main board.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 19:01:34 +03:00
Tzafrir Cohen
d4ac65d0c1 xpp: fxo: update red alarms on span assignment
DAHDI gets notified of changes to battery status and hence to red alarm
on an FXO channel when the status changes. It thus needs to get notified
about it on "startup".

This startup was initially span registration. However following the
separation between device registration and span assignment, the
notification was sent after device registration, whereas it was ignored
if span was not assigned. It happened to work in most cases due to
delays.

This fix moves the startup notifications of battery status to the new
hook that is run on span assignment.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:58:33 +03:00
Tzafrir Cohen
7292c263ef xpp: add xpd method span_assigned
Add an phone device XPD method called 'span_assigned' that gets
called when the XPD's span is assigned.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:58:33 +03:00
Tzafrir Cohen
151853df0d xpp: bug fix in FPGA firmware: 11553
Update FPGA_1161.201.hex to rev. 11553 to fix
'category=2 errorbits=0x01' errors.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:58:33 +03:00
Dima Stoliarov
d9abf02894 xpp: init_card_6_3: parallel calibration
FXS module type 6: Further reduces time of the initialization by writing
to several ports' chips in parallel.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:58:33 +03:00
Dima Stoliarov
24648e6eb3 xpp: init_card_6_3: broadcasts for faster calibration
FXS module type 6: Use broadcast write for a much faster
calibration at init time.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:58:29 +03:00
Tzafrir Cohen
9c0002bf1f fail non-blocking I/O in case of span unassignment
In case a user has a file descriptor that is used for non-blocking I/O
and the span to which it belongs gets unassigned, its reads and writes
will still yield -EAGAIN.

This commit adds a test for such a case and returns the proper -ENODEV.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-06-26 17:49:13 +03:00
Shaun Ruffell
0159b0e7ce 'atomic_read()' -> refcount_read()'
The upstream 4.11 kernel, in commit (10383aea2f445bce9b2a2b308def08134b438c8e
"kref: Implement 'struct kref' using refcount_t"), changed refcount type on kref
objects. We now need to use refcount_read to read them.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2017-06-26 17:49:13 +03:00
Shaun Ruffell
ff88ccb1cd signal_pending() is now in linux/sched/signal.h include
Upstream kernel 4.11, in commit (bd0f9b356d00aa241ced36fb075a07041c28d3b8
"sched/headers: fix up header file dependency on <linux/sched/signal.h>"), now
requires users of signal_pending to include the new linux/sched/signal.h file.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2017-06-26 17:48:40 +03:00
Shaun Ruffell
7ab8780c25 GpakApi: Fix misleading indentation.
gcc-6.3.1 reports the following error when building the driver suite:

    drivers/dahdi/voicebus/GpakApi.c: In function 'gpakReadDSPMemoryMap':
    drivers/dahdi/voicebus/GpakApi.c:1560:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
         if (DspStatus != 0)
         ^~
    drivers/dahdi/voicebus/GpakApi.c:1563:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
      for (i = 0; i < MemoryLength_Word16; i++)
      ^~~

So we'll now update the indentation level (which appears to be a side effect of
mixed tabs and spaces in this file).

NOTE: The GpakAPI files are checkpatch.pl unclean because I did not want to
increase the burden of merging in updates from the original provider, but it may
be time to go ahead and bring the file in compliance with the kernel coding
standards.

Internal-Issue-ID: DAHLIN-354
Reported-by: Sean Darcy
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2017-06-04 16:24:38 -05:00
Tzafrir Cohen
76ad75fc2a xpp: fxs: demote LED FXS6 messages to debug 2017-04-19 15:51:35 +03:00
Tzafrir Cohen
27b1ad108d xpp: fxs: remove verbose poll_inputs notice
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:35 +03:00
Dima Stoliarov
2dc030e61d xpp: bug fix in FPGA firmware: 11551
Update FPGA_1161.201.hex to rev. 11551 to fix the support of module type
6.
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
5b9f520e78 xpp: re-add setting xpd->subunits
The number of subunits per XPD (which is not trivial in BRI) has been
accidentally left out in a previous commit.

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:34 +03:00
Tzafrir Cohen
8e310fd264 xpp: output of parse_hexbyte() may be negative
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2017-04-19 15:51:34 +03:00