From 41279a8dcc318a59cad7b66da0a6edbb8bcad7dd Mon Sep 17 00:00:00 2001 From: Dima Stoliarov Date: Sun, 10 Apr 2016 15:46:52 +0300 Subject: [PATCH] xpp: added hwid attribute Signed-off-by: Tzafrir Cohen --- drivers/dahdi/xpp/xbus-sysfs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index 376215a..de84dad 100644 --- a/drivers/dahdi/xpp/xbus-sysfs.c +++ b/drivers/dahdi/xpp/xbus-sysfs.c @@ -676,6 +676,19 @@ static DEVICE_ATTR_READER(type_show, dev, buf) return len; } +static DEVICE_ATTR_READER(hwid_show, dev, buf) +{ + xpd_t *xpd; + int len = 0; + + BUG_ON(!dev); + xpd = dev_to_xpd(dev); + if (!xpd) + return -ENODEV; + len += sprintf(buf, "%d.%d\n", XPD_HW(xpd).type, XPD_HW(xpd).subtype); + return len; +} + static DEVICE_ATTR_READER(offhook_show, dev, buf) { xpd_t *xpd; @@ -749,6 +762,7 @@ static struct device_attribute xpd_dev_attrs[] = { __ATTR(blink, S_IRUGO | S_IWUSR, blink_show, blink_store), __ATTR(span, S_IRUGO | S_IWUSR, span_show, span_store), __ATTR_RO(type), + __ATTR_RO(hwid), __ATTR_RO(offhook), __ATTR_RO(timing_priority), __ATTR_RO(refcount_xpd),