PATCH: 2.5.40 Fix stupid scsi setup bug in 53c406, fix addressing

PATCH: 2.5.40 Fix stupid scsi setup bug in 53c406, fix addressing

Post by Alan Co » Mon, 07 Oct 2002 19:40:04



diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.2.5.40/drivers/scsi/NCR53c406a.c linux.2.5.40-ac5/drivers/scsi/NCR53c406a.c
--- linux.2.5.40/drivers/scsi/NCR53c406a.c      2002-10-02 21:32:55.000000000 +0100

 int  __init
 NCR53c406a_detect(Scsi_Host_Template * tpnt){
-    struct Scsi_Host *shpnt;
+    struct Scsi_Host *shpnt = NULL;
 #ifndef PORT_BASE
     int i;

 #endif

     DEB(printk("NCR53c406a: using port_base %x\n", port_base));
+
+    tpnt->present = 1;
+    tpnt->proc_name = "NCR53c406a";
+    
+    shpnt = scsi_register(tpnt, 0);
+    if (!shpnt) {
+            printk("NCR53c406a: Unable to register host, giving up.\n");
+            goto err_release;
+    }

     if(irq_level > 0) {
         if(request_irq(irq_level, do_NCR53c406a_intr, 0, "NCR53c406a", shpnt)){
             printk("NCR53c406a: unable to allocate IRQ %d\n", irq_level);
-            goto err_release;
+            goto err_free_scsi;
         }
         tpnt->can_queue = 1;

         DEB(printk("NCR53c406a: No interrupts detected\n"));
 #if USE_DMA
         printk("NCR53c406a: No interrupts found and DMA mode defined. Giving up.\n");
-        goto err_release;
+        goto err_free_scsi;
 #endif /* USE_DMA */
     }
     else {
         DEB(printk("NCR53c406a: Shouldn't get here!\n"));
-        goto err_free_irq;
+        goto err_free_scsi;
     }

 #if USE_DMA
     dma_chan = DMA_CHAN;
     if(request_dma(dma_chan, "NCR53c406a") != 0){
         printk("NCR53c406a: unable to allocate DMA channel %d\n", dma_chan);
-        goto err_release;
+        goto err_free_irq;
     }

     DEB(printk("Allocated DMA channel %d\n", dma_chan));
 #endif /* USE_DMA */

-    tpnt->present = 1;
-    tpnt->proc_name = "NCR53c406a";
-    
-    shpnt = scsi_register(tpnt, 0);
-    if (!shpnt) {
-            printk("NCR53c406a: Unable to register host, giving up.\n");
-            goto err_free_dma;
-    }
     shpnt->irq = irq_level;
     shpnt->io_port = port_base;

     return (tpnt->present);

-
- err_free_dma:
 #if USE_DMA
-    free_dma(dma_chan);
-#endif
  err_free_irq:
-    free_irq(irq_level, do_NCR53c406a_intr);
+    if(irq_level)
+       free_irq(irq_level, shpnt);
+#endif        
+ err_free_scsi:
+    scsi_unregister(shpnt);
  err_release:
     release_region(port_base, 0x10);

                 sgcount = current_SC->use_sg;
                 sglist = current_SC->request_buffer;
                 while( sgcount-- ) {
-                    NCR53c406a_pio_write(sglist->address, sglist->length);
+                    NCR53c406a_pio_write(page_address(sglist->page) + sglist->offset, sglist->length);
                     sglist++;
                 }

                 sgcount = current_SC->use_sg;
                 sglist = current_SC->request_buffer;
                 while( sgcount-- ) {
-                    NCR53c406a_pio_read(sglist->address, sglist->length);
+                    NCR53c406a_pio_read(page_address(sglist->page) + sglist->offset, sglist->length);
                     sglist++;
                 }
             }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. PATCH: 2.5.40 Fix cs89x0 warnings

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.2.5.40/drivers/net/cs89x0.c linux.2.5.40-ac5/drivers/net/cs89x0.c
--- linux.2.5.40/drivers/net/cs89x0.c   2002-10-02 21:33:29.000000000 +0100

 #ifdef MODULE

-static struct net_device dev_cs89x0 = {
-        "",
-        0, 0, 0, 0,
-        0, 0,
-        0, 0, 0, NULL, NULL };
+static struct net_device dev_cs89x0;

 /*
  * Support the 'debug' module parm even if we're compiled for non-debug to
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. telnet file transfer

3. PATCH: 2.5.40 forward port toughbook fixes for maestro3

4. tar xvfz question

5. PATCH: 2.5.40 fix comment in mca

6. Xbae (spreadsheet widget) v4.6.1 released

7. PATCH: 2.5.40 fix warning in longhaul.c

8. is All-In-Wonder Pro AGP 8M Ram fit for X?

9. ALSA Menuconfig Breakage in 2.5.40 and 2.5.40-bk1

10. compile fix for drm in 2.5.40

11. 2.5.40 Compile fix for UP-NOAPIC-ACPI

12. 2.5.40 - random fixes

13. 2.5.40: fix chmod/chown on procfs