static int acer_dma_init(void *v, int channel, int drive, void *databuf, size_t datalen, int flags) { /* use PIO for LBA48 transfer */ if (flags & WDC_DMA_LBA48) return EINVAL; return pciide_dma_init(v, channel, drive, databuf, datalen, flags); }
static int piix_dma_init(void *v, int channel, int drive, void *databuf, size_t datalen, int flags) { /* use PIO for unaligned transfer */ if (((uintptr_t)databuf) & 0x1) return EINVAL; return pciide_dma_init(v, channel, drive, databuf, datalen, flags); }
static int geodeide_dma_init(void *v, int channel, int drive, void *databuf, size_t datalen, int flags) { /* * If the buffer is not properly aligned, we can't allow DMA * and need to fall back to PIO. */ if (((uintptr_t)databuf) & 0xf) return (EINVAL); return (pciide_dma_init(v, channel, drive, databuf, datalen, flags)); }