scsi_to_pci_dma_dir(Cmnd->sc_data_direction)); 
Cmnd->sc_data_direction); 
void isp1020_intr_handler(int irq, void *dev_id, struct pt_regs *regs){	Scsi_Cmnd *Cmnd;	struct Status_Entry *sts;	struct Scsi_Host *host = dev_id;	struct isp1020_hostdata *hostdata;	u_int in_ptr, out_ptr;	u_short status;	ENTER_INTR("isp1020_intr_handler");	hostdata = (struct isp1020_hostdata *) host->hostdata;	DEBUG_INTR(printk("qlogicisp : interrupt on line %d\n", irq));	if (!(isp_inw(host, PCI_INTF_STS) & 0x04)) {		/* spurious interrupts can happen legally */		DEBUG_INTR(printk("qlogicisp: got spurious interrupt\n"));		return;	}	in_ptr = isp_inw(host, MBOX5);	isp_outw(HCCR_CLEAR_RISC_INTR, host, HOST_HCCR);	if ((isp_inw(host, PCI_SEMAPHORE) & ASYNC_EVENT_INTERRUPT)) {		status = isp_inw(host, MBOX0);		DEBUG_INTR(printk("qlogicisp : mbox completion status: %x\n",				  status));		switch (status) {		      case ASYNC_SCSI_BUS_RESET:		      case EXECUTION_TIMEOUT_RESET:			hostdata->send_marker = 1;			break;		      case INVALID_COMMAND:		      case HOST_INTERFACE_ERROR:		      case COMMAND_ERROR:		      case COMMAND_PARAM_ERROR:			printk("qlogicisp : bad mailbox return status\n");			break;		}		isp_outw(0x0, host, PCI_SEMAPHORE);	}	out_ptr = hostdata->res_out_ptr;	DEBUG_INTR(printk("qlogicisp : response queue update\n"));	DEBUG_INTR(printk("qlogicisp : response queue depth %d\n",			  QUEUE_DEPTH(in_ptr, out_ptr, RES_QUEUE_LEN)));	while (out_ptr != in_ptr) {		u_int cmd_slot;		sts = (struct Status_Entry *) &hostdata->res_cpu[out_ptr];		out_ptr = (out_ptr + 1) & RES_QUEUE_LEN;		cmd_slot = sts->handle;		Cmnd = hostdata->cmd_slots[cmd_slot];		hostdata->cmd_slots[cmd_slot] = NULL;		TRACE("done", out_ptr, Cmnd);		if (le16_to_cpu(sts->completion_status) == CS_RESET_OCCURRED		    || le16_to_cpu(sts->completion_status) == CS_ABORTED		    || (le16_to_cpu(sts->status_flags) & STF_BUS_RESET))			hostdata->send_marker = 1;		if (le16_to_cpu(sts->state_flags) & SF_GOT_SENSE)			memcpy(Cmnd->sense_buffer, sts->req_sense_data,			       sizeof(Cmnd->sense_buffer));		DEBUG_INTR(isp1020_print_status_entry(sts));		if (sts->hdr.entry_type == ENTRY_STATUS)			Cmnd->result = isp1020_return_status(sts);		else			Cmnd->result = DID_ERROR << 16;		if (Cmnd->use_sg)			pci_unmap_sg(hostdata->pci_dev,				     (struct scatterlist *)Cmnd->buffer,				     Cmnd->use_sg,				     scsi_to_pci_dma_dir(Cmnd->sc_data_direction));		else if (Cmnd->request_bufflen)			pci_unmap_single(hostdata->pci_dev,#ifdef CONFIG_QL_ISP_A64					 (dma_addr_t)((long)Cmnd->SCp.ptr),#else					 (u32)((long)Cmnd->SCp.ptr),#endif					 Cmnd->request_bufflen,					 scsi_to_pci_dma_dir(Cmnd->sc_data_direction));		isp_outw(out_ptr, host, MBOX5);		(*Cmnd->scsi_done)(Cmnd);	}	hostdata->res_out_ptr = out_ptr;	LEAVE_INTR("isp1020_intr_handler");}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/be7db055dd7261522557046370f49160728e3847/qlogicisp.c/clean/drivers/scsi/qlogicisp.c