Lines Matching defs:current_drive

155 	pr_info("floppy%d: " format, current_drive, ##args)
589 static unsigned char current_drive;
631 if (drive_params[current_drive].flags & DEBUGT)
855 * Both current_drive and current_fdc are changed to match the new drive.
881 current_drive = drive;
887 * Both current_drive and current_fdc are changed to match the new drive.
966 if (drive_params[current_drive].select_delay)
969 saved_drive = current_drive;
1025 debug_dcl(drive_params[current_drive].flags,
1028 if (disk_change(current_drive)) {
1447 &drive_state[current_drive].flags);
1452 &drive_state[current_drive].flags);
1454 if (drive_params[current_drive].flags & FTD_MSG)
1457 } else if (floppy_errors >= drive_params[current_drive].max_errors.reporting) {
1462 drive_state[current_drive].track = NEED_2_RECAL;
1495 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup;
1500 if (time_after(ready_date, jiffies + drive_params[current_drive].select_delay)) {
1501 ready_date -= drive_params[current_drive].select_delay;
1546 drive_state[current_drive].track = NEED_2_RECAL;
1551 if (drive_state[current_drive].track >= 0 &&
1552 drive_state[current_drive].track != reply_buffer[ST1] &&
1554 debug_dcl(drive_params[current_drive].flags,
1556 debug_dcl(drive_params[current_drive].flags, "jiffies=%lu\n",
1559 &drive_state[current_drive].flags);
1561 drive_state[current_drive].select_date = jiffies;
1563 drive_state[current_drive].track = reply_buffer[ST1];
1599 debug_dcl(drive_params[current_drive].flags,
1602 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1603 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) {
1609 &drive_state[current_drive].flags);
1614 if (drive_state[current_drive].track <= NEED_1_RECAL) {
1617 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1619 (drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->track)) {
1625 if (drive_params[current_drive].flags & FD_SILENT_DCL_CLEAR) {
1626 set_dor(current_fdc, ~(0x10 << UNIT(current_drive)), 0);
1633 check_wp(current_fdc, current_drive);
1634 if (raw_cmd->track != drive_state[current_drive].track &&
1645 output_byte(current_fdc, UNIT(current_drive));
1659 switch (drive_state[current_drive].track) {
1677 debug_dcl(drive_params[current_drive].flags,
1681 &drive_state[current_drive].flags);
1682 drive_state[current_drive].select_date = jiffies;
1692 drive_state[current_drive].track = NEED_1_RECAL;
1696 drive_state[current_drive].track = reply_buffer[ST1];
1758 } while ((reply_buffer[ST0] & 0x83) != UNIT(current_drive) &&
1777 if (output_byte(current_fdc, UNIT(current_drive)) < 0)
1904 data = UNIT(current_drive);
1906 if (!(fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))) {
1909 drive_state[current_drive].first_read_date = 0;
1911 drive_state[current_drive].spinup_date = jiffies;
1912 data |= (0x10 << UNIT(current_drive));
1914 } else if (fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))
1915 mask &= ~(0x10 << UNIT(current_drive));
1918 del_timer(motor_off_timer + current_drive);
1922 return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive].select_delay,
1937 debug_dcl(drive_params[current_drive].flags,
1940 disk_change(current_drive) && !drive_params[current_drive].select_delay)
1941 twaddle(current_fdc, current_drive); /* this clears the dcl on certain
1954 fdc_specify(current_fdc, current_drive); /* must be done here because of hut, hlt ... */
1959 fdc_specify(current_fdc, current_drive);
1966 reschedule_timeout(current_drive, "floppy start");
1969 debug_dcl(drive_params[current_drive].flags,
1971 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2093 drive_state[current_drive].probed_format++;
2094 if (!next_valid_format(current_drive))
2098 INFBOUND(write_errors[current_drive].badness, err_count);
2099 if (err_count > drive_params[current_drive].max_errors.abort)
2101 if (err_count > drive_params[current_drive].max_errors.reset)
2103 else if (err_count > drive_params[current_drive].max_errors.recal)
2104 drive_state[current_drive].track = NEED_2_RECAL;
2156 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head);
2233 _floppy->track > drive_params[current_drive].tracks ||
2294 INFBOUND(drive_state[current_drive].maxblock, block);
2296 drive_state[current_drive].maxtrack = 1;
2302 write_errors[current_drive].write_errors++;
2303 if (write_errors[current_drive].write_errors == 1) {
2304 write_errors[current_drive].first_error_sector = blk_rq_pos(req);
2305 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation;
2307 write_errors[current_drive].last_error_sector = blk_rq_pos(req);
2308 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation;
2329 if (!drive_state[current_drive].first_read_date)
2330 drive_state[current_drive].first_read_date = jiffies;
2385 current_type[current_drive] = _floppy;
2386 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2391 if (drive_params[current_drive].flags & FTD_MSG)
2393 _floppy->name, current_drive);
2394 current_type[current_drive] = _floppy;
2395 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2405 buffer_drive = current_drive;
2606 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) &&
2632 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]);
2670 (current_drive == buffer_drive) &&
2722 floppy_errors < drive_params[current_drive].max_errors.read_track &&
2724 (drive_params[current_drive].read_track & (1 << drive_state[current_drive].probed_format)))))) {
2745 buffer_drive != current_drive || /* bad drive */
2754 buffer_drive = current_drive;
2768 buffer_drive = current_drive;
2863 if (current_drive < N_DRIVE)
2864 floppy_off(current_drive);
2881 reschedule_timeout(current_drive, "redo fd request");
2889 disk_change(current_drive);
2890 if (test_bit(current_drive, &fake_change) ||
2891 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) {
2898 drive_state[current_drive].probed_format = 0;
2899 if (next_valid_format(current_drive)) {
2907 _floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_format];
2916 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags))
2917 twaddle(current_fdc, current_drive);
2986 debug_dcl(drive_params[current_drive].flags,
2988 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
3012 * Both current_drive and current_fdc are changed to match the new drive.
3098 if (disk_change(current_drive))
3103 motor_off_callback(&motor_off_timer[current_drive]);
3238 if (drive == current_drive) {
3261 debug_dcl(drive_params[current_drive].flags,
3267 drive_state[current_drive].track = NO_TRACK;
3370 drive_state[current_drive].keep_data = -1;
3372 drive_state[current_drive].keep_data = 1;
3378 if (drive_state[current_drive].maxblock > user_params[drive].sect ||
3379 drive_state[current_drive].maxtrack ||
3647 twaddle(current_fdc, current_drive);
4443 int current_drive = 0;
4449 current_drive = ints[1];
4450 if (current_drive < 0 || current_drive >= 8) {
4455 if (current_drive >= 4 && !FDC2)
4458 drive_params[current_drive].cmos = ints[2];
4568 saved_drive = current_drive;
4764 current_drive = 0;