diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-08-20 14:06:04 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 10:41:55 -0400 |
commit | cf53b069f52ae3f83dec1acd339e3c3a2e979478 (patch) | |
tree | 98764fcfd96cacf5aa2f7874deddf4ac558c5a83 /drivers/scsi/qla2xxx | |
parent | dc162b63bfc4201ca5c13df3fc8836c56979eb07 (diff) |
[SCSI] qla2xxx: Generalize srb structure usage.
Lay groundwork for adding alternative asynchronous operations by
generalize and extending the SRB structure. This allows for
follow-on patches to add support for:
- Asynchronous logins.
- ELS/CT passthru requests.
- Loopback requests.
- Non-blocking mailbox commands (ABTS, Task Management, etc).
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 11 |
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 68ab28c8152b..9eb7be684f0a 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -189,6 +189,7 @@ struct req_que; | |||
189 | */ | 189 | */ |
190 | typedef struct srb { | 190 | typedef struct srb { |
191 | struct fc_port *fcport; | 191 | struct fc_port *fcport; |
192 | uint32_t handle; | ||
192 | 193 | ||
193 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ | 194 | struct scsi_cmnd *cmd; /* Linux SCSI command pkt */ |
194 | 195 | ||
@@ -196,6 +197,8 @@ typedef struct srb { | |||
196 | 197 | ||
197 | uint32_t request_sense_length; | 198 | uint32_t request_sense_length; |
198 | uint8_t *request_sense_ptr; | 199 | uint8_t *request_sense_ptr; |
200 | |||
201 | void *ctx; | ||
199 | } srb_t; | 202 | } srb_t; |
200 | 203 | ||
201 | /* | 204 | /* |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index c0ba370b23cf..d37554ecd313 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -350,6 +350,7 @@ qla2x00_start_scsi(srb_t *sp) | |||
350 | /* Build command packet */ | 350 | /* Build command packet */ |
351 | req->current_outstanding_cmd = handle; | 351 | req->current_outstanding_cmd = handle; |
352 | req->outstanding_cmds[handle] = sp; | 352 | req->outstanding_cmds[handle] = sp; |
353 | sp->handle = handle; | ||
353 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; | 354 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; |
354 | req->cnt -= req_cnt; | 355 | req->cnt -= req_cnt; |
355 | 356 | ||
@@ -778,6 +779,7 @@ qla24xx_start_scsi(srb_t *sp) | |||
778 | /* Build command packet. */ | 779 | /* Build command packet. */ |
779 | req->current_outstanding_cmd = handle; | 780 | req->current_outstanding_cmd = handle; |
780 | req->outstanding_cmds[handle] = sp; | 781 | req->outstanding_cmds[handle] = sp; |
782 | sp->handle = handle; | ||
781 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; | 783 | sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle; |
782 | req->cnt -= req_cnt; | 784 | req->cnt -= req_cnt; |
783 | 785 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d7b271339a5c..b6c088caf35e 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -473,6 +473,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport, | |||
473 | sp->flags = 0; | 473 | sp->flags = 0; |
474 | CMD_SP(cmd) = (void *)sp; | 474 | CMD_SP(cmd) = (void *)sp; |
475 | cmd->scsi_done = done; | 475 | cmd->scsi_done = done; |
476 | sp->ctx = NULL; | ||
476 | 477 | ||
477 | return sp; | 478 | return sp; |
478 | } | 479 | } |
@@ -709,6 +710,8 @@ qla2x00_abort_fcport_cmds(fc_port_t *fcport) | |||
709 | continue; | 710 | continue; |
710 | if (sp->fcport != fcport) | 711 | if (sp->fcport != fcport) |
711 | continue; | 712 | continue; |
713 | if (sp->ctx) | ||
714 | continue; | ||
712 | 715 | ||
713 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 716 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
714 | if (ha->isp_ops->abort_command(sp)) { | 717 | if (ha->isp_ops->abort_command(sp)) { |
@@ -794,7 +797,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
794 | 797 | ||
795 | if (sp == NULL) | 798 | if (sp == NULL) |
796 | continue; | 799 | continue; |
797 | 800 | if (sp->ctx) | |
801 | continue; | ||
798 | if (sp->cmd != cmd) | 802 | if (sp->cmd != cmd) |
799 | continue; | 803 | continue; |
800 | 804 | ||
@@ -859,7 +863,8 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, | |||
859 | sp = req->outstanding_cmds[cnt]; | 863 | sp = req->outstanding_cmds[cnt]; |
860 | if (!sp) | 864 | if (!sp) |
861 | continue; | 865 | continue; |
862 | 866 | if (sp->ctx) | |
867 | continue; | ||
863 | if (vha->vp_idx != sp->fcport->vha->vp_idx) | 868 | if (vha->vp_idx != sp->fcport->vha->vp_idx) |
864 | continue; | 869 | continue; |
865 | match = 0; | 870 | match = 0; |
@@ -2986,6 +2991,8 @@ qla2x00_timer(scsi_qla_host_t *vha) | |||
2986 | sp = req->outstanding_cmds[index]; | 2991 | sp = req->outstanding_cmds[index]; |
2987 | if (!sp) | 2992 | if (!sp) |
2988 | continue; | 2993 | continue; |
2994 | if (sp->ctx) | ||
2995 | continue; | ||
2989 | sfcp = sp->fcport; | 2996 | sfcp = sp->fcport; |
2990 | if (!(sfcp->flags & FCF_TAPE_PRESENT)) | 2997 | if (!(sfcp->flags & FCF_TAPE_PRESENT)) |
2991 | continue; | 2998 | continue; |