summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2005-04-13 04:59:13 +0200
committerMichael Brown2005-04-13 04:59:13 +0200
commit1aee4e80011e9c75eb18b9e1c694d209899f2084 (patch)
tree7895086b2cca4cf335faed3cdbff8f3d8db76971 /src/include
parentWhoops (diff)
downloadipxe-1aee4e80011e9c75eb18b9e1c694d209899f2084.tar.gz
ipxe-1aee4e80011e9c75eb18b9e1c694d209899f2084.tar.xz
ipxe-1aee4e80011e9c75eb18b9e1c694d209899f2084.zip
Extracted from 3c509.c
Diffstat (limited to 'src/include')
-rw-r--r--src/include/mca.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/include/mca.h b/src/include/mca.h
new file mode 100644
index 000000000..f6d37ba79
--- /dev/null
+++ b/src/include/mca.h
@@ -0,0 +1,75 @@
+/*
+ * MCA bus driver code
+ *
+ * Abstracted from 3c509.c.
+ *
+ */
+
+#ifndef MCA_H
+#define MCA_H
+
+/*
+ * MCA constants
+ *
+ */
+
+#define MCA_MOTHERBOARD_SETUP_REG 0x94
+#define MCA_ADAPTER_SETUP_REG 0x96
+#define MCA_MAX_SLOT_NR 8
+#define MCA_POS_REG(n) (0x100+(n))
+
+/* Is there a standard that would define this? */
+#include "isa.h"
+#define GENERIC_MCA_VENDOR ISAPNP_VENDOR ( 'M', 'C', 'A' )
+
+/*
+ * A physical MCA device
+ *
+ */
+struct dev;
+struct mca_device {
+ struct dev *dev;
+ unsigned int slot;
+ unsigned char pos[8];
+ int already_tried;
+};
+#define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
+
+/*
+ * An individual MCA device identified by ID
+ *
+ */
+struct mca_id {
+ const char *name;
+ int id;
+};
+
+/*
+ * An MCA driver, with a device ID (struct mca_id) table.
+ *
+ */
+struct mca_driver {
+ const char *name;
+ struct mca_id *ids;
+ unsigned int id_count;
+};
+
+/*
+ * Define an MCA driver
+ *
+ */
+#define MCA_DRIVER( driver_name, mca_ids ) { \
+ .name = driver_name, \
+ .ids = mca_ids, \
+ .id_count = sizeof ( mca_ids ) / sizeof ( mca_ids[0] ), \
+}
+
+/*
+ * Functions in mca.c
+ *
+ */
+extern struct mca_device * mca_device ( struct dev *dev );
+extern int find_mca_device ( struct mca_device *mca,
+ struct mca_driver *driver );
+
+#endif