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>
*/
typedef struct srb {
struct fc_port *fcport;
+ uint32_t handle;
struct scsi_cmnd *cmd; /* Linux SCSI command pkt */
uint32_t request_sense_length;
uint8_t *request_sense_ptr;
+
+ void *ctx;
} srb_t;
/*
/* Build command packet */
req->current_outstanding_cmd = handle;
req->outstanding_cmds[handle] = sp;
+ sp->handle = handle;
sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
req->cnt -= req_cnt;
/* Build command packet. */
req->current_outstanding_cmd = handle;
req->outstanding_cmds[handle] = sp;
+ sp->handle = handle;
sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
req->cnt -= req_cnt;
sp->flags = 0;
CMD_SP(cmd) = (void *)sp;
cmd->scsi_done = done;
+ sp->ctx = NULL;
return sp;
}
continue;
if (sp->fcport != fcport)
continue;
+ if (sp->ctx)
+ continue;
spin_unlock_irqrestore(&ha->hardware_lock, flags);
if (ha->isp_ops->abort_command(sp)) {
if (sp == NULL)
continue;
-
+ if (sp->ctx)
+ continue;
if (sp->cmd != cmd)
continue;
sp = req->outstanding_cmds[cnt];
if (!sp)
continue;
-
+ if (sp->ctx)
+ continue;
if (vha->vp_idx != sp->fcport->vha->vp_idx)
continue;
match = 0;
sp = req->outstanding_cmds[index];
if (!sp)
continue;
+ if (sp->ctx)
+ continue;
sfcp = sp->fcport;
if (!(sfcp->flags & FCF_TAPE_PRESENT))
continue;