]> git.neil.brown.name Git - history.git/commitdiff
Import 2.0.33 2.0.33
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:37 +0000 (15:11 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:11:37 +0000 (15:11 -0500)
drivers/char/ftape/ftape-ctl.c
drivers/char/ftape/kernel-interface.c
drivers/scsi/aic7xxx.c

index adab7ea83f291f1745fdd7d9be5e9152583f0700..51aee0b88e776cd64f236856f301d324d3342200 100644 (file)
@@ -371,7 +371,7 @@ void ftape_log_vendor_id(void)
                TRACEx1(-1, "   Vendor id     : 0x%04x", drive_type.vendor_id);
                TRACEx1(-1, "   Wakeup method : %s", methods[drive_type.wake_up].name);
                TRACE(-1, "And a description of your tape drive to:");
-               TRACE(-1, "Kai Harrekilde-Petersen <khp@dolphinics.no>");
+               TRACE(-1, "Claus Heine <claus@momo.math.rwth-aachen.de>");
                TRACE(-1, "==========================================");
                drive_type.speed = 500;         /* deci-ips: very safe value */
        } else {
@@ -393,7 +393,7 @@ void ftape_log_vendor_id(void)
                        TRACEx2(-1, "found: %s, expected: %s",
                                methods[drive_type.wake_up].name,
                            methods[vendors[vendor_index].wake_up].name);
-                       TRACE(-1, "please report this to <khp@dolphinics.no>");
+                       TRACE(-1, "please report this to <claus@momo.math.rwth-aachen.de>");
                        TRACE(-1, "==========================================");
                }
        }
@@ -456,7 +456,7 @@ void ftape_calc_timeouts(void)
                TRACEx1(-1, "drive : %s", drive_type.name);
                TRACEx2(-1, "delta time = %d, length = %d", dt, length);
                TRACEx1(-1, "has max tape speed of %d ips", drive_type.speed);
