Lines Matching refs:drive
12 * - Disk change detection and drive deselecting after motor-off
15 * don't have an HD drive :-(
20 * - Removed drive type (unknown on atari)
43 * - Let user set max. supported drive type (speeds up format
177 { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */
178 { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
275 * MSch: User-provided type information. 'drive' points to
281 * User-provided permanent type information. 'drive' points to
290 int connected; /* !=0 : drive is connected */
309 #define UD unit[drive]
310 #define UDT unit[drive].disktype
367 #define IS_BUFFERED(drive,side,track) \
368 (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
395 #define RECALIBRATE_ERRORS 4 /* After this many errors the drive
423 static void fd_select_drive( int drive );
429 static int do_format(int drive, int type, struct atari_format_descr *desc);
430 static void do_fd_action( int drive );
444 static void setup_req_params( int drive );
447 static void fd_probe( int drive );
448 static int fd_test_drive_present( int drive );
517 /* Select a drive, update the FDC's track register and set the correct
521 static void fd_select_drive( int drive )
526 if (drive == SelectedDrive)
533 sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1);
546 SelectedDrive = drive;
562 /* On Falcon, the drive B select line is used on the printer port, so
571 * counts the index signals, which arrive only if one drive is selected.
579 /* no drive selected, needn't deselect anyone */
597 * in the drive and the FDC will leave the motor on forever (or,
612 static int drive = 0;
618 if (++drive > 1 || !UD.connected)
619 drive = 0;
628 ~(drive == 0 ? DSKDRV0 : DSKDRV1);
633 DPRINT(( "wpstat[%d] = %d\n", drive, stat ));
635 set_bit (drive, &changed_floppies);
743 static int do_format(int drive, int type, struct atari_format_descr *desc)
760 q = unit[drive].disk[type]->queue;
812 do_fd_action( drive );
826 * required parameter settings (drive select, side select, track
834 static void do_fd_action( int drive )
840 if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
845 setup_req_params( drive );
863 if (SelectedDrive != drive)
864 fd_select_drive( drive );
919 /* Seek the drive to the requested track. The drive must have been
1439 unsigned int drive = p - unit;
1440 if (test_bit (drive, &fake_change)) {
1444 if (test_bit (drive, &changed_floppies)) {
1461 unsigned int drive = p - unit;
1463 if (test_bit(drive, &changed_floppies) ||
1464 test_bit(drive, &fake_change) || !p->disktype) {
1468 clear_bit(drive, &fake_change);
1469 clear_bit(drive, &changed_floppies);
1473 if (default_params[drive].blocks == 0)
1476 UDT = &default_params[drive];
1484 static void setup_req_params( int drive )
1495 read_track = (ReqCmd == READ && unit[drive].error_count == 0);
1507 int drive = floppy - unit;
1510 DPRINT(("Queue request: drive %d type %d sectors %d of %d last %d\n",
1511 drive, type, blk_rq_cur_sectors(bd->rq),
1524 unit[drive].error_count = 0;
1532 /* drive not connected */
1533 printk(KERN_ERR "Unknown Device: fd%d\n", drive );
1550 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1556 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1574 setup_req_params( drive );
1575 do_fd_action( drive );
1589 int drive = floppy - unit;
1609 drive, dtp, dtp->name);
1633 * Currently, the drive geometry is cleared after each
1654 drive, setprm.size, setprm.sect, setprm.stretch);
1673 /* skip this one, invalid for drive ... */
1685 drive, dtp->name, dtp);
1691 default_params[drive].name = dtp->name;
1692 default_params[drive].spt = dtp->spt;
1693 default_params[drive].blocks = dtp->blocks;
1694 default_params[drive].fdc_speed = dtp->fdc_speed;
1695 default_params[drive].stretch = dtp->stretch;
1707 dtp = &default_params[drive];
1710 dtp = &user_params[drive];
1723 drive, dtp->blocks, dtp->spt, dtp->stretch);
1751 return do_format(drive, type, &fmt_desc);
1755 default_params[drive].blocks = 0;
1762 set_bit(drive, &fake_change);
1783 /* Initialize the 'unit' variable for drive 'drive' */
1785 static void __init fd_probe( int drive )
1790 if (!fd_test_drive_present( drive ))
1795 switch( UserSteprate[drive] ) {
1819 /* This function tests the physical presence of a floppy drive (not
1823 * signal. This should now be raised if there is a drive connected
1824 * (and there is no hardware failure :-) Otherwise, the drive is
1828 static int __init fd_test_drive_present( int drive )
1834 if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 );
1835 fd_select_drive( drive );
1877 int drive, cnt = 0;
1883 printk(KERN_INFO "Probing floppy drive(s):\n");
1884 for( drive = 0; drive < FD_MAX_UNITS; drive++ ) {
1885 fd_probe( drive );
1887 printk(KERN_INFO "fd%d\n", drive);
1915 * drive with different device numbers.
1991 static int ataflop_alloc_disk(unsigned int drive, unsigned int type)
1995 disk = blk_mq_alloc_disk(&unit[drive].tag_set, NULL);
2000 disk->first_minor = drive + (type << 2);
2002 sprintf(disk->disk_name, "fd%d", drive);
2006 disk->private_data = &unit[drive];
2009 unit[drive].disk[type] = disk;
2015 int drive = MINOR(dev) & 3;
2021 if (drive >= FD_MAX_UNITS || type >= NUM_DISK_MINORS)
2023 if (unit[drive].disk[type])
2025 if (ataflop_alloc_disk(drive, type))
2027 if (add_disk(unit[drive].disk[type]))
2029 unit[drive].registered[type] = true;
2033 put_disk(unit[drive].disk[type]);
2034 unit[drive].disk[type] = NULL;
2170 printk(KERN_ERR "ataflop_setup: bad drive type\n" );