Lines Matching refs:SC
775 int ips_eh_abort(struct scsi_cmnd *SC) in ips_eh_abort() argument
784 if (!SC) in ips_eh_abort()
787 host = SC->device->host; in ips_eh_abort()
788 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
800 while ((item) && (item->scsi_cmd != SC)) in ips_eh_abort()
809 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
832 static int __ips_eh_reset(struct scsi_cmnd *SC) in __ips_eh_reset() argument
846 if (!SC) { in __ips_eh_reset()
852 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
865 while ((item) && (item->scsi_cmd != SC)) in __ips_eh_reset()
875 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
1015 static int ips_eh_reset(struct scsi_cmnd *SC) in ips_eh_reset() argument
1019 spin_lock_irq(SC->device->host->host_lock); in ips_eh_reset()
1020 rc = __ips_eh_reset(SC); in ips_eh_reset()
1021 spin_unlock_irq(SC->device->host->host_lock); in ips_eh_reset()
1038 static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) in ips_queue_lck() argument
1045 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1053 if (ips_is_passthru(SC)) { in ips_queue_lck()
1055 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1056 done(SC); in ips_queue_lck()
1061 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1062 done(SC); in ips_queue_lck()
1067 SC->scsi_done = done; in ips_queue_lck()
1072 SC->cmnd[0], in ips_queue_lck()
1073 SC->device->channel, SC->device->id, SC->device->lun); in ips_queue_lck()
1076 if ((scmd_channel(SC) > 0) in ips_queue_lck()
1077 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1078 SC->result = DID_NO_CONNECT << 16; in ips_queue_lck()
1079 done(SC); in ips_queue_lck()
1084 if (ips_is_passthru(SC)) { in ips_queue_lck()
1091 pt = (ips_passthru_t *) scsi_sglist(SC); in ips_queue_lck()
1095 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1096 done(SC); in ips_queue_lck()
1100 __ips_eh_reset(SC); in ips_queue_lck()
1101 SC->result = DID_OK << 16; in ips_queue_lck()
1102 SC->scsi_done(SC); in ips_queue_lck()
1110 SC->result = DID_ERROR << 16; in ips_queue_lck()
1111 done(SC); in ips_queue_lck()
1116 scratch->scsi_cmd = SC; in ips_queue_lck()
1121 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1482 static int ips_is_passthru(struct scsi_cmnd *SC) in ips_is_passthru() argument
1488 if (!SC) in ips_is_passthru()
1491 if ((SC->cmnd[0] == IPS_IOCTL_COMMAND) && in ips_is_passthru()
1492 (SC->device->channel == 0) && in ips_is_passthru()
1493 (SC->device->id == IPS_ADAPTER_ID) && in ips_is_passthru()
1494 (SC->device->lun == 0) && scsi_sglist(SC)) { in ips_is_passthru()
1495 struct scatterlist *sg = scsi_sglist(SC); in ips_is_passthru()
1557 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1562 struct scatterlist *sg = scsi_sglist(SC); in ips_make_passthru()
1566 scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i) in ips_make_passthru()
1580 ips_scmd_buf_read(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1583 ips_scmd_buf_write(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1589 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1606 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1608 SC->result = DID_OK << 16; in ips_make_passthru()
1614 if (SC->cmnd[0] == IPS_IOCTL_COMMAND) { in ips_make_passthru()
1628 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
2525 struct scsi_cmnd *SC; in ips_next() local
2639 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2644 SC->result = DID_OK; in ips_next()
2645 SC->host_scribble = NULL; in ips_next()
2647 scb->target_id = SC->device->id; in ips_next()
2648 scb->lun = SC->device->lun; in ips_next()
2649 scb->bus = SC->device->channel; in ips_next()
2650 scb->scsi_cmd = SC; in ips_next()
2658 memcpy(scb->cdb, SC->cmnd, SC->cmd_len); in ips_next()
2660 scb->sg_count = scsi_dma_map(SC); in ips_next()
2668 scsi_for_each_sg(SC, sg, scb->sg_count, i) { in ips_next()