Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33c1002e authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: add IDE_HFLAG_NO_ATAPI_DMA host flag



Add IDE_HFLAG_NO_ATAPI_DMA host flag and set it in host drivers which
don't support ATAPI DMA.  Then remove no longer needed hwif->atapi_dma.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 1c3dd326
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -415,7 +415,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)

static void icside_dma_init(ide_hwif_t *hwif)
{
	hwif->atapi_dma		= 1;
	hwif->mwdma_mask	= 7; /* MW0..2 */
	hwif->swdma_mask	= 7; /* SW0..2 */

+1 −0
Original line number Diff line number Diff line
@@ -805,6 +805,7 @@ init_e100_ide (void)
		hwif->dma_host_on = &cris_dma_on;
		hwif->dma_off_quietly = &cris_dma_off;
		hwif->cbl = ATA_CBL_PATA40;
		hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
		hwif->pio_mask = ATA_PIO4,
		hwif->drives[0].autotune = 1;
		hwif->drives[1].autotune = 1;
+8 −4
Original line number Diff line number Diff line
@@ -338,8 +338,10 @@ static int config_drive_for_dma (ide_drive_t *drive)
	ide_hwif_t *hwif = drive->hwif;
	struct hd_driveid *id = drive->id;

	if (drive->media != ide_disk && hwif->atapi_dma == 0)
		return 0;
	if (drive->media != ide_disk) {
		if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
			return -1;
	}

	/*
	 * Enable DMA on any drive that has
@@ -726,8 +728,10 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
	int x, i;
	u8 mode = 0;

	if (drive->media != ide_disk && hwif->atapi_dma == 0)
	if (drive->media != ide_disk) {
		if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
			return 0;
	}

	for (i = 0; i < ARRAY_SIZE(xfer_mode_bases); i++) {
		if (req_mode < xfer_mode_bases[i])
+0 −3
Original line number Diff line number Diff line
@@ -134,8 +134,6 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)

	hwif->bus_state	= BUSSTATE_ON;

	hwif->atapi_dma = 0;		/* disable all atapi dma */ 

	init_completion(&hwif->gendev_rel_comp);

	default_hwif_iops(hwif);
@@ -379,7 +377,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)

	hwif->pio_mask			= tmp_hwif->pio_mask;

	hwif->atapi_dma			= tmp_hwif->atapi_dma;
	hwif->ultra_mask		= tmp_hwif->ultra_mask;
	hwif->mwdma_mask		= tmp_hwif->mwdma_mask;
	hwif->swdma_mask		= tmp_hwif->swdma_mask;
+0 −3
Original line number Diff line number Diff line
@@ -699,9 +699,6 @@ static int au_ide_probe(struct device *dev)
	hwif->dma_host_on		= &auide_dma_host_on;
	hwif->dma_lost_irq		= &auide_dma_lost_irq;
	hwif->ide_dma_on                = &auide_dma_on;

	hwif->atapi_dma                 = 1;

#else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
	hwif->channel                   = 0;
	hwif->hold                      = 1;
Loading