aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chaudhary <vikas.chaudhary@qlogic.com>2013-03-07 05:43:11 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-04-10 14:47:10 -0400
commitae3ae252356377e523ae1163834e088d346410b0 (patch)
treeca6970fbc72bdac40838afa4a7a2e3cf4f52850a
parent6cf9412124a4a2166b4d5a6919050f7fdfb82b64 (diff)
[SCSI] qla4xxx: Pass correct LUN address to firmware in case of lun_reset
Use function int_to_scsilun() in qla4xxx_reset_lun() to convert integer value comming from scsi_transport to scsi LUN address format. Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/qla4xxx/ql4_mbx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 160d33697216..446511d58124 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -1129,6 +1129,7 @@ int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry,
1129{ 1129{
1130 uint32_t mbox_cmd[MBOX_REG_COUNT]; 1130 uint32_t mbox_cmd[MBOX_REG_COUNT];
1131 uint32_t mbox_sts[MBOX_REG_COUNT]; 1131 uint32_t mbox_sts[MBOX_REG_COUNT];
1132 uint32_t scsi_lun[2];
1132 int status = QLA_SUCCESS; 1133 int status = QLA_SUCCESS;
1133 1134
1134 DEBUG2(printk("scsi%ld:%d:%d: lun reset issued\n", ha->host_no, 1135 DEBUG2(printk("scsi%ld:%d:%d: lun reset issued\n", ha->host_no,
@@ -1140,10 +1141,16 @@ int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry,
1140 */ 1141 */
1141 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 1142 memset(&mbox_cmd, 0, sizeof(mbox_cmd));
1142 memset(&mbox_sts, 0, sizeof(mbox_sts)); 1143 memset(&mbox_sts, 0, sizeof(mbox_sts));
1144 int_to_scsilun(lun, (struct scsi_lun *) scsi_lun);
1143 1145
1144 mbox_cmd[0] = MBOX_CMD_LUN_RESET; 1146 mbox_cmd[0] = MBOX_CMD_LUN_RESET;
1145 mbox_cmd[1] = ddb_entry->fw_ddb_index; 1147 mbox_cmd[1] = ddb_entry->fw_ddb_index;
1146 mbox_cmd[2] = lun << 8; 1148 /* FW expects LUN bytes 0-3 in Incoming Mailbox 2
1149 * (LUN byte 0 is LSByte, byte 3 is MSByte) */
1150 mbox_cmd[2] = cpu_to_le32(scsi_lun[0]);
1151 /* FW expects LUN bytes 4-7 in Incoming Mailbox 3
1152 * (LUN byte 4 is LSByte, byte 7 is MSByte) */
1153 mbox_cmd[3] = cpu_to_le32(scsi_lun[1]);
1147 mbox_cmd[5] = 0x01; /* Immediate Command Enable */ 1154 mbox_cmd[5] = 0x01; /* Immediate Command Enable */
1148 1155
1149 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]); 1156 qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 1, &mbox_cmd[0], &mbox_sts[0]);