aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
authorManish Dusane <manish.dusane@qlogic.com>2012-09-20 07:35:01 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:25:13 -0400
commitcfb27874ca278fbb157f82a1d0ca9faff49aecfe (patch)
treea73c1cc58e0b364e2209dedebf0eaa3402eb76da /drivers/scsi/qla4xxx
parente47f8976d8e573928824a06748f7bc82c58d747f (diff)
[SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW
Signed-off-by: Manish Dusane <manish.dusane@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_fw.h3
-rw-r--r--drivers/scsi/qla4xxx/ql4_glbl.h1
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c37
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c4
4 files changed, 45 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h
index 1ef954f886b7..69a21718f4d0 100644
--- a/drivers/scsi/qla4xxx/ql4_fw.h
+++ b/drivers/scsi/qla4xxx/ql4_fw.h
@@ -390,6 +390,9 @@ struct qla_flt_region {
390#define LOGOUT_OPTION_CLOSE_SESSION 0x0002 390#define LOGOUT_OPTION_CLOSE_SESSION 0x0002
391#define LOGOUT_OPTION_RELOGIN 0x0004 391#define LOGOUT_OPTION_RELOGIN 0x0004
392#define LOGOUT_OPTION_FREE_DDB 0x0008 392#define LOGOUT_OPTION_FREE_DDB 0x0008
393#define MBOX_CMD_SET_PARAM 0x0059
394#define SET_DRVR_VERSION 0x200
395#define MAX_DRVR_VER_LEN 24
393#define MBOX_CMD_EXECUTE_IOCB_A64 0x005A 396#define MBOX_CMD_EXECUTE_IOCB_A64 0x005A
394#define MBOX_CMD_INITIALIZE_FIRMWARE 0x0060 397#define MBOX_CMD_INITIALIZE_FIRMWARE 0x0060
395#define MBOX_CMD_GET_INIT_FW_CTRL_BLOCK 0x0061 398#define MBOX_CMD_GET_INIT_FW_CTRL_BLOCK 0x0061
diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h
index 9adc512ab2e7..eea04e011a48 100644
--- a/drivers/scsi/qla4xxx/ql4_glbl.h
+++ b/drivers/scsi/qla4xxx/ql4_glbl.h
@@ -255,6 +255,7 @@ int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha);
255void qla4_8xxx_get_minidump(struct scsi_qla_host *ha); 255void qla4_8xxx_get_minidump(struct scsi_qla_host *ha);
256int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha); 256int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha);
257int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha); 257int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha);
258int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param);
258 259
259extern int ql4xextended_error_logging; 260extern int ql4xextended_error_logging;
260extern int ql4xdontresethba; 261extern int ql4xdontresethba;
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 0bd8bc7b93f5..f31e79b6aa6d 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -9,6 +9,7 @@
9#include "ql4_glbl.h" 9#include "ql4_glbl.h"
10#include "ql4_dbg.h" 10#include "ql4_dbg.h"
11#include "ql4_inline.h" 11#include "ql4_inline.h"
12#include "ql4_version.h"
12 13
13void qla4xxx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd, 14void qla4xxx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,
14 int in_count) 15 int in_count)
@@ -1931,3 +1932,39 @@ int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha,
1931 } 1932 }
1932 return status; 1933 return status;
1933} 1934}
1935
1936/**
1937 * qla4_8xxx_set_param - set driver version in firmware.
1938 * @ha: Pointer to host adapter structure.
1939 * @param: Parameter to set i.e driver version
1940 **/
1941int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param)
1942{
1943 uint32_t mbox_cmd[MBOX_REG_COUNT];
1944 uint32_t mbox_sts[MBOX_REG_COUNT];
1945 uint32_t status;
1946
1947 memset(&mbox_cmd, 0, sizeof(mbox_cmd));
1948 memset(&mbox_sts, 0, sizeof(mbox_sts));
1949
1950 mbox_cmd[0] = MBOX_CMD_SET_PARAM;
1951 if (param == SET_DRVR_VERSION) {
1952 mbox_cmd[1] = SET_DRVR_VERSION;
1953 strncpy((char *)&mbox_cmd[2], QLA4XXX_DRIVER_VERSION,
1954 MAX_DRVR_VER_LEN);
1955 } else {
1956 ql4_printk(KERN_ERR, ha, "%s: invalid parameter 0x%x\n",
1957 __func__, param);
1958 status = QLA_ERROR;
1959 goto exit_set_param;
1960 }
1961
1962 status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, mbox_cmd,
1963 mbox_sts);
1964 if (status == QLA_ERROR)
1965 ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n",
1966 __func__, mbox_sts[0]);
1967
1968exit_set_param:
1969 return status;
1970}
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index c44e49a1f1a2..d2d7b252c5df 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -5329,6 +5329,10 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
5329 ha->host_no, ha->firmware_version[0], ha->firmware_version[1], 5329 ha->host_no, ha->firmware_version[0], ha->firmware_version[1],
5330 ha->patch_number, ha->build_number); 5330 ha->patch_number, ha->build_number);
5331 5331
5332 /* Set the driver version */
5333 if (is_qla80XX(ha))
5334 qla4_8xxx_set_param(ha, SET_DRVR_VERSION);
5335
5332 if (qla4xxx_setup_boot_info(ha)) 5336 if (qla4xxx_setup_boot_info(ha))
5333 ql4_printk(KERN_ERR, ha, 5337 ql4_printk(KERN_ERR, ha,
5334 "%s: No iSCSI boot target configured\n", __func__); 5338 "%s: No iSCSI boot target configured\n", __func__);