• Home
  • Raw
  • Download

Lines Matching full:scp

67  * Bogendoerfer). Added missing SCp->request_bufflen initialisation
561 struct scsi_cmnd *SCp, __u32 dsp) in save_for_reselection() argument
564 if(SCp != NULL) { in save_for_reselection()
566 (struct NCR_700_command_slot *)SCp->host_scribble; in save_for_reselection()
575 NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, in NCR_700_unmap() argument
578 if(SCp->sc_data_direction != DMA_NONE && in NCR_700_unmap()
579 SCp->sc_data_direction != DMA_BIDIRECTIONAL) in NCR_700_unmap()
580 scsi_dma_unmap(SCp); in NCR_700_unmap()
585 struct scsi_cmnd *SCp, int result) in NCR_700_scsi_done() argument
590 if(SCp != NULL) { in NCR_700_scsi_done()
592 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_scsi_done()
597 char *cmnd = NCR_700_get_sense_cmnd(SCp->device); in NCR_700_scsi_done()
606 SCp->cmd_len = cmnd[8]; in NCR_700_scsi_done()
608 NCR_700_unmap(hostdata, SCp, slot); in NCR_700_scsi_done()
612 if(NCR_700_get_depth(SCp->device) == 0 || in NCR_700_scsi_done()
613 NCR_700_get_depth(SCp->device) > SCp->device->queue_depth) in NCR_700_scsi_done()
615 NCR_700_get_depth(SCp->device)); in NCR_700_scsi_done()
617 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1); in NCR_700_scsi_done()
619 SCp->host_scribble = NULL; in NCR_700_scsi_done()
620 SCp->result = result; in NCR_700_scsi_done()
621 SCp->scsi_done(SCp); in NCR_700_scsi_done()
623 printk(KERN_ERR "53c700: SCSI DONE HAS NULL SCp\n"); in NCR_700_scsi_done()
779 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_extended_message() argument
784 if(SCp != NULL) { in process_extended_message()
785 pun = SCp->device->id; in process_extended_message()
786 lun = SCp->device->lun; in process_extended_message()
791 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_extended_message()
792 struct scsi_target *starget = SCp->device->sdev_target; in process_extended_message()
804 if(NCR_700_is_flag_set(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION)) { in process_extended_message()
806 NCR_700_clear_flag(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION); in process_extended_message()
809 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_extended_message()
810 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_extended_message()
812 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in process_extended_message()
861 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_message() argument
867 if(SCp != NULL) { in process_message()
868 pun = SCp->device->id; in process_message()
869 lun = SCp->device->lun; in process_message()
882 resume_offset = process_extended_message(host, hostdata, SCp, in process_message()
887 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_message()
889 spi_period(SCp->device->sdev_target) = in process_message()
890 spi_offset(SCp->device->sdev_target) = 0; in process_message()
891 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_message()
892 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_message()
893 …} else if(SCp != NULL && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION)… in process_message()
895 scmd_printk(KERN_WARNING, SCp, in process_message()
898 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION); in process_message()
899 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_message()
901 SCp->device->tagged_supported = 0; in process_message()
902 SCp->device->simple_tags = 0; in process_message()
903 scsi_change_queue_depth(SCp->device, host->cmd_per_lun); in process_message()
949 process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, in process_script_interrupt() argument
956 if(SCp != NULL) { in process_script_interrupt()
957 pun = SCp->device->id; in process_script_interrupt()
958 lun = SCp->device->lun; in process_script_interrupt()
965 if (NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION) in process_script_interrupt()
966 NCR_700_set_tag_neg_state(SCp->device, in process_script_interrupt()
973 (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
977 scmd_printk(KERN_ERR, SCp, in process_script_interrupt()
979 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
982 NCR_700_get_sense_cmnd(SCp->device); in process_script_interrupt()
984 scsi_print_command(SCp); in process_script_interrupt()
986 SCp, hostdata->status[0]); in process_script_interrupt()
995 NCR_700_unmap(hostdata, SCp, slot); in process_script_interrupt()
1014 cmnd[8] = SCp->cmd_len; in process_script_interrupt()
1015 SCp->cmd_len = 6; /* command length for in process_script_interrupt()
1018 …slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FRO… in process_script_interrupt()
1025 dma_cache_sync(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE); in process_script_interrupt()
1038 // SCp->cmnd[0] == INQUIRY && SCp->use_sg == 0) { in process_script_interrupt()
1043 // SCp->request_bufflen, in process_script_interrupt()
1045 // if(((char *)SCp->request_buffer)[7] & 0x02) { in process_script_interrupt()
1046 // scmd_printk(KERN_INFO, SCp, in process_script_interrupt()
1048 // hostdata->tag_negotiated |= (1<<scmd_id(SCp)); in process_script_interrupt()
1049 // NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1051 // NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1052 // hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_script_interrupt()
1055 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
1060 scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n", in process_script_interrupt()
1063 scmd_printk(KERN_ERR, SCp, " len = %d, cmd =", in process_script_interrupt()
1064 SCp->cmd_len); in process_script_interrupt()
1065 scsi_print_command(SCp); in process_script_interrupt()
1086 save_for_reselection(hostdata, SCp, dsp); in process_script_interrupt()
1107 struct scsi_cmnd *SCp; in process_script_interrupt() local
1109 SCp = scsi_host_find_tag(SDp->host, hostdata->msgin[2]); in process_script_interrupt()
1110 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1116 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1122 struct scsi_cmnd *SCp = p->current_cmnd; in process_script_interrupt() local
1124 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1129 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1203 SCp = hostdata->slots[i].cmnd; in process_script_interrupt()
1206 if(SCp != NULL) { in process_script_interrupt()
1207 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1243 resume_offset = process_message(host, hostdata, SCp, in process_script_interrupt()
1250 if(SCp != NULL) { in process_script_interrupt()
1253 scsi_print_command(SCp); in process_script_interrupt()
1254 scsi_for_each_sg(SCp, sg, scsi_sg_count(SCp) + 1, i) { in process_script_interrupt()
1255 …g->length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_comman… in process_script_interrupt()
1286 struct scsi_cmnd *SCp = hostdata->cmd; in process_selection() local
1309 if(hostdata->state == NCR_700_HOST_BUSY && SCp != NULL) { in process_selection()
1311 (struct NCR_700_command_slot *)SCp->host_scribble; in process_selection()
1317 save_for_reselection(hostdata, SCp, Ent_Disconnect2 + hostdata->pScript); in process_selection()
1321 save_for_reselection(hostdata, SCp, Ent_Disconnect4 + hostdata->pScript); in process_selection()
1325 save_for_reselection(hostdata, SCp, Ent_Disconnect6 + hostdata->pScript); in process_selection()
1329 save_for_reselection(hostdata, SCp, Ent_Disconnect8 + hostdata->pScript); in process_selection()
1333 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata); in process_selection()
1389 NCR_700_start_command(struct scsi_cmnd *SCp) in NCR_700_start_command() argument
1392 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_start_command()
1394 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_start_command()
1396 u8 lun = SCp->device->lun; in NCR_700_start_command()
1405 SCp->device->host->host_no, slot->cmnd, slot)); in NCR_700_start_command()
1409 hostdata->cmd = SCp; in NCR_700_start_command()
1414 hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1420 if(SCp->cmnd[0] == INQUIRY || SCp->cmnd[0] == REQUEST_SENSE || in NCR_700_start_command()
1422 NCR_700_clear_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in NCR_700_start_command()
1429 if((hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_start_command()
1430 && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1432 count += spi_populate_tag_msg(&hostdata->msgout[count], SCp); in NCR_700_start_command()
1436 NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) { in NCR_700_start_command()
1438 spi_period(SCp->device->sdev_target), in NCR_700_start_command()
1439 spi_offset(SCp->device->sdev_target)); in NCR_700_start_command()
1440 NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in NCR_700_start_command()
1447 Device_ID, 1<<scmd_id(SCp)); in NCR_700_start_command()
1452 SCp->cmd_len); in NCR_700_start_command()
1457 NCR_700_clear_fifo(SCp->device->host); in NCR_700_start_command()
1465 dma_cache_sync(hostdata->dev, SCp->cmnd, SCp->cmd_len, DMA_TO_DEVICE); in NCR_700_start_command()
1469 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in NCR_700_start_command()
1470 SCp->device->host, SXFER_REG); in NCR_700_start_command()
1471 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG); in NCR_700_start_command()
1472 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG); in NCR_700_start_command()
1500 struct scsi_cmnd *SCp = hostdata->cmd; in NCR_700_intr() local
1505 SCp = hostdata->cmd; in NCR_700_intr()
1527 if(SCp != NULL) { in NCR_700_intr()
1528 pun = SCp->device->id; in NCR_700_intr()
1529 lun = SCp->device->lun; in NCR_700_intr()
1539 … host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript); in NCR_700_intr()
1549 struct scsi_cmnd *SCp; in NCR_700_intr() local
1556 SCp = slot->cmnd; in NCR_700_intr()
1558 slot, SCp); in NCR_700_intr()
1560 SCp->host_scribble = NULL; in NCR_700_intr()
1561 NCR_700_set_depth(SCp->device, 0); in NCR_700_intr()
1568 SCp->result = DID_RESET << 16; in NCR_700_intr()
1569 SCp->scsi_done(SCp); in NCR_700_intr()
1583 NCR_700_scsi_done(hostdata, SCp, DID_NO_CONNECT<<16); in NCR_700_intr()
1585 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : in NCR_700_intr()
1586 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_intr()
1609 scsi_print_command(SCp); in NCR_700_intr()
1658 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1662 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1666 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata); in NCR_700_intr()
1672 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1676 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1750 NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)) in NCR_700_queuecommand_lck() argument
1753 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_queuecommand_lck()
1761 …printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_n… in NCR_700_queuecommand_lck()
1770 if(NCR_700_get_depth(SCp->device) != 0 in NCR_700_queuecommand_lck()
1771 && (!(hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_queuecommand_lck()
1772 || !(SCp->flags & SCMD_TAGGED))) { in NCR_700_queuecommand_lck()
1773 CDEBUG(KERN_ERR, SCp, "has non zero depth %d\n", in NCR_700_queuecommand_lck()
1774 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1777 if(NCR_700_get_depth(SCp->device) >= SCp->device->queue_depth) { in NCR_700_queuecommand_lck()
1778 CDEBUG(KERN_ERR, SCp, "has max tag depth %d\n", in NCR_700_queuecommand_lck()
1779 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1782 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) + 1); in NCR_700_queuecommand_lck()
1789 slot->cmnd = SCp; in NCR_700_queuecommand_lck()
1791 SCp->scsi_done = done; in NCR_700_queuecommand_lck()
1792 SCp->host_scribble = (unsigned char *)slot; in NCR_700_queuecommand_lck()
1793 SCp->SCp.ptr = NULL; in NCR_700_queuecommand_lck()
1794 SCp->SCp.buffer = NULL; in NCR_700_queuecommand_lck()
1797 printk("53c700: scsi%d, command ", SCp->device->host->host_no); in NCR_700_queuecommand_lck()
1798 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1800 if ((SCp->flags & SCMD_TAGGED) in NCR_700_queuecommand_lck()
1801 && (hostdata->tag_negotiated &(1<<scmd_id(SCp))) == 0 in NCR_700_queuecommand_lck()
1802 && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_START_TAG_NEGOTIATION) { in NCR_700_queuecommand_lck()
1803 scmd_printk(KERN_ERR, SCp, "Enabling Tag Command Queuing\n"); in NCR_700_queuecommand_lck()
1804 hostdata->tag_negotiated |= (1<<scmd_id(SCp)); in NCR_700_queuecommand_lck()
1805 NCR_700_set_tag_neg_state(SCp->device, NCR_700_DURING_TAG_NEGOTIATION); in NCR_700_queuecommand_lck()
1814 if (!(SCp->flags & SCMD_TAGGED) in NCR_700_queuecommand_lck()
1815 && (hostdata->tag_negotiated &(1<<scmd_id(SCp)))) { in NCR_700_queuecommand_lck()
1816 scmd_printk(KERN_INFO, SCp, "Disabling Tag Command Queuing\n"); in NCR_700_queuecommand_lck()
1817 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in NCR_700_queuecommand_lck()
1820 if ((hostdata->tag_negotiated & (1<<scmd_id(SCp))) && in NCR_700_queuecommand_lck()
1821 SCp->device->simple_tags) { in NCR_700_queuecommand_lck()
1822 slot->tag = SCp->request->tag; in NCR_700_queuecommand_lck()
1823 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", in NCR_700_queuecommand_lck()
1826 struct NCR_700_Device_Parameters *p = SCp->device->hostdata; in NCR_700_queuecommand_lck()
1830 p->current_cmnd = SCp; in NCR_700_queuecommand_lck()
1834 if(!scsi_sg_count(SCp) && !scsi_bufflen(SCp) && in NCR_700_queuecommand_lck()
1835 SCp->sc_data_direction != DMA_NONE) { in NCR_700_queuecommand_lck()
1838 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1839 printk("Has wrong data direction %d\n", SCp->sc_data_direction); in NCR_700_queuecommand_lck()
1841 SCp->sc_data_direction = DMA_NONE; in NCR_700_queuecommand_lck()
1844 switch (SCp->cmnd[0]) { in NCR_700_queuecommand_lck()
1847 SCp->cmnd[6] = 0; in NCR_700_queuecommand_lck()
1851 switch(SCp->sc_data_direction) { in NCR_700_queuecommand_lck()
1855 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1872 direction = SCp->sc_data_direction; in NCR_700_queuecommand_lck()
1880 sg_count = scsi_dma_map(SCp); in NCR_700_queuecommand_lck()
1883 scsi_for_each_sg(SCp, sg, sg_count, i) { in NCR_700_queuecommand_lck()
1900 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, in NCR_700_queuecommand_lck()
1902 NCR_700_start_command(SCp); in NCR_700_queuecommand_lck()
1909 NCR_700_abort(struct scsi_cmnd * SCp) in DEF_SCSI_QCMD()
1913 scmd_printk(KERN_INFO, SCp, "abort command\n"); in DEF_SCSI_QCMD()
1915 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in DEF_SCSI_QCMD()
1920 if(SCp->cmnd[0] == TEST_UNIT_READY) { in DEF_SCSI_QCMD()
1931 NCR_700_internal_bus_reset(SCp->device->host); in DEF_SCSI_QCMD()
1939 NCR_700_host_reset(struct scsi_cmnd * SCp) in NCR_700_host_reset() argument
1943 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_host_reset()
1945 scmd_printk(KERN_INFO, SCp, in NCR_700_host_reset()
1946 "New error handler wants HOST reset, cmd %p\n\t", SCp); in NCR_700_host_reset()
1947 scsi_print_command(SCp); in NCR_700_host_reset()
1952 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1954 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1956 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1960 NCR_700_internal_bus_reset(SCp->device->host); in NCR_700_host_reset()
1961 NCR_700_chip_reset(SCp->device->host); in NCR_700_host_reset()
1963 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1965 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1970 spi_schedule_dv_device(SCp->device); in NCR_700_host_reset()
1972 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()