Lines Matching refs:SCpnt

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