[dahdi-commits] tzafrir: branch linux/tzafrir/sysfs r5451 - /linux/team/tzafrir/sysfs/README
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Sat Dec 6 17:35:28 CST 2008
Author: tzafrir
Date: Sat Dec 6 17:35:27 2008
New Revision: 5451
URL: http://svn.digium.com/view/dahdi?view=rev&rev=5451
Log:
Document the (mostly new) sysfs interface.
Modified:
linux/team/tzafrir/sysfs/README
Modified: linux/team/tzafrir/sysfs/README
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/README?view=diff&rev=5451&r1=5450&r2=5451
==============================================================================
--- linux/team/tzafrir/sysfs/README (original)
+++ linux/team/tzafrir/sysfs/README Sat Dec 6 17:35:27 2008
@@ -268,7 +268,7 @@
Internals
---------
DAHDI Device Files
-~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~
Userspace programs will usually interact with DAHDI through device
files under the /dev/dahdi directory (pedantically: characted device files
with major number 196) . Those device files can be generated statically
@@ -292,7 +292,7 @@
DAHDI Timing
-~~~~~~~~~~~~~
+~~~~~~~~~~~~
A PBX system should generally have a single clock. If you are connected to a
telephony provider via a digital interface (e.g: E1, T1) you should also
typically use the provider's clock (as you get through the interface). Hence
@@ -344,7 +344,7 @@
PROCFS Interface: /proc/dahdi
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A simple way to get the current list of spans and channels each span contains
is the files under /proc/dahdi . /proc/dahdi is generated by DAHDI as it
loads. As each span registers to DAHDI, a file under /proc/dahdi is created
@@ -377,6 +377,75 @@
see an extra '(In use)':
2 XPP_FXS/0/0/1 FXOLS (In use)
+
+
+/sys Interface
+~~~~~~~~~~~~~~
+Sapns and channels are also represented in sysfs. In sysfs objects are
+represented as directories, simple attributes are shown as files in that
+directory and more complex objects are subdirectories or symbolic links
+to other directories.
+
+Historically in Zaptel the sysfs representation was used merely for
+generating device files (See <<_sys_class_dahdi,/sys/class/dahdi>>
+below). Newer versions of DAHDI represent each span and channel as a
+node under the /sys/devices tree.
+
+The sysfs interface is still experimental and subject to changes.
+Alternative phrasing: The sysfs interface is subject to changes. You are
+advised to use the published interfaces from dahdi-tools (e.g. the
+dahdi-perl modules) rather than access it directly.
+
+/sys/class/dahdi
+^^^^^^^^^^^^^^^^
+Includes a very simple sysfs node for each file that should be
+represented as a device file under /dev/dahdi . The name for each file
+is 'dahdi!<something>'. The '!' is interpeted by udev as a directory
+seperator, and hence this will create the device file
+/dev/dahdi/<something>. See <<_dahdi_device_files,Dahdi Device Files>>
+above for more information.
+
+
+/sys/devices/dahdi/span-NNN
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+This node (directory) represents dahdi span no. NNN (e.g. 'span-003' for
+span 3). Spans may also have some span-specific attributes. Its
+attributes include:
+
+===== /sys/devices/dahdi/span-NNN/desc
+String. The span description.
+
+===== /sys/devices/dahdi/span-NNN/devicetype
+String. The span's device's "device type".
+
+===== /sys/devices/dahdi/span-NNN/location
+String. The span's device's location in the system. On most PCI devices
+this is something in the lines of 'PCI Bus 03 Slot 14'. On an Astribank
+this is the connector field.
+
+===== /sys/devices/dahdi/span-NNN/manufacturer
+String. The span's device's manufacturer.
+
+===== /sys/devices/dahdi/span-NNN/name
+String. The name of the span. More terse than the desc above.
+
+===== /sys/devices/dahdi/span-NNN/spantype
+String. The type of the span. May be '<NULL>' for some analog spans.
+
+===== /sys/devices/dahdi/span-NNN/battery
+===== /sys/devices/dahdi/span-NNN/offhook
+Those are two example fields that are specific to the driver wcfxo.
+
+
+/sys/devices/dahdi/span-NNN/NNN:MM
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+A sysfs node (directory) that represents channel MM in span NNN. E.g.
+for channel number 40 in dahdi span 3 you will get
+'/sys/devices/dahdi/span-003/40'. Note that the numbering of the
+channels is global rather than per-span.
+
+Channel attributes will need to be filled in here when there are some.
+
ABI Compatibility
~~~~~~~~~~~~~~~~~
More information about the dahdi-commits
mailing list