Lines Matching refs:drive_state
401 static struct floppy_drive_struct drive_state[N_DRIVE]; variable
607 return !current_type[drive] && !ITYPE(drive_state[drive].fd_device); in drive_no_geom()
737 if (time_before(jiffies, drive_state[drive].select_date + drive_params[drive].select_delay)) in disk_change()
752 drive_state[drive].flags); in disk_change()
756 &drive_state[drive].flags); in disk_change()
758 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in disk_change()
761 if (drive_state[drive].maxblock) /* mark it changed */ in disk_change()
763 &drive_state[drive].flags); in disk_change()
766 if (drive_state[drive].keep_data >= 0) { in disk_change()
776 drive_state[drive].last_checked = jiffies; in disk_change()
777 clear_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[drive].flags); in disk_change()
819 drive_state[drive].select_date = jiffies; in set_dor()
832 drive_state[drive].select_date = jiffies; in twaddle()
849 (mode || drive_state[drive].track != NEED_1_RECAL)) in reset_fdc_info()
850 drive_state[drive].track = NEED_2_RECAL; in reset_fdc_info()
946 delta = jiffies - drive_state[drive].first_read_date + HZ - in floppy_off()
972 if (drive_state[drive].fd_ref == 0 || drive_params[drive].select_delay != 0) in scandrives()
1447 &drive_state[current_drive].flags); in interpret_errors()
1452 &drive_state[current_drive].flags); in interpret_errors()
1462 drive_state[current_drive].track = NEED_2_RECAL; in interpret_errors()
1495 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup; in setup_rw_floppy()
1546 drive_state[current_drive].track = NEED_2_RECAL; in seek_interrupt()
1551 if (drive_state[current_drive].track >= 0 && in seek_interrupt()
1552 drive_state[current_drive].track != reply_buffer[ST1] && in seek_interrupt()
1559 &drive_state[current_drive].flags); in seek_interrupt()
1561 drive_state[current_drive].select_date = jiffies; in seek_interrupt()
1563 drive_state[current_drive].track = reply_buffer[ST1]; in seek_interrupt()
1569 if (test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)) { in check_wp()
1577 clear_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in check_wp()
1579 &drive_state[drive].flags); in check_wp()
1586 &drive_state[drive].flags); in check_wp()
1589 &drive_state[drive].flags); in check_wp()
1602 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1609 &drive_state[current_drive].flags); in seek_floppy()
1614 if (drive_state[current_drive].track <= NEED_1_RECAL) { in seek_floppy()
1617 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1619 …(drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->trac… in seek_floppy()
1634 if (raw_cmd->track != drive_state[current_drive].track && in seek_floppy()
1659 switch (drive_state[current_drive].track) { in recal_interrupt()
1681 &drive_state[current_drive].flags); in recal_interrupt()
1682 drive_state[current_drive].select_date = jiffies; in recal_interrupt()
1692 drive_state[current_drive].track = NEED_1_RECAL; in recal_interrupt()
1696 drive_state[current_drive].track = reply_buffer[ST1]; in recal_interrupt()
1909 drive_state[current_drive].first_read_date = 0; in start_motor()
1911 drive_state[current_drive].spinup_date = jiffies; in start_motor()
1922 …return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive]… in start_motor()
1971 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in floppy_start()
2073 probed_format = drive_state[drive].probed_format; in next_valid_format()
2077 drive_state[drive].probed_format = 0; in next_valid_format()
2081 drive_state[drive].probed_format = probed_format; in next_valid_format()
2093 drive_state[current_drive].probed_format++; in bad_flp_intr()
2104 drive_state[current_drive].track = NEED_2_RECAL; in bad_flp_intr()
2109 int type = ITYPE(drive_state[drive].fd_device); in set_floppy()
2295 INFBOUND(drive_state[current_drive].maxblock, block); in request_done()
2297 drive_state[current_drive].maxtrack = 1; in request_done()
2306 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation; in request_done()
2309 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation; in request_done()
2330 if (!drive_state[current_drive].first_read_date) in rw_interrupt()
2331 drive_state[current_drive].first_read_date = jiffies; in rw_interrupt()
2579 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) && in make_raw_rw_request()
2804 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) { in redo_fd_request()
2811 drive_state[current_drive].probed_format = 0; in redo_fd_request()
2820 …_floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_f… in redo_fd_request()
2829 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) in redo_fd_request()
2901 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in poll_drive()
3147 if (drive_state[drive].fd_ref > 1) { in raw_cmd_ioctl()
3151 } else if (drive_state[drive].fd_ref) { in raw_cmd_ioctl()
3175 drive_state[current_drive].track = NO_TRACK; in raw_cmd_ioctl()
3256 if (!disk || ITYPE(drive_state[cnt].fd_device) != type) in set_geometry()
3279 drive_state[current_drive].keep_data = -1; in set_geometry()
3281 drive_state[current_drive].keep_data = 1; in set_geometry()
3287 if (drive_state[current_drive].maxblock > user_params[drive].sect || in set_geometry()
3288 drive_state[current_drive].maxtrack || in set_geometry()
3365 int type = ITYPE(drive_state[drive].fd_device); in fd_getgeo()
3401 int type = ITYPE(drive_state[drive].fd_device); in fd_locked_ioctl()
3449 if (drive_state[drive].fd_ref != 1) in fd_locked_ioctl()
3459 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in fd_locked_ioctl()
3460 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in fd_locked_ioctl()
3468 drive_state[drive].keep_data = 0; in fd_locked_ioctl()
3493 ret = drive_state[drive].flags; in fd_locked_ioctl()
3501 if (drive_state[drive].fd_ref != 1) in fd_locked_ioctl()
3539 outparam = &drive_state[drive]; in fd_locked_ioctl()
3677 type = ITYPE(drive_state[drive].fd_device); in compat_set_geometry()
3693 err = get_floppy_geometry(drive, ITYPE(drive_state[drive].fd_device), in compat_get_prm()
3791 v.spinup_date = drive_state[drive].spinup_date; in compat_getdrvstat()
3792 v.select_date = drive_state[drive].select_date; in compat_getdrvstat()
3793 v.first_read_date = drive_state[drive].first_read_date; in compat_getdrvstat()
3794 v.probed_format = drive_state[drive].probed_format; in compat_getdrvstat()
3795 v.track = drive_state[drive].track; in compat_getdrvstat()
3796 v.maxblock = drive_state[drive].maxblock; in compat_getdrvstat()
3797 v.maxtrack = drive_state[drive].maxtrack; in compat_getdrvstat()
3798 v.generation = drive_state[drive].generation; in compat_getdrvstat()
3799 v.keep_data = drive_state[drive].keep_data; in compat_getdrvstat()
3800 v.fd_ref = drive_state[drive].fd_ref; in compat_getdrvstat()
3801 v.fd_device = drive_state[drive].fd_device; in compat_getdrvstat()
3802 v.last_checked = drive_state[drive].last_checked; in compat_getdrvstat()
3803 v.dmabuf = (uintptr_t) drive_state[drive].dmabuf; in compat_getdrvstat()
3804 v.bufblocks = drive_state[drive].bufblocks; in compat_getdrvstat()
3973 if (!drive_state[drive].fd_ref--) { in floppy_release()
3975 drive_state[drive].fd_ref = 0; in floppy_release()
3977 if (!drive_state[drive].fd_ref) in floppy_release()
3998 old_dev = drive_state[drive].fd_device; in floppy_open()
4002 if (!drive_state[drive].fd_ref && (drive_params[drive].flags & FD_BROKEN_DCL)) { in floppy_open()
4003 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in floppy_open()
4004 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in floppy_open()
4007 drive_state[drive].fd_ref++; in floppy_open()
4044 drive_state[drive].fd_device = new_dev; in floppy_open()
4055 drive_state[drive].last_checked = 0; in floppy_open()
4057 &drive_state[drive].flags); in floppy_open()
4060 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags)) in floppy_open()
4062 if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &drive_state[drive].flags)) in floppy_open()
4067 !test_bit(FD_DISK_WRITABLE_BIT, &drive_state[drive].flags)) in floppy_open()
4074 drive_state[drive].fd_ref--; in floppy_open()
4076 if (!drive_state[drive].fd_ref) in floppy_open()
4092 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_check_events()
4093 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)) in floppy_check_events()
4096 if (time_after(jiffies, drive_state[drive].last_checked + drive_params[drive].checkfreq)) { in floppy_check_events()
4103 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_check_events()
4104 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags) || in floppy_check_events()
4130 set_bit(FD_OPEN_SHOULD_FAIL_BIT, &drive_state[drive].flags); in floppy_rb0_cb()
4180 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4181 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4191 cf = (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4192 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)); in floppy_revalidate()
4197 drive_state[drive].maxblock = 0; in floppy_revalidate()
4198 drive_state[drive].maxtrack = 0; in floppy_revalidate()
4202 clear_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in floppy_revalidate()
4204 drive_state[drive].generation++; in floppy_revalidate()
4215 set_capacity(disk, floppy_sizes[drive_state[drive].fd_device]); in floppy_revalidate()
4657 memset(&drive_state[drive], 0, sizeof(drive_state[drive])); in do_floppy_init()
4659 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[drive].flags); in do_floppy_init()
4660 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in do_floppy_init()
4661 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in do_floppy_init()
4662 drive_state[drive].fd_device = -1; in do_floppy_init()