[dahdi-commits] dahdi/linux.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Sun Oct 13 15:33:32 CDT 2013


branch "master" has been updated
       via  d4c8eb47ac369c41343bba399a028842580529b1 (commit)
      from  2bd36a3307ec9f20e9538de08f8d2eec1f9828a9 (commit)

Summary of changes:
 drivers/dahdi/dahdi-sysfs.c |   11 +++++++++++
 1 file changed, 11 insertions(+)


- Log -----------------------------------------------------------------
commit d4c8eb47ac369c41343bba399a028842580529b1
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Sun Sep 29 10:04:32 2013 +0200

    add a 'location' attribute to sysfs (dahdi_device):
    
    * Our user-space previously used the implicit location from the sysfs
      device path of the "dahdi_device".
    * However:
      - Sysfs paths are very limited in length.
      - Low-level driver need more control on the location field.
      - For example, it need to be persistant for span_assignments.
    * We now export explicitly the 'location' field which is managed by
      low-level drivers.
    * We will use this field as the location in span_assignments.
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/drivers/dahdi/dahdi-sysfs.c b/drivers/dahdi/dahdi-sysfs.c
index 1715f8f..2b50c3f 100644
--- a/drivers/dahdi/dahdi-sysfs.c
+++ b/drivers/dahdi/dahdi-sysfs.c
@@ -403,6 +403,16 @@ dahdi_device_hardware_id_show(struct device *dev,
 }
 
 static ssize_t
+dahdi_device_location_show(struct device *dev,
+			     struct device_attribute *attr, char *buf)
+{
+	struct dahdi_device *ddev = to_ddev(dev);
+
+	return sprintf(buf, "%s\n",
+		(ddev->location) ? ddev->location : "");
+}
+
+static ssize_t
 dahdi_device_auto_assign(struct device *dev, struct device_attribute *attr,
 			 const char *buf, size_t count)
 {
@@ -549,6 +559,7 @@ static struct device_attribute dahdi_device_attrs[] = {
 	__ATTR(type, S_IRUGO, dahdi_device_type_show, NULL),
 	__ATTR(span_count, S_IRUGO, dahdi_device_span_count_show, NULL),
 	__ATTR(hardware_id, S_IRUGO, dahdi_device_hardware_id_show, NULL),
+	__ATTR(location, S_IRUGO, dahdi_device_location_show, NULL),
 	__ATTR(auto_assign, S_IWUSR, NULL, dahdi_device_auto_assign),
 	__ATTR(assign_span, S_IWUSR, NULL, dahdi_device_assign_span),
 	__ATTR(unassign_span, S_IWUSR, NULL, dahdi_device_unassign_span),

-----------------------------------------------------------------------


-- 
dahdi/linux.git



More information about the dahdi-commits mailing list