[PATCH] aoe: add firmware version to info in sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[PATCH] aoe: add firmware version to info in sysfs

add firmware version to info in sysfs

Signed-off-by: Ed L. Cashin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
commit 4613ed277ab8a41640434181898ef4649cc7301e
tree a1993e2276302a253f73e5139347e9ab374561bc
parent 93d489fc56f819d8805d80ae83cbafc5e5719804
author Ed L Cashin <[email protected]> 1114784665 -0400
committer Greg KH <[email protected]> 1115188495 -0700

Index: drivers/block/aoe/aoeblk.c
===================================================================
--- 946adcae0abe20dc6d9d58682ea2d6980efd1a4c/drivers/block/aoe/aoeblk.c  (mode:100644 sha1:4780f7926d4292bc8150e2712ea18d8a11204ec2)
+++ a1993e2276302a253f73e5139347e9ab374561bc/drivers/block/aoe/aoeblk.c  (mode:100644 sha1:0e97fcb9f3a15b3bbe5b4a0bb8bd085c20e05b2b)
@@ -37,6 +37,13 @@
 
 	return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name);
 }
+/* firmware version */
+static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page)
+{
+	struct aoedev *d = disk->private_data;
+
+	return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver);
+}
 
 static struct disk_attribute disk_attr_state = {
 	.attr = {.name = "state", .mode = S_IRUGO },
@@ -50,6 +57,10 @@
 	.attr = {.name = "netif", .mode = S_IRUGO },
 	.show = aoedisk_show_netif
 };
+static struct disk_attribute disk_attr_fwver = {
+	.attr = {.name = "firmware-version", .mode = S_IRUGO },
+	.show = aoedisk_show_fwver
+};
 
 static void
 aoedisk_add_sysfs(struct aoedev *d)
@@ -57,6 +68,7 @@
 	sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr);
 	sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr);
 	sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr);
+	sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr);
 }
 void
 aoedisk_rm_sysfs(struct aoedev *d)
@@ -64,6 +76,7 @@
 	sysfs_remove_link(&d->gd->kobj, "state");
 	sysfs_remove_link(&d->gd->kobj, "mac");
 	sysfs_remove_link(&d->gd->kobj, "netif");
+	sysfs_remove_link(&d->gd->kobj, "firmware-version");
 }
 
 static int

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux