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
906 static int aha152x_internal_queue(struct scsi_cmnd *SCpnt, in aha152x_internal_queue() argument
910 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_internal_queue()
913 SCpnt->scsi_done = done; in aha152x_internal_queue()
914 SCpnt->SCp.phase = not_issued | phase; in aha152x_internal_queue()
915 SCpnt->SCp.Status = 0x1; /* Ilegal status by SCSI standard */ in aha152x_internal_queue()
916 SCpnt->SCp.Message = 0; in aha152x_internal_queue()
917 SCpnt->SCp.have_data_in = 0; in aha152x_internal_queue()
918 SCpnt->SCp.sent_command = 0; in aha152x_internal_queue()
920 if(SCpnt->SCp.phase & (resetting|check_condition)) { in aha152x_internal_queue()
921 if (!SCpnt->host_scribble || SCSEM(SCpnt) || SCNEXT(SCpnt)) { in aha152x_internal_queue()
922 scmd_printk(KERN_ERR, SCpnt, "cannot reuse command\n"); in aha152x_internal_queue()
926 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); in aha152x_internal_queue()
927 if(!SCpnt->host_scribble) { in aha152x_internal_queue()
928 scmd_printk(KERN_ERR, SCpnt, "allocation failed\n"); in aha152x_internal_queue()
933 SCNEXT(SCpnt) = NULL; in aha152x_internal_queue()
934 SCSEM(SCpnt) = complete; in aha152x_internal_queue()
942 if ((phase & resetting) || !scsi_sglist(SCpnt)) { in aha152x_internal_queue()
943 SCpnt->SCp.ptr = NULL; in aha152x_internal_queue()
944 SCpnt->SCp.this_residual = 0; in aha152x_internal_queue()
945 scsi_set_resid(SCpnt, 0); in aha152x_internal_queue()
946 SCpnt->SCp.buffer = NULL; in aha152x_internal_queue()
948 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); in aha152x_internal_queue()
949 SCpnt->SCp.buffer = scsi_sglist(SCpnt); in aha152x_internal_queue()
950 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer); in aha152x_internal_queue()
951 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; in aha152x_internal_queue()
965 append_SC(&ISSUE_SC, SCpnt); in aha152x_internal_queue()
979 static int aha152x_queue_lck(struct scsi_cmnd *SCpnt, in aha152x_queue_lck() argument
982 return aha152x_internal_queue(SCpnt, NULL, 0, done); in aha152x_queue_lck()
991 static void reset_done(struct scsi_cmnd *SCpnt) in DEF_SCSI_QCMD()
993 if(SCSEM(SCpnt)) { in DEF_SCSI_QCMD()
994 complete(SCSEM(SCpnt)); in DEF_SCSI_QCMD()
1004 static int aha152x_abort(struct scsi_cmnd *SCpnt) in aha152x_abort() argument
1006 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_abort()
1012 ptr=remove_SC(&ISSUE_SC, SCpnt); in aha152x_abort()
1020 kfree(SCpnt->host_scribble); in aha152x_abort()
1021 SCpnt->host_scribble=NULL; in aha152x_abort()
1035 scmd_printk(KERN_ERR, SCpnt, in aha152x_abort()
1045 static int aha152x_device_reset(struct scsi_cmnd * SCpnt) in aha152x_device_reset() argument
1047 struct Scsi_Host *shpnt = SCpnt->device->host; in aha152x_device_reset()
1050 unsigned char old_cmd_len = SCpnt->cmd_len; in aha152x_device_reset()
1054 if(CURRENT_SC==SCpnt) { in aha152x_device_reset()
1055 scmd_printk(KERN_ERR, SCpnt, "cannot reset current device\n"); in aha152x_device_reset()
1060 issued = remove_SC(&ISSUE_SC, SCpnt) == NULL; in aha152x_device_reset()
1061 disconnected = issued && remove_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1064 SCpnt->cmd_len = 0; in aha152x_device_reset()
1066 aha152x_internal_queue(SCpnt, &done, resetting, reset_done); in aha152x_device_reset()
1072 remove_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1076 SCpnt->cmd_len = old_cmd_len; in aha152x_device_reset()
1080 if(SCpnt->SCp.phase & resetted) { in aha152x_device_reset()
1084 kfree(SCpnt->host_scribble); in aha152x_device_reset()
1085 SCpnt->host_scribble=NULL; in aha152x_device_reset()
1091 append_SC(&ISSUE_SC, SCpnt); in aha152x_device_reset()
1093 append_SC(&DISCONNECTED_SC, SCpnt); in aha152x_device_reset()
1165 static int aha152x_bus_reset(struct scsi_cmnd *SCpnt) in aha152x_bus_reset() argument
1167 return aha152x_bus_reset_host(SCpnt->device->host); in aha152x_bus_reset()