|
|
3c6e85 |
From 762cc7b1d46c24e176b416306b03ebb2cf1893d5 Mon Sep 17 00:00:00 2001
|
|
|
3c6e85 |
From: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Date: Thu, 1 Aug 2019 15:54:53 -0400
|
|
|
3c6e85 |
Subject: [PATCH 033/124] [scsi] scsi: qla2xxx: Add Serdes support for ISP28XX
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Message-id: <20190801155618.12650-34-hmadhani@redhat.com>
|
|
|
3c6e85 |
Patchwork-id: 267807
|
|
|
3c6e85 |
O-Subject: [RHEL 7.8 e-stor PATCH 033/118] scsi: qla2xxx: Add Serdes support for ISP28XX
|
|
|
3c6e85 |
Bugzilla: 1729270
|
|
|
3c6e85 |
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
|
|
|
3c6e85 |
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
From: Joe Carnuccio <joe.carnuccio@cavium.com>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Bugzilla 1729270
|
|
|
3c6e85 |
|
|
|
3c6e85 |
This patch adds sysfs node for serdes_version and also cleans up port_speed
|
|
|
3c6e85 |
display.
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
|
|
|
3c6e85 |
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
|
|
|
3c6e85 |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
|
3c6e85 |
(cherry picked from commit 2a3192a3f3bc4fe1b077c55fffb6d8afe3213d57)
|
|
|
3c6e85 |
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
|
3c6e85 |
---
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_attr.c | 43 +++++++++++++++++------
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_def.h | 4 ++-
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_gs.c | 77 ++++++++++++++++-------------------------
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_isr.c | 4 ++-
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_mbx.c | 25 +++++++------
|
|
|
3c6e85 |
5 files changed, 82 insertions(+), 71 deletions(-)
|
|
|
3c6e85 |
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
|
|
|
3c6e85 |
index ec76b33b9a95..4dd5dd9767ed 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_attr.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_attr.c
|
|
|
3c6e85 |
@@ -1379,6 +1379,21 @@ qla24xx_84xx_fw_version_show(struct device *dev,
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
static ssize_t
|
|
|
3c6e85 |
+qla2x00_serdes_version_show(struct device *dev, struct device_attribute *attr,
|
|
|
3c6e85 |
+ char *buf)
|
|
|
3c6e85 |
+{
|
|
|
3c6e85 |
+ scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
|
|
|
3c6e85 |
+ struct qla_hw_data *ha = vha->hw;
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
+ if (!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
|
|
|
3c6e85 |
+ return scnprintf(buf, PAGE_SIZE, "\n");
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
+ return scnprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n",
|
|
|
3c6e85 |
+ ha->serdes_version[0], ha->serdes_version[1],
|
|
|
3c6e85 |
+ ha->serdes_version[2]);
|
|
|
3c6e85 |
+}
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
+static ssize_t
|
|
|
3c6e85 |
qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr,
|
|
|
3c6e85 |
char *buf)
|
|
|
3c6e85 |
{
|
|
|
3c6e85 |
@@ -2221,6 +2236,7 @@ static DEVICE_ATTR(84xx_fw_version, S_IRUGO, qla24xx_84xx_fw_version_show,
|
|
|
3c6e85 |
NULL);
|
|
|
3c6e85 |
static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show,
|
|
|
3c6e85 |
NULL);
|
|
|
3c6e85 |
+static DEVICE_ATTR(serdes_version, 0444, qla2x00_serdes_version_show, NULL);
|
|
|
3c6e85 |
static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL);
|
|
|
3c6e85 |
static DEVICE_ATTR(phy_version, S_IRUGO, qla2x00_phy_version_show, NULL);
|
|
|
3c6e85 |
static DEVICE_ATTR(flash_block_size, S_IRUGO, qla2x00_flash_block_size_show,
|
|
|
3c6e85 |
@@ -2273,6 +2289,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
|
|
|
3c6e85 |
&dev_attr_optrom_fw_version,
|
|
|
3c6e85 |
&dev_attr_84xx_fw_version,
|
|
|
3c6e85 |
&dev_attr_total_isp_aborts,
|
|
|
3c6e85 |
+ &dev_attr_serdes_version,
|
|
|
3c6e85 |
&dev_attr_mpi_version,
|
|
|
3c6e85 |
&dev_attr_phy_version,
|
|
|
3c6e85 |
&dev_attr_flash_block_size,
|
|
|
3c6e85 |
@@ -2329,16 +2346,15 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost)
|
|
|
3c6e85 |
static void
|
|
|
3c6e85 |
qla2x00_get_host_speed(struct Scsi_Host *shost)
|
|
|
3c6e85 |
{
|
|
|
3c6e85 |
- struct qla_hw_data *ha = ((struct scsi_qla_host *)
|
|
|
3c6e85 |
- (shost_priv(shost)))->hw;
|
|
|
3c6e85 |
- u32 speed = FC_PORTSPEED_UNKNOWN;
|
|
|
3c6e85 |
+ scsi_qla_host_t *vha = shost_priv(shost);
|
|
|
3c6e85 |
+ u32 speed;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- if (IS_QLAFX00(ha)) {
|
|
|
3c6e85 |
+ if (IS_QLAFX00(vha->hw)) {
|
|
|
3c6e85 |
qlafx00_get_host_speed(shost);
|
|
|
3c6e85 |
return;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- switch (ha->link_data_rate) {
|
|
|
3c6e85 |
+ switch (vha->hw->link_data_rate) {
|
|
|
3c6e85 |
case PORT_SPEED_1GB:
|
|
|
3c6e85 |
speed = FC_PORTSPEED_1GBIT;
|
|
|
3c6e85 |
break;
|
|
|
3c6e85 |
@@ -2363,7 +2379,11 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)
|
|
|
3c6e85 |
case PORT_SPEED_64GB:
|
|
|
3c6e85 |
speed = FC_PORTSPEED_64GBIT;
|
|
|
3c6e85 |
break;
|
|
|
3c6e85 |
+ default:
|
|
|
3c6e85 |
+ speed = FC_PORTSPEED_UNKNOWN;
|
|
|
3c6e85 |
+ break;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
fc_host_speed(shost) = speed;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
@@ -2371,7 +2391,7 @@ static void
|
|
|
3c6e85 |
qla2x00_get_host_port_type(struct Scsi_Host *shost)
|
|
|
3c6e85 |
{
|
|
|
3c6e85 |
scsi_qla_host_t *vha = shost_priv(shost);
|
|
|
3c6e85 |
- uint32_t port_type = FC_PORTTYPE_UNKNOWN;
|
|
|
3c6e85 |
+ uint32_t port_type;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (vha->vp_idx) {
|
|
|
3c6e85 |
fc_host_port_type(shost) = FC_PORTTYPE_NPIV;
|
|
|
3c6e85 |
@@ -2390,7 +2410,11 @@ qla2x00_get_host_port_type(struct Scsi_Host *shost)
|
|
|
3c6e85 |
case ISP_CFG_F:
|
|
|
3c6e85 |
port_type = FC_PORTTYPE_NPORT;
|
|
|
3c6e85 |
break;
|
|
|
3c6e85 |
+ default:
|
|
|
3c6e85 |
+ port_type = FC_PORTTYPE_UNKNOWN;
|
|
|
3c6e85 |
+ break;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
fc_host_port_type(shost) = port_type;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
@@ -2452,13 +2476,10 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
|
|
|
3c6e85 |
fc_starget_port_id(starget) = port_id;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
-static void
|
|
|
3c6e85 |
+static inline void
|
|
|
3c6e85 |
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
|
|
|
3c6e85 |
{
|
|
|
3c6e85 |
- if (timeout)
|
|
|
3c6e85 |
- rport->dev_loss_tmo = timeout;
|
|
|
3c6e85 |
- else
|
|
|
3c6e85 |
- rport->dev_loss_tmo = 1;
|
|
|
3c6e85 |
+ rport->dev_loss_tmo = timeout ? timeout : 1;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
static void
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
|
|
|
3c6e85 |
index d0862e76a279..2c1fe64d2454 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_def.h
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_def.h
|
|
|
3c6e85 |
@@ -4030,6 +4030,7 @@ struct qla_hw_data {
|
|
|
3c6e85 |
uint8_t fw_seriallink_options[4];
|
|
|
3c6e85 |
uint16_t fw_seriallink_options24[4];
|
|
|
3c6e85 |
|
|
|
3c6e85 |
+ uint8_t serdes_version[3];
|
|
|
3c6e85 |
uint8_t mpi_version[3];
|
|
|
3c6e85 |
uint32_t mpi_capabilities;
|
|
|
3c6e85 |
uint8_t phy_version[3];
|
|
|
3c6e85 |
@@ -4041,7 +4042,8 @@ struct qla_hw_data {
|
|
|
3c6e85 |
/* Firmware dump information. */
|
|
|
3c6e85 |
struct qla2xxx_fw_dump *fw_dump;
|
|
|
3c6e85 |
uint32_t fw_dump_len;
|
|
|
3c6e85 |
- int fw_dumped;
|
|
|
3c6e85 |
+ bool fw_dumped;
|
|
|
3c6e85 |
+ bool fw_dump_mpi;
|
|
|
3c6e85 |
unsigned long fw_dump_cap_flags;
|
|
|
3c6e85 |
#define RISC_PAUSE_CMPL 0
|
|
|
3c6e85 |
#define DMA_SHUTDOWN_CMPL 1
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
|
|
|
3c6e85 |
index 70b832105f86..adf853ead5b4 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_gs.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_gs.c
|
|
|
3c6e85 |
@@ -2783,6 +2783,31 @@ qla24xx_prep_ct_fm_req(struct ct_sns_pkt *p, uint16_t cmd,
|
|
|
3c6e85 |
return &p->p.req;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
+static uint16_t
|
|
|
3c6e85 |
+qla2x00_port_speed_capability(uint16_t speed)
|
|
|
3c6e85 |
+{
|
|
|
3c6e85 |
+ switch (speed) {
|
|
|
3c6e85 |
+ case BIT_15:
|
|
|
3c6e85 |
+ return PORT_SPEED_1GB;
|
|
|
3c6e85 |
+ case BIT_14:
|
|
|
3c6e85 |
+ return PORT_SPEED_2GB;
|
|
|
3c6e85 |
+ case BIT_13:
|
|
|
3c6e85 |
+ return PORT_SPEED_4GB;
|
|
|
3c6e85 |
+ case BIT_12:
|
|
|
3c6e85 |
+ return PORT_SPEED_10GB;
|
|
|
3c6e85 |
+ case BIT_11:
|
|
|
3c6e85 |
+ return PORT_SPEED_8GB;
|
|
|
3c6e85 |
+ case BIT_10:
|
|
|
3c6e85 |
+ return PORT_SPEED_16GB;
|
|
|
3c6e85 |
+ case BIT_8:
|
|
|
3c6e85 |
+ return PORT_SPEED_32GB;
|
|
|
3c6e85 |
+ case BIT_7:
|
|
|
3c6e85 |
+ return PORT_SPEED_64GB;
|
|
|
3c6e85 |
+ default:
|
|
|
3c6e85 |
+ return PORT_SPEED_UNKNOWN;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
+}
|
|
|
3c6e85 |
+
|
|
|
3c6e85 |
/**
|
|
|
3c6e85 |
* qla2x00_gpsc() - FCS Get Port Speed Capabilities (GPSC) query.
|
|
|
3c6e85 |
* @vha: HA context
|
|
|
3c6e85 |
@@ -2855,31 +2880,8 @@ qla2x00_gpsc(scsi_qla_host_t *vha, sw_info_t *list)
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
rval = QLA_FUNCTION_FAILED;
|
|
|
3c6e85 |
} else {
|
|
|
3c6e85 |
- /* Save port-speed */
|
|
|
3c6e85 |
- switch (be16_to_cpu(ct_rsp->rsp.gpsc.speed)) {
|
|
|
3c6e85 |
- case BIT_15:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_1GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_14:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_2GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_13:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_4GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_12:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_10GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_11:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_8GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_10:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_16GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_8:
|
|
|
3c6e85 |
- list[i].fp_speed = PORT_SPEED_32GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- }
|
|
|
3c6e85 |
-
|
|
|
3c6e85 |
+ list->fp_speed = qla2x00_port_speed_capability(
|
|
|
3c6e85 |
+ be16_to_cpu(ct_rsp->rsp.gpsc.speed));
|
|
|
3c6e85 |
ql_dbg(ql_dbg_disc, vha, 0x205b,
|
|
|
3c6e85 |
"GPSC ext entry - fpn "
|
|
|
3c6e85 |
"%8phN speeds=%04x speed=%04x.\n",
|
|
|
3c6e85 |
@@ -3048,29 +3050,8 @@ static void qla24xx_async_gpsc_sp_done(void *s, int res)
|
|
|
3c6e85 |
goto done;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
} else {
|
|
|
3c6e85 |
- switch (be16_to_cpu(ct_rsp->rsp.gpsc.speed)) {
|
|
|
3c6e85 |
- case BIT_15:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_1GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_14:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_2GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_13:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_4GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_12:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_10GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_11:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_8GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_10:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_16GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- case BIT_8:
|
|
|
3c6e85 |
- fcport->fp_speed = PORT_SPEED_32GB;
|
|
|
3c6e85 |
- break;
|
|
|
3c6e85 |
- }
|
|
|
3c6e85 |
+ fcport->fp_speed = qla2x00_port_speed_capability(
|
|
|
3c6e85 |
+ be16_to_cpu(ct_rsp->rsp.gpsc.speed));
|
|
|
3c6e85 |
|
|
|
3c6e85 |
ql_dbg(ql_dbg_disc, vha, 0x2054,
|
|
|
3c6e85 |
"Async-%s OUT WWPN %8phC speeds=%04x speed=%04x.\n",
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
index fc1d11c492cb..18631ea250c0 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
@@ -713,7 +713,9 @@ skip_rio:
|
|
|
3c6e85 |
ql_log(ql_log_warn, vha, 0x5003,
|
|
|
3c6e85 |
"ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh "
|
|
|
3c6e85 |
"mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx);
|
|
|
3c6e85 |
-
|
|
|
3c6e85 |
+ ha->fw_dump_mpi =
|
|
|
3c6e85 |
+ (IS_QLA27XX(ha) || IS_QLA28XX(ha)) &&
|
|
|
3c6e85 |
+ RD_REG_WORD(®24->mailbox7) & BIT_8;
|
|
|
3c6e85 |
ha->isp_ops->fw_dump(vha, 1);
|
|
|
3c6e85 |
ha->flags.fw_init_done = 0;
|
|
|
3c6e85 |
QLA_FW_STOPPED(ha);
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
|
|
|
3c6e85 |
index 90efc3e102cb..b64b7b9be08b 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_mbx.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
|
|
|
3c6e85 |
@@ -634,14 +634,15 @@ qla2x00_load_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t risc_addr,
|
|
|
3c6e85 |
mcp->out_mb |= MBX_4;
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
- mcp->in_mb = MBX_0;
|
|
|
3c6e85 |
+ mcp->in_mb = MBX_1|MBX_0;
|
|
|
3c6e85 |
mcp->tov = MBX_TOV_SECONDS;
|
|
|
3c6e85 |
mcp->flags = 0;
|
|
|
3c6e85 |
rval = qla2x00_mailbox_command(vha, mcp);
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (rval != QLA_SUCCESS) {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx, vha, 0x1023,
|
|
|
3c6e85 |
- "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
|
|
|
3c6e85 |
+ "Failed=%x mb[0]=%x mb[1]=%x.\n",
|
|
|
3c6e85 |
+ rval, mcp->mb[0], mcp->mb[1]);
|
|
|
3c6e85 |
} else {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1024,
|
|
|
3c6e85 |
"Done %s.\n", __func__);
|
|
|
3c6e85 |
@@ -1059,7 +1060,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)
|
|
|
3c6e85 |
if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
|
|
|
3c6e85 |
mcp->in_mb |=
|
|
|
3c6e85 |
MBX_25|MBX_24|MBX_23|MBX_22|MBX_21|MBX_20|MBX_19|MBX_18|
|
|
|
3c6e85 |
- MBX_14|MBX_13|MBX_11|MBX_10|MBX_9|MBX_8;
|
|
|
3c6e85 |
+ MBX_14|MBX_13|MBX_11|MBX_10|MBX_9|MBX_8|MBX_7;
|
|
|
3c6e85 |
|
|
|
3c6e85 |
mcp->flags = 0;
|
|
|
3c6e85 |
mcp->tov = MBX_TOV_SECONDS;
|
|
|
3c6e85 |
@@ -1126,6 +1127,9 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)
|
|
|
3c6e85 |
}
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
|
|
|
3c6e85 |
+ ha->serdes_version[0] = mcp->mb[7] & 0xff;
|
|
|
3c6e85 |
+ ha->serdes_version[1] = mcp->mb[8] >> 8;
|
|
|
3c6e85 |
+ ha->serdes_version[2] = mcp->mb[8] & 0xff;
|
|
|
3c6e85 |
ha->mpi_version[0] = mcp->mb[10] & 0xff;
|
|
|
3c6e85 |
ha->mpi_version[1] = mcp->mb[11] >> 8;
|
|
|
3c6e85 |
ha->mpi_version[2] = mcp->mb[11] & 0xff;
|
|
|
3c6e85 |
@@ -3750,7 +3754,7 @@ qla2x00_get_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
|
|
|
3c6e85 |
rval = qla2x00_mailbox_command(vha, mcp);
|
|
|
3c6e85 |
|
|
|
3c6e85 |
/* Return mailbox statuses. */
|
|
|
3c6e85 |
- if (mb != NULL) {
|
|
|
3c6e85 |
+ if (mb) {
|
|
|
3c6e85 |
mb[0] = mcp->mb[0];
|
|
|
3c6e85 |
mb[1] = mcp->mb[1];
|
|
|
3c6e85 |
mb[3] = mcp->mb[3];
|
|
|
3c6e85 |
@@ -3785,7 +3789,7 @@ qla2x00_set_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
|
|
|
3c6e85 |
mcp->mb[0] = MBC_PORT_PARAMS;
|
|
|
3c6e85 |
mcp->mb[1] = loop_id;
|
|
|
3c6e85 |
mcp->mb[2] = BIT_0;
|
|
|
3c6e85 |
- mcp->mb[3] = port_speed & (BIT_5|BIT_4|BIT_3|BIT_2|BIT_1|BIT_0);
|
|
|
3c6e85 |
+ mcp->mb[3] = port_speed & 0x3F;
|
|
|
3c6e85 |
mcp->mb[9] = vha->vp_idx;
|
|
|
3c6e85 |
mcp->out_mb = MBX_9|MBX_3|MBX_2|MBX_1|MBX_0;
|
|
|
3c6e85 |
mcp->in_mb = MBX_3|MBX_1|MBX_0;
|
|
|
3c6e85 |
@@ -3794,7 +3798,7 @@ qla2x00_set_idma_speed(scsi_qla_host_t *vha, uint16_t loop_id,
|
|
|
3c6e85 |
rval = qla2x00_mailbox_command(vha, mcp);
|
|
|
3c6e85 |
|
|
|
3c6e85 |
/* Return mailbox statuses. */
|
|
|
3c6e85 |
- if (mb != NULL) {
|
|
|
3c6e85 |
+ if (mb) {
|
|
|
3c6e85 |
mb[0] = mcp->mb[0];
|
|
|
3c6e85 |
mb[1] = mcp->mb[1];
|
|
|
3c6e85 |
mb[3] = mcp->mb[3];
|
|
|
3c6e85 |
@@ -4825,10 +4829,10 @@ qla2x00_read_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint8_t *sfp,
|
|
|
3c6e85 |
if (rval != QLA_SUCCESS) {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx, vha, 0x10e9,
|
|
|
3c6e85 |
"Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
|
|
|
3c6e85 |
- if (mcp->mb[0] == MBS_COMMAND_ERROR &&
|
|
|
3c6e85 |
- mcp->mb[1] == 0x22)
|
|
|
3c6e85 |
+ if (mcp->mb[0] == MBS_COMMAND_ERROR && mcp->mb[1] == 0x22) {
|
|
|
3c6e85 |
/* sfp is not there */
|
|
|
3c6e85 |
rval = QLA_INTERFACE_ERROR;
|
|
|
3c6e85 |
+ }
|
|
|
3c6e85 |
} else {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10ea,
|
|
|
3c6e85 |
"Done %s.\n", __func__);
|
|
|
3c6e85 |
@@ -5168,13 +5172,14 @@ qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data)
|
|
|
3c6e85 |
mcp->mb[3] = MSW(data);
|
|
|
3c6e85 |
mcp->mb[8] = MSW(risc_addr);
|
|
|
3c6e85 |
mcp->out_mb = MBX_8|MBX_3|MBX_2|MBX_1|MBX_0;
|
|
|
3c6e85 |
- mcp->in_mb = MBX_0;
|
|
|
3c6e85 |
+ mcp->in_mb = MBX_1|MBX_0;
|
|
|
3c6e85 |
mcp->tov = 30;
|
|
|
3c6e85 |
mcp->flags = 0;
|
|
|
3c6e85 |
rval = qla2x00_mailbox_command(vha, mcp);
|
|
|
3c6e85 |
if (rval != QLA_SUCCESS) {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx, vha, 0x1101,
|
|
|
3c6e85 |
- "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
|
|
|
3c6e85 |
+ "Failed=%x mb[0]=%x mb[1]=%x.\n",
|
|
|
3c6e85 |
+ rval, mcp->mb[0], mcp->mb[1]);
|
|
|
3c6e85 |
} else {
|
|
|
3c6e85 |
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1102,
|
|
|
3c6e85 |
"Done %s.\n", __func__);
|
|
|
3c6e85 |
--
|
|
|
3c6e85 |
2.13.6
|
|
|
3c6e85 |
|