summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-09-17 18:50:38 +0000
committerimp <imp@FreeBSD.org>2004-09-17 18:50:38 +0000
commit3f2f99f7d2a1ab5fe9473bf348ac8110afa27006 (patch)
tree465e6c9c745833f92e06577dc4b9627dbd400dd1 /sys
parent566c62aad22c4961d5511b9cf1954d16e2621bf7 (diff)
downloadFreeBSD-src-3f2f99f7d2a1ab5fe9473bf348ac8110afa27006.zip
FreeBSD-src-3f2f99f7d2a1ab5fe9473bf348ac8110afa27006.tar.gz
The long dead hand of the past has pushed forward useless bits in this
driver. Trim its fingernails by removing some useless bits before fixing the 'thread not terminated on detach' problem. o dmacnt is no longer used now that we allocate at attach time. Remove it from struct fdc_data. o ISPNP was only ever set, but never tested. It used to be used for the allocation routines to change how it allocated resources. Since that's no longer necessary, retire the flag. o ISPCMICA was only ever tested, but never set. GC it. This removes a special case in determining the drive type. The drive type is now set in fdc_pcmcia.c, so the hack isn't needed anymore. Sadly, this isn't tested with a Y-E Data pcmcia floppy drive because there are a number of other issues that preclude it from working. o Fix ifdef for reading from the rtc. I'm of the opinion that this ifdef should be moved into fdc_isa.c, but not today as ideally there'd be other fixes to the probing of children. So now we just read it on i386 ! pc98 (there's no #define for MACHINE_ARCH, just MACHINE, hence this slightly inelegant kludge) and amd64. The PC98 exclusion likely isn't meaningful since pc98 uses a different driver, but will be when merging of the pc98 floppy code into this driver is complete (this is the other reason I think this block of code belongs outside fdc.c). All of these changes are safe to MT5.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdc/fdc.c24
-rw-r--r--sys/dev/fdc/fdc_acpi.c1
-rw-r--r--sys/dev/fdc/fdc_isa.c4
-rw-r--r--sys/dev/fdc/fdcvar.h3
4 files changed, 4 insertions, 28 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 90c4da1..139285c 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1778,29 +1778,13 @@ fd_probe(device_t dev)
fd->type = type;
}
-/*
- * XXX I think using __i386__ is wrong here since we actually want to probe
- * for the machine type, not the CPU type (so non-PC arch's like the PC98 will
- * fail the probe). However, for whatever reason, testing for _MACHINE_ARCH
- * == i386 breaks the test on FreeBSD/Alpha.
- */
-#if defined(__i386__) || defined(__amd64__)
+#if (defined(__i386__) && !defined(PC98)) || defined(__amd64__)
if (fd->type == FDT_NONE && (unit == 0 || unit == 1)) {
/* Look up what the BIOS thinks we have. */
- if (unit == 0) {
- if ((fdc->flags & FDC_ISPCMCIA))
- /*
- * Somewhat special. No need to force the
- * user to set device flags, since the Y-E
- * Data PCMCIA floppy is always a 1.44 MB
- * device.
- */
- fd->type = FDT_144M;
- else
- fd->type = (rtcin(RTC_FDISKETTE) & 0xf0) >> 4;
- } else {
+ if (unit == 0)
+ fd->type = (rtcin(RTC_FDISKETTE) & 0xf0) >> 4;
+ else
fd->type = rtcin(RTC_FDISKETTE) & 0x0f;
- }
if (fd->type == FDT_288M_1)
fd->type = FDT_288M;
}
diff --git a/sys/dev/fdc/fdc_acpi.c b/sys/dev/fdc/fdc_acpi.c
index 6e543aa..89a5a5d 100644
--- a/sys/dev/fdc/fdc_acpi.c
+++ b/sys/dev/fdc/fdc_acpi.c
@@ -104,7 +104,6 @@ fdc_acpi_attach(device_t dev)
/* Get our softc and use the same accessor as ISA. */
sc = device_get_softc(dev);
sc->fdc_dev = dev;
- sc->flags |= FDC_ISPNP;
/* Initialize variables and get a temporary buffer for _FDE. */
error = ENXIO;
diff --git a/sys/dev/fdc/fdc_isa.c b/sys/dev/fdc/fdc_isa.c
index 1d04a81..b912771 100644
--- a/sys/dev/fdc/fdc_isa.c
+++ b/sys/dev/fdc/fdc_isa.c
@@ -197,10 +197,6 @@ fdc_isa_attach(device_t dev)
int error;
fdc = device_get_softc(dev);
- error = ISA_PNP_PROBE(device_get_parent(dev), dev, fdc_ids);
- if (error == 0)
- fdc->flags |= FDC_ISPNP;
-
error = fdc_isa_alloc_resources(dev, fdc);
if (error == 0)
error = fdc_attach(dev);
diff --git a/sys/dev/fdc/fdcvar.h b/sys/dev/fdc/fdcvar.h
index 5cfc3d1..5ecf912 100644
--- a/sys/dev/fdc/fdcvar.h
+++ b/sys/dev/fdc/fdcvar.h
@@ -39,7 +39,6 @@ enum fdc_type {
*/
struct fdc_data {
int fdcu; /* our unit number */
- int dmacnt;
int dmachan;
int flags;
#define FDC_HASDMA 0x01
@@ -47,8 +46,6 @@ struct fdc_data {
#define FDC_HAS_FIFO 0x10
#define FDC_NEEDS_RESET 0x20
#define FDC_NODMA 0x40
-#define FDC_ISPNP 0x80
-#define FDC_ISPCMCIA 0x100
struct fd_data *fd; /* The active drive */
int retry;
int fdout; /* mirror of the w/o digital output reg */
OpenPOWER on IntegriCloud