patch-1.3.91 linux/drivers/scsi/scsi.c

Next file: linux/drivers/scsi/scsi.h
Previous file: linux/drivers/scsi/g_NCR5380.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.90/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
@@ -1935,14 +1935,25 @@
 
 /* Mark all SCSI Devices on a specific Host as having been reset. */
 
-void scsi_mark_host_bus_reset(struct Scsi_Host *Host)
+void scsi_mark_host_reset(struct Scsi_Host *Host)
 {
   Scsi_Cmnd *SCpnt;
-  for(SCpnt = Host->host_queue; SCpnt; SCpnt = SCpnt->next)
+  for (SCpnt = Host->host_queue; SCpnt; SCpnt = SCpnt->next)
     scsi_mark_device_reset(SCpnt->device);
 }
 
 
+/* Mark all SCSI Devices on a specific Host Bus as having been reset. */
+
+void scsi_mark_bus_reset(struct Scsi_Host *Host, int channel)
+{
+  Scsi_Cmnd *SCpnt;
+  for (SCpnt = Host->host_queue; SCpnt; SCpnt = SCpnt->next)
+      if (SCpnt->channel == channel)
+	  scsi_mark_device_reset(SCpnt->device);
+}
+
+
 int scsi_reset (Scsi_Cmnd * SCpnt, unsigned int reset_flags)
 {
     int temp;
@@ -2071,8 +2082,10 @@
              */
             switch(temp & SCSI_RESET_ACTION) {
 	    case SCSI_RESET_SUCCESS:
-	        if (temp & SCSI_RESET_BUS_RESET)
-		  scsi_mark_host_bus_reset(host);
+	        if (temp & SCSI_RESET_HOST_RESET)
+		  scsi_mark_host_reset(host);
+	        else if (temp & SCSI_RESET_BUS_RESET)
+		  scsi_mark_bus_reset(host, SCpnt->channel);
 		else scsi_mark_device_reset(SCpnt->device);
 		save_flags(flags);
 		cli();
@@ -2080,8 +2093,10 @@
 		restore_flags(flags);
 		return 0;
 	    case SCSI_RESET_PENDING:
-	        if (temp & SCSI_RESET_BUS_RESET)
-		  scsi_mark_host_bus_reset(host);
+	        if (temp & SCSI_RESET_HOST_RESET)
+		  scsi_mark_host_reset(host);
+	        else if (temp & SCSI_RESET_BUS_RESET)
+		  scsi_mark_bus_reset(host, SCpnt->channel);
 		else scsi_mark_device_reset(SCpnt->device);
 	    case SCSI_RESET_NOT_RUNNING:
 		return 0;
@@ -2090,8 +2105,10 @@
                 scsi_request_sense (SCpnt);
                 return 0;
 	    case SCSI_RESET_WAKEUP:
-	        if (temp & SCSI_RESET_BUS_RESET)
-		  scsi_mark_host_bus_reset(host);
+	        if (temp & SCSI_RESET_HOST_RESET)
+		  scsi_mark_host_reset(host);
+	        else if (temp & SCSI_RESET_BUS_RESET)
+		  scsi_mark_bus_reset(host, SCpnt->channel);
 		else scsi_mark_device_reset(SCpnt->device);
 		SCpnt->internal_timeout &= ~IN_RESET;
 		scsi_request_sense (SCpnt);

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