From e34c71ea40a1a18d241a5459d22765bffe3eb719 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Tue, 21 Dec 1999 08:33:03 +0000 Subject: [PATCH] Add a flag to disable FIFO probing. The code seems to have a chance of misdetecting FIFO capabilities, at least on my girlfriend's Thinkpad 755, the driver doesn't work using the FIFO. While i was at it, i (partially) fixed option FCC_YE since it would no longer have compiled at all under -current. I've also made an attempt to document the device driver flags value (ab-)used internally by this option. RELENG_3 candidate, but with a slightly different patch there (will go to jkh in email). --- share/man/man4/fdc.4 | 14 ++++++++++++++ sys/dev/fdc/fdc.c | 4 +++- sys/isa/fd.c | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/share/man/man4/fdc.4 b/share/man/man4/fdc.4 index 97348c1ca65..f837eb0d8e4 100644 --- a/share/man/man4/fdc.4 +++ b/share/man/man4/fdc.4 @@ -53,6 +53,20 @@ configuration value in their CMOS. Use the flags value .Ql 0x1 to pretend a 1.44 MB floppy drive as the first unit, without asking the CMOS for it. +.Pp +The flags value +.Ql 0x2 +is reserved for PCMCIA floppy use, and should never be set in a +configuration file directly. It is internally handled in the driver +if the compilation option +.Dv FDC_YE +is set, and defers device probing. +.Pp +Normally, the device driver detects FDC chipsets that have an internal +FIFO, and enables the FIFO on them. There is a slight chance that this +feature is actually misdetected (seen on an IBM Thinkpad 755c), so it +can be turned off using flags +.Ql 0x4 . .Sh FILES .Bl -tag -width Pa -compact .It /dev/fd* diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 86b79d10538..7b44573a96e 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -96,6 +96,7 @@ #define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's a PCMCIA device */ #endif +#define FDC_NO_FIFO (1 << 2) /* do not enable FIFO */ /* internally used only, not really from CMOS: */ #define RTCFDT_144M_PRETENDED 0x1000 @@ -739,7 +740,7 @@ fdc_probe(device_t dev) * don't succeed on probe; wait * for PCCARD subsystem to do it */ - if (dev->id_flags & FDC_IS_PCMCIA) + if (device_get_flags(fdc->fdc_dev) & FDC_IS_PCMCIA) return(0); #endif return (0); @@ -920,6 +921,7 @@ fd_probe(device_t dev) /* XXX This doesn't work before the first set_motor() */ if (fd_fifo == 0 && fdc->fdct != FDC_NE765 && fdc->fdct != FDC_UNKNOWN + && (device_get_flags(fdc->fdc_dev) & FDC_NO_FIFO) == 0 && enable_fifo(fdc) == 0) { device_print_prettyname(device_get_parent(dev)); printf("FIFO enabled, %d bytes threshold\n", fifo_threshold); diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 86b79d10538..7b44573a96e 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -96,6 +96,7 @@ #define FDC_IS_PCMCIA (1 << 1) /* if successful probe, then it's a PCMCIA device */ #endif +#define FDC_NO_FIFO (1 << 2) /* do not enable FIFO */ /* internally used only, not really from CMOS: */ #define RTCFDT_144M_PRETENDED 0x1000 @@ -739,7 +740,7 @@ fdc_probe(device_t dev) * don't succeed on probe; wait * for PCCARD subsystem to do it */ - if (dev->id_flags & FDC_IS_PCMCIA) + if (device_get_flags(fdc->fdc_dev) & FDC_IS_PCMCIA) return(0); #endif return (0); @@ -920,6 +921,7 @@ fd_probe(device_t dev) /* XXX This doesn't work before the first set_motor() */ if (fd_fifo == 0 && fdc->fdct != FDC_NE765 && fdc->fdct != FDC_UNKNOWN + && (device_get_flags(fdc->fdc_dev) & FDC_NO_FIFO) == 0 && enable_fifo(fdc) == 0) { device_print_prettyname(device_get_parent(dev)); printf("FIFO enabled, %d bytes threshold\n", fifo_threshold); -- 2.45.2