summaryrefslogtreecommitdiffstats
path: root/sys/dev/eisa/eisaconf.h
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1995-11-05 04:42:50 +0000
committergibbs <gibbs@FreeBSD.org>1995-11-05 04:42:50 +0000
commitda1c8c00f7a22cf7bfcdbbc3284526654f740067 (patch)
tree9e1526b8e1aaf53d70978a04c0cd8c8da905aa09 /sys/dev/eisa/eisaconf.h
parent50b6fea8689bea515e458da09e30c3ffc2e8d1ce (diff)
downloadFreeBSD-src-da1c8c00f7a22cf7bfcdbbc3284526654f740067.zip
FreeBSD-src-da1c8c00f7a22cf7bfcdbbc3284526654f740067.tar.gz
This is a totally new implementation of eisaconf. It will hopefully
be the beginning of our move to a more dynamic (configuration manager) based setup for all drivers. Everything seems to work except for some devconf problems. Only the aic7xxx driver will be using this interface until it is reviewed, revised and accepted as a good configuration interface. Adapt aic7770.c to use new eisaconf. eisadevs.c is replaced by a linker set.
Diffstat (limited to 'sys/dev/eisa/eisaconf.h')
-rw-r--r--sys/dev/eisa/eisaconf.h106
1 files changed, 85 insertions, 21 deletions
diff --git a/sys/dev/eisa/eisaconf.h b/sys/dev/eisa/eisaconf.h
index 9b16c23..63ac12f 100644
--- a/sys/dev/eisa/eisaconf.h
+++ b/sys/dev/eisa/eisaconf.h
@@ -1,31 +1,95 @@
/*
- * Written by Billie Alsup (balsup@tfs.com)
- * for TRW Financial Systems for use under the MACH(2.5)and OSF/1 operating
- * systems.
+ * EISA bus device definitions
*
- * TRW Financial Systems, in accordance with their agreement with Carnegie
- * Mellon University, makes this software available to CMU to distribute
- * or use in any manner that they see fit as long as this message is kept with
- * the software. For this reason TFS also grants any other persons or
- * organisations permission to use or modify this software.
+ * Copyright (c) 1995 Justin T. Gibbs.
+ * All rights reserved.
*
- * TFS supplies this software to be publicly redistributed
- * on the understanding that TFS is not responsible for the correct
- * functioning of this software in any circumstances.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice immediately at the beginning of the file, without modification,
+ * this list of conditions, and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Absolutely no warranty of function or purpose is made by the author
+ * Justin T. Gibbs.
+ * 4. Modifications may be freely made to this file if the above conditions
+ * are met.
*
- * $Id: eisaconf.h,v 1.1 1995/04/23 08:55:42 julian Exp $
+ * $Id$
*/
-/*
- * Ported to run under FreeBSD by Julian Elischer (julian@tfs.com) Sept 1992
- */
+#ifndef _I386_EISA_EISACONF_H_
+#define _I386_EISA_EISACONF_H_ 1
#define EISA_SLOTS 10 /* PCI clashes with higher ones.. fix later */
-struct eisa_dev {
- char productID[4];
- unsigned short productType;
- unsigned char productRevision;
- unsigned int *imask;
- struct isa_device isa_dev;
+
+#define EISA_MFCTR_CHAR0(ID) (((ID>>26) & 0x1F) | '@') /* Bits 26-30 */
+#define EISA_MFCTR_CHAR1(ID) (((ID>>21) & 0x1F) | '@') /* Bits 21-25 */
+#define EISA_MFCTR_CHAR2(ID) (((ID>>16) & 0x1F) | '@') /* Bits 16-20 */
+#define EISA_MFCTR_ID(ID) ((ID>>16) & 0xFF) /* Bits 16-31 */
+#define EISA_PRODUCT_ID(ID) ((ID>>4) & 0xFFF) /* Bits 4-15 */
+#define EISA_REVISION_ID(ID) (ID & 0x0F) /* Bits 0-3 */
+
+extern struct linker_set eisadriver_set;
+
+typedef u_long eisa_id_t; /* Should use u_int32? */
+
+struct eisa_ioconf {
+ int slot;
+ u_long iobase; /* base i/o address */
+ int iosize; /* size of i/o space */
+ u_short irq; /* interrupt request */
+ caddr_t maddr; /* physical i/o memory address on bus (if any)*/
+ int msize; /* size of i/o memory */
+};
+
+struct kern_devconf;
+struct eisa_device;
+
+struct eisa_driver {
+ char* name; /* device name */
+ int (*probe) __P((void));
+ /* test whether device is present */
+ int (*attach) __P((struct eisa_device *));
+ /* setup driver for a device */
+ int (*shutdown) __P((struct kern_devconf *, int));
+ /* Return the device to a safe
+ * state before shutdown
+ */
+ u_long *unit; /* Next availible unit */
};
+/* To be replaced by the "super device" generic device structure... */
+struct eisa_device {
+ eisa_id_t id;
+ u_long unit;
+ char* full_name; /* for use in the probe message */
+ struct eisa_ioconf ioconf;
+ struct eisa_driver* driver;
+ struct kern_devconf* kdc;
+};
+
+struct eisa_device *eisa_match_dev __P((struct eisa_device *, char * (*)(eisa_id_t)));
+
+void eisa_reg_start __P((struct eisa_device *));
+void eisa_reg_end __P((struct eisa_device *));
+int eisa_add_intr __P((struct eisa_device *, int));
+int eisa_reg_intr __P((struct eisa_device *, int, void (*)(void *), void *, u_int *, int));
+int eisa_release_intr __P((struct eisa_device *, int, void (*)(void *)));
+int eisa_enable_intr __P((struct eisa_device *, int));
+int eisa_add_iospace __P((struct eisa_device *, u_long, int));
+int eisa_reg_iospace __P((struct eisa_device *, u_long, int));
+int eisa_registerdev __P((struct eisa_device *, struct eisa_driver *, struct kern_devconf *));
+
+
+extern int eisa_externalize __P((struct eisa_device *, void *, size_t *));
+
+extern int eisa_generic_externalize __P((struct proc *,struct kern_devconf *, void *, size_t));
+extern struct kern_devconf kdc_eisa0;
+
+#define EISA_EXTERNALLEN (sizeof(struct eisa_device))
+
+#endif /* _I386_EISA_EISACONF_H_ */
OpenPOWER on IntegriCloud