summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-09-29 16:14:19 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-09-29 16:14:19 +0000
commit3f652d418dd89b1a4b84923afe9ee84b21d0e7e0 (patch)
treeb3def93e7ab1aae1e359b0e73bc5f5110aa58c58 /drivers/dahdi/xpp
parentdc271ee187704032407459958ba47c0ce5fd7155 (diff)
xpp: Add sysfs xpd attribute 'timing_priority'
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7237 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/xpp')
-rw-r--r--drivers/dahdi/xpp/xbus-sysfs.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c
index df9f49a..35895ca 100644
--- a/drivers/dahdi/xpp/xbus-sysfs.c
+++ b/drivers/dahdi/xpp/xbus-sysfs.c
@@ -118,7 +118,7 @@ static DEVICE_ATTR_READER(timing_show, dev, buf)
do_gettimeofday(&now);
xbus = dev_to_xbus(dev);
driftinfo = &xbus->drift;
- len += snprintf(buf + len, PAGE_SIZE - len, "DRIFT: %-3s", sync_mode_name(xbus->sync_mode));
+ len += snprintf(buf + len, PAGE_SIZE - len, "%-3s", sync_mode_name(xbus->sync_mode));
if(xbus->sync_mode == SYNC_MODE_PLL) {
len += snprintf(buf + len, PAGE_SIZE - len,
" %5d: jitter %4d median %4d calc_drift %3d lost (%4d,%4d) : ",
@@ -636,6 +636,22 @@ static DEVICE_ATTR_READER(offhook_show, dev, buf)
return len;
}
+static DEVICE_ATTR_READER(timing_priority_show, dev, buf)
+{
+ xpd_t *xpd;
+ unsigned long flags;
+ int len = 0;
+
+ BUG_ON(!dev);
+ xpd = dev_to_xpd(dev);
+ if(!xpd)
+ return -ENODEV;
+ spin_lock_irqsave(&xpd->lock, flags);
+ len += sprintf(buf + len, "%d\n", xpd->timing_priority);
+ spin_unlock_irqrestore(&xpd->lock, flags);
+ return len;
+}
+
static int xpd_match(struct device *dev, struct device_driver *driver)
{
struct xpd_driver *xpd_driver;
@@ -659,6 +675,7 @@ static struct device_attribute xpd_dev_attrs[] = {
__ATTR(span, S_IRUGO | S_IWUSR, span_show, span_store),
__ATTR_RO(type),
__ATTR_RO(offhook),
+ __ATTR_RO(timing_priority),
__ATTR_NULL,
};