Lines Matching refs:fdc_state
583 static struct floppy_fdc_state fdc_state[N_FDC]; variable
597 return fd_inb(fdc_state[fdc].address, reg); in fdc_inb()
602 fd_outb(value, fdc_state[fdc].address, reg); in fdc_outb()
739 if (!(fdc_state[fdc].dor & (0x10 << UNIT(drive))) || in disk_change()
740 (fdc_state[fdc].dor & 3) != UNIT(drive) || fdc != FDC(drive)) { in disk_change()
743 (unsigned int)fdc_state[fdc].dor); in disk_change()
800 if (fdc_state[fdc].address == -1) in set_dor()
803 olddor = fdc_state[fdc].dor; in set_dor()
813 fdc_state[fdc].dor = newdor; in set_dor()
829 fdc_outb(fdc_state[fdc].dor & ~(0x10 << UNIT(drive)), in twaddle()
831 fdc_outb(fdc_state[fdc].dor, fdc, FD_DOR); in twaddle()
843 fdc_state[fdc].spec1 = fdc_state[fdc].spec2 = -1; in reset_fdc_info()
844 fdc_state[fdc].need_configure = 1; in reset_fdc_info()
845 fdc_state[fdc].perp_mode = 1; in reset_fdc_info()
846 fdc_state[fdc].rawcmd = 0; in reset_fdc_info()
876 if (fdc_state[fdc].rawcmd == 2) in set_fdc()
879 fdc_state[fdc].reset = 1; in set_fdc()
938 if (!(fdc_state[fdc].dor & (0x10 << UNIT(drive)))) in floppy_off()
1050 if (fdc_state[current_fdc].reset) { in fd_wait_for_completion()
1075 fdc_state[current_fdc].reset = 1; in setup_DMA()
1081 fdc_state[current_fdc].reset = 1; in setup_DMA()
1090 fdc_state[current_fdc].address) < 0) { in setup_DMA()
1093 fdc_state[current_fdc].reset = 1; in setup_DMA()
1104 virtual_dma_port = fdc_state[current_fdc].address; in setup_DMA()
1118 if (fdc_state[fdc].reset) in wait_til_ready()
1129 fdc_state[fdc].reset = 1; in wait_til_ready()
1149 fdc_state[fdc].reset = 1; in output_byte()
1184 fdc_state[fdc].reset = 1; in result()
1221 fdc_state[fdc].reset = 1; in perpendicular_mode()
1232 if (fdc_state[fdc].perp_mode == perp_mode) in perpendicular_mode()
1234 if (fdc_state[fdc].version >= FDC_82077_ORIG) { in perpendicular_mode()
1237 fdc_state[fdc].perp_mode = perp_mode; in perpendicular_mode()
1291 if (fdc_state[fdc].need_configure && in fdc_specify()
1292 fdc_state[fdc].version >= FDC_82072A) { in fdc_specify()
1294 fdc_state[fdc].need_configure = 0; in fdc_specify()
1303 if (fdc_state[fdc].version >= FDC_82078) { in fdc_specify()
1318 if (fdc_state[fdc].version >= FDC_82072) { in fdc_specify()
1351 if (fdc_state[fdc].spec1 != spec1 || in fdc_specify()
1352 fdc_state[fdc].spec2 != spec2) { in fdc_specify()
1355 output_byte(fdc, fdc_state[fdc].spec1 = spec1); in fdc_specify()
1356 output_byte(fdc, fdc_state[fdc].spec2 = spec2); in fdc_specify()
1367 if ((raw_cmd->rate & 3) == fdc_state[current_fdc].dtr) in fdc_dtr()
1378 fdc_state[current_fdc].dtr = raw_cmd->rate & 3; in fdc_dtr()
1434 fdc_state[current_fdc].reset = 1; in interpret_errors()
1574 fdc_state[fdc].reset = 1; in check_wp()
1657 fdc_state[current_fdc].reset = 1; in recal_interrupt()
1726 if (current_fdc >= N_FDC || fdc_state[current_fdc].address == -1) { in floppy_interrupt()
1728 pr_info("DOR0=%x\n", fdc_state[0].dor); in floppy_interrupt()
1735 fdc_state[current_fdc].reset = 0; in floppy_interrupt()
1762 fdc_state[current_fdc].reset = 1; in floppy_interrupt()
1788 if (fdc_state[current_fdc].reset) { in reset_interrupt()
1806 fdc_state[current_fdc].reset = 0; in reset_fdc()
1816 if (fdc_state[current_fdc].version >= FDC_82072A) in reset_fdc()
1817 fdc_outb(0x80 | (fdc_state[current_fdc].dtr & 3), in reset_fdc()
1820 fdc_outb(fdc_state[current_fdc].dor & ~0x04, current_fdc, FD_DOR); in reset_fdc()
1822 fdc_outb(fdc_state[current_fdc].dor, current_fdc, FD_DOR); in reset_fdc()
1886 fdc_state[current_fdc].reset = 1; in floppy_shutdown()
1906 if (!(fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))) { in start_motor()
1914 } else if (fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive))) in start_motor()
1928 if (fdc_state[current_fdc].reset) { in floppy_ready()
2032 if (fdc_state[current_fdc].reset) in wait_til_done()
2102 fdc_state[current_fdc].reset = 1; in bad_flp_intr()
2935 fdc_state[current_fdc].reset = 1; in user_reset_fdc()
2936 if (fdc_state[current_fdc].reset) { in user_reset_fdc()
3141 if (fdc_state[current_fdc].rawcmd <= 1) in raw_cmd_ioctl()
3142 fdc_state[current_fdc].rawcmd = 1; in raw_cmd_ioctl()
3148 fdc_state[current_fdc].rawcmd = 2; in raw_cmd_ioctl()
3152 fdc_state[current_fdc].rawcmd = 2; in raw_cmd_ioctl()
3157 if (fdc_state[current_fdc].reset) in raw_cmd_ioctl()
3172 if (ret != -EINTR && fdc_state[current_fdc].reset) in raw_cmd_ioctl()
3544 outparam = &fdc_state[FDC(drive)]; in fd_locked_ioctl()
3822 v = fdc_state[FDC(drive)]; in compat_getfdcstat()
4051 if (fdc_state[FDC(drive)].rawcmd == 1) in floppy_open()
4052 fdc_state[FDC(drive)].rawcmd = 2; in floppy_open()
4243 if (fdc_state[fdc].reset) in get_fdc_version()
4478 if (fdc_state[fdc].address != -1) in floppy_resume()
4507 if (fdc_state[FDC(drive)].version == FDC_NONE) in floppy_available()
4624 memset(&fdc_state[i], 0, sizeof(*fdc_state)); in do_floppy_init()
4625 fdc_state[i].dtr = -1; in do_floppy_init()
4626 fdc_state[i].dor = 0x4; in do_floppy_init()
4632 fdc_state[i].version = FDC_82072A; in do_floppy_init()
4637 fdc_state[0].address = FDC1; in do_floppy_init()
4638 if (fdc_state[0].address == -1) { in do_floppy_init()
4644 fdc_state[1].address = FDC2; in do_floppy_init()
4674 fdc_state[i].driver_version = FD_DRIVER_VERSION; in do_floppy_init()
4676 fdc_state[i].track[unit] = 0; in do_floppy_init()
4677 if (fdc_state[i].address == -1) in do_floppy_init()
4679 fdc_state[i].rawcmd = 2; in do_floppy_init()
4683 fdc_state[i].address = -1; in do_floppy_init()
4684 fdc_state[i].version = FDC_NONE; in do_floppy_init()
4688 fdc_state[i].version = get_fdc_version(i); in do_floppy_init()
4689 if (fdc_state[i].version == FDC_NONE) { in do_floppy_init()
4692 fdc_state[i].address = -1; in do_floppy_init()
4696 fdc_state[i].version < FDC_82072A) in do_floppy_init()
4800 release_region(fdc_state[fdc].address + p->offset, p->size); in floppy_release_allocated_regions()
4811 if (!request_region(fdc_state[fdc].address + p->offset, in floppy_request_regions()
4814 fdc_state[fdc].address + p->offset); in floppy_request_regions()
4859 if (fdc_state[fdc].address != -1) { in floppy_grab_irq_and_dma()
4865 if (fdc_state[fdc].address != -1) { in floppy_grab_irq_and_dma()
4867 fdc_outb(fdc_state[fdc].dor, fdc, FD_DOR); in floppy_grab_irq_and_dma()
4874 if (fdc_state[fdc].address != -1) in floppy_grab_irq_and_dma()
4875 fdc_outb(fdc_state[fdc].dor, fdc, FD_DOR); in floppy_grab_irq_and_dma()
4937 if (fdc_state[fdc].address != -1) in floppy_release_irq_and_dma()