Document new channel sysfs interface

Document the new sysfs interface and the changes to /dev .

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
This commit is contained in:
Tzafrir Cohen 2012-12-11 23:07:06 +02:00
parent 00221e8bfd
commit e1245b9dd6

59
README
View File

@ -521,9 +521,12 @@ or dynamically through the udev system.
* /dev/dahdi/ctl (196:0) - a general device file for various information and * /dev/dahdi/ctl (196:0) - a general device file for various information and
control operations on the DAHDI channels. control operations on the DAHDI channels.
* /dev/dahdi/channels/N/M - A device file for channel M in span N
(M is chanpos - numbering relative to the current span).
* /dev/dahdi/NNN (196:NNN) - for NNN in the range 1-249. A device file for * /dev/dahdi/NNN (196:NNN) - for NNN in the range 1-249. A device file for
DAHDI channel NNN. It can be used to read data from the channel DAHDI channel NNN. It can be used to read data from the channel
and write data to the channel. and write data to the channel. It is not generated by default but may
be generated as a symlink using udev rules.
* /dev/dahdi/transcode (196:250) - Used to connect to a DAHDI transcoding * /dev/dahdi/transcode (196:250) - Used to connect to a DAHDI transcoding
device. device.
* /dev/dahdi/timer (196:253) - Allows setting timers. Used anywhere? * /dev/dahdi/timer (196:253) - Allows setting timers. Used anywhere?
@ -851,6 +854,60 @@ A very short type string.
Current sync source. Current sync source.
Channels Bus
^^^^^^^^^^^^
Each DAHDI channel is represented by a node under
/sys/bus/dahdi_channels/devices with the name 'dahdi!channels!N!M'
(where N is the number of the span and M is the number of the channel
in the span - chanpos). Channels of each span also reside under the node
of the span.
Useful attributes in the channel node (All attributed listed below are
read-only):
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/alarms
List of names of the current active alarms (space separated). Normally
(no alarms) empty. Example:
RED YELLOW
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/blocksize
The block size set by userspace.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/channo
The (global) channel number.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/chanpos
The channel number within the span.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/dev
Major and minor device numbers.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/ec_factory
The name of the echo canceller to be used in the channel, if one is
configured. Example:
MG2
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/ec_state
State of the echo canceller. ACTIVE: configured and inuse. INACTIVE
otherwise.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/in_use
1 if the channel is in use (was opepend by userspace), 0 otherwise.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/name
A name string for the channel
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/sig
The signalling types set for the channel. A space-separated list of
signalling types.
===== /sys/bus/dahdi_spans/devices/span-N/dahdi!channels!N!M/sigcap
The signalling types this channel may be configured to handle. A space-
separated list of signalling types.
User-space Interface User-space Interface
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
User-space programs can only work with DAHDI channels. The basic User-space programs can only work with DAHDI channels. The basic