From: Ke Wei <kewei.mv@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@hansenpartnership.com, jeff@garzik.org,
qswang@marvell.com, jfeng@marvell.com, qzhao@marvell.com,
lil@marvell.com, saeed.bishara@gmail.com, kewei@marvell.com
Subject: [PATCH] mvsas: Mainly add version info to run testing process.
Date: Wed, 27 Feb 2008 20:50:25 +0800 [thread overview]
Message-ID: <20080227125025.GA7897@ubuntu.domain> (raw)
1. Owing to device testing, we need the kernel can show mvsas current
version in the /proc system.
2. Set the correct SAS address to per port.
Signed-off-by: Ke Wei <kewei@marvell.com>
diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c
old mode 100644
new mode 100755
index d4a6ac3..3e56178
--- a/drivers/scsi/mvsas.c
+++ b/drivers/scsi/mvsas.c
@@ -40,7 +40,7 @@
#include <asm/io.h>
#define DRV_NAME "mvsas"
-#define DRV_VERSION "0.5"
+#define DRV_VERSION "0.5.1"
#define _MV_DUMP 0
#define MVS_DISABLE_NVRAM
#define MVS_DISABLE_MSI
@@ -645,6 +645,8 @@ static void mvs_update_phyinfo(struct mvs_info *mvi, int i, int get_st);
static int mvs_scan_finished(struct Scsi_Host *, unsigned long);
static void mvs_scan_start(struct Scsi_Host *);
static int mvs_sas_slave_alloc(struct scsi_device *scsi_dev);
+static int mvs_linux_proc_info(struct Scsi_Host *shost, char *buffer,
+ char **start, off_t offset, int length, int inout);
static struct scsi_transport_template *mvs_stt;
@@ -657,6 +659,8 @@ static const struct mvs_chip_info mvs_chips[] = {
static struct scsi_host_template mvs_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
+ .proc_name = DRV_NAME,
+ .proc_info = mvs_linux_proc_info,
.queuecommand = sas_queuecommand,
.target_alloc = sas_target_alloc,
.slave_configure = sas_slave_configure,
@@ -799,6 +803,29 @@ static void mvs_hba_cq_dump(struct mvs_info *mvi)
#endif
}
+static int mvs_linux_proc_info(struct Scsi_Host *shost, char *buffer,
+ char **start, off_t offset, int length, int inout)
+{
+ char *p = buffer;
+ int pos;
+ struct mvs_info *mvi = SHOST_TO_SAS_HA(shost)->lldd_ha;
+
+ if (inout == 1)
+ return -EINVAL;
+
+ p += sprintf(p, "Marvell 88SE64XX Driver , Version %s\n", DRV_VERSION);
+ p += sprintf(p, "%u phys, SAS addr %llX\n",
+ mvi->chip->n_phy, SAS_ADDR(mvi->sas_addr));
+
+ *start = buffer + offset;
+ pos = p - buffer - offset;
+ if (pos > length)
+ pos = length;
+
+ return pos;
+
+}
+
static void mvs_hba_interrupt_enable(struct mvs_info *mvi)
{
void __iomem *regs = mvi->regs;
@@ -1005,7 +1032,7 @@ err_out:
return rc;
#else
/* FIXME , For SAS target mode */
- memcpy(buf, "\x00\x00\xab\x11\x30\x04\x05\x50", 8);
+ memcpy(buf, "\x50\x05\x04\x30\x11\xab\x00\x00", 8);
return 0;
#endif
}
@@ -1330,7 +1357,7 @@ static int mvs_int_rx(struct mvs_info *mvi, bool self_clear)
mvs_hba_cq_dump(mvi);
- if (unlikely(rx_desc & RXQ_DONE))
+ if (likely(rx_desc & RXQ_DONE))
mvs_slot_complete(mvi, rx_desc);
if (rx_desc & RXQ_ATTN) {
attn = true;
@@ -2720,9 +2747,8 @@ static int __devinit mvs_hw_init(struct mvs_info *mvi)
msleep(100);
/* init and reset phys */
for (i = 0; i < mvi->chip->n_phy; i++) {
- /* FIXME: is this the correct dword order? */
- u32 lo = *((u32 *)&mvi->sas_addr[0]);
- u32 hi = *((u32 *)&mvi->sas_addr[4]);
+ u32 lo = swab32p((u32 *)&mvi->sas_addr[4]);
+ u32 hi = swab32p((u32 *)&mvi->sas_addr[0]);
mvs_detect_porttype(mvi, i);
next reply other threads:[~2008-02-27 12:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-27 12:50 Ke Wei [this message]
2008-02-27 16:22 ` [PATCH] mvsas: Mainly add version info to run testing process James Bottomley
2008-02-28 3:16 ` Ke Wei
2008-02-28 23:51 ` Jeff Garzik
2008-02-29 1:15 ` James Bottomley
2008-02-29 13:34 ` Ke Wei
2008-02-29 17:04 ` James Bottomley
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=20080227125025.GA7897@ubuntu.domain \
--to=kewei.mv@gmail.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jeff@garzik.org \
--cc=jfeng@marvell.com \
--cc=kewei@marvell.com \
--cc=lil@marvell.com \
--cc=linux-scsi@vger.kernel.org \
--cc=qswang@marvell.com \
--cc=qzhao@marvell.com \
--cc=saeed.bishara@gmail.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