patch-pre2.0.13 linux/drivers/scsi/BusLogic.c

Next file: linux/drivers/scsi/BusLogic.h
Previous file: linux/drivers/net/smc-ultra.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.12/linux/drivers/scsi/BusLogic.c linux/drivers/scsi/BusLogic.c
@@ -24,8 +24,8 @@
 */
 
 
-#define BusLogic_DriverVersion		"2.0.3"
-#define BusLogic_DriverDate		"17 May 1996"
+#define BusLogic_DriverVersion		"2.0.4"
+#define BusLogic_DriverDate		"5 June 1996"
 
 
 #include <linux/module.h>
@@ -100,7 +100,7 @@
   which BusLogic Host Adapters may potentially be found.
 */
 
-static unsigned short
+static unsigned int
   BusLogic_IO_StandardAddresses[] =
     { 0x330, 0x334, 0x230, 0x234, 0x130, 0x134, 0 };
 
@@ -112,19 +112,18 @@
   standard BusLogic I/O Addresses.
 */
 
-static unsigned short
+static unsigned int
   BusLogic_IO_AddressProbeList[BusLogic_IO_MaxProbeAddresses+1] =   { 0 };
 
 
 /*
   BusLogic_IRQ_UsageCount stores a count of the number of Host Adapters using
   a given IRQ Channel, which is necessary to support PCI, EISA, or MCA shared
-  interrupts.  Only IRQ Channels 9, 10, 11, 12, 14, and 15 are supported by
-  BusLogic Host Adapters.
+  interrupts.
 */
 
-static short
-  BusLogic_IRQ_UsageCount[7] =		{ 0 };
+static int
+  BusLogic_IRQ_UsageCount[NR_IRQS] =	{ 0 };
 
 
 /*
@@ -319,7 +318,7 @@
 
 static BusLogic_CCB_T *BusLogic_AllocateCCB(BusLogic_HostAdapter_T *HostAdapter)
 {
-  static unsigned int SerialNumber = 0;
+  static unsigned long SerialNumber = 0;
   BusLogic_CCB_T *CCB;
   int Allocated;
   CCB = HostAdapter->Free_CCBs;
@@ -406,8 +405,7 @@
   unsigned char *ParameterPointer = (unsigned char *) ParameterData;
   unsigned char *ReplyPointer = (unsigned char *) ReplyData;
   unsigned char StatusRegister = 0, InterruptRegister;
-  long TimeoutCounter;
-  int ReplyBytes = 0;
+  int ReplyBytes = 0, TimeoutCounter;
   /*
     Clear out the Reply Data if provided.
   */
