[svn-commits] tzafrir: linux/trunk r10286 - /linux/trunk/drivers/dahdi/dahdi-sysfs.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Oct 26 14:08:36 CDT 2011


Author: tzafrir
Date: Wed Oct 26 14:08:33 2011
New Revision: 10286

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10286
Log:
added 'basechan' and 'channels' attributes to spans

 * So we can:
   - Generate 'pinned-spans.conf' from existing state
   - Run dahdi_cfg from udev (on specific span + its channels)

Signed-off-by: Oron Peled <oron.peled at xorcom.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-sysfs.c

Modified: linux/trunk/drivers/dahdi/dahdi-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-sysfs.c?view=diff&rev=10286&r1=10285&r2=10286
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-sysfs.c Wed Oct 26 14:08:33 2011
@@ -246,6 +246,22 @@
 	return sprintf(buf, "%d\n", dahdi_is_sync_master(span));
 }
 
+static BUS_ATTR_READER(basechan_show, dev, buf)
+{
+	struct dahdi_span *span;
+
+	span = dev_to_span(dev);
+	return sprintf(buf, "%d\n", span->chans[0]->channo);
+}
+
+static BUS_ATTR_READER(channels_show, dev, buf)
+{
+	struct dahdi_span *span;
+
+	span = dev_to_span(dev);
+	return sprintf(buf, "%d\n", span->channels);
+}
+
 static struct device_attribute span_dev_attrs[] = {
 	__ATTR_RO(name),
 	__ATTR_RO(desc),
@@ -256,6 +272,8 @@
 	__ATTR_RO(syncsrc),
 	__ATTR_RO(is_digital),
 	__ATTR_RO(is_sync_master),
+	__ATTR_RO(basechan),
+	__ATTR_RO(channels),
 	__ATTR_NULL,
 };
 




More information about the svn-commits mailing list