summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1999-12-21 08:33:03 +0000
committerjoerg <joerg@FreeBSD.org>1999-12-21 08:33:03 +0000
commit367ba76bfd7f174f8f5f824a936846ca6b127977 (patch)
tree201362a26fcc6c8ea16af3ec77fa6e98428a19c9
parent53a4306dc988cadece776e9474ce21ef9b1da014 (diff)
downloadFreeBSD-src-367ba76bfd7f174f8f5f824a936846ca6b127977.zip
FreeBSD-src-367ba76bfd7f174f8f5f824a936846ca6b127977.tar.gz
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).
-rw-r--r--share/man/man4/fdc.414
-rw-r--r--sys/dev/fdc/fdc.c4
-rw-r--r--sys/isa/fd.c4
3 files changed, 20 insertions, 2 deletions
diff --git a/share/man/man4/fdc.4 b/share/man/man4/fdc.4
index 97348c1..f837eb0 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 86b79d1..7b44573 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 86b79d1..7b44573 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);
OpenPOWER on IntegriCloud