Lines Matching refs:hwif
237 static int ide_build_sglist(ide_hwif_t *hwif, struct request *rq) in ide_build_sglist() argument
240 struct scatterlist *sg = hwif->sg_table; in ide_build_sglist()
244 hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; in ide_build_sglist()
246 hwif->sg_dma_direction = PCI_DMA_TODEVICE; in ide_build_sglist()
263 return pci_map_sg(NULL, sg, nents, hwif->sg_dma_direction); in ide_build_sglist()
446 ide_hwif_t *hwif = HWIF(drive); in icside_dma_check() local
447 int autodma = hwif->autodma; in icside_dma_check()
451 return hwif->ide_dma_off_quietly(drive); in icside_dma_check()
457 return hwif->ide_dma_off(drive); in icside_dma_check()
484 return hwif->ide_dma_on(drive); in icside_dma_check()
485 return hwif->ide_dma_off(drive); in icside_dma_check()
496 ide_hwif_t *hwif = HWIF(drive); in icside_dma_test_irq() local
497 return inb((unsigned long)hwif->hw.priv) & 1; in icside_dma_test_irq()
530 ide_hwif_t *hwif = HWIF(drive); in icside_dma_begin() local
532 enable_dma(hwif->hw.dma); in icside_dma_begin()
538 ide_hwif_t *hwif = HWIF(drive); in icside_dma_end() local
541 disable_dma(hwif->hw.dma); in icside_dma_end()
543 return get_dma_residue(hwif->hw.dma) != 0; in icside_dma_end()
553 ide_hwif_t *hwif = HWIF(drive); in icside_dma_read() local
562 disable_dma(hwif->hw.dma); in icside_dma_read()
567 HWIF(drive)->OUTB(hwif->select_data, hwif->config_data); in icside_dma_read()
572 set_dma_speed(hwif->hw.dma, drive->drive_data); in icside_dma_read()
574 set_dma_sg(hwif->hw.dma, HWIF(drive)->sg_table, count); in icside_dma_read()
575 set_dma_mode(hwif->hw.dma, DMA_MODE_READ); in icside_dma_read()
607 ide_hwif_t *hwif = HWIF(drive); in icside_dma_write() local
616 disable_dma(hwif->hw.dma); in icside_dma_write()
621 HWIF(drive)->OUTB(hwif->select_data, hwif->config_data); in icside_dma_write()
626 set_dma_speed(hwif->hw.dma, drive->drive_data); in icside_dma_write()
628 set_dma_sg(hwif->hw.dma, HWIF(drive)->sg_table, count); in icside_dma_write()
629 set_dma_mode(hwif->hw.dma, DMA_MODE_WRITE); in icside_dma_write()
660 icside_setup_dma(ide_hwif_t *hwif, int autodma) in icside_setup_dma() argument
662 printk(" %s: SG-DMA", hwif->name); in icside_setup_dma()
664 hwif->sg_table = kmalloc(sizeof(struct scatterlist) * NR_ENTRIES, in icside_setup_dma()
666 if (!hwif->sg_table) in icside_setup_dma()
669 hwif->dmatable_cpu = NULL; in icside_setup_dma()
670 hwif->dmatable_dma = 0; in icside_setup_dma()
671 hwif->speedproc = icside_set_speed; in icside_setup_dma()
672 hwif->autodma = autodma; in icside_setup_dma()
674 hwif->ide_dma_check = icside_dma_check; in icside_setup_dma()
675 hwif->ide_dma_host_off = icside_dma_host_off; in icside_setup_dma()
676 hwif->ide_dma_off_quietly = icside_dma_off_quietly; in icside_setup_dma()
677 hwif->ide_dma_off = icside_dma_off; in icside_setup_dma()
678 hwif->ide_dma_host_on = icside_dma_host_on; in icside_setup_dma()
679 hwif->ide_dma_on = icside_dma_on; in icside_setup_dma()
680 hwif->ide_dma_read = icside_dma_read; in icside_setup_dma()
681 hwif->ide_dma_write = icside_dma_write; in icside_setup_dma()
682 hwif->ide_dma_count = icside_dma_count; in icside_setup_dma()
683 hwif->ide_dma_begin = icside_dma_begin; in icside_setup_dma()
684 hwif->ide_dma_end = icside_dma_end; in icside_setup_dma()
685 hwif->ide_dma_verbose = icside_dma_verbose; in icside_setup_dma()
686 hwif->ide_dma_bad_drive = check_drive_bad_lists; in icside_setup_dma()
687 hwif->ide_dma_good_drive = check_drive_good_lists; in icside_setup_dma()
688 hwif->ide_dma_test_irq = icside_dma_test_irq; in icside_setup_dma()
704 ide_hwif_t *hwif; in icside_find_hwif() local
708 hwif = &ide_hwifs[index]; in icside_find_hwif()
709 if (hwif->io_ports[IDE_DATA_OFFSET] == (ide_ioreg_t)dataport) in icside_find_hwif()
714 hwif = &ide_hwifs[index]; in icside_find_hwif()
715 if (!hwif->io_ports[IDE_DATA_OFFSET]) in icside_find_hwif()
721 return hwif; in icside_find_hwif()
728 ide_hwif_t *hwif; in icside_setup() local
730 hwif = icside_find_hwif(base); in icside_setup()
731 if (hwif) { in icside_setup()
734 memset(&hwif->hw, 0, sizeof(hw_regs_t)); in icside_setup()
737 hwif->hw.io_ports[i] = (ide_ioreg_t)port; in icside_setup()
738 hwif->io_ports[i] = (ide_ioreg_t)port; in icside_setup()
741 hwif->hw.io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; in icside_setup()
742 hwif->io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; in icside_setup()
743 hwif->hw.irq = irq; in icside_setup()
744 hwif->irq = irq; in icside_setup()
745 hwif->hw.dma = NO_DMA; in icside_setup()
746 hwif->noprobe = 0; in icside_setup()
747 hwif->chipset = ide_acorn; in icside_setup()
750 return hwif; in icside_setup()
756 ide_hwif_t *hwif; in icside_register_v5() local
770 hwif = icside_setup(slot_port, &icside_cardinfo_v5, ec->irq); in icside_register_v5()
772 return hwif ? 0 : -1; in icside_register_v5()
778 ide_hwif_t *hwif, *mate; in icside_register_v6() local
800 hwif = icside_setup(port, &icside_cardinfo_v6_1, ec->irq); in icside_register_v6()
805 if (request_dma(ec->dma, hwif->name)) in icside_register_v6()
808 if (hwif) { in icside_register_v6()
809 hwif->config_data = slot_port; in icside_register_v6()
810 hwif->select_data = sel; in icside_register_v6()
811 hwif->hw.dma = ec->dma; in icside_register_v6()
812 hwif->hw.priv = (void *) in icside_register_v6()
814 hwif->channel = 0; in icside_register_v6()
815 icside_setup_dma(hwif, autodma); in icside_register_v6()
816 hwif->drives[0].autodma = autodma; in icside_register_v6()
817 hwif->drives[1].autodma = autodma; in icside_register_v6()
833 return hwif || mate ? 0 : -1; in icside_register_v6()