Lines Matching refs:drive_state

401 static struct floppy_drive_struct drive_state[N_DRIVE];  variable
606 return !current_type[drive] && !ITYPE(drive_state[drive].fd_device); in drive_no_geom()
736 if (time_before(jiffies, drive_state[drive].select_date + drive_params[drive].select_delay)) in disk_change()
751 drive_state[drive].flags); in disk_change()
755 &drive_state[drive].flags); in disk_change()
757 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in disk_change()
760 if (drive_state[drive].maxblock) /* mark it changed */ in disk_change()
762 &drive_state[drive].flags); in disk_change()
765 if (drive_state[drive].keep_data >= 0) { in disk_change()
775 drive_state[drive].last_checked = jiffies; in disk_change()
776 clear_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[drive].flags); in disk_change()
818 drive_state[drive].select_date = jiffies; in set_dor()
831 drive_state[drive].select_date = jiffies; in twaddle()
848 (mode || drive_state[drive].track != NEED_1_RECAL)) in reset_fdc_info()
849 drive_state[drive].track = NEED_2_RECAL; in reset_fdc_info()
945 delta = jiffies - drive_state[drive].first_read_date + HZ - in floppy_off()
971 if (drive_state[drive].fd_ref == 0 || drive_params[drive].select_delay != 0) in scandrives()
1450 &drive_state[current_drive].flags); in interpret_errors()
1455 &drive_state[current_drive].flags); in interpret_errors()
1465 drive_state[current_drive].track = NEED_2_RECAL; in interpret_errors()
1498 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup; in setup_rw_floppy()
1549 drive_state[current_drive].track = NEED_2_RECAL; in seek_interrupt()
1554 if (drive_state[current_drive].track >= 0 && in seek_interrupt()
1555 drive_state[current_drive].track != reply_buffer[ST1] && in seek_interrupt()
1562 &drive_state[current_drive].flags); in seek_interrupt()
1564 drive_state[current_drive].select_date = jiffies; in seek_interrupt()
1566 drive_state[current_drive].track = reply_buffer[ST1]; in seek_interrupt()
1572 if (test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)) { in check_wp()
1580 clear_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in check_wp()
1582 &drive_state[drive].flags); in check_wp()
1589 &drive_state[drive].flags); in check_wp()
1592 &drive_state[drive].flags); in check_wp()
1605 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1612 &drive_state[current_drive].flags); in seek_floppy()
1617 if (drive_state[current_drive].track <= NEED_1_RECAL) { in seek_floppy()
1620 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1622 …(drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->trac… in seek_floppy()
1637 if (raw_cmd->track != drive_state[current_drive].track && in seek_floppy()
1662 switch (drive_state[current_drive].track) { in recal_interrupt()
1684 &drive_state[current_drive].flags); in recal_interrupt()
1685 drive_state[current_drive].select_date = jiffies; in recal_interrupt()
1695 drive_state[current_drive].track = NEED_1_RECAL; in recal_interrupt()
1699 drive_state[current_drive].track = reply_buffer[ST1]; in recal_interrupt()
1912 drive_state[current_drive].first_read_date = 0; in start_motor()
1914 drive_state[current_drive].spinup_date = jiffies; in start_motor()
1925 …return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive]… in start_motor()
1974 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in floppy_start()
2076 probed_format = drive_state[drive].probed_format; in next_valid_format()
2080 drive_state[drive].probed_format = 0; in next_valid_format()
2084 drive_state[drive].probed_format = probed_format; in next_valid_format()
2096 drive_state[current_drive].probed_format++; in bad_flp_intr()
2107 drive_state[current_drive].track = NEED_2_RECAL; in bad_flp_intr()
2112 int type = ITYPE(drive_state[drive].fd_device); in set_floppy()
2298 INFBOUND(drive_state[current_drive].maxblock, block); in request_done()
2300 drive_state[current_drive].maxtrack = 1; in request_done()
2309 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation; in request_done()
2312 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation; in request_done()
2333 if (!drive_state[current_drive].first_read_date) in rw_interrupt()
2334 drive_state[current_drive].first_read_date = jiffies; in rw_interrupt()
2582 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) && in make_raw_rw_request()
2806 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) { in redo_fd_request()
2813 drive_state[current_drive].probed_format = 0; in redo_fd_request()
2822 …_floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_f… in redo_fd_request()
2831 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) in redo_fd_request()
2903 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in poll_drive()
3149 if (drive_state[drive].fd_ref > 1) { in raw_cmd_ioctl()
3153 } else if (drive_state[drive].fd_ref) { in raw_cmd_ioctl()
3177 drive_state[current_drive].track = NO_TRACK; in raw_cmd_ioctl()
3260 if (!disk || ITYPE(drive_state[cnt].fd_device) != type) in set_geometry()
3283 drive_state[current_drive].keep_data = -1; in set_geometry()
3285 drive_state[current_drive].keep_data = 1; in set_geometry()
3291 if (drive_state[current_drive].maxblock > user_params[drive].sect || in set_geometry()
3292 drive_state[current_drive].maxtrack || in set_geometry()
3369 int type = ITYPE(drive_state[drive].fd_device); in fd_getgeo()
3405 int type = ITYPE(drive_state[drive].fd_device); in fd_locked_ioctl()
3453 if (drive_state[drive].fd_ref != 1) in fd_locked_ioctl()
3463 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in fd_locked_ioctl()
3464 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in fd_locked_ioctl()
3472 drive_state[drive].keep_data = 0; in fd_locked_ioctl()
3497 ret = drive_state[drive].flags; in fd_locked_ioctl()
3505 if (drive_state[drive].fd_ref != 1) in fd_locked_ioctl()
3543 outparam = &drive_state[drive]; in fd_locked_ioctl()
3681 type = ITYPE(drive_state[drive].fd_device); in compat_set_geometry()
3697 err = get_floppy_geometry(drive, ITYPE(drive_state[drive].fd_device), in compat_get_prm()
3795 v.spinup_date = drive_state[drive].spinup_date; in compat_getdrvstat()
3796 v.select_date = drive_state[drive].select_date; in compat_getdrvstat()
3797 v.first_read_date = drive_state[drive].first_read_date; in compat_getdrvstat()
3798 v.probed_format = drive_state[drive].probed_format; in compat_getdrvstat()
3799 v.track = drive_state[drive].track; in compat_getdrvstat()
3800 v.maxblock = drive_state[drive].maxblock; in compat_getdrvstat()
3801 v.maxtrack = drive_state[drive].maxtrack; in compat_getdrvstat()
3802 v.generation = drive_state[drive].generation; in compat_getdrvstat()
3803 v.keep_data = drive_state[drive].keep_data; in compat_getdrvstat()
3804 v.fd_ref = drive_state[drive].fd_ref; in compat_getdrvstat()
3805 v.fd_device = drive_state[drive].fd_device; in compat_getdrvstat()
3806 v.last_checked = drive_state[drive].last_checked; in compat_getdrvstat()
3807 v.dmabuf = (uintptr_t) drive_state[drive].dmabuf; in compat_getdrvstat()
3808 v.bufblocks = drive_state[drive].bufblocks; in compat_getdrvstat()
3977 if (!drive_state[drive].fd_ref--) { in floppy_release()
3979 drive_state[drive].fd_ref = 0; in floppy_release()
3981 if (!drive_state[drive].fd_ref) in floppy_release()
4002 old_dev = drive_state[drive].fd_device; in floppy_open()
4006 if (!drive_state[drive].fd_ref && (drive_params[drive].flags & FD_BROKEN_DCL)) { in floppy_open()
4007 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in floppy_open()
4008 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in floppy_open()
4011 drive_state[drive].fd_ref++; in floppy_open()
4048 drive_state[drive].fd_device = new_dev; in floppy_open()
4059 drive_state[drive].last_checked = 0; in floppy_open()
4061 &drive_state[drive].flags); in floppy_open()
4064 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags)) in floppy_open()
4066 if (test_bit(FD_OPEN_SHOULD_FAIL_BIT, &drive_state[drive].flags)) in floppy_open()
4071 !test_bit(FD_DISK_WRITABLE_BIT, &drive_state[drive].flags)) in floppy_open()
4078 drive_state[drive].fd_ref--; in floppy_open()
4080 if (!drive_state[drive].fd_ref) in floppy_open()
4096 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_check_events()
4097 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)) in floppy_check_events()
4100 if (time_after(jiffies, drive_state[drive].last_checked + drive_params[drive].checkfreq)) { in floppy_check_events()
4107 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_check_events()
4108 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags) || in floppy_check_events()
4134 set_bit(FD_OPEN_SHOULD_FAIL_BIT, &drive_state[drive].flags); in floppy_rb0_cb()
4184 if (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4185 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4195 cf = (test_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags) || in floppy_revalidate()
4196 test_bit(FD_VERIFY_BIT, &drive_state[drive].flags)); in floppy_revalidate()
4201 drive_state[drive].maxblock = 0; in floppy_revalidate()
4202 drive_state[drive].maxtrack = 0; in floppy_revalidate()
4206 clear_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in floppy_revalidate()
4208 drive_state[drive].generation++; in floppy_revalidate()
4219 set_capacity(disk, floppy_sizes[drive_state[drive].fd_device]); in floppy_revalidate()
4664 memset(&drive_state[drive], 0, sizeof(drive_state[drive])); in do_floppy_init()
4666 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[drive].flags); in do_floppy_init()
4667 set_bit(FD_DISK_CHANGED_BIT, &drive_state[drive].flags); in do_floppy_init()
4668 set_bit(FD_VERIFY_BIT, &drive_state[drive].flags); in do_floppy_init()
4669 drive_state[drive].fd_device = -1; in do_floppy_init()