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>
`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>
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>
The xpp drivers were originally developed seperately and thus had their
own version number. For quite some time they no longer have this version
number and report 'Revision: Unknown'.
Get rid of this mechanism.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Generation of metering tone (a feture normally disabled at build time)
is not yet implemented on the new FXS type 6 module.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
The new FXS chip supports two ports for each chip and hence we once
again need to look at hardware differently.
Struct unit_description includes information about all chips/port in a
specific module.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Currently we only have REG (register) commands. Refactor it to allow
MEM (memory) commands.
* A common header
* Don't assume a constant size.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
A new SysFS interface for FXS modules (XPDs):
* In /sys/bus/xpds/devices/<ll>:<m>:<n>/fxs_ring_registers
* Reading show current register values for NEON/TRAPEZ/NORMAL
* Modify the table via writing: "<column> <reg> <byte> [<byte>]"
* Example:
echo "NEON 0x33 0x12" > \
'/sys/bus/xpds/devices/00:0:0/fxs_ring_registers'
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
xpp: refactor the FXS module ring settings into separate data structure:
* Update High VBAT initialization in init_card_1_30:
- Take the value used in set_vm_led_mode() (0x34)
- Now we don't need to set it over and over again in set_vm_led_mode()
* Create a unified ring_parameters[] array for all ring registers:
- Columns for 3 ring types (NEON, TRAPEZ, NORMAL)
- Used by new send_ring_parameters() function
* Now the set_vm_led_mode() simply calls send_ring_parameters()
* This cleanup would allow us to change ring parameters at runtime (by
updating the values in these tables).
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.
This is needed to compile against Linux 3.10.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
[tzafrir.cohen@xorcom.com: fixed passing /proc/xpp/XPD/summary xbus number]
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Cc: Russ Meyerriecks <rmeyerriecks@digium.com>
Cc: Oron Peled <oron.peled@xorcom.com>
* This is a minimal convertion -- everything compiles and looks OK.
* We print a warning for spans registering without a spantype.
* Low-level drivers may later want (but not required)
to fold their internal representations to this canonical
representation -- it will save code and make it more readable.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10683 a0bf4364-ded3-4de4-8d8a-66a801d63aff
* Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs.
* Makes the "power-down" behaviour that was added
in upstream svn r10478, switchable in runtime.
* By default (false), makes the vbat_h behave like it did
before the power-down change.
- I.e: vbat_h is held throughout the ringing period (during
both ring-up/ring-down)
- So this patch revert part of r10478
* When switched to true, activate the "power-down" behaviour.
- I.e: vbat_h follows the ring-up/ring-down.
- This behaviour lowers the noise caused by group ringing of
FXS channels in the same unit, but causes problems with CallerID.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
* In do_chan_power() make vbat_h changes atomic.
* As a result we can ignore duplicate requests.
This will allow cleaner logic in the next commit.
* Added proper debug messages.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10573 a0bf4364-ded3-4de4-8d8a-66a801d63aff
* Rotate the channels table in /proc/xpp/XBUS-*/XPD-*/fxs_info
- This way we don't overflow 80 columns
- Can also add more info items per-channel
* Linearize LED output for easier grep'ping
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10479 a0bf4364-ded3-4de4-8d8a-66a801d63aff
* Now every linefeed control command which is not RING'ing
powers-down the SLIC. This reduce audible noise when
several channels are ringing.
* Simplify code by removing redundant calls to do_chan_power()
before linefeed_control()
* Manage vbat_h state so we skip do_chan_power() calls when
there isn't a state change
* Export vbat_h state to /proc/.../fxs_info
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10478 a0bf4364-ded3-4de4-8d8a-66a801d63aff
This patch removes support for kernel versions < 2.6.18, as those are
not actively supported in any major Linux distribution (except RHEL4,
which is in the "extended" support level of the product life cycle).
This removes much of the more #ifdef-rich parts of the code.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Acked-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10472 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Synchronize some changes from out internal tree:
* Fix a few of the places where indent did a lousy job.
* sparse did not like using the const MAX_ARGS as an index. Make it a define.
* Incorrect header included in card_fxs.c (doh!).
* One more funciton to statify.
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10429 a0bf4364-ded3-4de4-8d8a-66a801d63aff
* We must not block PCM during from 'search_fsk_pattern' channels.
* We must vmwi_search() not only on FXS_LINE_POL_ACTIVE, but also during
'neon_blinking' -- so we notice the message to turn it off.
* Also added 'search_fsk_pattern' and neon_blinking to /proc/.../fxs_info
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: : Tzafrir Cohen <tzafrir.cohen@xorcom.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10372 a0bf4364-ded3-4de4-8d8a-66a801d63aff