Lines Matching refs:SCp

564 		     struct scsi_cmnd *SCp, __u32 dsp)  in save_for_reselection()  argument
567 if(SCp != NULL) { in save_for_reselection()
569 (struct NCR_700_command_slot *)SCp->host_scribble; in save_for_reselection()
578 NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, in NCR_700_unmap() argument
581 if(SCp->sc_data_direction != DMA_NONE && in NCR_700_unmap()
582 SCp->sc_data_direction != DMA_BIDIRECTIONAL) in NCR_700_unmap()
583 scsi_dma_unmap(SCp); in NCR_700_unmap()
588 struct scsi_cmnd *SCp, int result) in NCR_700_scsi_done() argument
593 if(SCp != NULL) { in NCR_700_scsi_done()
595 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_scsi_done()
600 char *cmnd = NCR_700_get_sense_cmnd(SCp->device); in NCR_700_scsi_done()
609 SCp->cmd_len = cmnd[8]; in NCR_700_scsi_done()
611 NCR_700_unmap(hostdata, SCp, slot); in NCR_700_scsi_done()
615 if(NCR_700_get_depth(SCp->device) == 0 || in NCR_700_scsi_done()
616 NCR_700_get_depth(SCp->device) > SCp->device->queue_depth) in NCR_700_scsi_done()
618 NCR_700_get_depth(SCp->device)); in NCR_700_scsi_done()
620 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1); in NCR_700_scsi_done()
622 SCp->host_scribble = NULL; in NCR_700_scsi_done()
623 SCp->result = result; in NCR_700_scsi_done()
624 SCp->scsi_done(SCp); in NCR_700_scsi_done()
782 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_extended_message() argument
787 if(SCp != NULL) { in process_extended_message()
788 pun = SCp->device->id; in process_extended_message()
789 lun = SCp->device->lun; in process_extended_message()
794 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_extended_message()
795 struct scsi_target *starget = SCp->device->sdev_target; in process_extended_message()
807 if(NCR_700_is_flag_set(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION)) { in process_extended_message()
809 NCR_700_clear_flag(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION); in process_extended_message()
812 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_extended_message()
813 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_extended_message()
815 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in process_extended_message()
864 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_message() argument
870 if(SCp != NULL) { in process_message()
871 pun = SCp->device->id; in process_message()
872 lun = SCp->device->lun; in process_message()
885 resume_offset = process_extended_message(host, hostdata, SCp, in process_message()
890 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_message()
892 spi_period(SCp->device->sdev_target) = in process_message()
893 spi_offset(SCp->device->sdev_target) = 0; in process_message()
894 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_message()
895 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_message()
896 …} else if(SCp != NULL && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION)… in process_message()
898 scmd_printk(KERN_WARNING, SCp, in process_message()
901 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION); in process_message()
902 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_message()
904 SCp->device->tagged_supported = 0; in process_message()
905 SCp->device->simple_tags = 0; in process_message()
906 scsi_change_queue_depth(SCp->device, host->cmd_per_lun); in process_message()
952 process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, in process_script_interrupt() argument
959 if(SCp != NULL) { in process_script_interrupt()
960 pun = SCp->device->id; in process_script_interrupt()
961 lun = SCp->device->lun; in process_script_interrupt()
968 if (NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION) in process_script_interrupt()
969 NCR_700_set_tag_neg_state(SCp->device, in process_script_interrupt()
976 (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
980 scmd_printk(KERN_ERR, SCp, in process_script_interrupt()
982 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
985 NCR_700_get_sense_cmnd(SCp->device); in process_script_interrupt()
987 scsi_print_command(SCp); in process_script_interrupt()
989 SCp, hostdata->status[0]); in process_script_interrupt()
998 NCR_700_unmap(hostdata, SCp, slot); in process_script_interrupt()
1017 cmnd[8] = SCp->cmd_len; in process_script_interrupt()
1018 SCp->cmd_len = 6; /* command length for in process_script_interrupt()
1021 …slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FRO… in process_script_interrupt()
1028 dma_cache_sync(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE); in process_script_interrupt()
1058 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
1063 scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n", in process_script_interrupt()
1066 scmd_printk(KERN_ERR, SCp, " len = %d, cmd =", in process_script_interrupt()
1067 SCp->cmd_len); in process_script_interrupt()
1068 scsi_print_command(SCp); in process_script_interrupt()
1089 save_for_reselection(hostdata, SCp, dsp); in process_script_interrupt()
1110 struct scsi_cmnd *SCp = scsi_find_tag(SDp, hostdata->msgin[2]); in process_script_interrupt() local
1111 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1117 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1122 struct scsi_cmnd *SCp = scsi_find_tag(SDp, SCSI_NO_TAG); in process_script_interrupt() local
1123 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1128 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1202 SCp = hostdata->slots[i].cmnd; in process_script_interrupt()
1205 if(SCp != NULL) { in process_script_interrupt()
1206 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1242 resume_offset = process_message(host, hostdata, SCp, in process_script_interrupt()
1249 if(SCp != NULL) { in process_script_interrupt()
1252 scsi_print_command(SCp); in process_script_interrupt()
1253 scsi_for_each_sg(SCp, sg, scsi_sg_count(SCp) + 1, i) { in process_script_interrupt()
1254 …g->length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_comman… in process_script_interrupt()
1285 struct scsi_cmnd *SCp = hostdata->cmd; in process_selection() local
1308 if(hostdata->state == NCR_700_HOST_BUSY && SCp != NULL) { in process_selection()
1310 (struct NCR_700_command_slot *)SCp->host_scribble; in process_selection()
1316 save_for_reselection(hostdata, SCp, Ent_Disconnect2 + hostdata->pScript); in process_selection()
1320 save_for_reselection(hostdata, SCp, Ent_Disconnect4 + hostdata->pScript); in process_selection()
1324 save_for_reselection(hostdata, SCp, Ent_Disconnect6 + hostdata->pScript); in process_selection()
1328 save_for_reselection(hostdata, SCp, Ent_Disconnect8 + hostdata->pScript); in process_selection()
1332 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata); in process_selection()
1388 NCR_700_start_command(struct scsi_cmnd *SCp) in NCR_700_start_command() argument
1391 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_start_command()
1393 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_start_command()
1395 u8 lun = SCp->device->lun; in NCR_700_start_command()
1404 SCp->device->host->host_no, slot->cmnd, slot)); in NCR_700_start_command()
1408 hostdata->cmd = SCp; in NCR_700_start_command()
1413 hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1419 if(SCp->cmnd[0] == INQUIRY || SCp->cmnd[0] == REQUEST_SENSE || in NCR_700_start_command()
1421 NCR_700_clear_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in NCR_700_start_command()
1428 if((hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_start_command()
1429 && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1431 count += spi_populate_tag_msg(&hostdata->msgout[count], SCp); in NCR_700_start_command()
1435 NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) { in NCR_700_start_command()
1437 spi_period(SCp->device->sdev_target), in NCR_700_start_command()
1438 spi_offset(SCp->device->sdev_target)); in NCR_700_start_command()
1439 NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in NCR_700_start_command()
1446 Device_ID, 1<<scmd_id(SCp)); in NCR_700_start_command()
1451 SCp->cmd_len); in NCR_700_start_command()
1456 NCR_700_clear_fifo(SCp->device->host); in NCR_700_start_command()
1464 dma_cache_sync(hostdata->dev, SCp->cmnd, SCp->cmd_len, DMA_TO_DEVICE); in NCR_700_start_command()
1468 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in NCR_700_start_command()
1469 SCp->device->host, SXFER_REG); in NCR_700_start_command()
1470 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG); in NCR_700_start_command()
1471 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG); in NCR_700_start_command()
1499 struct scsi_cmnd *SCp = hostdata->cmd; in NCR_700_intr() local
1504 SCp = hostdata->cmd; in NCR_700_intr()
1526 if(SCp != NULL) { in NCR_700_intr()
1527 pun = SCp->device->id; in NCR_700_intr()
1528 lun = SCp->device->lun; in NCR_700_intr()
1538 … host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript); in NCR_700_intr()
1548 struct scsi_cmnd *SCp; in NCR_700_intr() local
1555 SCp = slot->cmnd; in NCR_700_intr()
1557 slot, SCp); in NCR_700_intr()
1559 SCp->host_scribble = NULL; in NCR_700_intr()
1560 NCR_700_set_depth(SCp->device, 0); in NCR_700_intr()
1567 SCp->result = DID_RESET << 16; in NCR_700_intr()
1568 SCp->scsi_done(SCp); in NCR_700_intr()
1582 NCR_700_scsi_done(hostdata, SCp, DID_NO_CONNECT<<16); in NCR_700_intr()
1584 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : in NCR_700_intr()
1585 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_intr()
1608 scsi_print_command(SCp); in NCR_700_intr()
1657 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1661 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1665 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata); in NCR_700_intr()
1671 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1675 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1749 NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) in NCR_700_queuecommand_lck() argument
1752 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_queuecommand_lck()
1760 …printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_n… in NCR_700_queuecommand_lck()
1769 if(NCR_700_get_depth(SCp->device) != 0 in NCR_700_queuecommand_lck()
1770 && (!(hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_queuecommand_lck()
1771 || !(SCp->flags & SCMD_TAGGED))) { in NCR_700_queuecommand_lck()
1772 CDEBUG(KERN_ERR, SCp, "has non zero depth %d\n", in NCR_700_queuecommand_lck()
1773 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1776 if(NCR_700_get_depth(SCp->device) >= SCp->device->queue_depth) { in NCR_700_queuecommand_lck()
1777 CDEBUG(KERN_ERR, SCp, "has max tag depth %d\n", in NCR_700_queuecommand_lck()
1778 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1781 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) + 1); in NCR_700_queuecommand_lck()
1788 slot->cmnd = SCp; in NCR_700_queuecommand_lck()
1790 SCp->scsi_done = done; in NCR_700_queuecommand_lck()
1791 SCp->host_scribble = (unsigned char *)slot; in NCR_700_queuecommand_lck()
1792 SCp->SCp.ptr = NULL; in NCR_700_queuecommand_lck()
1793 SCp->SCp.buffer = NULL; in NCR_700_queuecommand_lck()
1796 printk("53c700: scsi%d, command ", SCp->device->host->host_no); in NCR_700_queuecommand_lck()
1797 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1799 if ((SCp->flags & SCMD_TAGGED) in NCR_700_queuecommand_lck()
1800 && (hostdata->tag_negotiated &(1<<scmd_id(SCp))) == 0 in NCR_700_queuecommand_lck()
1801 && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_START_TAG_NEGOTIATION) { in NCR_700_queuecommand_lck()
1802 scmd_printk(KERN_ERR, SCp, "Enabling Tag Command Queuing\n"); in NCR_700_queuecommand_lck()
1803 hostdata->tag_negotiated |= (1<<scmd_id(SCp)); in NCR_700_queuecommand_lck()
1804 NCR_700_set_tag_neg_state(SCp->device, NCR_700_DURING_TAG_NEGOTIATION); in NCR_700_queuecommand_lck()
1813 if (!(SCp->flags & SCMD_TAGGED) in NCR_700_queuecommand_lck()
1814 && (hostdata->tag_negotiated &(1<<scmd_id(SCp)))) { in NCR_700_queuecommand_lck()
1815 scmd_printk(KERN_INFO, SCp, "Disabling Tag Command Queuing\n"); in NCR_700_queuecommand_lck()
1816 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in NCR_700_queuecommand_lck()
1819 if ((hostdata->tag_negotiated & (1<<scmd_id(SCp))) && in NCR_700_queuecommand_lck()
1820 SCp->device->simple_tags) { in NCR_700_queuecommand_lck()
1821 slot->tag = SCp->request->tag; in NCR_700_queuecommand_lck()
1822 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", in NCR_700_queuecommand_lck()
1827 SCp->device->current_cmnd = SCp; in NCR_700_queuecommand_lck()
1831 if(!scsi_sg_count(SCp) && !scsi_bufflen(SCp) && in NCR_700_queuecommand_lck()
1832 SCp->sc_data_direction != DMA_NONE) { in NCR_700_queuecommand_lck()
1835 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1836 printk("Has wrong data direction %d\n", SCp->sc_data_direction); in NCR_700_queuecommand_lck()
1838 SCp->sc_data_direction = DMA_NONE; in NCR_700_queuecommand_lck()
1841 switch (SCp->cmnd[0]) { in NCR_700_queuecommand_lck()
1844 SCp->cmnd[6] = 0; in NCR_700_queuecommand_lck()
1848 switch(SCp->sc_data_direction) { in NCR_700_queuecommand_lck()
1852 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1869 direction = SCp->sc_data_direction; in NCR_700_queuecommand_lck()
1877 sg_count = scsi_dma_map(SCp); in NCR_700_queuecommand_lck()
1880 scsi_for_each_sg(SCp, sg, sg_count, i) { in NCR_700_queuecommand_lck()
1897 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, in NCR_700_queuecommand_lck()
1899 NCR_700_start_command(SCp); in NCR_700_queuecommand_lck()
1906 NCR_700_abort(struct scsi_cmnd * SCp) in DEF_SCSI_QCMD()
1910 scmd_printk(KERN_INFO, SCp, "abort command\n"); in DEF_SCSI_QCMD()
1912 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in DEF_SCSI_QCMD()
1917 if(SCp->cmnd[0] == TEST_UNIT_READY) { in DEF_SCSI_QCMD()
1928 NCR_700_internal_bus_reset(SCp->device->host); in DEF_SCSI_QCMD()
1936 NCR_700_bus_reset(struct scsi_cmnd * SCp) in NCR_700_bus_reset() argument
1940 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_bus_reset()
1942 scmd_printk(KERN_INFO, SCp, in NCR_700_bus_reset()
1943 "New error handler wants BUS reset, cmd %p\n\t", SCp); in NCR_700_bus_reset()
1944 scsi_print_command(SCp); in NCR_700_bus_reset()
1949 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1951 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1953 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1957 NCR_700_internal_bus_reset(SCp->device->host); in NCR_700_bus_reset()
1959 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1961 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1966 spi_schedule_dv_device(SCp->device); in NCR_700_bus_reset()
1968 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_bus_reset()
1973 NCR_700_host_reset(struct scsi_cmnd * SCp) in NCR_700_host_reset() argument
1975 scmd_printk(KERN_INFO, SCp, "New error handler wants HOST reset\n\t"); in NCR_700_host_reset()
1976 scsi_print_command(SCp); in NCR_700_host_reset()
1978 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1980 NCR_700_internal_bus_reset(SCp->device->host); in NCR_700_host_reset()
1981 NCR_700_chip_reset(SCp->device->host); in NCR_700_host_reset()
1983 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()