Lines Matching refs:SC
784 int ips_eh_abort(struct scsi_cmnd *SC) in ips_eh_abort() argument
793 if (!SC) in ips_eh_abort()
796 host = SC->device->host; in ips_eh_abort()
797 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
809 while ((item) && (item->scsi_cmd != SC)) in ips_eh_abort()
818 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
841 static int __ips_eh_reset(struct scsi_cmnd *SC) in __ips_eh_reset() argument
855 if (!SC) { in __ips_eh_reset()
861 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
874 while ((item) && (item->scsi_cmd != SC)) in __ips_eh_reset()
884 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
1027 static int ips_eh_reset(struct scsi_cmnd *SC) in ips_eh_reset() argument
1031 spin_lock_irq(SC->device->host->host_lock); in ips_eh_reset()
1032 rc = __ips_eh_reset(SC); in ips_eh_reset()
1033 spin_unlock_irq(SC->device->host->host_lock); in ips_eh_reset()
1050 static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) in ips_queue_lck() argument
1057 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1065 if (ips_is_passthru(SC)) { in ips_queue_lck()
1067 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1068 done(SC); in ips_queue_lck()
1073 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1074 done(SC); in ips_queue_lck()
1079 SC->scsi_done = done; in ips_queue_lck()
1084 SC->cmnd[0], in ips_queue_lck()
1085 SC->device->channel, SC->device->id, SC->device->lun); in ips_queue_lck()
1088 if ((scmd_channel(SC) > 0) in ips_queue_lck()
1089 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1090 SC->result = DID_NO_CONNECT << 16; in ips_queue_lck()
1091 done(SC); in ips_queue_lck()
1096 if (ips_is_passthru(SC)) { in ips_queue_lck()
1103 pt = (ips_passthru_t *) scsi_sglist(SC); in ips_queue_lck()
1107 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1108 done(SC); in ips_queue_lck()
1112 __ips_eh_reset(SC); in ips_queue_lck()
1113 SC->result = DID_OK << 16; in ips_queue_lck()
1114 SC->scsi_done(SC); in ips_queue_lck()
1122 SC->result = DID_ERROR << 16; in ips_queue_lck()
1123 done(SC); in ips_queue_lck()
1128 scratch->scsi_cmd = SC; in ips_queue_lck()
1133 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1494 static int ips_is_passthru(struct scsi_cmnd *SC) in ips_is_passthru() argument
1500 if (!SC) in ips_is_passthru()
1503 if ((SC->cmnd[0] == IPS_IOCTL_COMMAND) && in ips_is_passthru()
1504 (SC->device->channel == 0) && in ips_is_passthru()
1505 (SC->device->id == IPS_ADAPTER_ID) && in ips_is_passthru()
1506 (SC->device->lun == 0) && scsi_sglist(SC)) { in ips_is_passthru()
1507 struct scatterlist *sg = scsi_sglist(SC); in ips_is_passthru()
1568 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1573 struct scatterlist *sg = scsi_sglist(SC); in ips_make_passthru()
1577 scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i) in ips_make_passthru()
1591 ips_scmd_buf_read(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1594 ips_scmd_buf_write(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1600 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1617 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1619 SC->result = DID_OK << 16; in ips_make_passthru()
1625 if (SC->cmnd[0] == IPS_IOCTL_COMMAND) { in ips_make_passthru()
1639 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
2542 struct scsi_cmnd *SC; in ips_next() local
2659 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2664 SC->result = DID_OK; in ips_next()
2665 SC->host_scribble = NULL; in ips_next()
2667 scb->target_id = SC->device->id; in ips_next()
2668 scb->lun = SC->device->lun; in ips_next()
2669 scb->bus = SC->device->channel; in ips_next()
2670 scb->scsi_cmd = SC; in ips_next()
2678 memcpy(scb->cdb, SC->cmnd, SC->cmd_len); in ips_next()
2680 scb->sg_count = scsi_dma_map(SC); in ips_next()
2688 scsi_for_each_sg(SC, sg, scb->sg_count, i) { in ips_next()