Commit 3a11711a authored by Joe Carnuccio's avatar Joe Carnuccio Committed by James Bottomley

[SCSI] qla2xxx: Add setting of driver version string for vendor application.

Signed-off-by: default avatarJoe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 90687a1e
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* | Level | Last Value Used | Holes | * | Level | Last Value Used | Holes |
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* | Module Init and Probe | 0x0126 | 0x4b,0xba,0xfa | * | Module Init and Probe | 0x0126 | 0x4b,0xba,0xfa |
* | Mailbox commands | 0x1154 | 0x111a-0x111b | * | Mailbox commands | 0x1158 | 0x111a-0x111b |
* | | | 0x112c-0x112e | * | | | 0x112c-0x112e |
* | | | 0x113a | * | | | 0x113a |
* | Device Discovery | 0x2087 | 0x2020-0x2022, | * | Device Discovery | 0x2087 | 0x2020-0x2022, |
......
...@@ -863,6 +863,8 @@ typedef struct { ...@@ -863,6 +863,8 @@ typedef struct {
#define MBX_1 BIT_1 #define MBX_1 BIT_1
#define MBX_0 BIT_0 #define MBX_0 BIT_0
#define RNID_TYPE_SET_VERSION 0x9
/* /*
* Firmware state codes from get firmware state mailbox command * Firmware state codes from get firmware state mailbox command
*/ */
......
...@@ -357,6 +357,9 @@ qla2x00_enable_fce_trace(scsi_qla_host_t *, dma_addr_t, uint16_t , uint16_t *, ...@@ -357,6 +357,9 @@ qla2x00_enable_fce_trace(scsi_qla_host_t *, dma_addr_t, uint16_t , uint16_t *,
extern int extern int
qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *); qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *);
extern int
qla2x00_set_driver_version(scsi_qla_host_t *, char *);
extern int extern int
qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *, qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *,
uint16_t, uint16_t, uint16_t, uint16_t); uint16_t, uint16_t, uint16_t, uint16_t);
......
...@@ -619,6 +619,8 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha) ...@@ -619,6 +619,8 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha))
qla24xx_read_fcp_prio_cfg(vha); qla24xx_read_fcp_prio_cfg(vha);
qla2x00_set_driver_version(vha, QLA2XXX_VERSION);
return (rval); return (rval);
} }
......
...@@ -3866,6 +3866,64 @@ qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha) ...@@ -3866,6 +3866,64 @@ qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha)
return rval; return rval;
} }
int
qla2x00_set_driver_version(scsi_qla_host_t *vha, char *version)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
int len;
uint16_t dwlen;
uint8_t *str;
dma_addr_t str_dma;
struct qla_hw_data *ha = vha->hw;
if (!IS_FWI2_CAPABLE(ha) || IS_QLA82XX(ha))
return QLA_FUNCTION_FAILED;
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1155,
"Entered %s.\n", __func__);
str = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &str_dma);
if (!str) {
ql_log(ql_log_warn, vha, 0x1156,
"Failed to allocate driver version param.\n");
return QLA_MEMORY_ALLOC_FAILED;
}
memcpy(str, "\x7\x3\x11\x0", 4);
dwlen = str[0];
len = dwlen * sizeof(uint32_t) - 4;
memset(str + 4, 0, len);
if (len > strlen(version))
len = strlen(version);
memcpy(str + 4, version, len);
mcp->mb[0] = MBC_SET_RNID_PARAMS;
mcp->mb[1] = RNID_TYPE_SET_VERSION << 8 | dwlen;
mcp->mb[2] = MSW(LSD(str_dma));
mcp->mb[3] = LSW(LSD(str_dma));
mcp->mb[6] = MSW(MSD(str_dma));
mcp->mb[7] = LSW(MSD(str_dma));
mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
mcp->in_mb = MBX_0;
mcp->tov = MBX_TOV_SECONDS;
mcp->flags = 0;
rval = qla2x00_mailbox_command(vha, mcp);
if (rval != QLA_SUCCESS) {
ql_dbg(ql_dbg_mbx, vha, 0x1157,
"Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
} else {
ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1158,
"Done %s.\n", __func__);
}
dma_pool_free(ha->s_dma_pool, str, str_dma);
return rval;
}
int int
qla2x00_read_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint8_t *sfp, qla2x00_read_sfp(scsi_qla_host_t *vha, dma_addr_t sfp_dma, uint8_t *sfp,
uint16_t dev, uint16_t off, uint16_t len, uint16_t opt) uint16_t dev, uint16_t off, uint16_t len, uint16_t opt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment