aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h2
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c20
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c22
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c6
5 files changed, 27 insertions, 25 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 09190ba411fd..6911b9b32feb 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -188,7 +188,6 @@ struct req_que;
188 * SCSI Request Block 188 * SCSI Request Block
189 */ 189 */
190typedef struct srb { 190typedef struct srb {
191 struct req_que *que;
192 struct fc_port *fcport; 191 struct fc_port *fcport;
193 192
194 struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ 193 struct scsi_cmnd *cmd; /* Linux SCSI command pkt */
@@ -2010,7 +2009,6 @@ typedef struct vport_params {
2010#define VP_RET_CODE_NOT_FOUND 6 2009#define VP_RET_CODE_NOT_FOUND 6
2011 2010
2012struct qla_hw_data; 2011struct qla_hw_data;
2013struct req_que;
2014struct rsp_que; 2012struct rsp_que;
2015/* 2013/*
2016 * ISP operations 2014 * ISP operations
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 059909c9f29b..4c14cde3295f 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3177,8 +3177,14 @@ qla2x00_loop_resync(scsi_qla_host_t *vha)
3177{ 3177{
3178 int rval = QLA_SUCCESS; 3178 int rval = QLA_SUCCESS;
3179 uint32_t wait_time; 3179 uint32_t wait_time;
3180 struct req_que *req = vha->req; 3180 struct req_que *req;
3181 struct rsp_que *rsp = req->rsp; 3181 struct rsp_que *rsp;
3182
3183 if (ql2xmultique_tag)
3184 req = vha->hw->req_q_map[0];
3185 else
3186 req = vha->req;
3187 rsp = req->rsp;
3182 3188
3183 atomic_set(&vha->loop_state, LOOP_UPDATE); 3189 atomic_set(&vha->loop_state, LOOP_UPDATE);
3184 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); 3190 clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
@@ -4163,13 +4169,19 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha)
4163 uint16_t mb[MAILBOX_REGISTER_COUNT]; 4169 uint16_t mb[MAILBOX_REGISTER_COUNT];
4164 struct qla_hw_data *ha = vha->hw; 4170 struct qla_hw_data *ha = vha->hw;
4165 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); 4171 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
4166 struct req_que *req = vha->req; 4172 struct req_que *req;
4167 struct rsp_que *rsp = req->rsp; 4173 struct rsp_que *rsp;
4168 4174
4169 if (!vha->vp_idx) 4175 if (!vha->vp_idx)
4170 return -EINVAL; 4176 return -EINVAL;
4171 4177
4172 rval = qla2x00_fw_ready(base_vha); 4178 rval = qla2x00_fw_ready(base_vha);
4179 if (ql2xmultique_tag)
4180 req = ha->req_q_map[0];
4181 else
4182 req = vha->req;
4183 rsp = req->rsp;
4184
4173 if (rval == QLA_SUCCESS) { 4185 if (rval == QLA_SUCCESS) {
4174 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags); 4186 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
4175 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL); 4187 qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL);
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 7b15ded991cb..b4c6010ee5fa 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -93,9 +93,10 @@ qla2x00_calc_iocbs_64(uint16_t dsds)
93 * Returns a pointer to the Continuation Type 0 IOCB packet. 93 * Returns a pointer to the Continuation Type 0 IOCB packet.
94 */ 94 */
95static inline cont_entry_t * 95static inline cont_entry_t *
96qla2x00_prep_cont_type0_iocb(struct req_que *req, struct scsi_qla_host *vha) 96qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha)
97{ 97{
98 cont_entry_t *cont_pkt; 98 cont_entry_t *cont_pkt;
99 struct req_que *req = vha->req;
99 /* Adjust ring index. */ 100 /* Adjust ring index. */
100 req->ring_index++; 101 req->ring_index++;
101 if (req->ring_index == req->length) { 102 if (req->ring_index == req->length) {
@@ -121,10 +122,11 @@ qla2x00_prep_cont_type0_iocb(struct req_que *req, struct scsi_qla_host *vha)
121 * Returns a pointer to the continuation type 1 IOCB packet. 122 * Returns a pointer to the continuation type 1 IOCB packet.
122 */ 123 */
123static inline cont_a64_entry_t * 124static inline cont_a64_entry_t *
124qla2x00_prep_cont_type1_iocb(struct req_que *req, scsi_qla_host_t *vha) 125qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha)
125{ 126{
126 cont_a64_entry_t *cont_pkt; 127 cont_a64_entry_t *cont_pkt;
127 128
129 struct req_que *req = vha->req;
128 /* Adjust ring index. */ 130 /* Adjust ring index. */
129 req->ring_index++; 131 req->ring_index++;
130 if (req->ring_index == req->length) { 132 if (req->ring_index == req->length) {
@@ -160,7 +162,6 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
160 struct scsi_cmnd *cmd; 162 struct scsi_cmnd *cmd;
161 struct scatterlist *sg; 163 struct scatterlist *sg;
162 int i; 164 int i;
163 struct req_que *req;
164 165
165 cmd = sp->cmd; 166 cmd = sp->cmd;
166 167
@@ -175,8 +176,6 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
175 } 176 }
176 177
177 vha = sp->fcport->vha; 178 vha = sp->fcport->vha;
178 req = sp->que;
179
180 cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp)); 179 cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));
181 180
182 /* Three DSDs are available in the Command Type 2 IOCB */ 181 /* Three DSDs are available in the Command Type 2 IOCB */
@@ -193,7 +192,7 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
193 * Seven DSDs are available in the Continuation 192 * Seven DSDs are available in the Continuation
194 * Type 0 IOCB. 193 * Type 0 IOCB.
195 */ 194 */
196 cont_pkt = qla2x00_prep_cont_type0_iocb(req, vha); 195 cont_pkt = qla2x00_prep_cont_type0_iocb(vha);
197 cur_dsd = (uint32_t *)&cont_pkt->dseg_0_address; 196 cur_dsd = (uint32_t *)&cont_pkt->dseg_0_address;
198 avail_dsds = 7; 197 avail_dsds = 7;
199 } 198 }
@@ -221,7 +220,6 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
221 struct scsi_cmnd *cmd; 220 struct scsi_cmnd *cmd;
222 struct scatterlist *sg; 221 struct scatterlist *sg;
223 int i; 222 int i;
224 struct req_que *req;
225 223
226 cmd = sp->cmd; 224 cmd = sp->cmd;
227 225
@@ -236,8 +234,6 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
236 } 234 }
237 235
238 vha = sp->fcport->vha; 236 vha = sp->fcport->vha;
239 req = sp->que;
240
241 cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp)); 237 cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));
242 238
243 /* Two DSDs are available in the Command Type 3 IOCB */ 239 /* Two DSDs are available in the Command Type 3 IOCB */
@@ -255,7 +251,7 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
255 * Five DSDs are available in the Continuation 251 * Five DSDs are available in the Continuation
256 * Type 1 IOCB. 252 * Type 1 IOCB.
257 */ 253 */
258 cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha); 254 cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
259 cur_dsd = (uint32_t *)cont_pkt->dseg_0_address; 255 cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
260 avail_dsds = 5; 256 avail_dsds = 5;
261 } 257 }
@@ -354,7 +350,6 @@ qla2x00_start_scsi(srb_t *sp)
354 /* Build command packet */ 350 /* Build command packet */
355 req->current_outstanding_cmd = handle; 351 req->current_outstanding_cmd = handle;
356 req->outstanding_cmds[handle] = sp; 352 req->outstanding_cmds[handle] = sp;
357 sp->que = req;
358 sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; 353 sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
359 req->cnt -= req_cnt; 354 req->cnt -= req_cnt;
360 355
@@ -655,7 +650,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
655 } 650 }
656 651
657 vha = sp->fcport->vha; 652 vha = sp->fcport->vha;
658 req = sp->que; 653 req = vha->req;
659 654
660 /* Set transfer direction */ 655 /* Set transfer direction */
661 if (cmd->sc_data_direction == DMA_TO_DEVICE) { 656 if (cmd->sc_data_direction == DMA_TO_DEVICE) {
@@ -686,7 +681,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
686 * Five DSDs are available in the Continuation 681 * Five DSDs are available in the Continuation
687 * Type 1 IOCB. 682 * Type 1 IOCB.
688 */ 683 */
689 cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha); 684 cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
690 cur_dsd = (uint32_t *)cont_pkt->dseg_0_address; 685 cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
691 avail_dsds = 5; 686 avail_dsds = 5;
692 } 687 }
@@ -728,7 +723,6 @@ qla24xx_start_scsi(srb_t *sp)
728 ret = 0; 723 ret = 0;
729 724
730 qla25xx_set_que(sp, &req, &rsp); 725 qla25xx_set_que(sp, &req, &rsp);
731 sp->que = req;
732 726
733 /* So we know we haven't pci_map'ed anything yet */ 727 /* So we know we haven't pci_map'ed anything yet */
734 tot_dsds = 0; 728 tot_dsds = 0;
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 366522e8a766..258c39d8f448 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2232,7 +2232,7 @@ qla24xx_abort_command(srb_t *sp)
2232 fc_port_t *fcport = sp->fcport; 2232 fc_port_t *fcport = sp->fcport;
2233 struct scsi_qla_host *vha = fcport->vha; 2233 struct scsi_qla_host *vha = fcport->vha;
2234 struct qla_hw_data *ha = vha->hw; 2234 struct qla_hw_data *ha = vha->hw;
2235 struct req_que *req = sp->que; 2235 struct req_que *req = vha->req;
2236 2236
2237 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); 2237 DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
2238 2238
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d6817df95e30..94e53a5fd9aa 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -441,7 +441,6 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
441 441
442 sp->fcport = fcport; 442 sp->fcport = fcport;
443 sp->cmd = cmd; 443 sp->cmd = cmd;
444 sp->que = ha->req_q_map[0];
445 sp->flags = 0; 444 sp->flags = 0;
446 CMD_SP(cmd) = (void *)sp; 445 CMD_SP(cmd) = (void *)sp;
447 cmd->scsi_done = done; 446 cmd->scsi_done = done;
@@ -742,7 +741,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
742 unsigned long flags; 741 unsigned long flags;
743 int wait = 0; 742 int wait = 0;
744 struct qla_hw_data *ha = vha->hw; 743 struct qla_hw_data *ha = vha->hw;
745 struct req_que *req; 744 struct req_que *req = vha->req;
746 srb_t *spt; 745 srb_t *spt;
747 746
748 qla2x00_block_error_handler(cmd); 747 qla2x00_block_error_handler(cmd);
@@ -758,7 +757,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
758 spt = (srb_t *) CMD_SP(cmd); 757 spt = (srb_t *) CMD_SP(cmd);
759 if (!spt) 758 if (!spt)
760 return SUCCESS; 759 return SUCCESS;
761 req = spt->que;
762 760
763 /* Check active list for command command. */ 761 /* Check active list for command command. */
764 spin_lock_irqsave(&ha->hardware_lock, flags); 762 spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -826,7 +824,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
826 return status; 824 return status;
827 825
828 spin_lock_irqsave(&ha->hardware_lock, flags); 826 spin_lock_irqsave(&ha->hardware_lock, flags);
829 req = sp->que; 827 req = vha->req;
830 for (cnt = 1; status == QLA_SUCCESS && 828 for (cnt = 1; status == QLA_SUCCESS &&
831 cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { 829 cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
832 sp = req->outstanding_cmds[cnt]; 830 sp = req->outstanding_cmds[cnt];