diff options
author | Ed L Cashin <ecashin@coraid.com> | 2005-04-29 10:24:25 -0400 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-05-04 02:34:55 -0400 |
commit | 4613ed277ab8a41640434181898ef4649cc7301e (patch) | |
tree | a1993e2276302a253f73e5139347e9ab374561bc /drivers/block/aoe | |
parent | 93d489fc56f819d8805d80ae83cbafc5e5719804 (diff) |
[PATCH] aoe: add firmware version to info in sysfs
add firmware version to info in sysfs
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 4780f7926d42..0e97fcb9f3a1 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page) | |||
37 | 37 | ||
38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); | 38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); |
39 | } | 39 | } |
40 | /* firmware version */ | ||
41 | static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page) | ||
42 | { | ||
43 | struct aoedev *d = disk->private_data; | ||
44 | |||
45 | return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver); | ||
46 | } | ||
40 | 47 | ||
41 | static struct disk_attribute disk_attr_state = { | 48 | static struct disk_attribute disk_attr_state = { |
42 | .attr = {.name = "state", .mode = S_IRUGO }, | 49 | .attr = {.name = "state", .mode = S_IRUGO }, |
@@ -50,6 +57,10 @@ static struct disk_attribute disk_attr_netif = { | |||
50 | .attr = {.name = "netif", .mode = S_IRUGO }, | 57 | .attr = {.name = "netif", .mode = S_IRUGO }, |
51 | .show = aoedisk_show_netif | 58 | .show = aoedisk_show_netif |
52 | }; | 59 | }; |
60 | static struct disk_attribute disk_attr_fwver = { | ||
61 | .attr = {.name = "firmware-version", .mode = S_IRUGO }, | ||
62 | .show = aoedisk_show_fwver | ||
63 | }; | ||
53 | 64 | ||
54 | static void | 65 | static void |
55 | aoedisk_add_sysfs(struct aoedev *d) | 66 | aoedisk_add_sysfs(struct aoedev *d) |
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d) | |||
57 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); | 68 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); |
58 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); | 69 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); |
59 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); | 70 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); |
71 | sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr); | ||
60 | } | 72 | } |
61 | void | 73 | void |
62 | aoedisk_rm_sysfs(struct aoedev *d) | 74 | aoedisk_rm_sysfs(struct aoedev *d) |
@@ -64,6 +76,7 @@ aoedisk_rm_sysfs(struct aoedev *d) | |||
64 | sysfs_remove_link(&d->gd->kobj, "state"); | 76 | sysfs_remove_link(&d->gd->kobj, "state"); |
65 | sysfs_remove_link(&d->gd->kobj, "mac"); | 77 | sysfs_remove_link(&d->gd->kobj, "mac"); |
66 | sysfs_remove_link(&d->gd->kobj, "netif"); | 78 | sysfs_remove_link(&d->gd->kobj, "netif"); |
79 | sysfs_remove_link(&d->gd->kobj, "firmware-version"); | ||
67 | } | 80 | } |
68 | 81 | ||
69 | static int | 82 | static int |