if (spi_dv_retrain(sreq, buffer, buffer + len, 
if (spi_dv_retrain(sdev, buffer, buffer + len, 
spi_dv_device_internal(struct scsi_request *sreq, u8 *buffer){	struct spi_internal *i = to_spi_internal(sreq->sr_host->transportt);	struct scsi_device *sdev = sreq->sr_device;	struct scsi_target *starget = sdev->sdev_target;	int len = sdev->inquiry_len;	/* first set us up for narrow async */	DV_SET(offset, 0);	DV_SET(width, 0);		if (spi_dv_device_compare_inquiry(sreq, buffer, buffer, DV_LOOPS)	    != SPI_COMPARE_SUCCESS) {		SPI_PRINTK(starget, KERN_ERR, "Domain Validation Initial Inquiry Failed\n");		/* FIXME: should probably offline the device here? */		return;	}	/* test width */	if (i->f->set_width && spi_max_width(starget) &&	    scsi_device_wide(sdev)) {		i->f->set_width(starget, 1);		if (spi_dv_device_compare_inquiry(sreq, buffer,						   buffer + len,						   DV_LOOPS)		    != SPI_COMPARE_SUCCESS) {			SPI_PRINTK(starget, KERN_ERR, "Wide Transfers Fail\n");			i->f->set_width(starget, 0);		}	}	if (!i->f->set_period)		return;	/* device can't handle synchronous */	if (!scsi_device_sync(sdev) && !scsi_device_dt(sdev))		return;	/* see if the device has an echo buffer.  If it does we can	 * do the SPI pattern write tests */	len = 0;	if (scsi_device_dt(sdev))		len = spi_dv_device_get_echo_buffer(sreq, buffer); retry:	/* now set up to the maximum */	DV_SET(offset, spi_max_offset(starget));	DV_SET(period, spi_min_period(starget));	/* try QAS requests; this should be harmless to set if the	 * target supports it */	if (scsi_device_qas(sdev))		DV_SET(qas, 1);	/* Also try IU transfers */	if (scsi_device_ius(sdev))		DV_SET(iu, 1);	if (spi_min_period(starget) < 9) {		/* This u320 (or u640). Ignore the coupled parameters		 * like DT and IU, but set the optional ones */		DV_SET(rd_strm, 1);		DV_SET(wr_flow, 1);		DV_SET(rti, 1);		if (spi_min_period(starget) == 8)			DV_SET(pcomp_en, 1);	}	if (len == 0) {		SPI_PRINTK(starget, KERN_INFO, "Domain Validation skipping write tests\n");		spi_dv_retrain(sreq, buffer, buffer + len,			       spi_dv_device_compare_inquiry);		return;	}	if (len > SPI_MAX_ECHO_BUFFER_SIZE) {		SPI_PRINTK(starget, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE);		len = SPI_MAX_ECHO_BUFFER_SIZE;	}	if (spi_dv_retrain(sreq, buffer, buffer + len,			   spi_dv_device_echo_buffer)	    == SPI_COMPARE_SKIP_TEST) {		/* OK, the stupid drive can't do a write echo buffer		 * test after all, fall back to the read tests */		len = 0;		goto retry;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/33aa687db90dd8541bd5e9a762eebf880eaee767/scsi_transport_spi.c/clean/drivers/scsi/scsi_transport_spi.c