/* Enable/disable DMA on an IDE controller following generic bus-mastering IDE controller behaviour.  */
void ide_dma_host_set(ide_drive_t *drive, int on)
/* Enable/disable DMA on an IDE controller following generic bus-mastering IDE controller behaviour.  */
void ide_dma_host_set(ide_drive_t *drive, int on)
{
	ide_hwif_t *hwif = drive->hwif;
	u8 unit = drive->dn & 1;
	u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
	if (on)
		dma_stat |= (1 << (5 + unit));
	else
		dma_stat &= ~(1 << (5 + unit));
	ide_dma_sff_write_status(hwif, dma_stat);
}