From: Ed L Cashin <ecashin@coraid.com>
To: linux-kernel@vger.kernel.org
Cc: ecashin@coraid.com, Greg K-H <greg@kroah.com>
Subject: [PATCH 2.6.12-rc2] aoe [5/6]: add firmware version to info in sysfs
Date: Wed, 20 Apr 2005 13:06:04 -0400 [thread overview]
Message-ID: <87d5spnzsz.fsf@coraid.com> (raw)
In-Reply-To: 874qe1pejv.fsf@coraid.com
add firmware version to info in sysfs
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
diff -uprN a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
--- a/drivers/block/aoe/aoeblk.c 2005-04-20 11:41:18.000000000 -0400
+++ b/drivers/block/aoe/aoeblk.c 2005-04-20 11:42:23.000000000 -0400
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct
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 @@ static struct disk_attribute disk_attr_n
.attr = {.name = "netif", .mode = S_IRUGO },
.show = aoedisk_show_netif
};
+static struct disk_attribute disk_attr_fwver = {
+ .attr = {.name = "fwver", .mode = S_IRUGO },
+ .show = aoedisk_show_fwver
+};
static void
aoedisk_add_sysfs(struct aoedev *d)
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d)
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 @@ aoedisk_rm_sysfs(struct aoedev *d)
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, "fwver");
}
static int
--
Ed L. Cashin <ecashin@coraid.com>
next prev parent reply other threads:[~2005-04-20 17:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-20 17:02 [PATCH 2.6.12-rc2] aoe [1/6]: improve allowed interfaces configuration Ed L Cashin
2005-04-20 17:05 ` [PATCH 2.6.12-rc2] aoe [2/6]: aoe-stat should work for built-in as well as module Ed L Cashin
2005-04-20 17:05 ` [PATCH 2.6.12-rc2] aoe [3/6]: update the documentation to mention aoetools Ed L Cashin
2005-04-20 17:06 ` [PATCH 2.6.12-rc2] aoe [4/6]: allow multiple aoe devices to have the same mac Ed L Cashin
2005-04-20 17:06 ` Ed L Cashin [this message]
2005-04-20 17:37 ` [PATCH 2.6.12-rc2] aoe [5/6]: add firmware version to info in sysfs Randy.Dunlap
2005-04-20 19:13 ` Ed L Cashin
2005-04-20 17:06 ` [PATCH 2.6.12-rc2] aoe [6/6]: update version number to 10 Ed L Cashin
2005-04-20 17:16 ` [PATCH 2.6.12-rc2] aoe [1/6]: improve allowed interfaces configuration Randy.Dunlap
2005-04-20 17:27 ` Ed L Cashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d5spnzsz.fsf@coraid.com \
--to=ecashin@coraid.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox