From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: james.bottomley@hansenpartnership.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
mike.mikem@beardog.cce.hp.com, thenzl@redhat.com,
akpm@linux-foundation.org, smcameron@yahoo.com
Subject: [PATCH 3/6] hpsa: Add transport_mode host attribute in /sys
Date: Tue, 15 Feb 2011 15:32:58 -0600 [thread overview]
Message-ID: <20110215213258.5407.32366.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20110215212856.5407.3438.stgit@beardog.cce.hp.com>
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
Documentation/scsi/hpsa.txt | 5 +++++
drivers/scsi/hpsa.c | 18 +++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/Documentation/scsi/hpsa.txt b/Documentation/scsi/hpsa.txt
index dca6583..ed524f1 100644
--- a/Documentation/scsi/hpsa.txt
+++ b/Documentation/scsi/hpsa.txt
@@ -39,6 +39,7 @@ HPSA specific entries in /sys
/sys/class/scsi_host/host*/rescan
/sys/class/scsi_host/host*/firmware_revision
+ /sys/class/scsi_host/host*/transport_mode
the host "rescan" attribute is a write only attribute. Writing to this
attribute will cause the driver to scan for new, changed, or removed devices
@@ -55,6 +56,10 @@ HPSA specific entries in /sys
root@host:/sys/class/scsi_host/host4# cat firmware_revision
7.14
+ The transport_mode indicates whether the controller is in "performant"
+ or "simple" mode. This is controlled by the "hpsa_simple_mode" module
+ parameter.
+
HPSA specific disk attributes:
------------------------------
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 66ccacf..563d439 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -161,6 +161,8 @@ static ssize_t host_show_firmware_revision(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t host_show_commands_outstanding(struct device *dev,
struct device_attribute *attr, char *buf);
+static ssize_t host_show_transport_mode(struct device *dev,
+ struct device_attribute *attr, char *buf);
static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno);
static ssize_t host_store_rescan(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count);
@@ -192,6 +194,8 @@ static DEVICE_ATTR(firmware_revision, S_IRUGO,
host_show_firmware_revision, NULL);
static DEVICE_ATTR(commands_outstanding, S_IRUGO,
host_show_commands_outstanding, NULL);
+static DEVICE_ATTR(transport_mode, S_IRUGO,
+ host_show_transport_mode, NULL);
static struct device_attribute *hpsa_sdev_attrs[] = {
&dev_attr_raid_level,
@@ -204,6 +208,7 @@ static struct device_attribute *hpsa_shost_attrs[] = {
&dev_attr_rescan,
&dev_attr_firmware_revision,
&dev_attr_commands_outstanding,
+ &dev_attr_transport_mode,
NULL,
};
@@ -313,6 +318,18 @@ static ssize_t host_show_commands_outstanding(struct device *dev,
return snprintf(buf, 20, "%d\n", h->commands_outstanding);
}
+static ssize_t host_show_transport_mode(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct ctlr_info *h;
+ struct Scsi_Host *shost = class_to_shost(dev);
+
+ h = shost_to_hba(shost);
+ return snprintf(buf, 20, "%s\n",
+ h->transMethod == CFGTBL_Trans_Performant ?
+ "performant" : "simple");
+}
+
/* Enqueuing and dequeuing functions for cmdlists. */
static inline void addQ(struct list_head *list, struct CommandList *c)
{
@@ -3768,7 +3785,6 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev,
h->pdev = pdev;
h->busy_initializing = 1;
h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT;
- printk(KERN_WARNING "hpsa_simple_mode is %d\n", hpsa_simple_mode);
INIT_LIST_HEAD(&h->cmpQ);
INIT_LIST_HEAD(&h->reqQ);
spin_lock_init(&h->lock);
next prev parent reply other threads:[~2011-02-15 21:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 21:32 [PATCH 0/6] hpsa: Feb 15, 2011 updates Stephen M. Cameron
2011-02-15 21:32 ` [PATCH 1/6] hpsa: do not re-order commands in internal queues Stephen M. Cameron
2011-02-15 21:32 ` [PATCH 2/6] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually work Stephen M. Cameron
2011-02-15 21:32 ` Stephen M. Cameron [this message]
2011-02-15 21:33 ` [PATCH 4/6] hpsa: Inform controller we are using 32-bit tags Stephen M. Cameron
2011-02-15 21:33 ` [PATCH 5/6] hpsa: Do not attempt kdump if we detect resetting controller failed Stephen M. Cameron
2011-02-15 21:33 ` [PATCH 6/6] hpsa: fix bad comparison Stephen M. Cameron
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=20110215213258.5407.32366.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=akpm@linux-foundation.org \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mike.mikem@beardog.cce.hp.com \
--cc=smcameron@yahoo.com \
--cc=thenzl@redhat.com \
/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