Lines Matching refs:SCpnt

564 #define SCDATA(SCpnt)		((struct aha152x_scdata *) (SCpnt)->host_scribble)  argument
565 #define SCNEXT(SCpnt) SCDATA(SCpnt)->next argument
566 #define SCSEM(SCpnt) SCDATA(SCpnt)->done argument
917 static int aha152x_internal_queue(struct scsi_cmnd *SCpnt, in aha152x_internal_queue() argument
921 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_internal_queue()
924 SCpnt->scsi_done = done; in aha152x_internal_queue()
925 SCpnt->SCp.phase = not_issued | phase; in aha152x_internal_queue()
926 SCpnt->SCp.Status = 0x1; /* Ilegal status by SCSI standard */ in aha152x_internal_queue()
927 SCpnt->SCp.Message = 0; in aha152x_internal_queue()
928 SCpnt->SCp.have_data_in = 0; in aha152x_internal_queue()
929 SCpnt->SCp.sent_command = 0; in aha152x_internal_queue()
931 if(SCpnt->SCp.phase & (resetting|check_condition)) { in aha152x_internal_queue()
932 if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) { in aha152x_internal_queue()
933 scmd_printk(KERN_ERR, SCpnt, "cannot reuse command\n"); in aha152x_internal_queue()
937 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); in aha152x_internal_queue()
938 if(!SCpnt->host_scribble) { in aha152x_internal_queue()
939 scmd_printk(KERN_ERR, SCpnt, "allocation failed\n"); in aha152x_internal_queue()
944 SCNEXT(SCpnt) = NULL; in aha152x_internal_queue()
945 SCSEM(SCpnt) = complete; in aha152x_internal_queue()
954 if ((phase & resetting) || !scsi_sglist(SCpnt)) { in aha152x_internal_queue()
955 SCpnt->SCp.ptr = NULL; in aha152x_internal_queue()
956 SCpnt->SCp.this_residual = 0; in aha152x_internal_queue()
957 scsi_set_resid(SCpnt, 0); in aha152x_internal_queue()
958 SCpnt->SCp.buffer = NULL; in aha152x_internal_queue()
959 SCpnt->SCp.buffers_residual = 0; in aha152x_internal_queue()
961 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); in aha152x_internal_queue()
962 SCpnt->SCp.buffer = scsi_sglist(SCpnt); in aha152x_internal_queue()
963 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer); in aha152x_internal_queue()
964 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; in aha152x_internal_queue()
965 SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1; in aha152x_internal_queue()
979 append_SC(&ISSUE_SC, SCpnt); in aha152x_internal_queue()
993 static int aha152x_queue_lck(struct scsi_cmnd *SCpnt, in aha152x_queue_lck() argument
996 return aha152x_internal_queue(SCpnt, NULL, 0, done); in aha152x_queue_lck()
1005 static void reset_done(struct scsi_cmnd *SCpnt) in DEF_SCSI_QCMD()
1007 if(SCSEM(SCpnt)) { in DEF_SCSI_QCMD()
1008 complete(SCSEM(SCpnt)); in DEF_SCSI_QCMD()
1018 static int aha152x_abort(struct scsi_cmnd *SCpnt) in aha152x_abort() argument
1020 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_abort()
1026 ptr=remove_SC(&ISSUE_SC, SCpnt); in aha152x_abort()
1034 kfree(SCpnt->host_scribble); in aha152x_abort()
1035 SCpnt->host_scribble=NULL; in aha152x_abort()
1049 scmd_printk(KERN_ERR, SCpnt, in aha152x_abort()
1059 static int aha152x_device_reset(struct scsi_cmnd * SCpnt) in aha152x_device_reset() argument
1061 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_device_reset()
1064 unsigned char old_cmd_len = SCpnt->cmd_len; in aha152x_device_reset()
1068 if(CURRENT_SC==SCpnt) { in aha152x_device_reset()
1069 scmd_printk(KERN_ERR, SCpnt, "cannot reset current device\n"); in aha152x_device_reset()
1074 issued = remove_SC(&ISSUE_SC, SCpnt) == NULL; in aha152x_device_reset()
1075 disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1078 SCpnt->cmd_len = 0; in aha152x_device_reset()
1080 aha152x_internal_queue(SCpnt, &done, resetting, reset_done); in aha152x_device_reset()
1086 remove_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1090 SCpnt->cmd_len = old_cmd_len; in aha152x_device_reset()
1094 if(SCpnt->SCp.phase & resetted) { in aha152x_device_reset()
1098 kfree(SCpnt->host_scribble); in aha152x_device_reset()
1099 SCpnt->host_scribble=NULL; in aha152x_device_reset()
1105 append_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1107 append_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1179 static int aha152x_bus_reset(struct scsi_cmnd *SCpnt) in aha152x_bus_reset() argument
1181 return aha152x_bus_reset_host(SCpnt->device->host); in aha152x_bus_reset()