コード例 #1
0
ファイル: floppy.c プロジェクト: binsys/doc-linux
static void floppy_shutdown(void)
{
	cli();
	request_done(0);
	recover = 1;
	reset_floppy();
	sti();
}
コード例 #2
0
ファイル: floppy.c プロジェクト: hozmaster/octaneos
static void floppy_shutdown(void) {

	cli();
	do_floppy = NULL;
	request_done(0);
	recover = 1;
	reset_floppy();
	sti();
	redo_fd_request();
}
コード例 #3
0
ファイル: floppy.c プロジェクト: binsys/doc-linux
static void floppy_on_interrupt(void)
{
	if (inb(FD_DIR) & 0x80) {
		changed_floppies |= 1<<current_drive;
		buffer_track = -1;
		if (keep_data[current_drive]) {
			if (keep_data[current_drive] > 0)
				keep_data[current_drive]--;
		}
		else {
			if (ftd_msg[current_drive] && current_type[
			    current_drive] != NULL)
				printk("Disk type is undefined after disk "
				    "change in fd%d\r\n",current_drive);
			current_type[current_drive] = NULL;
			floppy_sizes[current_drive] = MAX_DISK_SIZE;
		}
/* Forcing the drive to seek makes the "media changed" condition go away.
 * There should be a cleaner solution for that ...
 */
		if (!reset && !recalibrate) {
			do_floppy = (current_track && current_track != NO_TRACK)
			    ?  shake_zero : shake_one;
			output_byte(FD_RECALIBRATE);
			output_byte(head<<2 | current_drive);
			return;
		}
	}
	if (reset) {
		reset_floppy();
		return;
	}
	if (recalibrate) {
		recalibrate_floppy();
		return;
	}
/* We cannot do a floppy-select, as that might sleep. We just force it */
	selected = 1;
	if (current_drive != (current_DOR & 3)) {
		seek = 1;
		current_track = NO_TRACK;
		current_DOR &= 0xFC;
		current_DOR |= current_drive;
		outb(current_DOR,FD_DOR);
		add_timer(2,&transfer);
	} else
		transfer();
}
コード例 #4
0
ファイル: floppy.c プロジェクト: hozmaster/octaneos
static void floppy_ready(void) {
	if (inb(FDC_DIR) & 0x80) {
		changed_floppies |= 1<<current_drive;
		buffer_track = -1;
		if (keep_data[current_drive]) {
			if (keep_data[current_drive] > 0)
				keep_data[current_drive]--;
		} else {
			if (ftd_msg[current_drive] && current_type[current_drive] != NULL)
				printk("Disk type is undefined after disk "
				    "change in fd%d\n",current_drive);
			current_type[current_drive] = NULL;
			floppy_sizes[current_drive] = MAX_DISK_SIZE;
		}

		/* Forcing the drive to seek makes the "media changed" condition go away.
		 * There should be a cleaner solution for that ...
		 */
		if (!reset && !recalibrate) {
			if (current_track && current_track != NO_TRACK) {
				do_floppy = shake_zero;
			} else {
				do_floppy = shake_one;
			}

			output_byte(FD_RECALIBRATE);
			output_byte(head<<2 | current_drive);
			return;
		}
	}
	if (reset) {
		reset_floppy();
		return;
	}
	if (recalibrate) {
		recalibrate_floppy();
		return;
	}
	transfer();
}