Lines Matching refs:SCpnt

66  *        + Use SCpnt->sc_data_direction if set.
579 struct scsi_cmnd *SCpnt;
1118 struct scsi_cmnd *SCpnt;
1120 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1121 pci_dir = SCpnt->sc_data_direction;
1123 if (SCpnt->sense_buffer)
1124 cpp->sense_addr = H2DEV(pci_map_single(HD(j)->pdev, SCpnt->sense_buffer,
1129 if (scsi_bufflen(SCpnt)) {
1130 count = scsi_dma_map(SCpnt);
1133 scsi_for_each_sg(SCpnt, sg, count, k) {
1140 cpp->use_sg = scsi_sg_count(SCpnt);
1149 cpp->data_len = H2DEV(scsi_bufflen(SCpnt));
1156 struct scsi_cmnd *SCpnt;
1158 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1159 pci_dir = SCpnt->sc_data_direction;
1165 scsi_dma_unmap(SCpnt);
1177 struct scsi_cmnd *SCpnt;
1179 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1180 pci_dir = SCpnt->sc_data_direction;
1186 if (scsi_sg_count(SCpnt))
1187 pci_dma_sync_sg_for_cpu(HD(j)->pdev, scsi_sglist(SCpnt),
1188 scsi_sg_count(SCpnt), pci_dir);
1213 struct scsi_cmnd *SCpnt;
1215 cpp = &HD(j)->cp[i]; SCpnt = cpp->SCpnt;
1217 if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
1221 else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
1225 else if (SCpnt->sc_data_direction == DMA_NONE) {
1230 if (SCpnt->sc_data_direction != DMA_BIDIRECTIONAL)
1231 panic("%s: qcomm, invalid SCpnt->sc_data_direction.\n", BN(j));
1236 if (SCpnt->cmnd[0] == data_out_cmds[k]) {
1243 if (SCpnt->cmnd[0] == data_none_cmds[k]) {
1250 static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) {
1255 j = ((struct hostdata *) SCpnt->device->host->hostdata)->board_number;
1257 if (SCpnt->host_scribble)
1258 panic("%s: qcomm, SCpnt %p already active.\n",
1259 BN(j), SCpnt);
1284 SCpnt->scsi_done = done;
1286 SCpnt->host_scribble = (unsigned char *) &cpp->cpp_index;
1289 BN(j), i, SCpnt->device->channel, SCpnt->device->id,
1290 (u8)SCpnt->device->lun);
1293 cpp->channel = SCpnt->device->channel;
1294 cpp->target = SCpnt->device->id;
1295 cpp->lun = (u8)SCpnt->device->lun;
1296 cpp->SCpnt = SCpnt;
1297 cpp->cdb_len = SCpnt->cmd_len;
1298 memcpy(cpp->cdb, SCpnt->cmnd, SCpnt->cmd_len);
1300 /* Use data transfer direction SCpnt->sc_data_direction */
1306 if (linked_comm && SCpnt->device->queue_depth > 2
1307 && TLDEV(SCpnt->device->type)) {
1309 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, FALSE);
1315 SCpnt->host_scribble = NULL;
1316 scmd_printk(KERN_INFO, SCpnt,
1362 if (SCarg != HD(j)->cp[i].SCpnt)
1363 panic("%s: abort, mbox %d, SCarg %p, cp SCpnt %p.\n",
1364 BN(j), i, SCarg, HD(j)->cp[i].SCpnt);
1399 struct scsi_cmnd *SCpnt;
1439 if (!(SCpnt = HD(j)->cp[i].SCpnt))
1440 panic("%s: reset, mbox %d, SCpnt == NULL.\n", BN(j), i);
1452 if (SCpnt->host_scribble == NULL)
1453 panic("%s: reset, mbox %d, garbled SCpnt.\n", BN(j), i);
1455 if (*(unsigned int *)SCpnt->host_scribble != i)
1458 if (SCpnt->scsi_done == NULL)
1459 panic("%s: reset, mbox %d, SCpnt->scsi_done == NULL.\n", BN(j), i);
1461 if (SCpnt == SCarg) arg_done = TRUE;
1489 SCpnt = HD(j)->cp[i].SCpnt;
1491 SCpnt->result = DID_RESET << 16;
1492 SCpnt->host_scribble = NULL;
1501 SCpnt = HD(j)->cp[i].SCpnt;
1503 SCpnt->result = DID_RESET << 16;
1504 SCpnt->host_scribble = NULL;
1517 SCpnt->scsi_done(SCpnt);
1580 struct scsi_cmnd *SCpnt;
1604 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1608 if (blk_rq_pos(SCpnt->request) < minsec)
1609 minsec = blk_rq_pos(SCpnt->request);
1610 if (blk_rq_pos(SCpnt->request) > maxsec)
1611 maxsec = blk_rq_pos(SCpnt->request);
1613 sl[n] = blk_rq_pos(SCpnt->request);
1614 ioseek += blk_rq_sectors(SCpnt->request);
1641 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1642 ll[n] = blk_rq_sectors(SCpnt->request); pl[n] = SCpnt->serial_number;
1665 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1668 (ihdlr ? "ihdlr" : "qcomm"), SCpnt->channel, SCpnt->target,
1669 (u8)SCpnt->lun, k, flushcount, n_ready,
1670 blk_rq_pos(SCpnt->request), blk_rq_sectors(SCpnt->request),
1680 struct scsi_cmnd *SCpnt;
1688 cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1690 if (SCpnt->device != dev) continue;
1700 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt;
1703 scmd_printk(KERN_INFO, SCpnt,
1720 struct scsi_cmnd *SCpnt;
1783 SCpnt = cpp->SCpnt;
1785 if (SCpnt == NULL) panic("%s: ihdlr, mbox %d, SCpnt == NULL.\n", BN(j), i);
1787 if (SCpnt->host_scribble == NULL)
1788 panic("%s: ihdlr, mbox %d, SCpnt %p garbled.\n", BN(j), i,
1789 SCpnt);
1791 if (*(unsigned int *)SCpnt->host_scribble != i)
1793 BN(j), i, *(unsigned int *)SCpnt->host_scribble);
1797 if (linked_comm && SCpnt->device->queue_depth > 2
1798 && TLDEV(SCpnt->device->type))
1799 flush_dev(SCpnt->device, blk_rq_pos(SCpnt->request), j, TRUE);
1812 if (tstatus == BUSY && SCpnt->device->type != TYPE_TAPE)
1816 else if (tstatus != GOOD && SCpnt->device->type == TYPE_DISK
1817 && HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)])
1822 && SCpnt->device->type == TYPE_DISK
1823 && (SCpnt->sense_buffer[2] & 0xf) == RECOVERED_ERROR)
1830 HD(j)->target_redo[scmd_id(SCpnt)][scmd_channel(SCpnt)] = FALSE;
1832 if (spp->target_status && SCpnt->device->type == TYPE_DISK &&
1834 (SCpnt->sense_buffer[2] & 0xf) == NOT_READY)))
1835 scmd_printk(KERN_INFO, SCpnt,
1838 SCpnt->sense_buffer[2]);
1840 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] = 0;
1842 if (HD(j)->last_retried_pid == SCpnt->serial_number) HD(j)->retries = 0;
1847 if (HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)] > 1)
1851 HD(j)->target_to[scmd_id(SCpnt)][scmd_channel(SCpnt)]++;
1869 if (SCpnt->device->type != TYPE_TAPE
1879 HD(j)->last_retried_pid = SCpnt->serial_number;
1897 SCpnt->result = status | spp->target_status;
1900 if (SCpnt->result || do_trace)
1907 scmd_printk(KERN_INFO, SCpnt, "ihdlr, mbox %2d, err 0x%x:%x,"\
1915 SCpnt->host_scribble = NULL;
1917 SCpnt->scsi_done(SCpnt);