View | Details | Raw Unified | Return to bug 278533
Collapse All | Expand All

(-)linux-2.6.23-rc2/drivers/ata/pata_ali.c.ori (+40 lines)
Lines 29-35 Link Here
29
#include <linux/init.h>
29
#include <linux/init.h>
30
#include <linux/blkdev.h>
30
#include <linux/blkdev.h>
31
#include <linux/delay.h>
31
#include <linux/delay.h>
32
#include <scsi/scsi.h>
32
#include <scsi/scsi_host.h>
33
#include <scsi/scsi_host.h>
34
#include <scsi/scsi_cmnd.h>
33
#include <linux/libata.h>
35
#include <linux/libata.h>
34
#include <linux/dmi.h>
36
#include <linux/dmi.h>
35
37
Lines 260-265 static void ali_set_dmamode(struct ata_p Link Here
260
}
262
}
261
263
262
/**
264
/**
265
 *	ali_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
266
 *	@qc: Metadata associated with taskfile to check
267
 *
268
 *	LOCKING:
269
 *	None (inherited from caller).
270
 *
271
 *	RETURNS: 0 when ATAPI DMA can be used
272
 *		 1 otherwise
273
 */
274
static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
275
{
276
	struct scsi_cmnd *cmd = qc->scsicmd;
277
	u8 *scsicmd = cmd->cmnd;
278
	int rc = 1; /* atapi dma off by default */
279
280
	switch (scsicmd[0]) {
281
	case READ_10:
282
	case WRITE_10:
283
	case READ_12:
284
	case WRITE_12:
285
	case READ_6:
286
	case WRITE_6:
287
	case 0xad: /* READ_DVD_STRUCTURE */
288
	case 0xbe: /* READ_CD */
289
		/* ATAPI DMA is ok */
290
		rc = 0;
291
		break;
292
	default:
293
		;
294
	}
295
296
	return rc;
297
}
298
299
/**
263
 *	ali_lock_sectors	-	Keep older devices to 255 sector mode
300
 *	ali_lock_sectors	-	Keep older devices to 255 sector mode
264
 *	@adev: Device
301
 *	@adev: Device
265
 *
302
 *
Lines 348-353 static struct ata_port_operations ali_20 Link Here
348
	.error_handler	= ata_bmdma_error_handler,
385
	.error_handler	= ata_bmdma_error_handler,
349
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
386
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
350
	.cable_detect	= ata_cable_40wire,
387
	.cable_detect	= ata_cable_40wire,
388
	.check_atapi_dma = ali_check_atapi_dma,
351
389
352
	.bmdma_setup 	= ata_bmdma_setup,
390
	.bmdma_setup 	= ata_bmdma_setup,
353
	.bmdma_start 	= ata_bmdma_start,
391
	.bmdma_start 	= ata_bmdma_start,
Lines 387-392 static struct ata_port_operations ali_c2 Link Here
387
	.error_handler	= ata_bmdma_error_handler,
425
	.error_handler	= ata_bmdma_error_handler,
388
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
426
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
389
	.cable_detect	= ali_c2_cable_detect,
427
	.cable_detect	= ali_c2_cable_detect,
428
	.check_atapi_dma = ali_check_atapi_dma,
390
429
391
	.bmdma_setup 	= ata_bmdma_setup,
430
	.bmdma_setup 	= ata_bmdma_setup,
392
	.bmdma_start 	= ata_bmdma_start,
431
	.bmdma_start 	= ata_bmdma_start,
Lines 425-430 static struct ata_port_operations ali_c5 Link Here
425
	.error_handler	= ata_bmdma_error_handler,
464
	.error_handler	= ata_bmdma_error_handler,
426
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
465
	.post_internal_cmd = ata_bmdma_post_internal_cmd,
427
	.cable_detect	= ali_c2_cable_detect,
466
	.cable_detect	= ali_c2_cable_detect,
467
	.check_atapi_dma = ali_check_atapi_dma,
428
468
429
	.bmdma_setup 	= ata_bmdma_setup,
469
	.bmdma_setup 	= ata_bmdma_setup,
430
	.bmdma_start 	= ata_bmdma_start,
470
	.bmdma_start 	= ata_bmdma_start,

Return to bug 278533