if (cmd->sc_data_direction == SCSI_DATA_WRITE) { 
if (cmd->sc_data_direction == DMA_TO_DEVICE) { 
static unsigned int atapi_xlat(struct ata_queued_cmd *qc, u8 *scsicmd){	struct scsi_cmnd *cmd = qc->scsicmd;	struct ata_device *dev = qc->dev;	int using_pio = (dev->flags & ATA_DFLAG_PIO);	int nodata = (cmd->sc_data_direction == SCSI_DATA_NONE);	if (!using_pio)		/* Check whether ATAPI DMA is safe */		if (ata_check_atapi_dma(qc))			using_pio = 1;	memcpy(&qc->cdb, scsicmd, qc->ap->cdb_len);	qc->complete_fn = atapi_qc_complete;	qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;	if (cmd->sc_data_direction == SCSI_DATA_WRITE) {		qc->tf.flags |= ATA_TFLAG_WRITE;		DPRINTK("direction: write\n");	}	qc->tf.command = ATA_CMD_PACKET;	/* no data, or PIO data xfer */	if (using_pio || nodata) {		if (nodata)			qc->tf.protocol = ATA_PROT_ATAPI_NODATA;		else			qc->tf.protocol = ATA_PROT_ATAPI;		qc->tf.lbam = (8 * 1024) & 0xff;		qc->tf.lbah = (8 * 1024) >> 8;	}	/* DMA data xfer */	else {		qc->tf.protocol = ATA_PROT_ATAPI_DMA;		qc->tf.feature |= ATAPI_PKT_DMA;#ifdef ATAPI_ENABLE_DMADIR		/* some SATA bridges need us to indicate data xfer direction */		if (cmd->sc_data_direction != SCSI_DATA_WRITE)			qc->tf.feature |= ATAPI_DMADIR;#endif	}	qc->nbytes = cmd->bufflen;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/be7db055dd7261522557046370f49160728e3847/libata-scsi.c/buggy/drivers/scsi/libata-scsi.c