Lines Matching refs:SCpnt

553 #define SCDATA(SCpnt)		((struct aha152x_scdata *) (SCpnt)->host_scribble)  argument
554 #define SCNEXT(SCpnt) SCDATA(SCpnt)->next argument
555 #define SCSEM(SCpnt) SCDATA(SCpnt)->done argument
907 static int aha152x_internal_queue(struct scsi_cmnd *SCpnt, in aha152x_internal_queue() argument
911 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_internal_queue()
914 SCpnt->scsi_done = done; in aha152x_internal_queue()
915 SCpnt->SCp.phase = not_issued | phase; in aha152x_internal_queue()
916 SCpnt->SCp.Status = 0x1; /* Ilegal status by SCSI standard */ in aha152x_internal_queue()
917 SCpnt->SCp.Message = 0; in aha152x_internal_queue()
918 SCpnt->SCp.have_data_in = 0; in aha152x_internal_queue()
919 SCpnt->SCp.sent_command = 0; in aha152x_internal_queue()
921 if(SCpnt->SCp.phase & (resetting|check_condition)) { in aha152x_internal_queue()
922 if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) { in aha152x_internal_queue()
923 scmd_printk(KERN_ERR, SCpnt, "cannot reuse command\n"); in aha152x_internal_queue()
927 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); in aha152x_internal_queue()
928 if(!SCpnt->host_scribble) { in aha152x_internal_queue()
929 scmd_printk(KERN_ERR, SCpnt, "allocation failed\n"); in aha152x_internal_queue()
934 SCNEXT(SCpnt) = NULL; in aha152x_internal_queue()
935 SCSEM(SCpnt) = complete; in aha152x_internal_queue()
943 if ((phase & resetting) || !scsi_sglist(SCpnt)) { in aha152x_internal_queue()
944 SCpnt->SCp.ptr = NULL; in aha152x_internal_queue()
945 SCpnt->SCp.this_residual = 0; in aha152x_internal_queue()
946 scsi_set_resid(SCpnt, 0); in aha152x_internal_queue()
947 SCpnt->SCp.buffer = NULL; in aha152x_internal_queue()
949 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); in aha152x_internal_queue()
950 SCpnt->SCp.buffer = scsi_sglist(SCpnt); in aha152x_internal_queue()
951 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer); in aha152x_internal_queue()
952 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; in aha152x_internal_queue()
966 append_SC(&ISSUE_SC, SCpnt); in aha152x_internal_queue()
980 static int aha152x_queue_lck(struct scsi_cmnd *SCpnt, in aha152x_queue_lck() argument
983 return aha152x_internal_queue(SCpnt, NULL, 0, done); in aha152x_queue_lck()
992 static void reset_done(struct scsi_cmnd *SCpnt) in DEF_SCSI_QCMD()
994 if(SCSEM(SCpnt)) { in DEF_SCSI_QCMD()
995 complete(SCSEM(SCpnt)); in DEF_SCSI_QCMD()
1005 static int aha152x_abort(struct scsi_cmnd *SCpnt) in aha152x_abort() argument
1007 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_abort()
1013 ptr=remove_SC(&ISSUE_SC, SCpnt); in aha152x_abort()
1021 kfree(SCpnt->host_scribble); in aha152x_abort()
1022 SCpnt->host_scribble=NULL; in aha152x_abort()
1036 scmd_printk(KERN_ERR, SCpnt, in aha152x_abort()
1046 static int aha152x_device_reset(struct scsi_cmnd * SCpnt) in aha152x_device_reset() argument
1048 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_device_reset()
1051 unsigned char old_cmd_len = SCpnt->cmd_len; in aha152x_device_reset()
1055 if(CURRENT_SC==SCpnt) { in aha152x_device_reset()
1056 scmd_printk(KERN_ERR, SCpnt, "cannot reset current device\n"); in aha152x_device_reset()
1061 issued = remove_SC(&ISSUE_SC, SCpnt) == NULL; in aha152x_device_reset()
1062 disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1065 SCpnt->cmd_len = 0; in aha152x_device_reset()
1067 aha152x_internal_queue(SCpnt, &done, resetting, reset_done); in aha152x_device_reset()
1073 remove_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1077 SCpnt->cmd_len = old_cmd_len; in aha152x_device_reset()
1081 if(SCpnt->SCp.phase & resetted) { in aha152x_device_reset()
1085 kfree(SCpnt->host_scribble); in aha152x_device_reset()
1086 SCpnt->host_scribble=NULL; in aha152x_device_reset()
1092 append_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1094 append_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1166 static int aha152x_bus_reset(struct scsi_cmnd *SCpnt) in aha152x_bus_reset() argument
1168 return aha152x_bus_reset_host(SCpnt->device->host); in aha152x_bus_reset()