pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, SCpnt->request_bufflen, scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); 
pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, SCpnt->request_bufflen, SCpnt->sc_data_direction); 
static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)	{	struct Scsi_Host   *shost = NULL;	// Pointer to host data block	PADAPTER2000		padapter;		// Pointer to adapter control structure	PDEV2000			pdev;	Scsi_Cmnd		   *SCpnt;	UCHAR				tag = 0;	UCHAR				tag0;	ULONG				error;	int					pun;	int					bus;	int					z;    unsigned long		flags;    int handled = 0;	DEB(printk ("\npci2000 received interrupt "));	for ( z = 0; z < NumAdapters;  z++ )										// scan for interrupt to process		{		if ( PsiHost[z]->irq == (UCHAR)(irq & 0xFF) )			{			tag = inb_p (HOSTDATA(PsiHost[z])->tag);			if (  tag )				{				shost = PsiHost[z];				break;				}			}		}	if ( !shost )		{		DEB (printk ("\npci2000: not my interrupt"));		goto out;		}    handled = 1;	spin_lock_irqsave(shost->host_lock, flags);	padapter = HOSTDATA(shost);	tag0 = tag & 0x7F;															// mask off the error bit	for ( bus = 0;  bus < MAX_BUS;  bus++ )										// scan the busses    	{		for ( pun = 0;  pun < MAX_UNITS;  pun++ )								// scan the targets    		{			pdev = &padapter->dev[bus][pun];			if ( !pdev->tag )    			continue;			if ( pdev->tag == tag0 )											// is this it?				{				pdev->tag = 0;				SCpnt = pdev->SCpnt;				goto unmapProceed;    			}			}    	}	outb_p (0xFF, padapter->tag);												// clear the op interrupt	outb_p (CMD_DONE, padapter->cmd);											// complete the op	goto irq_return;															// done, but, with what?unmapProceed:;	if ( !bus )		{		switch ( SCpnt->cmnd[0] )			{			case SCSIOP_TEST_UNIT_READY:				pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, sizeof (SCpnt->sense_buffer), PCI_DMA_FROMDEVICE);				goto irqProceed;			case SCSIOP_READ_CAPACITY:				pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, 8, PCI_DMA_FROMDEVICE);				goto irqProceed;			case SCSIOP_VERIFY:			case SCSIOP_START_STOP_UNIT:			case SCSIOP_MEDIUM_REMOVAL:				goto irqProceed;			}		}	if ( SCpnt->SCp.have_data_in )		pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, SCpnt->request_bufflen, scsi_to_pci_dma_dir(SCpnt->sc_data_direction));	else 		{		if ( SCpnt->use_sg )			pci_unmap_sg (padapter->pdev, (struct scatterlist *)SCpnt->request_buffer, SCpnt->use_sg, scsi_to_pci_dma_dir(SCpnt->sc_data_direction));		}irqProceed:;	if ( tag & ERR08_TAGGED )												// is there an error here?		{		if ( WaitReady (padapter) )			{			OpDone (SCpnt, DID_TIME_OUT << 16);			goto irq_return;			}		outb_p (tag0, padapter->mb0);										// get real error code		outb_p (CMD_ERROR, padapter->cmd);		if ( WaitReady (padapter) )											// wait for controller to suck up the op			{			OpDone (SCpnt, DID_TIME_OUT << 16);			goto irq_return;			}		error = inl (padapter->mb0);										// get error data		outb_p (0xFF, padapter->tag);										// clear the op interrupt		outb_p (CMD_DONE, padapter->cmd);									// complete the op		DEB (printk ("status: %lX ", error));		if ( error == 0x00020002 )											// is this error a check condition?			{			if ( bus )														// are we doint SCSI commands?				{				OpDone (SCpnt, (DID_OK << 16) | 2);				goto irq_return;				}			if ( *SCpnt->cmnd == SCSIOP_TEST_UNIT_READY )				OpDone (SCpnt, (DRIVER_SENSE << 24) | (DID_OK << 16) | 2);	// test caller we have sense data too			else				OpDone (SCpnt, DID_ERROR << 16);			goto irq_return;			}		OpDone (SCpnt, DID_ERROR << 16);		goto irq_return;		}	outb_p (0xFF, padapter->tag);											// clear the op interrupt	outb_p (CMD_DONE, padapter->cmd);										// complete the op	OpDone (SCpnt, DID_OK << 16);irq_return:    spin_unlock_irqrestore(shost->host_lock, flags);out:    return IRQ_RETVAL(handled);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/be7db055dd7261522557046370f49160728e3847/pci2000.c/buggy/drivers/scsi/pci2000.c