Skip to contentSkip to conversation

Add Domain Validation to the SPI transport class

PATCH New James Bottomley 1 participant 1 message Mar 13, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add Domain Validation to the SPI transport class

Domain Validation is a fairly essential element to the SCSI Parallel Interface (although if you look very few drivers actually do it). The premise is that the Parallel Bus, being a transmission line, might not be correctly tuned to the transfers you want do perform. DV probes the parameters of the transport until it finds a setting that works (for the interested, see http://www.t10.org/ftp/t10/drafts/sdv/sdv-r08b.pdf)

The current code employs rather simplistic DV heuristics, although those can be improved over time. The change in scsi_scan.c is so that DV may be done easily from the slave_configure routine, which is the most natural place to begin.

James

drivers/scsi/scsi_scan.c +4 -0
diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
@@ -643,6 +643,10 @@
 	if (*bflags & BLIST_USE_10_BYTE_MS)
 		sdev->use_10_for_ms = 1;
 
+	/* set the device running here so that slave configure
+	 * may do I/O */
+	scsi_device_set_state(sdev, SDEV_RUNNING);
+
 	if(sdev->host->hostt->slave_configure)
 		sdev->host->hostt->slave_configure(sdev);
 
drivers/scsi/scsi_transport_spi.c +391 -8

468 lines not on this page · raw message

include/scsi/scsi_transport_spi.h +3 -0
diff -Nru a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h
@@ -35,6 +35,7 @@
 	unsigned int rd_strm:1;	/* Read streaming enabled */
 	unsigned int rti:1;	/* Retain Training Information */
 	unsigned int pcomp_en:1;/* Precompensation enabled */
+	unsigned int dv_pending:1; /* Internal flag */
 };
 
 /* accessor functions */
@@ -89,5 +90,7 @@
 
 struct scsi_transport_template *spi_attach_transport(struct spi_function_template *);
 void spi_release_transport(struct scsi_transport_template *);
+void spi_schedule_dv_device(struct scsi_device *);
+void spi_dv_device(struct scsi_device *);
 
 #endif /* SCSI_TRANSPORT_SPI_H */