patch-1.3.16 linux/drivers/scsi/eata_pio_proc.c

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

diff -u --recursive --new-file v1.3.15/linux/drivers/scsi/eata_pio_proc.c linux/drivers/scsi/eata_pio_proc.c
@@ -28,19 +28,23 @@
 
 /*
  * eata_proc_info
- * inout : decides on the direction of the dataflow and the meaning of the variables
+ * inout : decides on the direction of the dataflow and the meaning of the 
+ *         variables
  * buffer: If inout==FALSE data is beeing written to it else read from it
  * *start: If inout==FALSE start of the valid data in the buffer
- * offset: If inout==FALSE offset from the beginning of the imaginary file from which we start writing into the buffer
- * length: If inout==FALSE max number of bytes to be written into the buffer else number of bytes in the buffer
+ * offset: If inout==FALSE offset from the beginning of the imaginary file 
+ *         from which we start writing into the buffer
+ * length: If inout==FALSE max number of bytes to be written into the buffer 
+ *         else number of bytes in the buffer
  */
-int eata_pio_proc_info(char *buffer, char **start, off_t offset, int length, int hostno, int inout)
+int eata_pio_proc_info(char *buffer, char **start, off_t offset, int length, 
+		       int hostno, int inout)
 {
 
     Scsi_Device *scd;
     struct Scsi_Host *HBA_ptr;
     static u8 buff[512];
-    int i, x; 
+    int i; 
     int   size, len = 0;
     off_t begin = 0;
     off_t pos = 0;
@@ -101,40 +105,7 @@
     
     while (scd) {
 	if (scd->host == HBA_ptr) {
-	    
-	    size = sprintf(buffer + len, "Channel: %02d Id: %02d Lun: %02d\n  Vendor: ",
-			   scd->channel, scd->id, scd->lun);
-	    for (x = 0; x < 8; x++) {
-		if (scd->vendor[x] >= 0x20)
-		    size += sprintf(buffer + len + size, "%c", scd->vendor[x]);
-		else
-		    size += sprintf(buffer + len + size," ");
-	    }
-	    size += sprintf(buffer + len + size, " Model: ");
-	    for (x = 0; x < 16; x++) {
-		if (scd->model[x] >= 0x20)
-		    size +=  sprintf(buffer + len + size, "%c", scd->model[x]);
-		else
-		    size += sprintf(buffer + len + size, " ");
-	    }
-	    size += sprintf(buffer + len + size, " Rev: ");
-	    for (x = 0; x < 4; x++) {
-		if (scd->rev[x] >= 0x20)
-		    size += sprintf(buffer + len + size, "%c", scd->rev[x]);
-		else
-		    size += sprintf(buffer + len + size, " ");
-	    }
-	    size += sprintf(buffer + len + size, "\n");
-	    
-	    size += sprintf(buffer + len + size, "  Type:   %s ",
-			    scd->type < MAX_SCSI_DEVICE_CODE ? 
-			    pio_scsi_dev_types[(int)scd->type] : "Unknown          " );
-	    size += sprintf(buffer + len + size, "               ANSI"
-			    " SCSI revision: %02x", (scd->scsi_level < 3)?1:2);
-	    if (scd->scsi_level == 2)
-		size += sprintf(buffer + len + size, " CCS\n");
-	    else
-		size += sprintf(buffer + len + size, "\n");
+	    proc_print_scsidevice(scd, buffer, &size, len);
 	    len += size; 
 	    pos = begin + len;
 	    
@@ -173,7 +144,7 @@
  * c-label-offset: -4
  * c-continued-statement-offset: 4
  * c-continued-brace-offset: 0
- * indent-tabs-mode: nil
  * tab-width: 8
  * End:
  */
+

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