sreq->sr_cmd_len = 0; sreq->sr_data_direction = DMA_FROM_DEVICE; 
result = spi_execute(sdev, spi_read_buffer_descriptor, DMA_FROM_DEVICE, buffer, 4, NULL); 
spi_dv_device_get_echo_buffer(struct scsi_request *sreq, u8 *buffer){	int l;	/* first off do a test unit ready.  This can error out 	 * because of reservations or some other reason.  If it	 * fails, the device won't let us write to the echo buffer	 * so just return failure */		const char spi_test_unit_ready[] = {		TEST_UNIT_READY, 0, 0, 0, 0, 0	};	const char spi_read_buffer_descriptor[] = {		READ_BUFFER, 0x0b, 0, 0, 0, 0, 0, 0, 4, 0	};		sreq->sr_cmd_len = 0;	sreq->sr_data_direction = DMA_NONE;	/* We send a set of three TURs to clear any outstanding 	 * unit attention conditions if they exist (Otherwise the	 * buffer tests won't be happy).  If the TUR still fails	 * (reservation conflict, device not ready, etc) just	 * skip the write tests */	for (l = 0; ; l++) {		spi_wait_req(sreq, spi_test_unit_ready, NULL, 0);		if(sreq->sr_result) {			if(l >= 3)				return 0;		} else {			/* TUR succeeded */			break;		}	}	sreq->sr_cmd_len = 0;	sreq->sr_data_direction = DMA_FROM_DEVICE;	spi_wait_req(sreq, spi_read_buffer_descriptor, buffer, 4);	if (sreq->sr_result)		/* Device has no echo buffer */		return 0;	return buffer[3] + ((buffer[2] & 0x1f) << 8);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/33aa687db90dd8541bd5e9a762eebf880eaee767/scsi_transport_spi.c/clean/drivers/scsi/scsi_transport_spi.c