@@ -591,7 +589,7 @@
   */
   if (pcibios_present())
     {
-      unsigned short BusDeviceFunction[BusLogic_IO_MaxProbeAddresses];
+      unsigned int BusDeviceFunction[BusLogic_IO_MaxProbeAddresses];
       unsigned short Index = 0, VendorID, DeviceID;
       boolean NonIncreasingScanningOrder = false;
       unsigned char Bus, DeviceFunction;
@@ -668,7 +666,7 @@
 		  for (j = 0; j < Bound; j++)
 		    if (BusDeviceFunction[j] > BusDeviceFunction[j+1])
 		      {
-			unsigned short Temp;
+			unsigned int Temp;
 			Temp = BusDeviceFunction[j];
 			BusDeviceFunction[j] = BusDeviceFunction[j+1];
 			BusDeviceFunction[j+1] = Temp;
@@ -765,7 +763,7 @@
 					     *HostAdapter)
 {
   boolean TraceHardReset = (BusLogic_GlobalOptions & BusLogic_TraceHardReset);
-  long TimeoutCounter = loops_per_sec >> 2;
+  int TimeoutCounter = loops_per_sec >> 2;
   unsigned char StatusRegister = 0;
   /*
     Issue a Hard Reset Command to the Host Adapter.  The Host Adapter should
@@ -958,18 +956,6 @@
       != sizeof(FirmwareVersion3rdDigit))
     return BusLogic_Failure(HostAdapter, "INQUIRE FIRMWARE 3RD DIGIT");
   /*
-    Issue the Inquire Firmware Version Letter command.
-  */
-  FirmwareVersionLetter = '\0';
-  if (BoardID.FirmwareVersion1stDigit > '3' ||
-      (BoardID.FirmwareVersion1stDigit == '3' &&
-       BoardID.FirmwareVersion2ndDigit >= '3'))
-    if (BusLogic_Command(HostAdapter, BusLogic_InquireFirmwareVersionLetter,
-			 NULL, 0, &FirmwareVersionLetter,
-			 sizeof(FirmwareVersionLetter))
-	!= sizeof(FirmwareVersionLetter))
-      return BusLogic_Failure(HostAdapter, "INQUIRE FIRMWARE VERSION LETTER");
-  /*
     BusLogic Host Adapters can be identified by their model number and
     the major version number of their firmware as follows:
 
@@ -985,10 +971,53 @@
     0.xx	AMI FastDisk VLB/EISA BusLogic Clone Host Adapter
   */
   /*
+    Save the Model Name and Board Name in the Host Adapter structure.
+  */
+  TargetPointer = HostAdapter->ModelName;
+  *TargetPointer++ = 'B';
+  *TargetPointer++ = 'T';
+  *TargetPointer++ = '-';
+  for (i = 0; i < sizeof(BoardModelNumber); i++)
+    {
+      Character = BoardModelNumber[i];
+      if (Character == ' ' || Character == '\0') break;
+      *TargetPointer++ = Character;
+    }
+  *TargetPointer++ = '\0';
+  strcpy(HostAdapter->BoardName, "BusLogic ");
+  strcat(HostAdapter->BoardName, HostAdapter->ModelName);
+  strcpy(HostAdapter->InterruptLabel, HostAdapter->BoardName);
+  /*
+    Save the Firmware Version in the Host Adapter structure.
+  */
+  TargetPointer = HostAdapter->FirmwareVersion;
+  *TargetPointer++ = BoardID.FirmwareVersion1stDigit;
+  *TargetPointer++ = '.';
+  *TargetPointer++ = BoardID.FirmwareVersion2ndDigit;
+  if (FirmwareVersion3rdDigit != ' ' && FirmwareVersion3rdDigit != '\0')
+    *TargetPointer++ = FirmwareVersion3rdDigit;
+  *TargetPointer = '\0';
+  /*
+    Issue the Inquire Firmware Version Letter command.
+  */
+  if (strcmp(HostAdapter->FirmwareVersion, "3.3") >= 0)
+    {
+      if (BusLogic_Command(HostAdapter, BusLogic_InquireFirmwareVersionLetter,
+			   NULL, 0, &FirmwareVersionLetter,
+			   sizeof(FirmwareVersionLetter))
+	  != sizeof(FirmwareVersionLetter))
+	return BusLogic_Failure(HostAdapter, "INQUIRE FIRMWARE VERSION LETTER");
+      if (FirmwareVersionLetter != ' ' && FirmwareVersionLetter != '\0')
+	*TargetPointer++ = FirmwareVersionLetter;
+      *TargetPointer = '\0';
+    }
+  /*
     Issue the Inquire Generic I/O Port Information command to read the
-    termination information from "W" Series Host Adapters.
+    IRQ Channel from all PCI Host Adapters, and the Termination Information
+    from "W" Series Host Adapters.
   */
-  if (BoardID.FirmwareVersion1stDigit == '5')
+  if (HostAdapter->ModelName[3] == '9' &&
+      strcmp(HostAdapter->FirmwareVersion, "4.25") >= 0)
     {
       if (BusLogic_Command(HostAdapter,
 			   BusLogic_InquireGenericIOPortInformation,
@@ -998,9 +1027,14 @@
 	return BusLogic_Failure(HostAdapter,
 				"INQUIRE GENERIC I/O PORT INFORMATION");
       /*
+	Save the IRQ Channel in the Host Adapter structure.
+      */
+      HostAdapter->IRQ_Channel = GenericIOPortInformation.PCIAssignedIRQChannel;
+      /*
 	Save the Termination Information in the Host Adapter structure.
       */
-      if (GenericIOPortInformation.Valid)
+      if (HostAdapter->FirmwareVersion[0] == '5' &&
+	  GenericIOPortInformation.Valid)
 	{
 	  HostAdapter->TerminationInfoValid = true;
 	  HostAdapter->LowByteTerminated =
@@ -1010,10 +1044,10 @@
 	}
     }
   /*
-    Issue the Fetch Host Adapter Local RAM command to read the termination
-    information from the AutoSCSI area of "C" Series Host Adapters.
+    Issue the Fetch Host Adapter Local RAM command to read the Termination
+    Information from the AutoSCSI area of "C" Series Host Adapters.
   */
-  if (BoardID.FirmwareVersion1stDigit == '4')
+  if (HostAdapter->FirmwareVersion[0] == '4')
     {
       FetchHostAdapterLocalRAMRequest.ByteOffset =
 	BusLogic_AutoSCSI_BaseOffset + 15;
@@ -1033,58 +1067,23 @@
       HostAdapter->HighByteTerminated = AutoSCSIByte15.HighByteTerminated;
     }
   /*
-    Save the Model Name and Board Name in the Host Adapter structure.
+    Determine the IRQ Channel and save it in the Host Adapter structure.
   */
-  TargetPointer = HostAdapter->ModelName;
-  *TargetPointer++ = 'B';
-  *TargetPointer++ = 'T';
-  *TargetPointer++ = '-';
-  for (i = 0; i < sizeof(BoardModelNumber); i++)
+  if (HostAdapter->IRQ_Channel == 0)
     {
-      Character = BoardModelNumber[i];
-      if (Character == ' ' || Character == '\0') break;
-      *TargetPointer++ = Character;
+      if (Configuration.IRQ_Channel9)
+	HostAdapter->IRQ_Channel = 9;
+      else if (Configuration.IRQ_Channel10)
+	HostAdapter->IRQ_Channel = 10;
+      else if (Configuration.IRQ_Channel11)
+	HostAdapter->IRQ_Channel = 11;
+      else if (Configuration.IRQ_Channel12)
+	HostAdapter->IRQ_Channel = 12;
+      else if (Configuration.IRQ_Channel14)
+	HostAdapter->IRQ_Channel = 14;
+      else if (Configuration.IRQ_Channel15)
+	HostAdapter->IRQ_Channel = 15;
     }
-  *TargetPointer++ = '\0';
-  strcpy(HostAdapter->BoardName, "BusLogic ");
-  strcat(HostAdapter->BoardName, HostAdapter->ModelName);
-  strcpy(HostAdapter->InterruptLabel, HostAdapter->BoardName);
-  /*
-    Save the Firmware Version in the Host Adapter structure.
-  */
-  TargetPointer = HostAdapter->FirmwareVersion;
-  *TargetPointer++ = BoardID.FirmwareVersion1stDigit;
-  *TargetPointer++ = '.';
-  *TargetPointer++ = BoardID.FirmwareVersion2ndDigit;
-  if (FirmwareVersion3rdDigit != ' ' && FirmwareVersion3rdDigit != '\0')
-    *TargetPointer++ = FirmwareVersion3rdDigit;
-  if (FirmwareVersionLetter != ' ' && FirmwareVersionLetter != '\0')
-    *TargetPointer++ = FirmwareVersionLetter;
-  *TargetPointer++ = '\0';
-  /*
-    Determine the IRQ Channel and save it in the Host Adapter structure.
-  */
-  if (Configuration.IRQ_Channel9)
-    HostAdapter->IRQ_Channel = 9;
-  else if (Configuration.IRQ_Channel10)
-    HostAdapter->IRQ_Channel = 10;
-  else if (Configuration.IRQ_Channel11)
-    HostAdapter->IRQ_Channel = 11;
-  else if (Configuration.IRQ_Channel12)
-    HostAdapter->IRQ_Channel = 12;
-  else if (Configuration.IRQ_Channel14)
-    HostAdapter->IRQ_Channel = 14;
-  else if (Configuration.IRQ_Channel15)
-    HostAdapter->IRQ_Channel = 15;
-  /*
-    Determine the DMA Channel and save it in the Host Adapter structure.
-  */
-  if (Configuration.DMA_Channel5)
-    HostAdapter->DMA_Channel = 5;
-  else if (Configuration.DMA_Channel6)
-    HostAdapter->DMA_Channel = 6;
-  else if (Configuration.DMA_Channel7)
-    HostAdapter->DMA_Channel = 7;
   /*
     Save the Host Adapter SCSI ID in the Host Adapter structure.
   */
@@ -1098,28 +1097,30 @@
   HostAdapter->ParityChecking = SetupInformation.ParityCheckEnabled;
   /*
     Determine the Bus Type and save it in the Host Adapter structure,
-    overriding the DMA Channel if it is inappropriate for the bus type.
+    and determine and save the DMA Channel for ISA Host Adapters.
   */
   switch (HostAdapter->ModelName[3])
     {
     case '4':
       HostAdapter->BusType = BusLogic_VESA_Bus;
-      HostAdapter->DMA_Channel = 0;
       break;
     case '5':
       HostAdapter->BusType = BusLogic_ISA_Bus;
+      if (Configuration.DMA_Channel5)
+	HostAdapter->DMA_Channel = 5;
+      else if (Configuration.DMA_Channel6)
+	HostAdapter->DMA_Channel = 6;
+      else if (Configuration.DMA_Channel7)
+	HostAdapter->DMA_Channel = 7;
       break;
     case '6':
       HostAdapter->BusType = BusLogic_MCA_Bus;
-      HostAdapter->DMA_Channel = 0;
       break;
     case '7':
       HostAdapter->BusType = BusLogic_EISA_Bus;
-      HostAdapter->DMA_Channel = 0;
       break;
     case '9':
       HostAdapter->BusType = BusLogic_PCI_Bus;
-      HostAdapter->DMA_Channel = 0;
       break;
     }
   /*
@@ -1341,7 +1342,7 @@
     printk("%d, ", HostAdapter->DMA_Channel);
   else printk("None, ");
   if (HostAdapter->BIOS_Address > 0)
-    printk("BIOS Address: 0x%lX, ", HostAdapter->BIOS_Address);
+    printk("BIOS Address: 0x%X, ", HostAdapter->BIOS_Address);
   else printk("BIOS Address: None, ");
   printk("Host Adapter SCSI ID: %d\n", HostAdapter->SCSI_ID);
   printk("scsi%d:   Scatter/Gather Limit: %d of %d segments, "
@@ -1432,13 +1433,13 @@
     Acquire exclusive or shared access to the IRQ Channel.  A usage count is
     maintained so that PCI, EISA, or MCA shared interrupts can be supported.
   */
-  if (BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel - 9]++ == 0)
+  if (BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel]++ == 0)
     {
       if (request_irq(HostAdapter->IRQ_Channel, BusLogic_InterruptHandler,
 		      SA_INTERRUPT | SA_SHIRQ,
 		      HostAdapter->InterruptLabel, NULL) < 0)
 	{
-	  BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel - 9]--;
+	  BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel]--;
 	  printk("scsi%d: UNABLE TO ACQUIRE IRQ CHANNEL %d - DETACHING\n",
 		 HostAdapter->HostNumber, HostAdapter->IRQ_Channel);
 	  return false;
@@ -1498,7 +1499,7 @@
     Release exclusive or shared access to the IRQ Channel.
   */
   if (HostAdapter->IRQ_ChannelAcquired)
-    if (--BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel - 9] == 0)
+    if (--BusLogic_IRQ_UsageCount[HostAdapter->IRQ_Channel] == 0)
       free_irq(HostAdapter->IRQ_Channel, NULL);
   /*
     Release exclusive access to the DMA Channel.
@@ -1601,7 +1602,8 @@
     Initialize the Host Adapter's Pointer to the Outgoing/Incoming Mailboxes.
   */
   ExtendedMailboxRequest.MailboxCount = HostAdapter->MailboxCount;
-  ExtendedMailboxRequest.BaseMailboxAddress = HostAdapter->FirstOutgoingMailbox;
+  ExtendedMailboxRequest.BaseMailboxAddress =
+    Virtual_to_Bus(HostAdapter->FirstOutgoingMailbox);
   if (BusLogic_Command(HostAdapter, BusLogic_InitializeExtendedMailbox,
 		       &ExtendedMailboxRequest,
 		       sizeof(ExtendedMailboxRequest), NULL, 0) < 0)
@@ -1858,12 +1860,14 @@
 	else UntaggedDeviceCount++;
       }
   if (TaggedQueueDepth == 0 && TaggedDeviceCount > 0)
