summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc/fdcvar.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-01-19 07:46:38 +0000
committerimp <imp@FreeBSD.org>2005-01-19 07:46:38 +0000
commit65cbf19ef7f2f188c3eeb842aa4dcb98cc4feb77 (patch)
tree2b913234aa2be66ec2ed3171f91718934b9ebcff /sys/dev/fdc/fdcvar.h
parentdb9d7feaad792794620217c9137990dc69b94076 (diff)
downloadFreeBSD-src-65cbf19ef7f2f188c3eeb842aa4dcb98cc4feb77.zip
FreeBSD-src-65cbf19ef7f2f188c3eeb842aa4dcb98cc4feb77.tar.gz
MFp4: overhaul of resource allocation
Rather than have a twisty maze of special case allocations, move instead to a data driven allocation. This should be the most robust way to cope with the resource problems that the multiplicity of ways of encoding 5 registers that have the misfortune of not being a power of 2 nor contiguous. Also, make it less impossible that pccard will work. I've not been able to get my libretto floppy working, but it now fails later than before. phk and I had similar ideas on this during the 5.3 release cycle, but it wasn't until recently that I could test more than one allocation scenario. MFC After: 1 month (5.4 if possible, 5.5 if not)
Diffstat (limited to 'sys/dev/fdc/fdcvar.h')
-rw-r--r--sys/dev/fdc/fdcvar.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/dev/fdc/fdcvar.h b/sys/dev/fdc/fdcvar.h
index 42ed32d..5ab60a6 100644
--- a/sys/dev/fdc/fdcvar.h
+++ b/sys/dev/fdc/fdcvar.h
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2004 M. Warner Losh.
+ * Copyright (c) 2004-2005 M. Warner Losh.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,8 @@ struct fdc_data {
#define FDC_STAT_VALID 0x08
#define FDC_HAS_FIFO 0x10
#define FDC_NEEDS_RESET 0x20
-#define FDC_NODMA 0x40
+#define FDC_NODMA 0x40 /* Don't do DMA */
+#define FDC_NOFAST 0x80 /* Don't register isr as a fast one */
#define FDC_KTHREAD_EXIT 0x1000 /* request worker thread to stop */
#define FDC_KTHREAD_ALIVE 0x2000 /* worker thread is alive */
struct fd_data *fd; /* The active drive */
@@ -54,17 +55,14 @@ struct fdc_data {
int fdc_errs; /* number of logged errors */
struct bio_queue_head head;
struct bio *bp; /* active buffer */
- struct resource *res_ioport, *res_sts, *res_ctl, *res_irq, *res_drq;
- int rid_ioport, rid_sts, rid_ctl, rid_irq, rid_drq;
- bus_space_tag_t portt;
- bus_space_handle_t porth;
- bus_space_tag_t stst;
- bus_space_handle_t stsh;
- bus_space_tag_t ctlt;
- bus_space_handle_t ctlh;
- int port_off;
- int ctl_off;
- int sts_off;
+ struct resource *res_irq, *res_drq;
+ int rid_irq, rid_drq;
+#define FDC_MAXREG 8
+ int ridio[FDC_MAXREG];
+ struct resource *resio[FDC_MAXREG];
+ bus_space_tag_t iot;
+ bus_space_handle_t ioh[FDC_MAXREG];
+ int ioff[FDC_MAXREG];
void *fdc_intr;
struct device *fdc_dev;
struct mtx fdc_mtx;
OpenPOWER on IntegriCloud