aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2009-04-07 01:33:42 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-05-20 18:21:08 -0400
commit67c2e93ae7465a3e279503ceddd7bd153d74bcf8 (patch)
tree3a28588b7289e290366964e70fbe081826427ff3 /drivers/scsi/qla2xxx/qla_iocb.c
parent68ca949cdb04b4dc71451a999148fbc5f187a220 (diff)
[SCSI] qla2xxx: Remove reference to request queue from scsi request block.
srbs used to maintain a reference to the request queue on which it was enqueued. This is no longer required as the request queue pointer is now maintained in the scsi host that issues the srb. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c22
1 files changed, 8 insertions, 14 deletions
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;