summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wcte12xp
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-04-26 23:29:16 +0000
committerShaun Ruffell <sruffell@digium.com>2010-04-26 23:29:16 +0000
commita7fcb5ecea3f415a8398ec04961f989a18017b0c (patch)
tree067e1d2c4c6c32be5cd6df0499424654a69a73d6 /drivers/dahdi/wcte12xp
parent83ba77163a3e206c086dd945991f134de939c6ec (diff)
wcte12xp, wctdm24xxp: Add vpm_firmware_version sysfs attribute.
Currently only exported if CONFIG_VOICEBUS_SYSFS is defined in drivers/dahdi/voicebus.h. Reading from the 'vpm_firmware_version' attribute will poll the firmware on the VPMADT032 for it's current version. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8574 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wcte12xp')
-rw-r--r--drivers/dahdi/wcte12xp/base.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index 42a7341..802f832 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -2112,6 +2112,29 @@ static ssize_t voicebus_current_latency_show(struct device *dev,
static DEVICE_ATTR(voicebus_current_latency, 0400,
voicebus_current_latency_show, NULL);
+
+static ssize_t vpm_firmware_version_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ int res;
+ u16 version = 0;
+ struct t1 *wc = dev_get_drvdata(dev);
+
+ if (wc->vpmadt032) {
+ res = gpakPingDsp(wc->vpmadt032->dspid, &version);
+ if (res) {
+ t1_info(wc, "Failed gpakPingDsp %d\n", res);
+ version = -1;
+ }
+ }
+
+ return sprintf(buf, "%x.%02x\n", (version & 0xff00) >> 8, (version & 0xff));
+}
+
+static DEVICE_ATTR(vpm_firmware_version, 0400,
+ vpm_firmware_version_show, NULL);
+
static void create_sysfs_files(struct t1 *wc)
{
int ret;
@@ -2121,11 +2144,21 @@ static void create_sysfs_files(struct t1 *wc)
dev_info(&wc->vb.pdev->dev,
"Failed to create device attributes.\n");
}
+
+ ret = device_create_file(&wc->vb.pdev->dev,
+ &dev_attr_vpm_firmware_version);
+ if (ret) {
+ dev_info(&wc->vb.pdev->dev,
+ "Failed to create device attributes.\n");
+ }
}
static void remove_sysfs_files(struct t1 *wc)
{
device_remove_file(&wc->vb.pdev->dev,
+ &dev_attr_vpm_firmware_version);
+
+ device_remove_file(&wc->vb.pdev->dev,
&dev_attr_voicebus_current_latency);
}