aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c63
1 files changed, 17 insertions, 46 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 37f82e2cd7fb..7ec0b8d6f07b 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -1,22 +1,9 @@
1/****************************************************************************** 1/*
2 * QLOGIC LINUX SOFTWARE 2 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2005 QLogic Corporation
3 * 4 *
4 * QLogic ISP2x00 device driver for Linux 2.6.x 5 * See LICENSE.qla2xxx for copyright and licensing details.
5 * Copyright (C) 2003-2005 QLogic Corporation 6 */
6 * (www.qlogic.com)
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 ******************************************************************************/
19
20#include "qla_def.h" 7#include "qla_def.h"
21 8
22#include <linux/blkdev.h> 9#include <linux/blkdev.h>
@@ -316,7 +303,6 @@ qla2x00_start_scsi(srb_t *sp)
316 uint16_t req_cnt; 303 uint16_t req_cnt;
317 uint16_t tot_dsds; 304 uint16_t tot_dsds;
318 struct device_reg_2xxx __iomem *reg; 305 struct device_reg_2xxx __iomem *reg;
319 char tag[2];
320 306
321 /* Setup device pointers. */ 307 /* Setup device pointers. */
322 ret = 0; 308 ret = 0;
@@ -401,18 +387,6 @@ qla2x00_start_scsi(srb_t *sp)
401 387
402 /* Update tagged queuing modifier */ 388 /* Update tagged queuing modifier */
403 cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG); 389 cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG);
404 if (scsi_populate_tag_msg(cmd, tag)) {
405 switch (tag[0]) {
406 case MSG_HEAD_TAG:
407 cmd_pkt->control_flags =
408 __constant_cpu_to_le16(CF_HEAD_TAG);
409 break;
410 case MSG_ORDERED_TAG:
411 cmd_pkt->control_flags =
412 __constant_cpu_to_le16(CF_ORDERED_TAG);
413 break;
414 }
415 }
416 390
417 /* Load SCSI command packet. */ 391 /* Load SCSI command packet. */
418 memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len); 392 memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);
@@ -440,6 +414,11 @@ qla2x00_start_scsi(srb_t *sp)
440 WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index); 414 WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
441 RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */ 415 RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg)); /* PCI Posting. */
442 416
417 /* Manage unprocessed RIO/ZIO commands in response queue. */
418 if (ha->flags.process_response_queue &&
419 ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
420 qla2x00_process_response_queue(ha);
421
443 spin_unlock_irqrestore(&ha->hardware_lock, flags); 422 spin_unlock_irqrestore(&ha->hardware_lock, flags);
444 return (QLA_SUCCESS); 423 return (QLA_SUCCESS);
445 424
@@ -749,7 +728,6 @@ qla24xx_start_scsi(srb_t *sp)
749 uint16_t req_cnt; 728 uint16_t req_cnt;
750 uint16_t tot_dsds; 729 uint16_t tot_dsds;
751 struct device_reg_24xx __iomem *reg; 730 struct device_reg_24xx __iomem *reg;
752 char tag[2];
753 731
754 /* Setup device pointers. */ 732 /* Setup device pointers. */
755 ret = 0; 733 ret = 0;
@@ -824,6 +802,7 @@ qla24xx_start_scsi(srb_t *sp)
824 cmd_pkt->handle = handle; 802 cmd_pkt->handle = handle;
825 803
826 /* Zero out remaining portion of packet. */ 804 /* Zero out remaining portion of packet. */
805 /* tagged queuing modifier -- default is TSK_SIMPLE (0). */
827 clr_ptr = (uint32_t *)cmd_pkt + 2; 806 clr_ptr = (uint32_t *)cmd_pkt + 2;
828 memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8); 807 memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8);
829 cmd_pkt->dseg_count = cpu_to_le16(tot_dsds); 808 cmd_pkt->dseg_count = cpu_to_le16(tot_dsds);
@@ -834,20 +813,7 @@ qla24xx_start_scsi(srb_t *sp)
834 cmd_pkt->port_id[1] = sp->fcport->d_id.b.area; 813 cmd_pkt->port_id[1] = sp->fcport->d_id.b.area;
835 cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain; 814 cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain;
836 815
837 cmd_pkt->lun[1] = LSB(sp->cmd->device->lun); 816 int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun);
838 cmd_pkt->lun[2] = MSB(sp->cmd->device->lun);
839
840 /* Update tagged queuing modifier -- default is TSK_SIMPLE (0). */
841 if (scsi_populate_tag_msg(cmd, tag)) {
842 switch (tag[0]) {
843 case MSG_HEAD_TAG:
844 cmd_pkt->task = TSK_HEAD_OF_QUEUE;
845 break;
846 case MSG_ORDERED_TAG:
847 cmd_pkt->task = TSK_ORDERED;
848 break;
849 }
850 }
851 817
852 /* Load SCSI command packet. */ 818 /* Load SCSI command packet. */
853 memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len); 819 memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len);
@@ -877,6 +843,11 @@ qla24xx_start_scsi(srb_t *sp)
877 WRT_REG_DWORD(&reg->req_q_in, ha->req_ring_index); 843 WRT_REG_DWORD(&reg->req_q_in, ha->req_ring_index);
878 RD_REG_DWORD_RELAXED(&reg->req_q_in); /* PCI Posting. */ 844 RD_REG_DWORD_RELAXED(&reg->req_q_in); /* PCI Posting. */
879 845
846 /* Manage unprocessed RIO/ZIO commands in response queue. */
847 if (ha->flags.process_response_queue &&
848 ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
849 qla24xx_process_response_queue(ha);
850
880 spin_unlock_irqrestore(&ha->hardware_lock, flags); 851 spin_unlock_irqrestore(&ha->hardware_lock, flags);
881 return QLA_SUCCESS; 852 return QLA_SUCCESS;
882 853