Lines Matching defs:current_drive

153 	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;
2157 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head);
2234 _floppy->track > drive_params[current_drive].tracks ||
2295 INFBOUND(drive_state[current_drive].maxblock, block);
2297 drive_state[current_drive].maxtrack = 1;
2303 write_errors[current_drive].write_errors++;
2304 if (write_errors[current_drive].write_errors == 1) {
2305 write_errors[current_drive].first_error_sector = blk_rq_pos(req);
2306 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation;
2308 write_errors[current_drive].last_error_sector = blk_rq_pos(req);
2309 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation;
2330 if (!drive_state[current_drive].first_read_date)
2331 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;
2404 buffer_drive = current_drive;
2579 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) &&
2605 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]);
2643 (current_drive == buffer_drive) &&
2670 buffer_drive != current_drive || /* bad drive */
2679 buffer_drive = current_drive;
2693 buffer_drive = current_drive;
2776 if (current_drive < N_DRIVE)
2777 floppy_off(current_drive);
2794 reschedule_timeout(current_drive, "redo fd request");
2802 disk_change(current_drive);
2803 if (test_bit(current_drive, &fake_change) ||
2804 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) {
2811 drive_state[current_drive].probed_format = 0;
2812 if (next_valid_format(current_drive)) {
2820 _floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_format];
2829 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags))
2830 twaddle(current_fdc, current_drive);
2899 debug_dcl(drive_params[current_drive].flags,
2901 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2925 * Both current_drive and current_fdc are changed to match the new drive.
3008 if (disk_change(current_drive))
3013 motor_off_callback(&motor_off_timer[current_drive]);
3146 if (drive == current_drive) {
3169 debug_dcl(drive_params[current_drive].flags,
3175 drive_state[current_drive].track = NO_TRACK;
3279 drive_state[current_drive].keep_data = -1;
3281 drive_state[current_drive].keep_data = 1;
3287 if (drive_state[current_drive].maxblock > user_params[drive].sect ||
3288 drive_state[current_drive].maxtrack ||
3557 twaddle(current_fdc, current_drive);
4351 int current_drive = 0;
4357 current_drive = ints[1];
4358 if (current_drive < 0 || current_drive >= 8) {
4363 if (current_drive >= 4 && !FDC2)
4366 drive_params[current_drive].cmos = ints[2];
4476 saved_drive = current_drive;
4708 current_drive = 0;