From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: james.bottomley@hansenpartnership.com
Cc: justin.lindley@hp.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, stephenmcameron@gmail.com,
joseph.t.handzik@hp.com, thenzl@redhat.com,
michael.miller@canonical.com, elliott@hp.com, scott.teel@hp.com
Subject: [PATCH 14/19] hpsa: define extended_report_lun_entry data structure
Date: Thu, 08 May 2014 14:28:35 -0500 [thread overview]
Message-ID: <20140508192835.13481.27192.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20140508192239.13481.81880.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>
---
drivers/scsi/hpsa.c | 21 ++++++++-------------
drivers/scsi/hpsa_cmd.h | 12 +++++++++++-
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c6ed5ea..96436bb 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2869,26 +2869,20 @@ static int hpsa_get_pdisk_of_ioaccel2(struct ctlr_info *h,
nphysicals = be32_to_cpu(*((__be32 *)physicals->LUNListLength)) /
responsesize;
-
/* find ioaccel2 handle in list of physicals: */
for (i = 0; i < nphysicals; i++) {
+ struct ext_report_lun_entry *entry = &physicals->LUN[i];
+
/* handle is in bytes 28-31 of each lun */
- if (memcmp(&((struct ReportExtendedLUNdata *)
- physicals)->LUN[i][20], &find, 4) != 0) {
+ if (entry->ioaccel_handle != find)
continue; /* didn't match */
- }
found = 1;
- memcpy(scsi3addr, &((struct ReportExtendedLUNdata *)
- physicals)->LUN[i][0], 8);
+ memcpy(scsi3addr, entry->lunid, 8);
if (h->raid_offload_debug > 0)
dev_info(&h->pdev->dev,
- "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%02x%02x%02x%02x%02x%02x%02x%02x\n",
+ "%s: Searched h=0x%08x, Found h=0x%08x, scsiaddr 0x%8phN\n",
__func__, find,
- ((struct ReportExtendedLUNdata *)
- physicals)->LUN[i][20],
- scsi3addr[0], scsi3addr[1], scsi3addr[2],
- scsi3addr[3], scsi3addr[4], scsi3addr[5],
- scsi3addr[6], scsi3addr[7]);
+ entry->ioaccel_handle, scsi3addr);
break; /* found it */
}
@@ -2973,7 +2967,8 @@ u8 *figure_lunaddrbytes(struct ctlr_info *h, int raid_ctlr_position, int i,
return RAID_CTLR_LUNID;
if (i < logicals_start)
- return &physdev_list->LUN[i - (raid_ctlr_position == 0)][0];
+ return &physdev_list->LUN[i -
+ (raid_ctlr_position == 0)].lunid[0];
if (i < last_device)
return &logdev_list->LUN[i - nphysicals -
diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h
index 55215d3..e394542 100644
--- a/drivers/scsi/hpsa_cmd.h
+++ b/drivers/scsi/hpsa_cmd.h
@@ -238,11 +238,21 @@ struct ReportLUNdata {
u8 LUN[HPSA_MAX_LUN][8];
};
+struct ext_report_lun_entry {
+ u8 lunid[8];
+ u8 wwid[8];
+ u8 device_type;
+ u8 device_flags;
+ u8 lun_count; /* multi-lun device, how many luns */
+ u8 redundant_paths;
+ u32 ioaccel_handle; /* ioaccel1 only uses lower 16 bits */
+};
+
struct ReportExtendedLUNdata {
u8 LUNListLength[4];
u8 extended_response_flag;
u8 reserved[3];
- u8 LUN[HPSA_MAX_LUN][24];
+ struct ext_report_lun_entry LUN[HPSA_MAX_LUN];
};
struct SenseSubsystem_info {
next prev parent reply other threads:[~2014-05-08 19:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 19:27 [PATCH 00/19] hpsa driver updates May 8, 2014 Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 01/19] hpsa: add new Smart Array PCI IDs (May 2014) Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 02/19] Checking for a NULL return from a kzalloc call in hpsa_get_pdisk_of_ioaccel2 Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 03/19] hpsa: remove unused fields from struct ctlr_info Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 04/19] hpsa: allow passthru ioctls to work with bidirectional commands Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 05/19] hpsa: change doorbell reset delay to ten seconds Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 06/19] hpsa: use gcc aligned attribute instead of manually padding structs Stephen M. Cameron
2014-05-08 19:27 ` [PATCH 07/19] hpsa: remove dev_dbg() calls from hot paths Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 08/19] hpsa: choose number of reply queues more intelligently Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 09/19] hpsa: allocate reply queues individually Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 10/19] hpsa: set irq affinity hints to route MSI-X vectors across CPUs Stephen M. Cameron
2014-05-08 21:11 ` Govindarajulu Varadarajan
2014-05-08 22:04 ` Elliott, Robert (Server Storage)
2014-05-08 19:28 ` [PATCH 11/19] hpsa: use per-cpu variable for lockup_detected Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 12/19] hpsa: avoid unnecessary readl on every command submission Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 13/19] hpsa: Rearrange start_io to avoid one unlock/lock sequence in main io path Stephen M. Cameron
2014-05-08 19:28 ` Stephen M. Cameron [this message]
2014-05-08 19:28 ` [PATCH 15/19] hpsa: kill annoying messages about SSD Smart Path retries Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 16/19] hpsa: fix event filtering to prevent excessive rescans with old firmware Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 17/19] hpsa: remove bad unlikely annotation from device list updating code Stephen M. Cameron
2014-05-08 19:28 ` [PATCH 18/19] hpsa: report check condition even if no sense data present for ioaccel2 mode Stephen M. Cameron
2014-05-08 19:29 ` [PATCH 19/19] hpsa: remove messages about volume status VPD inquiry page not supported Stephen M. Cameron
2014-05-19 17:18 ` [PATCH 00/19] hpsa driver updates May 8, 2014 Christoph Hellwig
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=20140508192835.13481.27192.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=elliott@hp.com \
--cc=james.bottomley@hansenpartnership.com \
--cc=joseph.t.handzik@hp.com \
--cc=justin.lindley@hp.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.miller@canonical.com \
--cc=scott.teel@hp.com \
--cc=stephenmcameron@gmail.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;
as well as URLs for NNTP newsgroup(s).