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)
761 q = unit[drive].disk[type]->queue;
813 do_fd_action( drive );
827 * required parameter settings (drive select, side select, track
835 static void do_fd_action( int drive )
841 if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
846 setup_req_params( drive );
864 if (SelectedDrive != drive)
865 fd_select_drive( drive );
920 /* Seek the drive to the requested track. The drive must have been
1440 unsigned int drive = p - unit;
1441 if (test_bit (drive, &fake_change)) {
1445 if (test_bit (drive, &changed_floppies)) {
1462 unsigned int drive = p - unit;
1464 if (test_bit(drive, &changed_floppies) ||
1465 test_bit(drive, &fake_change) || !p->disktype) {
1469 clear_bit(drive, &fake_change);
1470 clear_bit(drive, &changed_floppies);
1474 if (default_params[drive].blocks == 0)
1477 UDT = &default_params[drive];
1485 static void setup_req_params( int drive )
1496 read_track = (ReqCmd == READ && unit[drive].error_count == 0);
1508 int drive = floppy - unit;
1511 DPRINT(("Queue request: drive %d type %d sectors %d of %d last %d\n",
1512 drive, type, blk_rq_cur_sectors(bd->rq),
1525 unit[drive].error_count = 0;
1533 /* drive not connected */
1534 printk(KERN_ERR "Unknown Device: fd%d\n", drive );
1551 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1557 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1575 setup_req_params( drive );
1576 do_fd_action( drive );
1590 int drive = floppy - unit;
1610 drive, dtp, dtp->name);
1634 * Currently, the drive geometry is cleared after each
1655 drive, setprm.size, setprm.sect, setprm.stretch);
1674 /* skip this one, invalid for drive ... */
1686 drive, dtp->name, dtp);
1692 default_params[drive].name = dtp->name;
1693 default_params[drive].spt = dtp->spt;
1694 default_params[drive].blocks = dtp->blocks;
1695 default_params[drive].fdc_speed = dtp->fdc_speed;
1696 default_params[drive].stretch = dtp->stretch;
1708 dtp = &default_params[drive];
1711 dtp = &user_params[drive];
1724 drive, dtp->blocks, dtp->spt, dtp->stretch);
1752 return do_format(drive, type, &fmt_desc);
1756 default_params[drive].blocks = 0;
1763 set_bit(drive, &fake_change);
1786 /* Initialize the 'unit' variable for drive 'drive' */
1788 static void __init fd_probe( int drive )
1793 if (!fd_test_drive_present( drive ))
1798 switch( UserSteprate[drive] ) {
1822 /* This function tests the physical presence of a floppy drive (not
1826 * signal. This should now be raised if there is a drive connected
1827 * (and there is no hardware failure :-) Otherwise, the drive is
1831 static int __init fd_test_drive_present( int drive )
1837 if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 );
1838 fd_select_drive( drive );
1880 int drive, cnt = 0;
1886 printk(KERN_INFO "Probing floppy drive(s):\n");
1887 for( drive = 0; drive < FD_MAX_UNITS; drive++ ) {
1888 fd_probe( drive );
1890 printk(KERN_INFO "fd%d\n", drive);
1918 * drive with different device numbers.
1994 static int ataflop_alloc_disk(unsigned int drive, unsigned int type)
2001 disk = blk_mq_alloc_disk(&unit[drive].tag_set, &lim, NULL);
2006 disk->first_minor = drive + (type << 2);
2008 sprintf(disk->disk_name, "fd%d", drive);
2012 disk->private_data = &unit[drive];
2015 unit[drive].disk[type] = disk;
2021 int drive = MINOR(dev) & 3;
2027 if (drive >= FD_MAX_UNITS || type >= NUM_DISK_MINORS)
2029 if (unit[drive].disk[type])
2031 if (ataflop_alloc_disk(drive, type))
2033 if (add_disk(unit[drive].disk[type]))
2035 unit[drive].registered[type] = true;
2039 put_disk(unit[drive].disk[type]);
2040 unit[drive].disk[type] = NULL;
2175 printk(KERN_ERR "ataflop_setup: bad drive type\n" );