From: "Salyzyn, Mark" <Mark_Salyzyn@adaptec.com>
To: "'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: [RFC] aacraid: driver feature flags?
Date: Fri, 11 Jan 2008 08:41:04 -0800 [thread overview]
Message-ID: <532ABFBDAAC3A34EB12EBA6CEC2838F437E44117@ADPE2K703.adaptec.com> (raw)
In-Reply-To: <532ABFBDAAC3A34EB12EBA6CEC2838F437E96989@ADPE2K703.adaptec.com>
Feature enhancement.
Do we have a developing standard on how a driver may report to user tools via sysfs what features are supported or not by the driver? In the following I am proposing a 'flags' entry that will reside in the host controllers tree, with a newline separated list of arbitrary ascii named features that indicate whether the combination of driver and controller has support for said feature. Breaking from the one-line output typical of sysfs entries, newline was added to tailor for grep, or simple gets line by line string match within an application. I added one for a compiler time check for existence of debug print output, one for an optional manifest defined enhanced status reporting in the logs, and one for runtime reporting whether the controller and driver supports arrays larger than 2TB to my example below.
Suggestions?
This following patch is against current scsi-misc-2.6
ObligatoryDisclaimer: Please accept my condolences regarding Outlook's handling of patch attachments, so one can NOT use the following to patch, it is only present to demonstrate the idea.
drivers/scsi/aacraid/linit.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff -ru a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
--- a/drivers/scsi/aacraid/linit.c 2008-01-11 11:19:11.378159940 -0500
+++ b/drivers/scsi/aacraid/linit.c 2008-01-11 11:23:19.040145945 -0500
@@ -788,6 +788,23 @@
return len;
}
+static ssize_t aac_show_flags(struct class_device *class_dev, char *buf)
+{
+ int len = 0;
+ struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
+
+ if (nblank(dprintk(x)))
+ len = snprintf(buf, PAGE_SIZE, "dprintk\n");
+# ifdef AAC_DETAILED_STATUS_INFO
+ len += snprintf(buf + len, PAGE_SIZE - len,
+ "AAC_DETAILED_STATUS_INFO\n");
+# endif
+ if (dev->raw_io_interface && dev->raw_io_64)
+ len += snprintf(buf + len, PAGE_SIZE - len,
+ "SAI_READ_CAPACITY_16\n");
+ return len;
+}
+
static ssize_t aac_show_kernel_version(struct class_device *class_dev,
char *buf)
{
@@ -897,6 +914,13 @@
},
.show = aac_show_vendor,
};
+static struct class_device_attribute aac_flags = {
+ .attr = {
+ .name = "flags",
+ .mode = S_IRUGO,
+ },
+ .show = aac_show_flags,
+};
static struct class_device_attribute aac_kernel_version = {
.attr = {
.name = "hba_kernel_version",
@@ -951,6 +975,7 @@
static struct class_device_attribute *aac_attrs[] = {
&aac_model,
&aac_vendor,
+ &aac_flags,
&aac_kernel_version,
&aac_monitor_version,
&aac_bios_version,
prev parent reply other threads:[~2008-01-11 16:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 4:02 [PATCH] aacraid: don't assign cpu_to_le32(constant) to u8 Stephen Rothwell
2007-10-31 13:53 ` Salyzyn, Mark
2007-11-01 6:32 ` [PATCHv2] " Stephen Rothwell
2007-11-01 13:11 ` Salyzyn, Mark
2007-11-01 13:31 ` Andreas Schwab
2007-11-07 15:58 ` [PATCH 1/1] aacraid: don't assign cpu_to_le32(int) " Salyzyn, Mark
2007-11-07 17:33 ` Christoph Hellwig
2007-11-07 18:51 ` Salyzyn, Mark
2007-11-08 17:27 ` Christoph Hellwig
2007-11-08 18:09 ` Salyzyn, Mark
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE734@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE735@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE736@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE738@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE739@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F40FE73E@ADPE2K703.adaptec.com>
[not found] ` <532ABFBDAAC3A34EB12EBA6CEC2838F437E96989@ADPE2K703.adaptec.com>
2008-01-11 16:41 ` Salyzyn, Mark [this message]
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=532ABFBDAAC3A34EB12EBA6CEC2838F437E44117@ADPE2K703.adaptec.com \
--to=mark_salyzyn@adaptec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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
all inboxes | Powered by JetHome®