]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] qla4xxx: Added new mbox cmd to pass driver version to FW
authorManish Dusane <manish.dusane@qlogic.com>
Thu, 20 Sep 2012 11:35:01 +0000 (07:35 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 24 Sep 2012 08:25:13 +0000 (12:25 +0400)
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>
drivers/scsi/qla4xxx/ql4_fw.h
drivers/scsi/qla4xxx/ql4_glbl.h
drivers/scsi/qla4xxx/ql4_mbx.c
drivers/scsi/qla4xxx/ql4_os.c

index 1ef954f886b7510596ad33ab4dd43fc53c0203af..69a21718f4d0976b039afac10e9dcf8906a2e411 100644 (file)
@@ -390,6 +390,9 @@ struct qla_flt_region {
 #define LOGOUT_OPTION_CLOSE_SESSION            0x0002
 #define LOGOUT_OPTION_RELOGIN                  0x0004
 #define LOGOUT_OPTION_FREE_DDB                 0x0008
+#define MBOX_CMD_SET_PARAM                     0x0059
+#define SET_DRVR_VERSION                       0x200
+#define MAX_DRVR_VER_LEN                       24
 #define MBOX_CMD_EXECUTE_IOCB_A64              0x005A
 #define MBOX_CMD_INITIALIZE_FIRMWARE           0x0060
 #define MBOX_CMD_GET_INIT_FW_CTRL_BLOCK                0x0061
index 9adc512ab2e7ec1eab76d7ee693993b1f279edf1..eea04e011a48bca2fee3eeada20d65a076b50e0a 100644 (file)
@@ -255,6 +255,7 @@ int qla4_8xxx_device_bootstrap(struct scsi_qla_host *ha);
 void qla4_8xxx_get_minidump(struct scsi_qla_host *ha);
 int qla4_8xxx_mbx_intr_disable(struct scsi_qla_host *ha);
 int qla4_8xxx_mbx_intr_enable(struct scsi_qla_host *ha);
+int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param);
 
 extern int ql4xextended_error_logging;
 extern int ql4xdontresethba;
index 0bd8bc7b93f58d7c2b1fe0eee1f2e554e930c4ad..f31e79b6aa6d0a3772884cef61ca04792a622eb2 100644 (file)
@@ -9,6 +9,7 @@
 #include "ql4_glbl.h"
 #include "ql4_dbg.h"
 #include "ql4_inline.h"
+#include "ql4_version.h"
 
 void qla4xxx_queue_mbox_cmd(struct scsi_qla_host *ha, uint32_t *mbx_cmd,
                            int in_count)
@@ -1931,3 +1932,39 @@ int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha,
        }
        return status;
 }
+
+/**
+ * qla4_8xxx_set_param - set driver version in firmware.
+ * @ha: Pointer to host adapter structure.
+ * @param: Parameter to set i.e driver version
+ **/
+int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param)
+{
+       uint32_t mbox_cmd[MBOX_REG_COUNT];
+       uint32_t mbox_sts[MBOX_REG_COUNT];
+       uint32_t status;
+
+       memset(&mbox_cmd, 0, sizeof(mbox_cmd));
+       memset(&mbox_sts, 0, sizeof(mbox_sts));
+
+       mbox_cmd[0] = MBOX_CMD_SET_PARAM;
+       if (param == SET_DRVR_VERSION) {
+               mbox_cmd[1] = SET_DRVR_VERSION;
+               strncpy((char *)&mbox_cmd[2], QLA4XXX_DRIVER_VERSION,
+                       MAX_DRVR_VER_LEN);
+       } else {
+               ql4_printk(KERN_ERR, ha, "%s: invalid parameter 0x%x\n",
+                          __func__, param);
+               status = QLA_ERROR;
+               goto exit_set_param;
+       }
+
+       status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 2, mbox_cmd,
+                                        mbox_sts);
+       if (status == QLA_ERROR)
+               ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n",
+                          __func__, mbox_sts[0]);
+
+exit_set_param:
+       return status;
+}
index c44e49a1f1a216059de2671c358adb656bc3516b..d2d7b252c5df11b5278997fc1e592502cc7096d6 100644 (file)
@@ -5329,6 +5329,10 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
               ha->host_no, ha->firmware_version[0], ha->firmware_version[1],
               ha->patch_number, ha->build_number);
 
+       /* Set the driver version */
+       if (is_qla80XX(ha))
+               qla4_8xxx_set_param(ha, SET_DRVR_VERSION);
+
        if (qla4xxx_setup_boot_info(ha))
                ql4_printk(KERN_ERR, ha,
                           "%s: No iSCSI boot target configured\n", __func__);