Lines Matching refs:slot
472 struct NCR_700_command_slot *slot = hostdata->free_list; in find_empty_slot() local
474 if(slot == NULL) { in find_empty_slot()
481 if(slot->state != NCR_700_SLOT_FREE) in find_empty_slot()
486 hostdata->free_list = slot->ITL_forw; in find_empty_slot()
487 slot->ITL_forw = NULL; in find_empty_slot()
494 slot->state = NCR_700_SLOT_BUSY; in find_empty_slot()
497 return slot; in find_empty_slot()
501 free_slot(struct NCR_700_command_slot *slot, in free_slot() argument
508 if((slot->state & NCR_700_SLOT_MASK) != NCR_700_SLOT_MAGIC) { in free_slot()
509 printk(KERN_ERR "53c700: SLOT %p is not MAGIC!!!\n", slot); in free_slot()
511 if(slot->state == NCR_700_SLOT_FREE) { in free_slot()
512 printk(KERN_ERR "53c700: SLOT %p is FREE!!!\n", slot); in free_slot()
515 if(slot->tag != NCR_700_NO_TAG) { in free_slot()
516 hash = hash_ITLQ(slot->cmnd->target, slot->cmnd->lun, in free_slot()
517 slot->tag); in free_slot()
518 if(slot->ITLQ_forw == NULL) in free_slot()
521 back = &slot->ITLQ_forw->ITLQ_back; in free_slot()
523 if(slot->ITLQ_back == NULL) in free_slot()
526 forw = &slot->ITLQ_back->ITLQ_forw; in free_slot()
528 *forw = slot->ITLQ_forw; in free_slot()
529 *back = slot->ITLQ_back; in free_slot()
531 hash = hash_ITL(slot->cmnd->target, slot->cmnd->lun); in free_slot()
532 if(slot->ITL_forw == NULL) in free_slot()
535 back = &slot->ITL_forw->ITL_back; in free_slot()
537 if(slot->ITL_back == NULL) in free_slot()
540 forw = &slot->ITL_back->ITL_forw; in free_slot()
542 *forw = slot->ITL_forw; in free_slot()
543 *back = slot->ITL_back; in free_slot()
545 slot->resume_offset = 0; in free_slot()
546 slot->cmnd = NULL; in free_slot()
547 slot->state = NCR_700_SLOT_FREE; in free_slot()
548 slot->ITL_forw = hostdata->free_list; in free_slot()
549 hostdata->free_list = slot; in free_slot()
562 struct NCR_700_command_slot *slot = in save_for_reselection() local
565 slot->resume_offset = dsp; in save_for_reselection()
576 struct NCR_700_command_slot *slot = hostdata->ITL_Hash_back[hash]; in find_ITL_Nexus() local
577 while(slot != NULL && !(slot->cmnd->target == pun && in find_ITL_Nexus()
578 slot->cmnd->lun == lun)) in find_ITL_Nexus()
579 slot = slot->ITL_back; in find_ITL_Nexus()
580 return slot; in find_ITL_Nexus()
588 struct NCR_700_command_slot *slot = hostdata->ITLQ_Hash_back[hash]; in find_ITLQ_Nexus() local
590 while(slot != NULL && !(slot->cmnd->target == pun in find_ITLQ_Nexus()
591 && slot->cmnd->lun == lun && slot->tag == tag)) in find_ITLQ_Nexus()
592 slot = slot->ITLQ_back; in find_ITLQ_Nexus()
595 if(slot != NULL) { in find_ITLQ_Nexus()
596 struct NCR_700_command_slot *n = slot->ITLQ_back; in find_ITLQ_Nexus()
608 return slot; in find_ITLQ_Nexus()
649 struct NCR_700_command_slot *slot) in NCR_700_unmap() argument
659 slot->dma_handle, in NCR_700_unmap()
674 struct NCR_700_command_slot *slot = in NCR_700_scsi_done() local
677 NCR_700_unmap(hostdata, SCp, slot); in NCR_700_scsi_done()
678 pci_unmap_single(hostdata->pci_dev, slot->pCmd, in NCR_700_scsi_done()
703 free_slot(slot, hostdata); in NCR_700_scsi_done()
1037 struct NCR_700_command_slot *slot = in process_script_interrupt() local
1057 NCR_700_unmap(hostdata, SCp, slot); in process_script_interrupt()
1077 slot->pCmd, in process_script_interrupt()
1081 …slot->dma_handle = pci_map_single(hostdata->pci_dev, SCp->sense_buffer, sizeof(SCp->sense_buffer),… in process_script_interrupt()
1082 slot->SG[0].ins = bS_to_host(SCRIPT_MOVE_DATA_IN | sizeof(SCp->sense_buffer)); in process_script_interrupt()
1083 slot->SG[0].pAddr = bS_to_host(slot->dma_handle); in process_script_interrupt()
1084 slot->SG[1].ins = bS_to_host(SCRIPT_RETURN); in process_script_interrupt()
1085 slot->SG[1].pAddr = 0; in process_script_interrupt()
1086 slot->resume_offset = hostdata->pScript; in process_script_interrupt()
1087 NCR_700_dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG[0])*2); in process_script_interrupt()
1091 slot->state = NCR_700_SLOT_QUEUED; in process_script_interrupt()
1151 struct NCR_700_command_slot *slot; in process_script_interrupt() local
1161 slot = find_ITLQ_Nexus(hostdata, reselection_id, in process_script_interrupt()
1164 slot = find_ITL_Nexus(hostdata, reselection_id, lun); in process_script_interrupt()
1167 if(slot == NULL) { in process_script_interrupt()
1180 slot = s; in process_script_interrupt()
1192 resume_offset = slot->resume_offset; in process_script_interrupt()
1193 hostdata->cmd = slot->cmnd; in process_script_interrupt()
1197 slot->pCmd); in process_script_interrupt()
1199 CommandCount, slot->cmnd->cmd_len); in process_script_interrupt()
1201 to32bit(&slot->pSG[0].ins)); in process_script_interrupt()
1216 NCR_700_dma_cache_wback((unsigned long)slot->cmnd->cmnd, in process_script_interrupt()
1217 slot->cmnd->cmd_len); in process_script_interrupt()
1232 struct NCR_700_command_slot *slot; in process_script_interrupt() local
1257 slot = (struct NCR_700_command_slot *)SCp->host_scribble; in process_script_interrupt()
1259 slot->state = NCR_700_SLOT_QUEUED; in process_script_interrupt()
1361 struct NCR_700_command_slot *slot = in process_selection() local
1363 …saving cmd %p, slot %p, addr %x [%04x], resume %x!\n", id, hostdata->cmd, slot, dsp, dsp - hostdat… in process_selection()
1388 slot->state = NCR_700_SLOT_QUEUED; in process_selection()
1439 struct NCR_700_command_slot *slot = in NCR_700_start_command() local
1452 slot->state = NCR_700_SLOT_QUEUED; in NCR_700_start_command()
1456 SCp->host->host_no, slot->cmnd, slot)); in NCR_700_start_command()
1461 slot->state = NCR_700_SLOT_BUSY; in NCR_700_start_command()
1479 && (slot->tag != NCR_700_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE)) { in NCR_700_start_command()
1481 hostdata->msgout[count++] = slot->tag; in NCR_700_start_command()
1499 slot->pCmd); in NCR_700_start_command()
1504 to32bit(&slot->pSG[0].ins)); in NCR_700_start_command()
1507 if(slot->resume_offset == 0) in NCR_700_start_command()
1508 slot->resume_offset = hostdata->pScript; in NCR_700_start_command()
1518 NCR_700_writel(slot->temp, SCp->host, TEMP_REG); in NCR_700_start_command()
1519 NCR_700_writel(slot->resume_offset, SCp->host, DSP_REG); in NCR_700_start_command()
1605 struct NCR_700_command_slot *slot = in NCR_700_intr() local
1608 if(slot->state == NCR_700_SLOT_FREE) in NCR_700_intr()
1611 SCp = slot->cmnd; in NCR_700_intr()
1613 slot, SCp); in NCR_700_intr()
1614 free_slot(slot, hostdata); in NCR_700_intr()
1637 struct NCR_700_command_slot *slot = (SCp == NULL) ? NULL : in NCR_700_intr() local
1649 } else if(dsp >= to32bit(&slot->pSG[0].ins) && in NCR_700_intr()
1650 dsp <= to32bit(&slot->pSG[NCR_700_SG_SEGMENTS].ins)) { in NCR_700_intr()
1652 int SGcount = (dsp - to32bit(&slot->pSG[0].ins))/sizeof(struct NCR_700_SG_List); in NCR_700_intr()
1676 count = (bS_to_cpu(slot->SG[SGcount].ins) & 0x00ffffff); in NCR_700_intr()
1678 slot->SG[SGcount].ins &= bS_to_host(0xff000000); in NCR_700_intr()
1679 slot->SG[SGcount].ins |= bS_to_host(data_transfer); in NCR_700_intr()
1680 pAddr = bS_to_cpu(slot->SG[SGcount].pAddr); in NCR_700_intr()
1687 slot->SG[SGcount].pAddr = bS_to_host(pAddr); in NCR_700_intr()
1691 slot->SG[i].ins = bS_to_host(SCRIPT_NOP); in NCR_700_intr()
1692 slot->SG[i].pAddr = 0; in NCR_700_intr()
1694 NCR_700_dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG)); in NCR_700_intr()
1846 struct NCR_700_command_slot *slot; in NCR_700_queuecommand() local
1872 slot = find_empty_slot(hostdata); in NCR_700_queuecommand()
1874 slot->cmnd = SCp; in NCR_700_queuecommand()
1877 SCp->host_scribble = (unsigned char *)slot; in NCR_700_queuecommand()
1918 free_slot(slot, hostdata); in NCR_700_queuecommand()
1922 slot->tag = SCp->device->current_tag++; in NCR_700_queuecommand()
1924 while((found = find_ITLQ_Nexus(hostdata, SCp->target, SCp->lun, slot->tag)) != NULL) { in NCR_700_queuecommand()
1925 …printk("\n\n**ERROR** already using tag %d, but oldest is %d\n", slot->tag, (old == NULL) ? -1 : o… in NCR_700_queuecommand()
1928 slot->tag = SCp->device->current_tag++; in NCR_700_queuecommand()
1939 hash = hash_ITLQ(SCp->target, SCp->lun, slot->tag); in NCR_700_queuecommand()
1941 slot->ITLQ_forw = hostdata->ITLQ_Hash_forw[hash]; in NCR_700_queuecommand()
1942 hostdata->ITLQ_Hash_forw[hash] = slot; in NCR_700_queuecommand()
1944 if(slot->ITLQ_forw != NULL && slot->ITLQ_forw->ITLQ_back != NULL) { in NCR_700_queuecommand()
1948 if(slot->ITLQ_forw != NULL) in NCR_700_queuecommand()
1949 slot->ITLQ_forw->ITLQ_back = slot; in NCR_700_queuecommand()
1951 hostdata->ITLQ_Hash_back[hash] = slot; in NCR_700_queuecommand()
1952 slot->ITLQ_back = NULL; in NCR_700_queuecommand()
1954 slot->tag = NCR_700_NO_TAG; in NCR_700_queuecommand()
1958 slot->ITL_forw = hostdata->ITL_Hash_forw[hash]; in NCR_700_queuecommand()
1959 hostdata->ITL_Hash_forw[hash] = slot; in NCR_700_queuecommand()
1961 if(slot->ITL_forw != NULL && slot->ITL_forw->ITL_back != NULL) { in NCR_700_queuecommand()
1966 if(slot->ITL_forw != NULL) in NCR_700_queuecommand()
1967 slot->ITL_forw->ITL_back = slot; in NCR_700_queuecommand()
1969 hostdata->ITL_Hash_back[hash] = slot; in NCR_700_queuecommand()
1970 slot->ITL_back = NULL; in NCR_700_queuecommand()
2028 slot->dma_handle = vPtr; in NCR_700_queuecommand()
2042 slot->SG[i].ins = bS_to_host(move_ins | count); in NCR_700_queuecommand()
2044 i, count, slot->SG[i].ins, (unsigned long)vPtr)); in NCR_700_queuecommand()
2045 slot->SG[i].pAddr = bS_to_host(vPtr); in NCR_700_queuecommand()
2047 slot->SG[i].ins = bS_to_host(SCRIPT_RETURN); in NCR_700_queuecommand()
2048 slot->SG[i].pAddr = 0; in NCR_700_queuecommand()
2049 NCR_700_dma_cache_wback((unsigned long)slot->SG, sizeof(slot->SG)); in NCR_700_queuecommand()
2051 (&slot->pSG[i].ins), in NCR_700_queuecommand()
2052 slot->SG[i].ins)); in NCR_700_queuecommand()
2054 slot->resume_offset = 0; in NCR_700_queuecommand()
2055 slot->pCmd = pci_map_single(hostdata->pci_dev, SCp->cmnd, in NCR_700_queuecommand()
2064 struct NCR_700_command_slot *slot; in NCR_700_abort() local
2072 slot = find_ITL_Nexus(hostdata, SCp->target, SCp->lun); in NCR_700_abort()
2073 while(slot != NULL && slot->cmnd != SCp) in NCR_700_abort()
2074 slot = slot->ITL_back; in NCR_700_abort()
2076 if(slot == NULL) in NCR_700_abort()