patch-2.4.11-dontuse linux/drivers/scsi/lasi700.c

Next file: linux/drivers/scsi/lasi700.h
Previous file: linux/drivers/scsi/ips.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/drivers/scsi/lasi700.c linux/drivers/scsi/lasi700.c
@@ -109,6 +109,7 @@
 static int __initdata host_count = 0;
 static struct parisc_device_id lasi700_scsi_tbl[] = {
 	LASI700_ID_TABLE,
+	LASI710_ID_TABLE,
 	{ 0 }
 };
 
@@ -136,32 +137,48 @@
 {
 	unsigned long base = dev->hpa + LASI_SCSI_CORE_OFFSET;
 	int irq = busdevice_alloc_irq(dev);
+	char *driver_name;
 	struct Scsi_Host *host;
 	struct NCR_700_Host_Parameters *hostdata =
 		kmalloc(sizeof(struct NCR_700_Host_Parameters),
 			GFP_KERNEL);
+	if(dev->id.sversion == LASI_700_SVERSION) {
+		driver_name = "lasi700";
+	} else {
+		driver_name = "lasi710";
+	}
 	if(hostdata == NULL) {
-		printk(KERN_ERR "lasi700: Failed to allocate host data\n");
+		printk(KERN_ERR "%s: Failed to allocate host data\n",
+		       driver_name);
 		return 1;
 	}
 	memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));
-	if(request_mem_region(base, 64, "lasi700") == NULL) {
-		printk(KERN_ERR "lasi700: Failed to claim memory region\n");
+	if(request_mem_region(base, 64, driver_name) == NULL) {
+		printk(KERN_ERR "%s: Failed to claim memory region\n",
+		       driver_name);
 		kfree(hostdata);
 		return 1;
 	}
 	hostdata->base = base;
 	hostdata->differential = 0;
-	hostdata->clock = LASI700_CLOCK;
-	hostdata->force_le_on_be = 1;
+	if(dev->id.sversion == LASI_700_SVERSION) {
+		hostdata->clock = LASI700_CLOCK;
+		hostdata->force_le_on_be = 1;
+	} else {
+		hostdata->clock = LASI710_CLOCK;
+		hostdata->force_le_on_be = 0;
+		hostdata->chip710 = 1;
+		hostdata->dmode_extra = DMODE_FC2;
+	}
 	if((host = NCR_700_detect(host_tpnt, hostdata)) == NULL) {
 		kfree(hostdata);
 		release_mem_region(host->base, 64);
 		return 1;
 	}
 	host->irq = irq;
-	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) {
-		printk(KERN_ERR "lasi700: irq problem, detatching\n");
+	if(request_irq(irq, NCR_700_intr, SA_SHIRQ, driver_name, host)) {
+		printk(KERN_ERR "%s: irq problem, detatching\n",
+		       driver_name);
 		scsi_unregister(host);
 		NCR_700_release(host);
 		return 1;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)