Skip to contentSkip to conversation

Tekram DC390(T) and linux 2.6

DISCUSSION Michael Schlüter 2 participants 2 messages Sep 17, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,,

is there anybody working on porting the Tekram DC390(T) driver to linux 2.6? If not I'll try it :).

Bye, Michael

#1 lore raw
Quoted 4 lines · Michael Schl?ter

Hi,,

is there anybody working on porting the Tekram DC390(T) driver to linux 2.6? If not I'll try it :).

There's been no work done on the driver for a long time. The last time someone asked about the driver I took a quick look at it. I've attached the patch I made to get it mostly fixed up - this patch delete the entire write part of the proc support, but I don't think that's a major problem (I did the same to the dc395x driver). The main thing remaining to be done is to convert to the dma mapping api and check the error handling. Would be nice to convert to hotplug style driver as well.

Note that this driver was written by the same people as the dc395x driver, so it may help looking at that driver (although I've changed it so much that current version no longer look all that alike anymore). For the DMA mapping stuff looking at where it was added to the dc395x driver (in the 1.4 series of the driver) might be helpful. See http://www.garloff.de/kurt/linux/dc395/ for the older dc395x drivers.

drivers/scsi/scsiiom.c +12 -6
diff -du -r a/drivers/scsi/scsiiom.c b/drivers/scsi/scsiiom.c
@@ -213,7 +213,7 @@
 };
 #endif
 
-void __inline__
+irqreturn_t
 DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 {
     PACB   pACB, pACB2;
@@ -227,21 +227,24 @@
     UCHAR  dstatus;
 #endif
     DC390_AFLAGS DC390_IFLAGS //DC390_DFLAGS
+    irqreturn_t handled = IRQ_NONE;
+            
 
     pACB = (PACB)dev_id;
     for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB);
     if (!pACB2)
     {
 	printk ("DC390: IRQ called with foreign dev_id %p!\n", pACB);
-	return;
+	return handled;
     }
     
     //DC390_LOCK_DRV;
 
     sstatus = DC390_read8 (Scsi_Status);
     if( !(sstatus & INTERRUPT) )
-	{ /*DC390_UNLOCK_DRV;*/ return; };
+	{ /*DC390_UNLOCK_DRV;*/ return handled; };
 
+    handled = IRQ_HANDLED;
     DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus);)
 
 #if DMA_INT
@@ -256,7 +259,7 @@
       {
 	DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n");)
 	//DC390_UNLOCK_DRV;
-	return;
+	return handled;
       };
 #else
     //DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT);
@@ -342,15 +345,18 @@
     DC390_UNLOCK_ACB;
     DC390_UNLOCK_IO;
     //DC390_UNLOCK_DRV; /* Restore initial flags */
+    return handled;
 }
 
-void
+irqreturn_t
 do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 {
+    irqreturn_t handled;
     DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq);)
     /* Locking is done in DC390_Interrupt */
-    DC390_Interrupt(irq, dev_id, regs);
+    handled = DC390_Interrupt(irq, dev_id, regs);
     DEBUG1(printk (".. IRQ returned\n");)
+    return handled;
 }
 
 void
drivers/scsi/tmscsim.c +26 -521

652 lines not on this page · raw message

Signature · 1 line
 Jamie Lenehan <[email protected]>