## Automatically generated incremental diff
## From:   linux-2.0.33-pre3
## To:     linux-2.0.33
## Robot:  $Id: make-incremental-diff,v 1.7 2001/12/04 05:19:54 hpa Exp $

diff -urN linux-2.0.33-pre3/drivers/char/ftape/ftape-ctl.c linux/drivers/char/ftape/ftape-ctl.c
--- linux-2.0.33-pre3/drivers/char/ftape/ftape-ctl.c	Fri May 31 03:54:08 1996
+++ linux/drivers/char/ftape/ftape-ctl.c	Mon Dec  3 21:49:21 2001
@@ -371,7 +371,7 @@
 		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 @@
 			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 @@
 		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):
diff -urN linux-2.0.33-pre3/drivers/char/ftape/kernel-interface.c linux/drivers/char/ftape/kernel-interface.c
--- linux-2.0.33-pre3/drivers/char/ftape/kernel-interface.c	Fri May 31 03:54:08 1996
+++ linux/drivers/char/ftape/kernel-interface.c	Mon Dec  3 21:49:21 2001
@@ -128,6 +128,7 @@
 	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
diff -urN linux-2.0.33-pre3/drivers/scsi/aic7xxx.c linux/drivers/scsi/aic7xxx.c
--- linux-2.0.33-pre3/drivers/scsi/aic7xxx.c	Mon Dec  3 21:49:19 2001
+++ linux/drivers/scsi/aic7xxx.c	Mon Dec  3 21:49:21 2001
@@ -865,6 +865,8 @@
     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 @@
 #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 @@
   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 @@
     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 @@
           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 @@
 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 @@
     }
     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 @@
       }
       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",
