From 2894bcf9effd6960bd1bf5054d2c4817f501d67c Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Thu, 5 Nov 2009 09:10:38 +0000 Subject: xpp: Add sysfs xpd attribute 'timing_priority' Merged revisions 7237 via svnmerge from http://svn.digium.com/svn/dahdi/linux/trunk git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.2@7491 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/xbus-sysfs.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index 7f570ea..3f3aa25 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, }; -- cgit v1.2.3