Lines Matching refs:SC
780 int ips_eh_abort(struct scsi_cmnd *SC) in ips_eh_abort() argument
789 if (!SC) in ips_eh_abort()
792 host = SC->device->host; in ips_eh_abort()
793 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_eh_abort()
805 while ((item) && (item->scsi_cmd != SC)) in ips_eh_abort()
814 } else if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in ips_eh_abort()
837 static int __ips_eh_reset(struct scsi_cmnd *SC) in __ips_eh_reset() argument
851 if (!SC) { in __ips_eh_reset()
857 ha = (ips_ha_t *) SC->device->host->hostdata; in __ips_eh_reset()
870 while ((item) && (item->scsi_cmd != SC)) in __ips_eh_reset()
880 if (ips_removeq_wait(&ha->scb_waitlist, SC)) { in __ips_eh_reset()
1023 static int ips_eh_reset(struct scsi_cmnd *SC) in ips_eh_reset() argument
1027 spin_lock_irq(SC->device->host->host_lock); in ips_eh_reset()
1028 rc = __ips_eh_reset(SC); in ips_eh_reset()
1029 spin_unlock_irq(SC->device->host->host_lock); in ips_eh_reset()
1046 static int ips_queue_lck(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *)) in ips_queue_lck() argument
1053 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1061 if (ips_is_passthru(SC)) { in ips_queue_lck()
1063 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1064 done(SC); in ips_queue_lck()
1069 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1070 done(SC); in ips_queue_lck()
1075 SC->scsi_done = done; in ips_queue_lck()
1080 SC->cmnd[0], in ips_queue_lck()
1081 SC->device->channel, SC->device->id, SC->device->lun); in ips_queue_lck()
1084 if ((scmd_channel(SC) > 0) in ips_queue_lck()
1085 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1086 SC->result = DID_NO_CONNECT << 16; in ips_queue_lck()
1087 done(SC); in ips_queue_lck()
1092 if (ips_is_passthru(SC)) { in ips_queue_lck()
1099 pt = (ips_passthru_t *) scsi_sglist(SC); in ips_queue_lck()
1103 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1104 done(SC); in ips_queue_lck()
1108 __ips_eh_reset(SC); in ips_queue_lck()
1109 SC->result = DID_OK << 16; in ips_queue_lck()
1110 SC->scsi_done(SC); in ips_queue_lck()
1118 SC->result = DID_ERROR << 16; in ips_queue_lck()
1119 done(SC); in ips_queue_lck()
1124 scratch->scsi_cmd = SC; in ips_queue_lck()
1129 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1490 static int ips_is_passthru(struct scsi_cmnd *SC) in ips_is_passthru() argument
1496 if (!SC) in ips_is_passthru()
1499 if ((SC->cmnd[0] == IPS_IOCTL_COMMAND) && in ips_is_passthru()
1500 (SC->device->channel == 0) && in ips_is_passthru()
1501 (SC->device->id == IPS_ADAPTER_ID) && in ips_is_passthru()
1502 (SC->device->lun == 0) && scsi_sglist(SC)) { in ips_is_passthru()
1503 struct scatterlist *sg = scsi_sglist(SC); in ips_is_passthru()
1564 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1569 struct scatterlist *sg = scsi_sglist(SC); in ips_make_passthru()
1573 scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i) in ips_make_passthru()
1587 ips_scmd_buf_read(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1590 ips_scmd_buf_write(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1596 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1613 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1615 SC->result = DID_OK << 16; in ips_make_passthru()
1621 if (SC->cmnd[0] == IPS_IOCTL_COMMAND) { in ips_make_passthru()
1635 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
2538 struct scsi_cmnd *SC; in ips_next() local
2655 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2660 SC->result = DID_OK; in ips_next()
2661 SC->host_scribble = NULL; in ips_next()
2663 scb->target_id = SC->device->id; in ips_next()
2664 scb->lun = SC->device->lun; in ips_next()
2665 scb->bus = SC->device->channel; in ips_next()
2666 scb->scsi_cmd = SC; in ips_next()
2674 memcpy(scb->cdb, SC->cmnd, SC->cmd_len); in ips_next()
2676 scb->sg_count = scsi_dma_map(SC); in ips_next()
2684 scsi_for_each_sg(SC, sg, scb->sg_count, i) { in ips_next()