[dahdi-commits] tzafrir: branch linux/tzafrir/sysfs r8614 - /linux/team/tzafrir/sysfs/README

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed May 5 09:20:23 CDT 2010


Author: tzafrir
Date: Wed May  5 09:20:19 2010
New Revision: 8614

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8614
Log:
Document recent kernel-level changes in the branch.

Modified:
    linux/team/tzafrir/sysfs/README

Modified: linux/team/tzafrir/sysfs/README
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/README?view=diff&rev=8614&r1=8613&r2=8614
==============================================================================
--- linux/team/tzafrir/sysfs/README (original)
+++ linux/team/tzafrir/sysfs/README Wed May  5 09:20:19 2010
@@ -435,23 +435,6 @@
 or dynamically through the udev system.
 
 
-Channel Device Files
-^^^^^^^^^^^^^^^^^^^^
-DAHDI will dynamically allocate a separate major number and create a
-device file under /dev/dahdi per channel. Its name is the name of the
-channel. It could be used to reading from the chanel and writing to it,
-as well as applying various control operations using ioctl().
-
-The minor number of that file is the same as those of the device.
-
-It is possible, and recommended, to use udev to generate more logical
-names to those channel device files. See the script dahdi_symlinks on
-how to maintain more logical names for DAHDI channels.
-
-(This interface was originally limited with up to channel no. 249, and
-hence using /dev/dahdi/channel was preffered).
-
-
 Control Device Files
 ^^^^^^^^^^^^^^^^^^^^
 * /dev/dahdi/ctl (196:0) - a general device file for various information and
@@ -468,6 +451,25 @@
   same timing as the DAHDI timing master device.
 
 
+Channel Device Files
+^^^^^^^^^^^^^^^^^^^^
+DAHDI will dynamically allocate a separate major number and create a
+device file under /dev/dahdi per channel: /dev/dahdi/span-MMM/NN, where
+MMM is the number of the span, and NN is the number of the channel. The
+minor number of the device file is the same as the (global) DAHDI
+channel number. With standard UDEV rules you will also get /dev/dahdi/N
+(where N is the global channel number) as a symlink to the real device
+file.
+
+The channel-specific device file could be used to reading from the chanel
+and writing to it, as well as applying various control operations using
+ioctl().
+
+(This interface was originally limited with up to channel no. 249, and
+hence using /dev/dahdi/channel was preffered, nad the device file, and
+the file name was /dev/dahdi/N ).
+
+
 DAHDI Timing
 ~~~~~~~~~~~~
 A PBX system should generally have a single clock. If you are connected to a
@@ -658,21 +660,23 @@
 
 /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/class/dahdi_span/span-NNN
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Includes a very simple sysfs node for each of the special devices. See
+<<_control_device_files,Control Device Files>> above.
+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>.  
+
+
+/sys/bus/dahdi_span/devices/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/class/dahdi_span/span-NNN/alarms
+Currently all spans use a generic driver. However it should be possible
+for a module to provide its own "driver".
+
+===== /sys/bus/dahdi_span/devices/span-NNN/alarms
 (Hex) integer. A bitmask that represents the alarms this span has.
 
 * 1: Recovering from alarm
@@ -684,84 +688,105 @@
 
 FIXME: textual representation? Values are defined in dahdi/user.h .
 
-===== /sys/class/dahdi_span/span-NNN/desc
+===== /sys/bus/dahdi_span/devices/span-NNN/desc
 String. The span description.
 
-===== /sys/class/dahdi_span/span-NNN/name
+===== /sys/bus/dahdi_span/devices/span-NNN/name
 String. The name of the span. More terse than the desc above.
 
-===== /sys/class/dahdi_span/span-NNN/devicetype
+===== /sys/bus/dahdi_span/devices/span-NNN/devicetype
 String. The span's device's "device type".
 
-===== /sys/class/dahdi_span/span-NNN/irq
+===== /sys/bus/dahdi_span/devices/span-NNN/hardware_id
+String. An optional unique identifier (e.g.: serial number) of the
+device containing this span.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/hardware_port
+String. The number of the port inside the device contaning this span.
+The combination (location, hardware_port) should be unique. Likewise the
+combination (hardware_id, hardware port) if all devices have a hardware
+ID. For devices with a single span it is normally just '0'.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/irq
 String. The span's device IRQ line.
 
