Lines Matching full:scp

54  * Bogendoerfer). Added missing SCp->request_bufflen initialisation
578 struct scsi_cmnd *SCp, __u32 dsp) in save_for_reselection() argument
581 if(SCp != NULL) { in save_for_reselection()
583 (struct NCR_700_command_slot *)SCp->host_scribble; in save_for_reselection()
592 NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, in NCR_700_unmap() argument
595 if(SCp->sc_data_direction != DMA_NONE && in NCR_700_unmap()
596 SCp->sc_data_direction != DMA_BIDIRECTIONAL) in NCR_700_unmap()
597 scsi_dma_unmap(SCp); in NCR_700_unmap()
602 struct scsi_cmnd *SCp, int result) in NCR_700_scsi_done() argument
607 if(SCp != NULL) { in NCR_700_scsi_done()
609 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_scsi_done()
614 char *cmnd = NCR_700_get_sense_cmnd(SCp->device); in NCR_700_scsi_done()
623 SCp->cmd_len = cmnd[8]; in NCR_700_scsi_done()
625 NCR_700_unmap(hostdata, SCp, slot); in NCR_700_scsi_done()
629 if(NCR_700_get_depth(SCp->device) == 0 || in NCR_700_scsi_done()
630 NCR_700_get_depth(SCp->device) > SCp->device->queue_depth) in NCR_700_scsi_done()
632 NCR_700_get_depth(SCp->device)); in NCR_700_scsi_done()
634 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1); in NCR_700_scsi_done()
636 SCp->host_scribble = NULL; in NCR_700_scsi_done()
637 SCp->result = result; in NCR_700_scsi_done()
638 scsi_done(SCp); in NCR_700_scsi_done()
640 printk(KERN_ERR "53c700: SCSI DONE HAS NULL SCp\n"); in NCR_700_scsi_done()
796 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_extended_message() argument
801 if(SCp != NULL) { in process_extended_message()
802 pun = SCp->device->id; in process_extended_message()
803 lun = SCp->device->lun; in process_extended_message()
808 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_extended_message()
809 struct scsi_target *starget = SCp->device->sdev_target; in process_extended_message()
821 if(NCR_700_is_flag_set(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION)) { in process_extended_message()
823 NCR_700_clear_flag(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION); in process_extended_message()
826 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_extended_message()
827 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_extended_message()
829 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in process_extended_message()
876 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_message() argument
882 if(SCp != NULL) { in process_message()
883 pun = SCp->device->id; in process_message()
884 lun = SCp->device->lun; in process_message()
897 resume_offset = process_extended_message(host, hostdata, SCp, in process_message()
902 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_message()
904 spi_period(SCp->device->sdev_target) = in process_message()
905 spi_offset(SCp->device->sdev_target) = 0; in process_message()
906 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_message()
907 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_message()
908 …} else if(SCp != NULL && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION)… in process_message()
910 scmd_printk(KERN_WARNING, SCp, in process_message()
913 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION); in process_message()
914 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_message()
916 SCp->device->tagged_supported = 0; in process_message()
917 SCp->device->simple_tags = 0; in process_message()
918 scsi_change_queue_depth(SCp->device, host->cmd_per_lun); in process_message()
963 process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, in process_script_interrupt() argument
970 if(SCp != NULL) { in process_script_interrupt()
971 pun = SCp->device->id; in process_script_interrupt()
972 lun = SCp->device->lun; in process_script_interrupt()
979 if (NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION) in process_script_interrupt()
980 NCR_700_set_tag_neg_state(SCp->device, in process_script_interrupt()
987 (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
991 scmd_printk(KERN_ERR, SCp, in process_script_interrupt()
993 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
996 NCR_700_get_sense_cmnd(SCp->device); in process_script_interrupt()
998 scsi_print_command(SCp); in process_script_interrupt()
1000 SCp, hostdata->status[0]); in process_script_interrupt()
1009 NCR_700_unmap(hostdata, SCp, slot); in process_script_interrupt()
1028 cmnd[8] = SCp->cmd_len; in process_script_interrupt()
1029 SCp->cmd_len = 6; /* command length for in process_script_interrupt()
1032 …slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FRO… in process_script_interrupt()
1039 dma_sync_from_dev(hostdata, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE); in process_script_interrupt()
1052 // SCp->cmnd[0] == INQUIRY && SCp->use_sg == 0) { in process_script_interrupt()
1057 // SCp->request_bufflen, in process_script_interrupt()
1059 // if(((char *)SCp->request_buffer)[7] & 0x02) { in process_script_interrupt()
1060 // scmd_printk(KERN_INFO, SCp, in process_script_interrupt()
1062 // hostdata->tag_negotiated |= (1<<scmd_id(SCp)); in process_script_interrupt()
1063 // NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1065 // NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1066 // hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_script_interrupt()
1069 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
1074 scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n", in process_script_interrupt()
1077 scmd_printk(KERN_ERR, SCp, " len = %d, cmd =", in process_script_interrupt()
1078 SCp->cmd_len); in process_script_interrupt()
1079 scsi_print_command(SCp); in process_script_interrupt()
1100 save_for_reselection(hostdata, SCp, dsp); in process_script_interrupt()
1121 struct scsi_cmnd *SCp; in process_script_interrupt() local
1123 SCp = scsi_host_find_tag(SDp->host, hostdata->msgin[2]); in process_script_interrupt()
1124 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1130 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1136 struct scsi_cmnd *SCp = p->current_cmnd; in process_script_interrupt() local
1138 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1143 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1217 SCp = hostdata->slots[i].cmnd; in process_script_interrupt()
1220 if(SCp != NULL) { in process_script_interrupt()
1221 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1256 resume_offset = process_message(host, hostdata, SCp, in process_script_interrupt()
1263 if(SCp != NULL) { in process_script_interrupt()
1266 scsi_print_command(SCp); in process_script_interrupt()
1267 scsi_for_each_sg(SCp, sg, scsi_sg_count(SCp) + 1, i) { in process_script_interrupt()
1268 …g->length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_comman… in process_script_interrupt()
1299 struct scsi_cmnd *SCp = hostdata->cmd; in process_selection() local
1322 if(hostdata->state == NCR_700_HOST_BUSY && SCp != NULL) { in process_selection()
1324 (struct NCR_700_command_slot *)SCp->host_scribble; in process_selection()
1330 save_for_reselection(hostdata, SCp, Ent_Disconnect2 + hostdata->pScript); in process_selection()
1334 save_for_reselection(hostdata, SCp, Ent_Disconnect4 + hostdata->pScript); in process_selection()
1338 save_for_reselection(hostdata, SCp, Ent_Disconnect6 + hostdata->pScript); in process_selection()
1342 save_for_reselection(hostdata, SCp, Ent_Disconnect8 + hostdata->pScript); in process_selection()
1346 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata); in process_selection()
1401 NCR_700_start_command(struct scsi_cmnd *SCp) in NCR_700_start_command() argument
1404 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_start_command()
1406 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_start_command()
1408 u8 lun = SCp->device->lun; in NCR_700_start_command()
1417 SCp->device->host->host_no, slot->cmnd, slot)); in NCR_700_start_command()
1421 hostdata->cmd = SCp; in NCR_700_start_command()
1426 hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1432 if(SCp->cmnd[0] == INQUIRY || SCp->cmnd[0] == REQUEST_SENSE || in NCR_700_start_command()
1434 NCR_700_clear_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in NCR_700_start_command()
1441 if((hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_start_command()
1442 && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1444 count += spi_populate_tag_msg(&hostdata->msgout[count], SCp); in NCR_700_start_command()
1448 NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) { in NCR_700_start_command()
1450 spi_period(SCp->device->sdev_target), in NCR_700_start_command()
1451 spi_offset(SCp->device->sdev_target)); in NCR_700_start_command()
1452 NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in NCR_700_start_command()
1457 script_patch_ID(hostdata, hostdata->script, Device_ID, 1<<scmd_id(SCp)); in NCR_700_start_command()
1461 script_patch_16(hostdata, hostdata->script, CommandCount, SCp->cmd_len); in NCR_700_start_command()
1466 NCR_700_clear_fifo(SCp->device->host); in NCR_700_start_command()
1473 dma_sync_to_dev(hostdata, SCp->cmnd, SCp->cmd_len); in NCR_700_start_command()
1477 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in NCR_700_start_command()
1478 SCp->device->host, SXFER_REG); in NCR_700_start_command()
1479 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG); in NCR_700_start_command()
1480 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG); in NCR_700_start_command()
1508 struct scsi_cmnd *SCp = hostdata->cmd; in NCR_700_intr() local
1532 if(SCp != NULL) { in NCR_700_intr()
1533 pun = SCp->device->id; in NCR_700_intr()
1534 lun = SCp->device->lun; in NCR_700_intr()
1544 … host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript); in NCR_700_intr()
1554 struct scsi_cmnd *SCp; in NCR_700_intr() local
1561 SCp = slot->cmnd; in NCR_700_intr()
1563 slot, SCp); in NCR_700_intr()
1565 SCp->host_scribble = NULL; in NCR_700_intr()
1566 NCR_700_set_depth(SCp->device, 0); in NCR_700_intr()
1573 SCp->result = DID_RESET << 16; in NCR_700_intr()
1574 scsi_done(SCp); in NCR_700_intr()
1588 NCR_700_scsi_done(hostdata, SCp, DID_NO_CONNECT<<16); in NCR_700_intr()
1590 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : in NCR_700_intr()
1591 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_intr()
1614 scsi_print_command(SCp); in NCR_700_intr()
1663 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1667 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1671 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata); in NCR_700_intr()
1677 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1681 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1754 static int NCR_700_queuecommand_lck(struct scsi_cmnd *SCp) in NCR_700_queuecommand_lck() argument
1757 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_queuecommand_lck()
1764 …printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_n… in NCR_700_queuecommand_lck()
1773 if(NCR_700_get_depth(SCp->device) != 0 in NCR_700_queuecommand_lck()
1774 && (!(hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_queuecommand_lck()
1775 || !(SCp->flags & SCMD_TAGGED))) { in NCR_700_queuecommand_lck()
1776 CDEBUG(KERN_ERR, SCp, "has non zero depth %d\n", in NCR_700_queuecommand_lck()
1777 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1780 if(NCR_700_get_depth(SCp->device) >= SCp->device->queue_depth) { in NCR_700_queuecommand_lck()
1781 CDEBUG(KERN_ERR, SCp, "has max tag depth %d\n", in NCR_700_queuecommand_lck()
1782 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1785 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) + 1); in NCR_700_queuecommand_lck()
1792 slot->cmnd = SCp; in NCR_700_queuecommand_lck()
1794 SCp->host_scribble = (unsigned char *)slot; 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 = scsi_cmd_to_rq(SCp)->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()
1879 sg_count = scsi_dma_map(SCp); in NCR_700_queuecommand_lck()
1882 scsi_for_each_sg(SCp, sg, sg_count, i) { in NCR_700_queuecommand_lck()
1899 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, in NCR_700_queuecommand_lck()
1901 NCR_700_start_command(SCp); in NCR_700_queuecommand_lck()
1908 NCR_700_abort(struct scsi_cmnd * SCp) in DEF_SCSI_QCMD()
1912 scmd_printk(KERN_INFO, SCp, "abort command\n"); in DEF_SCSI_QCMD()
1914 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in DEF_SCSI_QCMD()
1919 if(SCp->cmnd[0] == TEST_UNIT_READY) { in DEF_SCSI_QCMD()
1930 NCR_700_internal_bus_reset(SCp->device->host); in DEF_SCSI_QCMD()
1938 NCR_700_host_reset(struct scsi_cmnd * SCp) in NCR_700_host_reset() argument
1942 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_host_reset()
1944 scmd_printk(KERN_INFO, SCp, in NCR_700_host_reset()
1945 "New error handler wants HOST reset, cmd %p\n\t", SCp); in NCR_700_host_reset()
1946 scsi_print_command(SCp); in NCR_700_host_reset()
1951 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1953 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1955 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1959 NCR_700_internal_bus_reset(SCp->device->host); in NCR_700_host_reset()
1960 NCR_700_chip_reset(SCp->device->host); in NCR_700_host_reset()
1962 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1964 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1969 spi_schedule_dv_device(SCp->device); in NCR_700_host_reset()
1971 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()