-    TaggedQueueDepth =
-      1 + ((HostAdapter->TotalQueueDepth
-	    - UntaggedDeviceCount * UntaggedQueueDepth)
-	   / TaggedDeviceCount);
-  if (TaggedQueueDepth > BusLogic_MaxTaggedQueueDepth)
-    TaggedQueueDepth = BusLogic_MaxTaggedQueueDepth;
+    {
+      TaggedQueueDepth =
+	1 + ((HostAdapter->TotalQueueDepth
+	      - UntaggedDeviceCount * UntaggedQueueDepth)
+	     / TaggedDeviceCount);
+      if (TaggedQueueDepth > BusLogic_PreferredTaggedQueueDepth)
+	TaggedQueueDepth = BusLogic_PreferredTaggedQueueDepth;
+    }
   for (Device = DeviceList; Device != NULL; Device = Device->next)
     if (Device->host == Host)
       {
@@ -2180,7 +2184,8 @@
 		      NextIncomingMailbox->CompletionCode) !=
 		     BusLogic_IncomingMailboxFree)
 		{
-		  BusLogic_CCB_T *CCB = NextIncomingMailbox->CCB;
+		  BusLogic_CCB_T *CCB =
+		    (BusLogic_CCB_T *) Bus_to_Virtual(NextIncomingMailbox->CCB);
 		  if (MailboxCompletionCode != BusLogic_AbortedCommandNotFound)
 		    if (CCB->Status == BusLogic_CCB_Active ||
 			CCB->Status == BusLogic_CCB_Reset)
@@ -2211,11 +2216,11 @@
 			  is not marked as status Active or Reset, then there
 			  is most likely a bug in the Host Adapter firmware.
 			*/
-			printk("scsi%d: Illegal CCB #%d status %d in "
+			printk("scsi%d: Illegal CCB #%ld status %d in "
 			       "Incoming Mailbox\n", HostAdapter->HostNumber,
 			       CCB->SerialNumber, CCB->Status);
 		      }
-		  else printk("scsi%d: Aborted CCB #%d to Target %d "
+		  else printk("scsi%d: Aborted CCB #%ld to Target %d "
 			      "Not Found\n", HostAdapter->HostNumber,
 			      CCB->SerialNumber, CCB->TargetID);
 		  NextIncomingMailbox->CompletionCode =
@@ -2252,8 +2257,8 @@
       */
       if (CCB->Opcode == BusLogic_BusDeviceReset)
 	{
-	  unsigned char TargetID = CCB->TargetID;
-	  printk("scsi%d: Bus Device Reset CCB #%d to Target %d Completed\n",
+	  int TargetID = CCB->TargetID;
+	  printk("scsi%d: Bus Device Reset CCB #%ld to Target %d Completed\n",
 		 HostAdapter->HostNumber, CCB->SerialNumber, TargetID);
 	  HostAdapter->TotalCommandCount[TargetID] = 0;
 	  HostAdapter->TaggedQueuingActive[TargetID] = false;
@@ -2301,7 +2306,7 @@
 	    {
 	    case BusLogic_IncomingMailboxFree:
 	    case BusLogic_AbortedCommandNotFound:
-	      printk("scsi%d: CCB #%d to Target %d Impossible State\n",
+	      printk("scsi%d: CCB #%ld to Target %d Impossible State\n",
 		     HostAdapter->HostNumber, CCB->SerialNumber, CCB->TargetID);
 	      break;
 	    case BusLogic_CommandCompletedWithoutError:
@@ -2309,7 +2314,7 @@
 	      Command->result = DID_OK << 16;
 	      break;
 	    case BusLogic_CommandAbortedAtHostRequest:
-	      printk("scsi%d: CCB #%d to Target %d Aborted\n",
+	      printk("scsi%d: CCB #%ld to Target %d Aborted\n",
 		     HostAdapter->HostNumber, CCB->SerialNumber, CCB->TargetID);
 	      Command->result = DID_ABORT << 16;
 	      break;
@@ -2321,7 +2326,7 @@
 		if (CCB->HostAdapterStatus != BusLogic_SCSISelectionTimeout)
 		  {
 		    int i;
-		    printk("scsi%d: CCB #%d Target %d: Result %X "
+		    printk("scsi%d: CCB #%ld Target %d: Result %X "
 			   "Host Adapter Status %02X Target Status %02X\n",
 			   HostAdapter->HostNumber, CCB->SerialNumber,
 			   CCB->TargetID, Command->result,
@@ -2332,7 +2337,7 @@
 		    printk("\n");
 		    printk("scsi%d: Sense ", HostAdapter->HostNumber);
 		    for (i = 0; i < CCB->SenseDataLength; i++)
-		      printk(" %02X", (*CCB->SenseDataPointer)[i]);
+		      printk(" %02X", Command->sense_buffer[i]);
 		    printk("\n");
 		  }
 	      break;
@@ -2388,7 +2393,7 @@
 	the Host Adapter is operating asynchronously and the locking code
 	does not protect against simultaneous access by the Host Adapter.
       */
-      NextOutgoingMailbox->CCB = CCB;
+      NextOutgoingMailbox->CCB = Virtual_to_Bus(CCB);
       NextOutgoingMailbox->ActionCode = ActionCode;
       BusLogic_StartMailboxCommand(HostAdapter);
       if (++NextOutgoingMailbox > HostAdapter->LastOutgoingMailbox)
@@ -2413,9 +2418,9 @@
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Command->host->hostdata;
   unsigned char *CDB = Command->cmnd;
-  unsigned char CDB_Length = Command->cmd_len;
-  unsigned char TargetID = Command->target;
-  unsigned char LogicalUnit = Command->lun;
+  int CDB_Length = Command->cmd_len;
+  int TargetID = Command->target;
+  int LogicalUnit = Command->lun;
   void *BufferPointer = Command->request_buffer;
   int BufferLength = Command->request_bufflen;
   int SegmentCount = Command->use_sg;
@@ -2461,7 +2466,7 @@
     {
       CCB->Opcode = BusLogic_InitiatorCCB;
       CCB->DataLength = BufferLength;
-      CCB->DataPointer = BufferPointer;
+      CCB->DataPointer = Virtual_to_Bus(BufferPointer);
     }
   else
     {
@@ -2469,13 +2474,13 @@
       int Segment;
       CCB->Opcode = BusLogic_InitiatorCCB_ScatterGather;
       CCB->DataLength = SegmentCount * sizeof(BusLogic_ScatterGatherSegment_T);
-      CCB->DataPointer = CCB->ScatterGatherList;
+      CCB->DataPointer = Virtual_to_Bus(CCB->ScatterGatherList);
       for (Segment = 0; Segment < SegmentCount; Segment++)
 	{
 	  CCB->ScatterGatherList[Segment].SegmentByteCount =
 	    ScatterList[Segment].length;
 	  CCB->ScatterGatherList[Segment].SegmentDataPointer =
-	    ScatterList[Segment].address;
+	    Virtual_to_Bus(ScatterList[Segment].address);
 	}
     }
   switch (CDB[0])
@@ -2515,13 +2520,13 @@
     the Host Adapter and Target Device can establish Synchronous and Wide
     Transfer before Queue Tag messages can interfere with the Synchronous and
     Wide Negotiation message.  By waiting to enable Tagged Queuing until after
-    the first BusLogic_MaxTaggedQueueDepth commands have been sent, it is
+    the first BusLogic_PreferredQueueDepth commands have been sent, it is
     assured that after a Reset any pending commands are resent before Tagged
     Queuing is enabled and that the Tagged Queuing message will not occur while
     the partition table is being printed.
   */
   if (HostAdapter->TotalCommandCount[TargetID]++ ==
-        BusLogic_MaxTaggedQueueDepth &&
+        BusLogic_PreferredTaggedQueueDepth &&
       (HostAdapter->TaggedQueuingPermitted & (1 << TargetID)) &&
       Command->device->tagged_supported)
     {
@@ -2564,7 +2569,7 @@
 	}
     }
   memcpy(CCB->CDB, CDB, CDB_Length);
-  CCB->SenseDataPointer = (SCSI_SenseData_T *) &Command->sense_buffer;
+  CCB->SenseDataPointer = Virtual_to_Bus(&Command->sense_buffer);
   CCB->Command = Command;
   Command->scsi_done = CompletionRoutine;
   /*
@@ -2608,7 +2613,7 @@
 {
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Command->host->hostdata;
-  unsigned char TargetID = Command->target;
+  int TargetID = Command->target;
   BusLogic_Lock_T Lock;
   BusLogic_CCB_T *CCB;
   int Result;
@@ -2666,7 +2671,7 @@
   if (HostAdapter->TaggedQueuingActive[TargetID] &&
       HostAdapter->FirmwareVersion[0] < '5')
     {
-      printk("scsi%d: Unable to Abort CCB #%d to Target %d - "
+      printk("scsi%d: Unable to Abort CCB #%ld to Target %d - "
 	     "Abort Tag Not Supported\n", HostAdapter->HostNumber,
 	     CCB->SerialNumber, TargetID);
       Result = SCSI_ABORT_SNOOZE;
@@ -2674,13 +2679,13 @@
   else if (BusLogic_WriteOutgoingMailbox(HostAdapter,
 					 BusLogic_MailboxAbortCommand, CCB))
     {
-      printk("scsi%d: Aborting CCB #%d to Target %d\n",
+      printk("scsi%d: Aborting CCB #%ld to Target %d\n",
 	     HostAdapter->HostNumber, CCB->SerialNumber, TargetID);
       Result = SCSI_ABORT_PENDING;
     }
   else
     {
-      printk("scsi%d: Unable to Abort CCB #%d to Target %d - "
+      printk("scsi%d: Unable to Abort CCB #%ld to Target %d - "
 	     "No Outgoing Mailboxes\n", HostAdapter->HostNumber,
 	     CCB->SerialNumber, TargetID);
       Result = SCSI_ABORT_BUSY;
@@ -2827,7 +2832,7 @@
 				       SCSI_Command_T *Command,
 				       unsigned int ResetFlags)
 {
-  unsigned char TargetID = Command->target;
+  int TargetID = Command->target;
   BusLogic_Lock_T Lock;
   BusLogic_CCB_T *CCB;
   int Result = -1;
@@ -2913,7 +2918,7 @@
   */
   CCB = BusLogic_AllocateCCB(HostAdapter);
   if (CCB == NULL) goto Done;
-  printk("scsi%d: Sending Bus Device Reset CCB #%d to Target %d\n",
+  printk("scsi%d: Sending Bus Device Reset CCB #%ld to Target %d\n",
 	 HostAdapter->HostNumber, CCB->SerialNumber, TargetID);
   CCB->Opcode = BusLogic_BusDeviceReset;
   CCB->TargetID = TargetID;
@@ -2984,9 +2989,8 @@
 {
   BusLogic_HostAdapter_T *HostAdapter =
     (BusLogic_HostAdapter_T *) Command->host->hostdata;
-  unsigned char TargetID = Command->target;
-  unsigned char ErrorRecoveryStrategy =
-    HostAdapter->ErrorRecoveryStrategy[TargetID];
+  int TargetID = Command->target;
+  int ErrorRecoveryStrategy = HostAdapter->ErrorRecoveryStrategy[TargetID];
   /*
     Disable Tagged Queuing if it is active for this Target Device and if
     it has been less than 10 minutes since the last reset occurred, or since
@@ -3255,7 +3259,8 @@
   BusLogic_CommandLineEntry_T *CommandLineEntry =
     &BusLogic_CommandLineEntries[BusLogic_CommandLineEntryCount++];
   static int ProbeListIndex = 0;
-  int IntegerCount = Integers[0], TargetID, i;
+  int IntegerCount = Integers[0];
+  int TargetID, i;
   CommandLineEntry->IO_Address = 0;
   CommandLineEntry->TaggedQueueDepth = 0;
   CommandLineEntry->BusSettleTime = 0;
@@ -3269,7 +3274,7 @@
     printk("BusLogic: Unexpected Command Line Integers ignored\n");
   if (IntegerCount >= 1)
     {
-      unsigned short IO_Address = Integers[1];
+      unsigned int IO_Address = Integers[1];
       if (IO_Address > 0)
 	{
 	  for (i = 0; ; i++)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this