Beispiel #1
0
/*
 * This routine is called when everything should be correctly set up
 * for the transfer (ie floppy motor is on and the correct floppy is
 * selected).
 */
static void transfer(void)
{
	read_track = (command == FD_READ) && (CURRENT_ERRORS < 4) &&
	    (floppy->sect <= MAX_BUFFER_SECTORS);
	if (cur_spec1 != floppy->spec1) {
		cur_spec1 = floppy->spec1;
		output_byte(FD_SPECIFY);
		output_byte(cur_spec1);		/* hut etc */
		output_byte(6);			/* Head load time =6ms, DMA */
	}
	if (cur_rate != floppy->rate) {
		/* use bit 6 of floppy->rate to indicate perpendicular mode */
		perpendicular_mode(floppy->rate);
		outb_p(cur_rate = ((floppy->rate)) & ~0x40, FD_DCR);
	}
	if (reset) {
		redo_fd_request();
		return;
	}
	if (!seek) {
		setup_rw_floppy();
		return;
	}
	do_floppy = seek_interrupt;
	output_byte(FD_SEEK);
	if (read_track)
		output_byte(current_drive);
	else
		output_byte((head<<2) | current_drive);
	output_byte(seek_track);
	if (reset)
		redo_fd_request();
}
Beispiel #2
0
/*
 * This has only been tested for the case fdc_version == FDC_TYPE_STD.
 * In case you have a 82077 and want to test it, you'll have to compile
 * with `FDC_FIFO_UNTESTED' defined. You may also want to add support for
 * recognizing drives with vertical recording support.
 */
static void configure_fdc_mode(void)
{
    if (need_configure && (fdc_version == FDC_TYPE_82077)) {
        /* Enhanced version with FIFO & vertical recording. */
        output_byte(FD_CONFIGURE);
        output_byte(0);
        output_byte(0x1A);	/* FIFO on, polling off, 10 byte threshold */
        output_byte(0);		/* precompensation from track 0 upwards */
        need_configure = 0;
        printk(DEVICE_NAME ": FIFO enabled\n");
    }
    if (cur_spec1 != floppy->spec1) {
        cur_spec1 = floppy->spec1;
        output_byte(FD_SPECIFY);
        output_byte(cur_spec1);		/* hut etc */
        output_byte(6);			/* Head load time =6ms, DMA */
    }
    if (cur_rate != floppy->rate) {
        /* use bit 6 of floppy->rate to indicate perpendicular mode */
        perpendicular_mode(floppy->rate);
        outb_p((cur_rate = (floppy->rate)) & ~0x40, FD_DCR);
    }
} /* configure_fdc_mode */