[svn-commits] tzafrir: branch linux/tzafrir/sysfs r8438 - in /linux/team/tzafrir/sysfs: dri...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Mar 28 06:35:04 CDT 2010


Author: tzafrir
Date: Sun Mar 28 06:34:59 2010
New Revision: 8438

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8438
Log:
two new span attribtes: hardware_id and hardware_port

hardware_id: serial id or a similar identifier.
hardware port: a number of a port inside the device.

hardware_id may not belong inside the span, but is currently placed
there until we have a better place to represent a "DAHDI device".

Modified:
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c
    linux/team/tzafrir/sysfs/include/dahdi/kernel.h

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c?view=diff&rev=8438&r1=8437&r2=8438
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-sysfs.c Sun Mar 28 06:34:59 2010
@@ -89,6 +89,8 @@
 span_attr(manufacturer, "%s\n");
 span_attr(devicetype, "%s\n");
 span_attr(location, "%s\n");
+span_attr(hardware_id, "%s\n");
+span_attr(hardware_port, "%02d\n");
 span_attr(alarms, "0x%x\n");
 span_attr(irq, "%d\n");
 span_attr(irqmisses, "%d\n");
@@ -125,6 +127,8 @@
 	__ATTR_RO(manufacturer),
 	__ATTR_RO(devicetype),
 	__ATTR_RO(location),
+	__ATTR_RO(hardware_id),
+	__ATTR_RO(hardware_port),
 	__ATTR_RO(alarms),
 	__ATTR_RO(irq),
 	__ATTR_RO(irqmisses),

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c?view=diff&rev=8438&r1=8437&r2=8438
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xpp_dahdi.c Sun Mar 28 06:34:59 2010
@@ -1116,6 +1116,9 @@
 	snprintf(span->location, sizeof(span->location) - 1, "%s!%d%d",
 			xbus->connector, xpd->addr.unit,
 			xpd->addr.subunit); 
+	snprintf(span->hardware_id, sizeof(span->hardware_id) - 1, "%s",
+		xbus->label);
+	span->hardware_port = xpd->addr.unit * 10 + xpd->addr.subunit;
 	/*
 	 * Who said a span and irq have 1-1 relationship?
 	 * Also exporting this low-level detail isn't too wise.

Modified: linux/team/tzafrir/sysfs/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/tzafrir/sysfs/include/dahdi/kernel.h?view=diff&rev=8438&r1=8437&r2=8438
==============================================================================
--- linux/team/tzafrir/sysfs/include/dahdi/kernel.h (original)
+++ linux/team/tzafrir/sysfs/include/dahdi/kernel.h Sun Mar 28 06:34:59 2010
@@ -763,6 +763,8 @@
 	const char *manufacturer;	/*!< span's device manufacturer */
 	char devicetype[80];		/*!< span's device type */
 	char location[40];		/*!< span device's location in system */
+	char hardware_id[40];		/*!< span device's unique id (serial) */
+	int hardware_port;		/*!< span port number on its device */
 	int deflaw;			/*!< Default law (DAHDI_MULAW or DAHDI_ALAW) */
 	int alarms;			/*!< Pending alarms on span */
 	unsigned long flags;




More information about the svn-commits mailing list