mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Patch?: linux-2.5.6-pre1/drivers/scsi/pci2000.c compilation fixes + pci device ID table
@ 2002-02-28 15:34 Adam J. Richter
  0 siblings, 0 replies; only message in thread
From: Adam J. Richter @ 2002-02-28 15:34 UTC (permalink / raw)
  To: tech, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

	The following patch is my attempt at getting
linux-2.5.6-pre1/drivers/scsi/pci2000.c to compile, and also adds
a pci_device_id table for automatic module loading.  I would
especially appreciate any input on whether I can use sg_dma_address
the way I have in this patch.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

[-- Attachment #2: pci2000.patch --]
[-- Type: text/plain, Size: 2259 bytes --]

--- 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 <linux/stat.h>
 #include <linux/spinlock.h>
+#include <linux/init.h>
 
 #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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-28 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-28 15:34 Patch?: linux-2.5.6-pre1/drivers/scsi/pci2000.c compilation fixes + pci device ID table Adam J. Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®