-               TRACE(-1, "please report this to <khp@dolphinics.no>");
+               TRACE(-1, "please report this to <claus@momo.math.rwth-aachen.de>");
                TRACE(-1, "==========================================");
        }
        /*  time to go from bot to eot at normal speed (data rate):
index 4ec106d598c4ed6a0bff347fb065f6399c873b12..9fdc936708ac6dcb7b19d26bfd8360be8b6f6f7c 100644 (file)
@@ -128,6 +128,7 @@ int ftape_init(void)
        printk(KERN_INFO "ftape-2.08 960314\n"
               KERN_INFO " (c) 1993-1995 Bas Laarhoven (bas@vimec.nl)\n"
               KERN_INFO " (c) 1995-1996 Kai Harrekilde-Petersen (khp@dolphinics.no)\n"
+              KERN_INFO " (c) 1996-1997 Claus Heine (claus@momo.math.rwth-aachen.de)\n"
        KERN_INFO " QIC-117 driver for QIC-40/80/3010/3020 tape drives\n"
               KERN_INFO " Compiled for kernel version %s"
 #ifdef MODVERSIONS
index 6d4b5584da910cf61d5556b8a933ffbd366fbfcd..2a27994191fccace9c3247850e605d3c1c21c9fe 100644 (file)
@@ -865,6 +865,8 @@ struct aic7xxx_host {
     int  flags;
     int  commands_sent;
     scb_queue_type delayed_scbs;
+    Scsi_Cmnd *scsi_cmnd0;
+    Scsi_Cmnd *scsi_cmnd1;
   } device_status[16];
 #ifdef AIC7XXX_PROC_STATS
   /*
@@ -4269,17 +4271,17 @@ aic7xxx_isr(int irq, void *dev_id, struct pt_regs *regs)
 #endif
     while (qoutcnt > 0)
     {
-      for (i = 0; i < qoutcnt; i++)
+      if (p->flags & PAGE_ENABLED)
       {
-        if (p->flags & PAGE_ENABLED)
+        p->cmdoutcnt += qoutcnt;
+        if ( p->cmdoutcnt >= p->qfullcount )
         {
-          p->cmdoutcnt += qoutcnt;
-          if ( p->cmdoutcnt >= p->qfullcount )
-          {
-            outb(0, p->base + CMDOUTCNT);
-            p->cmdoutcnt = 0;
-          }
+          outb(0, p->base + CMDOUTCNT);
+          p->cmdoutcnt = 0;
         }
+      }
+      for (i = 0; i < qoutcnt; i++)
+      {
         scb_index = inb(p->base + QOUTFIFO);
        if ( scb_index >= p->scb_data->numscbs )
            scb = NULL;
@@ -6121,7 +6123,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
   int slot, base;
   int chan_num = 0;
   unsigned char hcntrl, sxfrctl1, sblkctl, hostconf, irq = 0;
-  int i, print_info=TRUE;
+  int i;
   struct aic7xxx_host *p;
 
   /*
@@ -6165,15 +6167,6 @@ aic7xxx_detect(Scsi_Host_Template *template)
     if (chip_type != AIC_NONE)
     {
 
-      if (print_info)
-      {
-       printk(KERN_INFO 
-"aic7xxx: Driver modifications performed by Doug Ledford, Aug-Nov, 1997\n"
-"aic7xxx: This version is not supported by the official aic7xxx maintainer\n"
-"aic7xxx: Please email problems/questions directly to dledford@dialnet.net\n"
-         );
-       print_info = FALSE;
-      }
       switch (chip_type)
       {
         case AIC_7770:
@@ -6446,15 +6439,6 @@ aic7xxx_detect(Scsi_Host_Template *template)
           error += pcibios_read_config_dword(pci_bus, pci_device_fn,
                                              CLASS_PROGIF_REVID, &class_revid);
 
-          if (print_info)
-          {
-           printk(KERN_INFO 
-"aic7xxx: Driver modifications performed by Doug Ledford, Aug-Nov, 1997\n"
-"aic7xxx: This version is not supported by the official aic7xxx maintainer\n"
-"aic7xxx: Please email problems/questions directly to dledford@dialnet.net\n"
-             );
-           print_info = FALSE;
-          }
           printk("aic7xxx: <%s> at PCI %d\n",
                  board_names[chip_type], PCI_SLOT(pci_device_fn));
 
@@ -6673,9 +6657,34 @@ aic7xxx_detect(Scsi_Host_Template *template)
 static void
 aic7xxx_fake_scsi_done(Scsi_Cmnd *cmd)
 {
-  kfree(cmd);
+  memset(&cmd->sense_buffer[0], '\0', sizeof(cmd->sense_buffer));
 }
 
+static void
+aic7xxx_make_fake_cmnd(struct aic7xxx_host *p, Scsi_Cmnd *cmd, int which)
+{
+  Scsi_Cmnd *cmd2;
+
+  if (which == 0)
+    p->device_status[TARGET_INDEX(cmd)].scsi_cmnd0 = cmd2 =
+       kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
+  else
+    p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1 = cmd2 =
+       kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
+  if (cmd2 != NULL)
+  {
+    memcpy(cmd2, cmd, sizeof(Scsi_Cmnd));
+    memset(&cmd2->cmnd[0], '\0', sizeof(cmd2->cmnd));
+    cmd2->cmnd[0] = TEST_UNIT_READY;
+    cmd2->cmd_len = 6;
+    cmd2->bufflen = 0;
+    cmd2->request_bufflen = 0;
+    cmd2->buffer = NULL;
+    cmd2->request_buffer = NULL;
+    cmd2->use_sg = 0;
+    cmd2->underflow = 0;
+  }
+}
 
 /*+F*************************************************************************
  * Function:
@@ -6728,34 +6737,16 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
     }
     else
     {
-      Scsi_Cmnd *cmd2, *cmd3;
-
-      cmd2 = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
-      cmd3 = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
-      if ((cmd2 == NULL) || (cmd3 == NULL))
-        panic("aic7xxx: unable to proceed with device negotiation.\n");
-      memcpy(cmd2, cmd, sizeof(Scsi_Cmnd));
-      memcpy(cmd3, cmd, sizeof(Scsi_Cmnd));
-      memset(&cmd2->cmnd[0], '\0', sizeof(cmd2->cmnd));
-      memset(&cmd3->cmnd[0], '\0', sizeof(cmd3->cmnd));
-      cmd2->cmnd[0] = TEST_UNIT_READY;
-      cmd3->cmnd[0] = TEST_UNIT_READY;
-      cmd2->cmd_len = 6;
-      cmd3->cmd_len = 6;
-      cmd2->bufflen = 0;
-      cmd3->bufflen = 0;
-      cmd2->request_bufflen = 0;
-      cmd3->request_bufflen = 0;
-      cmd2->buffer = NULL;
-      cmd3->buffer = NULL;
-      cmd2->request_buffer = NULL;
-      cmd3->request_buffer = NULL;
-      cmd2->use_sg = 0;
-      cmd3->use_sg = 0;
-      cmd2->underflow = 0;
-      cmd3->underflow = 0;
-      aic7xxx_queue(cmd2, aic7xxx_fake_scsi_done);
-      aic7xxx_queue(cmd3, aic7xxx_fake_scsi_done);
+      if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd0 == NULL )
+        aic7xxx_make_fake_cmnd(p, cmd, 0);
+      if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1 == NULL )
+        aic7xxx_make_fake_cmnd(p, cmd, 1);
+      if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd0 != NULL )
+        aic7xxx_queue(p->device_status[TARGET_INDEX(cmd)].scsi_cmnd0,
+          aic7xxx_fake_scsi_done);
+      if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1 != NULL )
+        aic7xxx_queue(p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1,
+          aic7xxx_fake_scsi_done);
     }
 #if 0
     printk("scsi%d: Sending WDTR request to target %d.\n",
@@ -6774,22 +6765,13 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
       }
       else
       {
-        Scsi_Cmnd *cmd2;
-
-        cmd2 = kmalloc(sizeof(Scsi_Cmnd), GFP_ATOMIC);
-        if (cmd2 == NULL)
-          panic("aic7xxx: unable to proceed with device negotiation.\n");
-        memcpy(cmd2, cmd, sizeof(Scsi_Cmnd));
-        memset(&cmd2->cmnd[0], '\0', sizeof(cmd2->cmnd));
-        cmd2->cmnd[0] = TEST_UNIT_READY;
-        cmd2->cmd_len = 6;
-        cmd2->bufflen = 0;
-        cmd2->request_bufflen = 0;
-        cmd2->buffer = NULL;
-        cmd2->request_buffer = NULL;
-        cmd2->use_sg = 0;
-        cmd2->underflow = 0;
-        aic7xxx_queue(cmd2, aic7xxx_fake_scsi_done);
+        if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd0 == NULL )
+          aic7xxx_make_fake_cmnd(p, cmd, 0);
+        if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1 == NULL )
+          aic7xxx_make_fake_cmnd(p, cmd, 1);
+        if ( p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1 != NULL )
+          aic7xxx_queue(p->device_status[TARGET_INDEX(cmd)].scsi_cmnd1,
+            aic7xxx_fake_scsi_done);
       }
 #if 0
       printk("scsi%d: Sending SDTR request to target %d.\n",