-===== /sys/class/dahdi_span/span-NNN/irqmisses
+===== /sys/bus/dahdi_span/devices/span-NNN/irqmisses
 Integer. Counter for The span's device IRQ misses.
 
-===== /sys/class/dahdi_span/span-NNN/location
+===== /sys/bus/dahdi_span/devices/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/class/dahdi_span/span-NNN/manufacturer
+Note that in the perl interface, the content of this field is slightly
+cooked: spaces and some other special characters are replaced with '_'.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/manufacturer
 String. The span's device's manufacturer.
 
-===== /sys/class/dahdi_span/span-NNN/spantype
+===== /sys/bus/dahdi_span/devices/span-NNN/spantype
 String. The type of the span. May be '<NULL>' for some analog spans.
 
-===== /sys/class/dahdi_span/span-NNN/is_digital
+===== /sys/bus/dahdi_span/devices/span-NNN/is_digital
 1 if this span is capable of transporting digital calls. 0 otherwise.
 (0 is for analogs and also for dahdi_dummy).
 
-===== /sys/class/dahdi_span/span-NNN/is_sync_master
+===== /sys/bus/dahdi_span/devices/span-NNN/is_sync_master
 1 if this span is the one providing ticks to userspace (to DAHDI timers,
 pseudo channels, and such). 0 otherwise.
 
-===== /sys/class/dahdi_span/span-NNN/lbo
+===== /sys/bus/dahdi_span/devices/span-NNN/lbo
 Integer. The LBO (Line Build Out) parameter as configured for the span in
 system.conf. Only applies to digital spans. A number of devices blantly
 ignore that.
 
-===== /sys/class/dahdi_span/span-NNN/syncsrc
+===== /sys/bus/dahdi_span/devices/span-NNN/syncsrc
 Integer. The syncsrc parameter as configured for the span in
 system.conf. Only applies to digital spans. Used to set the sync source
 priority among different ports in the same device (only this meaning was
 overloaded for the xpp drvers. See README.Astribank).
 
-/sys/class/dahdi_span/span-NNN/NNN:MM
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+===== /sys/bus/dahdi_span/span-NNN/spantype
+String. A terse string describing the device (FIXME: provide a list of
+possible values).
+
+/sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 A sysfs node (directory) that represents channel MM in span NNN. E.g.
 for the second channels in dahdi span 3 you will get
-'/sys/class/dahdi_span/span-003/02'. 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.
-
-
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/blocksize
-Yea, we really need this one.
-
-
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/chan_alarms
-The current channel alarm this channel has.
-
-Values are the same as the ones of span alarms.
-
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/chanmute
+'/sys/bus/dahdi_span/devices/span-003/dahdi!spans!003!02'.
+
+This node can also be found at
+/sys/bus/dahdi_chan/devices/dahdi!spans!NNN:MM .
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/alarms
+Integer (hex). Bit-mask of alarms set for this channel. Similar to the
+one of the span.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/blocksize
+Integer. Block size used in reads and writes.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/chanmute
 1 if this channel is not passing audio due to the CHANMUTE code.
 0 otherwise. Only present if OPTIMIZE_CHANMUTE was enabled in dahdi_config.h .
 
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/channo
-MM from above. The global numbering of this DAHDI channel.
-
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/name
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/channo
+Integer. The global numbering of this DAHDI channel.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/dev
+Integers. The major number and minor number of this device.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/dev
+Boolean: 0 is no process has that channel open, and 1 if there is such a
+process.
+
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/name
 The name of the channel.
 
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/sig
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/sig
 The current signalling of the channel (hex).
 
-===== /sys/class/dahdi_span/span-NNN/NNN:MM/sigcap
+===== /sys/bus/dahdi_span/devices/span-NNN/dahdi!spans!NNN:MM/sigcap
 The signalling capability mask of the channel: all the possible 
 signalling bits the channel can used are set here.
 




More information about the dahdi-commits mailing list