patch-2.4.0-test7 linux/drivers/block/DAC960.c

Next file: linux/drivers/block/DAC960.h
Previous file: linux/drivers/acorn/scsi/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/drivers/block/DAC960.c linux/drivers/block/DAC960.c
@@ -19,8 +19,8 @@
 */
 
 
-#define DAC960_DriverVersion			"2.4.7"
-#define DAC960_DriverDate			"1 August 2000"
+#define DAC960_DriverVersion			"2.4.8"
+#define DAC960_DriverDate			"19 August 2000"
 
 
 #include <linux/version.h>
@@ -2206,7 +2206,6 @@
       Controller->Bus = Bus;
       Controller->Device = Device;
       Controller->Function = Function;
-      sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber);
       /*
 	Map the Controller Register Window.
       */
@@ -3756,15 +3755,15 @@
       { 0x008D, "M Rebuild Failed for Unknown Reasons" },
       { 0x008E, "M Rebuild Failed due to New Physical Device" },
       { 0x008F, "M Rebuild Failed due to Logical Drive Failure" },
-      { 0x0090, "L Initialization Started" },
-      { 0x0091, "L Initialization Completed" },
-      { 0x0092, "L Initialization Cancelled" },
-      { 0x0093, "L Initialization Failed" },
+      { 0x0090, "M Initialization Started" },
+      { 0x0091, "M Initialization Completed" },
+      { 0x0092, "M Initialization Cancelled" },
+      { 0x0093, "M Initialization Failed" },
       { 0x0094, "L Found" },
       { 0x0095, "L Gone" },
-      { 0x0096, "L Expand Capacity Started" },
-      { 0x0097, "L Expand Capacity Completed" },
-      { 0x0098, "L Expand Capacity Failed" },
+      { 0x0096, "M Expand Capacity Started" },
+      { 0x0097, "M Expand Capacity Completed" },
+      { 0x0098, "M Expand Capacity Failed" },
       { 0x0099, "L Bad Block Found" },
       { 0x009A, "L Size Changed" },
       { 0x009B, "L Type Changed" },
@@ -3799,6 +3798,12 @@
       { 0, "" } };
   int EventListIndex = 0, EventCode;
   unsigned char EventType, *EventMessage;
+  if (Event->EventCode == 0x1C &&
+      RequestSense->SenseKey == DAC960_SenseKey_VendorSpecific &&
+      (RequestSense->AdditionalSenseCode == 0x80 ||
+       RequestSense->AdditionalSenseCode == 0x81))
+    Event->EventCode = ((RequestSense->AdditionalSenseCode - 0x80) << 8) |
+		       RequestSense->AdditionalSenseCodeQualifier;
   while (true)
     {
       EventCode = EventList[EventListIndex].EventCode;
@@ -3862,6 +3867,7 @@
 		      RequestSense->CommandSpecificInformation[3]);
       break;
     case 'E':
+      if (Controller->SuppressEnclosureMessages) break;
       sprintf(MessageBuffer, EventMessage, Event->LogicalUnit);
       DAC960_Critical("Enclosure %d %s\n", Controller,
 		      Event->TargetID, MessageBuffer);
@@ -4274,7 +4280,7 @@
 					 LogicalDeviceSize);
 	      else if (NewLogicalDeviceInfo->BackgroundInitializationInProgress)
 		DAC960_V2_ReportProgress(Controller,
-					 "BackgroundInitialization",
+					 "Background Initialization",
 					 LogicalDeviceNumber,
 					 NewLogicalDeviceInfo
 					 ->BackgroundInitializationBlockNumber,
@@ -4900,6 +4906,7 @@
   DiskGeometry_T Geometry, *UserGeometry;
   DAC960_Controller_T *Controller;
   int PartitionNumber;
+  if (File == NULL) return -EINVAL;
   if (File->f_flags & O_NONBLOCK)
     return DAC960_UserIOCTL(Inode, File, Request, Argument);
   if (ControllerNumber < 0 || ControllerNumber > DAC960_ControllerCount - 1)
@@ -5106,6 +5113,7 @@
 	    ErrorCode =
 	      copy_from_user(&DCDB, UserCommand.DCDB, sizeof(DAC960_V1_DCDB_T));
 	    if (ErrorCode != 0) goto Failure1;
+	    if (DCDB.Channel >= DAC960_V1_MaxChannels) return -EINVAL;
 	    if (!((DataTransferLength == 0 &&
 		   DCDB.Direction
 		   == DAC960_V1_DCDB_NoDataTransfer) ||
@@ -5434,6 +5442,7 @@
 	if (CommandOpcode == DAC960_V1_DCDB)
 	  {
 	    DCDB = KernelCommand->DCDB;
+	    if (DCDB->Channel >= DAC960_V1_MaxChannels) return -EINVAL;
 	    if (!((DataTransferLength == 0 &&
 		   DCDB->Direction == DAC960_V1_DCDB_NoDataTransfer) ||
 		  (DataTransferLength > 0 &&
@@ -6246,6 +6255,8 @@
 			   == DAC960_V2_NormalCompletion
 			   ? "Cancelled" : "Not Cancelled"));
     }
+  else if (strcmp(UserCommand, "suppress-enclosure-messages") == 0)
+    Controller->SuppressEnclosureMessages = true;
   else DAC960_UserCritical("Illegal User Command: '%s'\n",
 			   Controller, UserCommand);
   DAC960_AcquireControllerLock(Controller, &ProcessorFlags);
@@ -6425,6 +6436,7 @@
       PROC_DirectoryEntry_T *ControllerProcEntry;
       PROC_DirectoryEntry_T *UserCommandProcEntry;
       if (Controller == NULL) continue;
+      sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber);
       ControllerProcEntry = proc_mkdir(Controller->ControllerName,
 				       DAC960_ProcDirectoryEntry);
       create_proc_read_entry("initial_status", 0, ControllerProcEntry,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)