Skip to content

Commit cf53b06

Browse files
avasquez01James Bottomley
authored andcommitted
[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>
1 parent dc162b6 commit cf53b06

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,16 @@ struct req_que;
189189
*/
190190
typedef struct srb {
191191
struct fc_port *fcport;
192+
uint32_t handle;
192193

193194
struct scsi_cmnd *cmd; /* Linux SCSI command pkt */
194195

195196
uint16_t flags;
196197

197198
uint32_t request_sense_length;
198199
uint8_t *request_sense_ptr;
200+
201+
void *ctx;
199202
} srb_t;
200203

201204
/*

drivers/scsi/qla2xxx/qla_iocb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ qla2x00_start_scsi(srb_t *sp)
350350
/* Build command packet */
351351
req->current_outstanding_cmd = handle;
352352
req->outstanding_cmds[handle] = sp;
353+
sp->handle = handle;
353354
sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
354355
req->cnt -= req_cnt;
355356

@@ -778,6 +779,7 @@ qla24xx_start_scsi(srb_t *sp)
778779
/* Build command packet. */
779780
req->current_outstanding_cmd = handle;
780781
req->outstanding_cmds[handle] = sp;
782+
sp->handle = handle;
781783
sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
782784
req->cnt -= req_cnt;
783785

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,
473473
sp->flags = 0;
474474
CMD_SP(cmd) = (void *)sp;
475475
cmd->scsi_done = done;
476+
sp->ctx = NULL;
476477

477478
return sp;
478479
}
@@ -709,6 +710,8 @@ qla2x00_abort_fcport_cmds(fc_port_t *fcport)
709710
continue;
710711
if (sp->fcport != fcport)
711712
continue;
713+
if (sp->ctx)
714+
continue;
712715

713716
spin_unlock_irqrestore(&ha->hardware_lock, flags);
714717
if (ha->isp_ops->abort_command(sp)) {
@@ -794,7 +797,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
794797

795798
if (sp == NULL)
796799
continue;
797-
800+
if (sp->ctx)
801+
continue;
798802
if (sp->cmd != cmd)
799803
continue;
800804

@@ -859,7 +863,8 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
859863
sp = req->outstanding_cmds[cnt];
860864
if (!sp)
861865
continue;
862-
866+
if (sp->ctx)
867+
continue;
863868
if (vha->vp_idx != sp->fcport->vha->vp_idx)
864869
continue;
865870
match = 0;
@@ -2986,6 +2991,8 @@ qla2x00_timer(scsi_qla_host_t *vha)
29862991
sp = req->outstanding_cmds[index];
29872992
if (!sp)
29882993
continue;
2994+
if (sp->ctx)
2995+
continue;
29892996
sfcp = sp->fcport;
29902997
if (!(sfcp->flags & FCF_TAPE_PRESENT))
29912998
continue;

0 commit comments

Comments
 (0)