if (i->f->set_width && sdev->wdtr) { 
if (i->f->set_width && spi_max_width(starget) && sdev->wdtr) { 
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;	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(sdev->sdev_target, KERN_ERR, "Domain Validation Initial Inquiry Failed\n");		/* FIXME: should probably offline the device here? */		return;	}	/* test width */	if (i->f->set_width && sdev->wdtr) {		i->f->set_width(sdev->sdev_target, 1);		if (spi_dv_device_compare_inquiry(sreq, buffer,						   buffer + len,						   DV_LOOPS)		    != SPI_COMPARE_SUCCESS) {			SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Wide Transfers Fail\n");			i->f->set_width(sdev->sdev_target, 0);		}	}	if (!i->f->set_period)		return;	/* device can't handle synchronous */	if(!sdev->ppr && !sdev->sdtr)		return;	/* see if the device has an echo buffer.  If it does we can	 * do the SPI pattern write tests */	len = 0;	if (sdev->ppr)		len = spi_dv_device_get_echo_buffer(sreq, buffer); retry:	/* now set up to the maximum */	DV_SET(offset, 255);	DV_SET(period, 1);	if (len == 0) {		SPI_PRINTK(sdev->sdev_target, 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(sdev->sdev_target, 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;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/62a8612972eaea804e1e42c63ee403cd4e14cc35/scsi_transport_spi.c/clean/drivers/scsi/scsi_transport_spi.c