Lines Matching full:scp

54  * Bogendoerfer). Added missing SCp->request_bufflen initialisation
577 struct scsi_cmnd *SCp, __u32 dsp) in save_for_reselection() argument
580 if(SCp != NULL) { in save_for_reselection()
582 (struct NCR_700_command_slot *)SCp->host_scribble; in save_for_reselection()
591 NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp, in NCR_700_unmap() argument
594 if(SCp->sc_data_direction != DMA_NONE && in NCR_700_unmap()
595 SCp->sc_data_direction != DMA_BIDIRECTIONAL) in NCR_700_unmap()
596 scsi_dma_unmap(SCp); in NCR_700_unmap()
601 struct scsi_cmnd *SCp, int result) in NCR_700_scsi_done() argument
606 if(SCp != NULL) { in NCR_700_scsi_done()
608 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_scsi_done()
613 char *cmnd = NCR_700_get_sense_cmnd(SCp->device); in NCR_700_scsi_done()
622 SCp->cmd_len = cmnd[8]; in NCR_700_scsi_done()
624 NCR_700_unmap(hostdata, SCp, slot); in NCR_700_scsi_done()
628 if(NCR_700_get_depth(SCp->device) == 0 || in NCR_700_scsi_done()
629 NCR_700_get_depth(SCp->device) > SCp->device->queue_depth) in NCR_700_scsi_done()
631 NCR_700_get_depth(SCp->device)); in NCR_700_scsi_done()
633 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) - 1); in NCR_700_scsi_done()
635 SCp->host_scribble = NULL; in NCR_700_scsi_done()
636 SCp->result = result; in NCR_700_scsi_done()
637 scsi_done(SCp); in NCR_700_scsi_done()
639 printk(KERN_ERR "53c700: SCSI DONE HAS NULL SCp\n"); in NCR_700_scsi_done()
795 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_extended_message() argument
800 if(SCp != NULL) { in process_extended_message()
801 pun = SCp->device->id; in process_extended_message()
802 lun = SCp->device->lun; in process_extended_message()
807 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_extended_message()
808 struct scsi_target *starget = SCp->device->sdev_target; in process_extended_message()
820 if(NCR_700_is_flag_set(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION)) { in process_extended_message()
822 NCR_700_clear_flag(SCp->device, NCR_700_DEV_PRINT_SYNC_NEGOTIATION); in process_extended_message()
825 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_extended_message()
826 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_extended_message()
828 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in process_extended_message()
875 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps) in process_message() argument
881 if(SCp != NULL) { in process_message()
882 pun = SCp->device->id; in process_message()
883 lun = SCp->device->lun; in process_message()
896 resume_offset = process_extended_message(host, hostdata, SCp, in process_message()
901 if(SCp != NULL && NCR_700_is_flag_set(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION)) { in process_message()
903 spi_period(SCp->device->sdev_target) = in process_message()
904 spi_offset(SCp->device->sdev_target) = 0; in process_message()
905 NCR_700_set_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in process_message()
906 NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in process_message()
907 …} else if(SCp != NULL && NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION)… in process_message()
909 scmd_printk(KERN_WARNING, SCp, in process_message()
912 NCR_700_set_tag_neg_state(SCp->device, NCR_700_FINISHED_TAG_NEGOTIATION); in process_message()
913 hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_message()
915 SCp->device->tagged_supported = 0; in process_message()
916 SCp->device->simple_tags = 0; in process_message()
917 scsi_change_queue_depth(SCp->device, host->cmd_per_lun); in process_message()
962 process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp, in process_script_interrupt() argument
969 if(SCp != NULL) { in process_script_interrupt()
970 pun = SCp->device->id; in process_script_interrupt()
971 lun = SCp->device->lun; in process_script_interrupt()
978 if (NCR_700_get_tag_neg_state(SCp->device) == NCR_700_DURING_TAG_NEGOTIATION) in process_script_interrupt()
979 NCR_700_set_tag_neg_state(SCp->device, in process_script_interrupt()
986 (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
990 scmd_printk(KERN_ERR, SCp, in process_script_interrupt()
992 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
995 NCR_700_get_sense_cmnd(SCp->device); in process_script_interrupt()
997 scsi_print_command(SCp); in process_script_interrupt()
999 SCp, hostdata->status[0]); in process_script_interrupt()
1008 NCR_700_unmap(hostdata, SCp, slot); in process_script_interrupt()
1027 cmnd[8] = SCp->cmd_len; in process_script_interrupt()
1028 SCp->cmd_len = 6; /* command length for in process_script_interrupt()
1031 …slot->dma_handle = dma_map_single(hostdata->dev, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE, DMA_FRO… in process_script_interrupt()
1038 dma_sync_from_dev(hostdata, SCp->sense_buffer, SCSI_SENSE_BUFFERSIZE); in process_script_interrupt()
1051 // SCp->cmnd[0] == INQUIRY && SCp->use_sg == 0) { in process_script_interrupt()
1056 // SCp->request_bufflen, in process_script_interrupt()
1058 // if(((char *)SCp->request_buffer)[7] & 0x02) { in process_script_interrupt()
1059 // scmd_printk(KERN_INFO, SCp, in process_script_interrupt()
1061 // hostdata->tag_negotiated |= (1<<scmd_id(SCp)); in process_script_interrupt()
1062 // NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1064 // NCR_700_clear_flag(SCp->device, NCR_700_DEV_BEGIN_TAG_QUEUEING); in process_script_interrupt()
1065 // hostdata->tag_negotiated &= ~(1<<scmd_id(SCp)); in process_script_interrupt()
1068 NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]); in process_script_interrupt()
1073 scmd_printk(KERN_ERR, SCp, "UNEXPECTED PHASE %s (%s)\n", in process_script_interrupt()
1076 scmd_printk(KERN_ERR, SCp, " len = %d, cmd =", in process_script_interrupt()
1077 SCp->cmd_len); in process_script_interrupt()
1078 scsi_print_command(SCp); in process_script_interrupt()
1099 save_for_reselection(hostdata, SCp, dsp); in process_script_interrupt()
1120 struct scsi_cmnd *SCp; in process_script_interrupt() local
1122 SCp = scsi_host_find_tag(SDp->host, hostdata->msgin[2]); in process_script_interrupt()
1123 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1129 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1135 struct scsi_cmnd *SCp = p->current_cmnd; in process_script_interrupt() local
1137 if(unlikely(SCp == NULL)) { in process_script_interrupt()
1142 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1216 SCp = hostdata->slots[i].cmnd; in process_script_interrupt()
1219 if(SCp != NULL) { in process_script_interrupt()
1220 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1255 resume_offset = process_message(host, hostdata, SCp, in process_script_interrupt()
1262 if(SCp != NULL) { in process_script_interrupt()
1265 scsi_print_command(SCp); in process_script_interrupt()
1266 scsi_for_each_sg(SCp, sg, scsi_sg_count(SCp) + 1, i) { in process_script_interrupt()
1267 …g->length, ((struct NCR_700_command_slot *)SCp->host_scribble)->SG[i].ins, ((struct NCR_700_comman… in process_script_interrupt()
1298 struct scsi_cmnd *SCp = hostdata->cmd; in process_selection() local
1321 if(hostdata->state == NCR_700_HOST_BUSY && SCp != NULL) { in process_selection()
1323 (struct NCR_700_command_slot *)SCp->host_scribble; in process_selection()
1329 save_for_reselection(hostdata, SCp, Ent_Disconnect2 + hostdata->pScript); in process_selection()
1333 save_for_reselection(hostdata, SCp, Ent_Disconnect4 + hostdata->pScript); in process_selection()
1337 save_for_reselection(hostdata, SCp, Ent_Disconnect6 + hostdata->pScript); in process_selection()
1341 save_for_reselection(hostdata, SCp, Ent_Disconnect8 + hostdata->pScript); in process_selection()
1345 process_script_interrupt(A_GOOD_STATUS_AFTER_STATUS, dsp, SCp, host, hostdata); in process_selection()
1400 NCR_700_start_command(struct scsi_cmnd *SCp) in NCR_700_start_command() argument
1403 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_start_command()
1405 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_start_command()
1407 u8 lun = SCp->device->lun; in NCR_700_start_command()
1416 SCp->device->host->host_no, slot->cmnd, slot)); in NCR_700_start_command()
1420 hostdata->cmd = SCp; in NCR_700_start_command()
1425 hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1431 if(SCp->cmnd[0] == INQUIRY || SCp->cmnd[0] == REQUEST_SENSE || in NCR_700_start_command()
1433 NCR_700_clear_flag(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC); in NCR_700_start_command()
1440 if((hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_start_command()
1441 && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE && in NCR_700_start_command()
1443 count += spi_populate_tag_msg(&hostdata->msgout[count], SCp); in NCR_700_start_command()
1447 NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) { in NCR_700_start_command()
1449 spi_period(SCp->device->sdev_target), in NCR_700_start_command()
1450 spi_offset(SCp->device->sdev_target)); in NCR_700_start_command()
1451 NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION); in NCR_700_start_command()
1456 script_patch_ID(hostdata, hostdata->script, Device_ID, 1<<scmd_id(SCp)); in NCR_700_start_command()
1460 script_patch_16(hostdata, hostdata->script, CommandCount, SCp->cmd_len); in NCR_700_start_command()
1465 NCR_700_clear_fifo(SCp->device->host); in NCR_700_start_command()
1472 dma_sync_to_dev(hostdata, SCp->cmnd, SCp->cmd_len); in NCR_700_start_command()
1476 NCR_700_writeb(NCR_700_get_SXFER(SCp->device), in NCR_700_start_command()
1477 SCp->device->host, SXFER_REG); in NCR_700_start_command()
1478 NCR_700_writel(slot->temp, SCp->device->host, TEMP_REG); in NCR_700_start_command()
1479 NCR_700_writel(slot->resume_offset, SCp->device->host, DSP_REG); in NCR_700_start_command()
1507 struct scsi_cmnd *SCp = hostdata->cmd; in NCR_700_intr() local
1531 if(SCp != NULL) { in NCR_700_intr()
1532 pun = SCp->device->id; in NCR_700_intr()
1533 lun = SCp->device->lun; in NCR_700_intr()
1543 … host->host_no, SCp, SCp == NULL ? NULL : SCp->host_scribble, dsp, dsp - hostdata->pScript); in NCR_700_intr()
1553 struct scsi_cmnd *SCp; in NCR_700_intr() local
1560 SCp = slot->cmnd; in NCR_700_intr()
1562 slot, SCp); in NCR_700_intr()
1564 SCp->host_scribble = NULL; in NCR_700_intr()
1565 NCR_700_set_depth(SCp->device, 0); in NCR_700_intr()
1572 SCp->result = DID_RESET << 16; in NCR_700_intr()
1573 scsi_done(SCp); in NCR_700_intr()
1587 NCR_700_scsi_done(hostdata, SCp, DID_NO_CONNECT<<16); in NCR_700_intr()
1589 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : in NCR_700_intr()
1590 (struct NCR_700_command_slot *)SCp->host_scribble; in NCR_700_intr()
1613 scsi_print_command(SCp); in NCR_700_intr()
1662 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1666 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1670 resume_offset = process_script_interrupt(dsps, dsp, SCp, host, hostdata); in NCR_700_intr()
1676 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1680 NCR_700_scsi_done(hostdata, SCp, DID_ERROR<<16); in NCR_700_intr()
1753 static int NCR_700_queuecommand_lck(struct scsi_cmnd *SCp) in NCR_700_queuecommand_lck() argument
1756 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_queuecommand_lck()
1763 …printk(KERN_WARNING "scsi%d: Command depth has gone over queue depth\n", SCp->device->host->host_n… in NCR_700_queuecommand_lck()
1772 if(NCR_700_get_depth(SCp->device) != 0 in NCR_700_queuecommand_lck()
1773 && (!(hostdata->tag_negotiated & (1<<scmd_id(SCp))) in NCR_700_queuecommand_lck()
1774 || !(SCp->flags & SCMD_TAGGED))) { in NCR_700_queuecommand_lck()
1775 CDEBUG(KERN_ERR, SCp, "has non zero depth %d\n", in NCR_700_queuecommand_lck()
1776 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1779 if(NCR_700_get_depth(SCp->device) >= SCp->device->queue_depth) { in NCR_700_queuecommand_lck()
1780 CDEBUG(KERN_ERR, SCp, "has max tag depth %d\n", in NCR_700_queuecommand_lck()
1781 NCR_700_get_depth(SCp->device)); in NCR_700_queuecommand_lck()
1784 NCR_700_set_depth(SCp->device, NCR_700_get_depth(SCp->device) + 1); in NCR_700_queuecommand_lck()
1791 slot->cmnd = SCp; in NCR_700_queuecommand_lck()
1793 SCp->host_scribble = (unsigned char *)slot; 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 = scsi_cmd_to_rq(SCp)->tag; in NCR_700_queuecommand_lck()
1822 CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", in NCR_700_queuecommand_lck()
1825 struct NCR_700_Device_Parameters *p = SCp->device->hostdata; in NCR_700_queuecommand_lck()
1829 p->current_cmnd = SCp; in NCR_700_queuecommand_lck()
1833 if(!scsi_sg_count(SCp) && !scsi_bufflen(SCp) && in NCR_700_queuecommand_lck()
1834 SCp->sc_data_direction != DMA_NONE) { in NCR_700_queuecommand_lck()
1837 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1838 printk("Has wrong data direction %d\n", SCp->sc_data_direction); in NCR_700_queuecommand_lck()
1840 SCp->sc_data_direction = DMA_NONE; in NCR_700_queuecommand_lck()
1843 switch (SCp->cmnd[0]) { in NCR_700_queuecommand_lck()
1846 SCp->cmnd[6] = 0; in NCR_700_queuecommand_lck()
1850 switch(SCp->sc_data_direction) { in NCR_700_queuecommand_lck()
1854 scsi_print_command(SCp); in NCR_700_queuecommand_lck()
1878 sg_count = scsi_dma_map(SCp); in NCR_700_queuecommand_lck()
1881 scsi_for_each_sg(SCp, sg, sg_count, i) { in NCR_700_queuecommand_lck()
1898 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, in NCR_700_queuecommand_lck()
1900 NCR_700_start_command(SCp); in NCR_700_queuecommand_lck()
1907 NCR_700_abort(struct scsi_cmnd * SCp) in DEF_SCSI_QCMD()
1911 scmd_printk(KERN_INFO, SCp, "abort command\n"); in DEF_SCSI_QCMD()
1913 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in DEF_SCSI_QCMD()
1918 if(SCp->cmnd[0] == TEST_UNIT_READY) { in DEF_SCSI_QCMD()
1929 NCR_700_internal_bus_reset(SCp->device->host); in DEF_SCSI_QCMD()
1937 NCR_700_host_reset(struct scsi_cmnd * SCp) in NCR_700_host_reset() argument
1941 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; in NCR_700_host_reset()
1943 scmd_printk(KERN_INFO, SCp, in NCR_700_host_reset()
1944 "New error handler wants HOST reset, cmd %p\n\t", SCp); in NCR_700_host_reset()
1945 scsi_print_command(SCp); in NCR_700_host_reset()
1950 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1952 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1954 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1958 NCR_700_internal_bus_reset(SCp->device->host); in NCR_700_host_reset()
1959 NCR_700_chip_reset(SCp->device->host); in NCR_700_host_reset()
1961 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1963 spin_lock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()
1968 spi_schedule_dv_device(SCp->device); in NCR_700_host_reset()
1970 spin_unlock_irq(SCp->device->host->host_lock); in NCR_700_host_reset()