Lines Matching refs:hwif
222 ide_hwif_t *hwif = &ide_hwifs[index]; in init_hwif_data() local
225 memset(hwif, 0, sizeof(ide_hwif_t)); in init_hwif_data()
229 hwif->index = index; in init_hwif_data()
230 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, &hwif->irq); in init_hwif_data()
231 memcpy(&hwif->hw, &hw, sizeof(hw)); in init_hwif_data()
232 memcpy(hwif->io_ports, hw.io_ports, sizeof(hw.io_ports)); in init_hwif_data()
233 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; in init_hwif_data()
235 if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) in init_hwif_data()
236 hwif->noprobe = 1; /* may be overridden by ide_setup() */ in init_hwif_data()
238 hwif->major = ide_hwif_to_major[index]; in init_hwif_data()
239 hwif->name[0] = 'i'; in init_hwif_data()
240 hwif->name[1] = 'd'; in init_hwif_data()
241 hwif->name[2] = 'e'; in init_hwif_data()
242 hwif->name[3] = '0' + index; in init_hwif_data()
243 hwif->bus_state = BUSSTATE_ON; in init_hwif_data()
244 hwif->reset_poll= NULL; in init_hwif_data()
245 hwif->pre_reset = NULL; in init_hwif_data()
247 hwif->atapi_dma = 0; /* disable all atapi dma */ in init_hwif_data()
248 hwif->ultra_mask = 0x80; /* disable all ultra */ in init_hwif_data()
249 hwif->mwdma_mask = 0x80; /* disable all mwdma */ in init_hwif_data()
250 hwif->swdma_mask = 0x80; /* disable all swdma */ in init_hwif_data()
251 hwif->sata = 0; /* assume PATA */ in init_hwif_data()
253 default_hwif_iops(hwif); in init_hwif_data()
254 default_hwif_transport(hwif); in init_hwif_data()
256 ide_drive_t *drive = &hwif->drives[unit]; in init_hwif_data()
260 drive->hwif = hwif; in init_hwif_data()
368 ide_hwif_t *hwif = HWIF(drive); in ide_dump_status() local
391 err = hwif->INB(IDE_ERROR_REG); in ide_dump_status()
410 hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); in ide_dump_status()
418 u8 cur = hwif->INB(IDE_SELECT_REG); in ide_dump_status()
422 |(hwif->INB(IDE_HCYL_REG)<<16) in ide_dump_status()
423 |(hwif->INB(IDE_LCYL_REG)<<8) in ide_dump_status()
424 | hwif->INB(IDE_SECTOR_REG)); in ide_dump_status()
427 (hwif->INB(IDE_HCYL_REG)<<8) + in ide_dump_status()
428 hwif->INB(IDE_LCYL_REG), in ide_dump_status()
430 hwif->INB(IDE_SECTOR_REG)); in ide_dump_status()
498 ide_hwif_t *hwif; in revalidate_drives() local
503 hwif = &ide_hwifs[index]; in revalidate_drives()
509 (void) ide_revalidate_disk(MKDEV(hwif->major, unit<<PARTN_BITS)); in revalidate_drives()
623 ((hwif->mmio) ? release_mem_region((addr),(num)) : release_region((addr),(num)))
630 void hwif_unregister (ide_hwif_t *hwif) in hwif_unregister() argument
634 if (hwif->mmio == 2) in hwif_unregister()
636 if (hwif->io_ports[IDE_CONTROL_OFFSET]) in hwif_unregister()
637 hwif_release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); in hwif_unregister()
639 if (hwif->io_ports[IDE_IRQ_OFFSET]) in hwif_unregister()
640 hwif_release_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); in hwif_unregister()
643 if (hwif->straight8) { in hwif_unregister()
644 hwif_release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); in hwif_unregister()
648 if (hwif->io_ports[i]) { in hwif_unregister()
649 hwif_release_region(hwif->io_ports[i], 1); in hwif_unregister()
674 ide_hwif_t *hwif = HWIF(our_drive); in ide_prepare_tristate() local
679 if (!hwif->present) in ide_prepare_tristate()
685 drive = &hwif->drives[unit]; in ide_prepare_tristate()
697 drive = &hwif->drives[unit]; in ide_prepare_tristate()
718 drive = &hwif->drives[unit]; in ide_prepare_tristate()
725 kdev_t devp = MKDEV(hwif->major, minor+p); in ide_prepare_tristate()
730 destroy_proc_ide_drives(hwif); in ide_prepare_tristate()
736 drive = &hwif->drives[i]; in ide_prepare_tristate()
773 ide_hwif_t *hwif = HWIF(our_drive); in ide_resume_hwif() local
774 int err = ide_wait_hwif_ready(hwif); in ide_resume_hwif()
787 irqd = hwif->irq; in ide_resume_hwif()
794 ide_drive_t *drive = &hwif->drives[unit]; in ide_resume_hwif()
795 drive->dn = ((hwif->channel ? 2 : 0) + unit); in ide_resume_hwif()
798 hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); in ide_resume_hwif()
803 ide_probe_reset(hwif); in ide_resume_hwif()
815 ide_tune_drives(hwif); in ide_resume_hwif()
817 hwif->present = 1; in ide_resume_hwif()
823 ide_drive_t *drive = &hwif->drives[unit]; in ide_resume_hwif()
835 ide_hwif_t *hwif, *g; in ide_unregister() local
846 hwif = &ide_hwifs[index]; in ide_unregister()
847 if (!hwif->present) in ide_unregister()
850 drive = &hwif->drives[unit]; in ide_unregister()
858 hwif->present = 0; in ide_unregister()
865 drive = &hwif->drives[unit]; in ide_unregister()
872 kdev_t devp = MKDEV(hwif->major, minor+p); in ide_unregister()
877 destroy_proc_ide_drives(hwif); in ide_unregister()
882 hwgroup = hwif->hwgroup; in ide_unregister()
887 g = hwgroup->hwif; in ide_unregister()
889 if (g->irq == hwif->irq) in ide_unregister()
892 } while (g != hwgroup->hwif); in ide_unregister()
894 free_irq(hwif->irq, hwgroup); in ide_unregister()
901 hwif_unregister(hwif); in ide_unregister()
909 drive = &hwif->drives[i]; in ide_unregister()
930 while (hwgroup->hwif->next != hwif) in ide_unregister()
931 hwgroup->hwif = hwgroup->hwif->next; in ide_unregister()
932 hwgroup->hwif->next = hwif->next; in ide_unregister()
933 if (hwgroup->hwif == hwif) in ide_unregister()
936 hwgroup->hwif = HWIF(hwgroup->drive); in ide_unregister()
939 if (hwif->dma_base) { in ide_unregister()
940 (void) ide_release_dma(hwif); in ide_unregister()
942 hwif->dma_base = 0; in ide_unregister()
943 hwif->dma_master = 0; in ide_unregister()
944 hwif->dma_command = 0; in ide_unregister()
945 hwif->dma_vendor1 = 0; in ide_unregister()
946 hwif->dma_status = 0; in ide_unregister()
947 hwif->dma_vendor3 = 0; in ide_unregister()
948 hwif->dma_prdtable = 0; in ide_unregister()
955 unregister_blkdev(hwif->major, hwif->name); in ide_unregister()
956 kfree(blksize_size[hwif->major]); in ide_unregister()
957 kfree(max_sectors[hwif->major]); in ide_unregister()
958 kfree(max_readahead[hwif->major]); in ide_unregister()
959 blk_dev[hwif->major].data = NULL; in ide_unregister()
960 blk_dev[hwif->major].queue = NULL; in ide_unregister()
961 blksize_size[hwif->major] = NULL; in ide_unregister()
962 gd = hwif->gd; in ide_unregister()
972 hwif->gd = NULL; in ide_unregister()
975 old_hwif = *hwif; in ide_unregister()
977 hwif->hwgroup = old_hwif.hwgroup; in ide_unregister()
979 hwif->proc = old_hwif.proc; in ide_unregister()
981 hwif->major = old_hwif.major; in ide_unregister()
984 hwif->straight8 = old_hwif.straight8; in ide_unregister()
985 hwif->bus_state = old_hwif.bus_state; in ide_unregister()
987 hwif->atapi_dma = old_hwif.atapi_dma; in ide_unregister()
988 hwif->ultra_mask = old_hwif.ultra_mask; in ide_unregister()
989 hwif->mwdma_mask = old_hwif.mwdma_mask; in ide_unregister()
990 hwif->swdma_mask = old_hwif.swdma_mask; in ide_unregister()
992 hwif->chipset = old_hwif.chipset; in ide_unregister()
993 hwif->hold = old_hwif.hold; in ide_unregister()
996 hwif->pci_dev = old_hwif.pci_dev; in ide_unregister()
997 hwif->cds = old_hwif.cds; in ide_unregister()
1001 hwif->hwifops = old_hwif.hwifops; in ide_unregister()
1003 hwif->identify = old_hwif.identify; in ide_unregister()
1004 hwif->tuneproc = old_hwif.tuneproc; in ide_unregister()
1005 hwif->speedproc = old_hwif.speedproc; in ide_unregister()
1006 hwif->selectproc = old_hwif.selectproc; in ide_unregister()
1007 hwif->reset_poll = old_hwif.reset_poll; in ide_unregister()
1008 hwif->pre_reset = old_hwif.pre_reset; in ide_unregister()
1009 hwif->resetproc = old_hwif.resetproc; in ide_unregister()
1010 hwif->intrproc = old_hwif.intrproc; in ide_unregister()
1011 hwif->maskproc = old_hwif.maskproc; in ide_unregister()
1012 hwif->quirkproc = old_hwif.quirkproc; in ide_unregister()
1013 hwif->busproc = old_hwif.busproc; in ide_unregister()
1017 hwif->pioops = old_hwif.pioops; in ide_unregister()
1019 hwif->ata_input_data = old_hwif.ata_input_data; in ide_unregister()
1020 hwif->ata_output_data = old_hwif.ata_output_data; in ide_unregister()
1021 hwif->atapi_input_bytes = old_hwif.atapi_input_bytes; in ide_unregister()
1022 hwif->atapi_output_bytes = old_hwif.atapi_output_bytes; in ide_unregister()
1026 hwif->dmaops = old_hwif.dmaops; in ide_unregister()
1028 hwif->ide_dma_read = old_hwif.ide_dma_read; in ide_unregister()
1029 hwif->ide_dma_write = old_hwif.ide_dma_write; in ide_unregister()
1030 hwif->ide_dma_begin = old_hwif.ide_dma_begin; in ide_unregister()
1031 hwif->ide_dma_end = old_hwif.ide_dma_end; in ide_unregister()
1032 hwif->ide_dma_check = old_hwif.ide_dma_check; in ide_unregister()
1033 hwif->ide_dma_on = old_hwif.ide_dma_on; in ide_unregister()
1034 hwif->ide_dma_off = old_hwif.ide_dma_off; in ide_unregister()
1035 hwif->ide_dma_off_quietly = old_hwif.ide_dma_off_quietly; in ide_unregister()
1036 hwif->ide_dma_test_irq = old_hwif.ide_dma_test_irq; in ide_unregister()
1037 hwif->ide_dma_host_on = old_hwif.ide_dma_host_on; in ide_unregister()
1038 hwif->ide_dma_host_off = old_hwif.ide_dma_host_off; in ide_unregister()
1039 hwif->ide_dma_bad_drive = old_hwif.ide_dma_bad_drive; in ide_unregister()
1040 hwif->ide_dma_good_drive = old_hwif.ide_dma_good_drive; in ide_unregister()
1041 hwif->ide_dma_count = old_hwif.ide_dma_count; in ide_unregister()
1042 hwif->ide_dma_verbose = old_hwif.ide_dma_verbose; in ide_unregister()
1043 hwif->ide_dma_retune = old_hwif.ide_dma_retune; in ide_unregister()
1044 hwif->ide_dma_lostirq = old_hwif.ide_dma_lostirq; in ide_unregister()
1045 hwif->ide_dma_timeout = old_hwif.ide_dma_timeout; in ide_unregister()
1049 hwif->iops = old_hwif.iops; in ide_unregister()
1051 hwif->OUTB = old_hwif.OUTB; in ide_unregister()
1052 hwif->OUTBSYNC = old_hwif.OUTBSYNC; in ide_unregister()
1053 hwif->OUTW = old_hwif.OUTW; in ide_unregister()
1054 hwif->OUTL = old_hwif.OUTL; in ide_unregister()
1055 hwif->OUTSW = old_hwif.OUTSW; in ide_unregister()
1056 hwif->OUTSL = old_hwif.OUTSL; in ide_unregister()
1058 hwif->INB = old_hwif.INB; in ide_unregister()
1059 hwif->INW = old_hwif.INW; in ide_unregister()
1060 hwif->INL = old_hwif.INL; in ide_unregister()
1061 hwif->INSW = old_hwif.INSW; in ide_unregister()
1062 hwif->INSL = old_hwif.INSL; in ide_unregister()
1065 hwif->mmio = old_hwif.mmio; in ide_unregister()
1066 hwif->rqsize = old_hwif.rqsize; in ide_unregister()
1067 hwif->addressing = old_hwif.addressing; in ide_unregister()
1069 hwif->irq = old_hwif.irq; in ide_unregister()
1071 hwif->initializing = old_hwif.initializing; in ide_unregister()
1073 hwif->dma_base = old_hwif.dma_base; in ide_unregister()
1074 hwif->dma_master = old_hwif.dma_master; in ide_unregister()
1075 hwif->dma_command = old_hwif.dma_command; in ide_unregister()
1076 hwif->dma_vendor1 = old_hwif.dma_vendor1; in ide_unregister()
1077 hwif->dma_status = old_hwif.dma_status; in ide_unregister()
1078 hwif->dma_vendor3 = old_hwif.dma_vendor3; in ide_unregister()
1079 hwif->dma_prdtable = old_hwif.dma_prdtable; in ide_unregister()
1081 hwif->dma_extra = old_hwif.dma_extra; in ide_unregister()
1082 hwif->config_data = old_hwif.config_data; in ide_unregister()
1083 hwif->select_data = old_hwif.select_data; in ide_unregister()
1084 hwif->autodma = old_hwif.autodma; in ide_unregister()
1085 hwif->udma_four = old_hwif.udma_four; in ide_unregister()
1086 hwif->no_dsc = old_hwif.no_dsc; in ide_unregister()
1088 hwif->hwif_data = old_hwif.hwif_data; in ide_unregister()
1152 ide_hwif_t *hwif; in ide_register_hw() local
1156 hwif = &ide_hwifs[index]; in ide_register_hw()
1157 if (hwif->hw.io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET]) in ide_register_hw()
1161 hwif = &ide_hwifs[index]; in ide_register_hw()
1162 if (!hwif->hold && ((!hwif->present && !hwif->mate && !initializing) || in ide_register_hw()
1163 (!hwif->hw.io_ports[IDE_DATA_OFFSET] && initializing))) in ide_register_hw()
1171 if (hwif->present) in ide_register_hw()
1173 else if (!hwif->hold) in ide_register_hw()
1175 if (hwif->present) in ide_register_hw()
1177 memcpy(&hwif->hw, hw, sizeof(*hw)); in ide_register_hw()
1178 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); in ide_register_hw()
1179 hwif->irq = hw->irq; in ide_register_hw()
1180 hwif->noprobe = 0; in ide_register_hw()
1181 hwif->chipset = hw->chipset; in ide_register_hw()
1192 *hwifp = hwif; in ide_register_hw()
1194 return (initializing || hwif->present) ? index : -1; in ide_register_hw()
1944 ide_hwif_t *hwif = HWIF(drive); in ide_ioctl() local
1949 if (hwif->busproc) in ide_ioctl()
1953 if(hwif->bus_state == arg) in ide_ioctl()
1956 if(hwif->bus_state == BUSSTATE_ON) in ide_ioctl()
1961 hwif->bus_state = arg; in ide_ioctl()
1963 if (hwif->busproc) in ide_ioctl()
1965 err = hwif->busproc(drive, (int)arg); in ide_ioctl()
1972 hwif->bus_state = arg; in ide_ioctl()
2142 ide_hwif_t *hwif; in ide_setup() local
2195 hwif = &ide_hwifs[hw]; in ide_setup()
2196 drive = &hwif->drives[unit]; in ide_setup()
2222 hwif->noprobe = 0; in ide_setup()
2227 hwif->noprobe = 0; in ide_setup()
2264 hwif->noprobe = 0; in ide_setup()
2298 hwif = &ide_hwifs[hw]; in ide_setup()
2305 if (hwif->chipset != ide_unknown) in ide_setup()
2377 hwif->chipset = mate->chipset = ide_4drives; in ide_setup()
2378 mate->irq = hwif->irq; in ide_setup()
2379 memcpy(mate->io_ports, hwif->io_ports, sizeof(hwif->io_ports)); in ide_setup()
2389 hwif->udma_four = 1; in ide_setup()
2392 hwif->udma_four = 0; in ide_setup()
2396 hwif->autodma = 1; in ide_setup()
2399 hwif->reset = 1; in ide_setup()
2402 hwif->drives[0].autotune = 2; in ide_setup()
2403 hwif->drives[1].autotune = 2; in ide_setup()
2406 hwif->drives[0].autotune = 1; in ide_setup()
2407 hwif->drives[1].autotune = 1; in ide_setup()
2411 hwif->mate = &ide_hwifs[hw^1]; in ide_setup()
2412 hwif->mate->mate = hwif; in ide_setup()
2413 hwif->serialized = hwif->mate->serialized = 1; in ide_setup()
2417 hwif->noprobe = 1; in ide_setup()
2425 hwif->hw.irq = vals[2]; in ide_setup()
2426 ide_init_hwif_ports(&hwif->hw, (ide_ioreg_t) vals[0], (ide_ioreg_t) vals[1], &hwif->irq); in ide_setup()
2427 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); in ide_setup()
2428 hwif->irq = vals[2]; in ide_setup()
2429 hwif->noprobe = 0; in ide_setup()
2430 hwif->chipset = ide_generic; in ide_setup()
2603 ide_hwif_t *hwif; in ide_attach_devices() local
2608 hwif = &ide_hwifs[i]; in ide_attach_devices()
2609 if (!hwif->present) in ide_attach_devices()
2612 drive = &hwif->drives[unit]; in ide_attach_devices()
2814 ide_hwif_t *hwif = &ide_hwifs[index]; in ide_scan_devices() local
2815 if (!hwif->present) in ide_scan_devices()
2818 ide_drive_t *drive = &hwif->drives[unit]; in ide_scan_devices()
2936 void ide_geninit (ide_hwif_t *hwif) in ide_geninit() argument
2939 struct gendisk *gd = hwif->gd; in ide_geninit()
2942 ide_drive_t *drive = &hwif->drives[unit]; in ide_geninit()
2948 register_disk(gd,MKDEV(hwif->major,unit<<PARTN_BITS), in ide_geninit()
2970 ide_hwif_t *hwif; in ide_notify_reboot() local
2986 hwif = &ide_hwifs[i]; in ide_notify_reboot()
2987 if (!hwif->present) in ide_notify_reboot()
2990 drive = &hwif->drives[unit]; in ide_notify_reboot()
3057 ide_hwif_t *hwif = &ide_hwifs[i]; in ide_init() local
3058 if (hwif->present) in ide_init()
3059 ide_geninit(hwif); in ide_init()