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) in ips_queue_lck() argument
1046 ha = (ips_ha_t *) SC->device->host->hostdata; in ips_queue_lck()
1054 if (ips_is_passthru(SC)) { in ips_queue_lck()
1056 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1057 done(SC); in ips_queue_lck()
1062 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1063 done(SC); in ips_queue_lck()
1071 SC->cmnd[0], in ips_queue_lck()
1072 SC->device->channel, SC->device->id, SC->device->lun); in ips_queue_lck()
1075 if ((scmd_channel(SC) > 0) in ips_queue_lck()
1076 && (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) { in ips_queue_lck()
1077 SC->result = DID_NO_CONNECT << 16; in ips_queue_lck()
1078 done(SC); in ips_queue_lck()
1083 if (ips_is_passthru(SC)) { in ips_queue_lck()
1090 pt = (ips_passthru_t *) scsi_sglist(SC); in ips_queue_lck()
1094 SC->result = DID_BUS_BUSY << 16; in ips_queue_lck()
1095 done(SC); in ips_queue_lck()
1099 __ips_eh_reset(SC); in ips_queue_lck()
1100 SC->result = DID_OK << 16; in ips_queue_lck()
1101 scsi_done(SC); in ips_queue_lck()
1109 SC->result = DID_ERROR << 16; in ips_queue_lck()
1110 done(SC); in ips_queue_lck()
1115 scratch->scsi_cmd = SC; in ips_queue_lck()
1120 ips_putq_wait_tail(&ha->scb_waitlist, SC); in ips_queue_lck()
1127 SC->result = DID_ERROR << 16; in ips_queue_lck()
1128 done(SC); in ips_queue_lck()
1486 static int ips_is_passthru(struct scsi_cmnd *SC) in ips_is_passthru() argument
1492 if (!SC) in ips_is_passthru()
1495 if ((SC->cmnd[0] == IPS_IOCTL_COMMAND) && in ips_is_passthru()
1496 (SC->device->channel == 0) && in ips_is_passthru()
1497 (SC->device->id == IPS_ADAPTER_ID) && in ips_is_passthru()
1498 (SC->device->lun == 0) && scsi_sglist(SC)) { in ips_is_passthru()
1499 struct scatterlist *sg = scsi_sglist(SC); in ips_is_passthru()
1561 ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr) in ips_make_passthru() argument
1566 struct scatterlist *sg = scsi_sglist(SC); in ips_make_passthru()
1570 scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i) in ips_make_passthru()
1584 ips_scmd_buf_read(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1587 ips_scmd_buf_write(SC, pt, sizeof (ips_passthru_t)); in ips_make_passthru()
1593 ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize); in ips_make_passthru()
1610 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
1612 SC->result = DID_OK << 16; in ips_make_passthru()
1618 if (SC->cmnd[0] == IPS_IOCTL_COMMAND) { in ips_make_passthru()
1632 ips_scmd_buf_write(SC, ha->ioctl_data, in ips_make_passthru()
2529 struct scsi_cmnd *SC; in ips_next() local
2643 SC = ips_removeq_wait(&ha->scb_waitlist, q); in ips_next()
2648 SC->result = DID_OK; in ips_next()
2649 SC->host_scribble = NULL; in ips_next()
2651 scb->target_id = SC->device->id; in ips_next()
2652 scb->lun = SC->device->lun; in ips_next()
2653 scb->bus = SC->device->channel; in ips_next()
2654 scb->scsi_cmd = SC; in ips_next()
2662 memcpy(scb->cdb, SC->cmnd, SC->cmd_len); in ips_next()
2664 scb->sg_count = scsi_dma_map(SC); in ips_next()
2672 scsi_for_each_sg(SC, sg, scb->sg_count, i) { in ips_next()