--- linux-2.5.6-pre1/drivers/scsi/pci2000.c Tue Feb 19 18:10:55 2002 +++ linux/drivers/scsi/pci2000.c Thu Feb 28 07:14:00 2002 @@ -53,6 +53,7 @@ #include "hosts.h" #include #include +#include #include "pci2000.h" #include "psi_roy.h" @@ -102,6 +103,18 @@ #define HOSTDATA(host) ((PADAPTER2000)&host->hostdata) #define consistentLen (MAX_BUS * MAX_UNITS * (16 * sizeof (SCATGATH) + MAX_COMMAND_SIZE)) +#ifdef MODULE +static struct pci_device_id pci2000_pci_tbl[] __initdata = { + { + vendor: VENDOR_PSI, + device: DEVICE_ROY_1, + subvendor: PCI_ANY_ID, + subdevice: PCI_ANY_ID, + }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(pci, pci2000_pci_tbl); +#endif static struct Scsi_Host *PsiHost[MAXADAPTER] = {NULL,}; // One for each adapter static int NumAdapters = 0; @@ -337,7 +350,7 @@ goto irqProceed; } } - if ( SCpnt->SCp.have_data_in ) + if ( SCpnt->SCp.have_data_in && !SCpnt->use_sg) pci_unmap_single (padapter->pdev, SCpnt->SCp.have_data_in, SCpnt->request_bufflen, scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); else { @@ -389,7 +402,7 @@ OpDone (SCpnt, DID_OK << 16); irq_return: - spin_unlock_irqrestore(&shost->host_lock, flags); + spin_unlock_irqrestore(shost->host_lock, flags); out:; } /**************************************************************** @@ -505,8 +518,7 @@ if ( SCpnt->use_sg ) { - SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, ((struct scatterlist *)SCpnt->request_buffer)->address, - SCpnt->request_bufflen, scsi_to_pci_dma_dir (SCpnt->sc_data_direction)); + SCpnt->SCp.have_data_in = sg_dma_address((struct scatterlist *)SCpnt->request_buffer); } else { @@ -528,8 +540,7 @@ case SCSIOP_READ_CAPACITY: // read capacity CDB if ( SCpnt->use_sg ) { - SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, ((struct scatterlist *)(SCpnt->request_buffer))->address, - 8, PCI_DMA_FROMDEVICE); + SCpnt->SCp.have_data_in = sg_dma_address((struct scatterlist *)SCpnt->request_buffer); } else SCpnt->SCp.have_data_in = pci_map_single (padapter->pdev, SCpnt->request_buffer, 8, PCI_DMA_FROMDEVICE);