4 * Abstracted from 3c509.c.
8 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <ipxe/isa_ids.h>
14 #include <ipxe/device.h>
15 #include <ipxe/tables.h>
21 #define MCA_MOTHERBOARD_SETUP_REG 0x94
22 #define MCA_ADAPTER_SETUP_REG 0x96
23 #define MCA_MAX_SLOT_NR 0x07 /* Must be 2^n - 1 */
24 #define MCA_POS_REG(n) (0x100+(n))
26 /* Is there a standard that would define this? */
27 #define GENERIC_MCA_VENDOR ISA_VENDOR ( 'M', 'C', 'A' )
29 /** An MCA device ID list entry */
30 struct mca_device_id {
43 /** POS register values */
45 /** Driver for this device */
46 struct mca_driver *driver;
47 /** Driver-private data
49 * Use mca_set_drvdata() and mca_get_drvdata() to access
55 #define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
60 struct mca_device_id *ids;
61 /** Number of entries in MCA ID table */
62 unsigned int id_count;
67 * @v id Matching entry in ID table
68 * @ret rc Return status code
70 int ( * probe ) ( struct mca_device *mca,
71 const struct mca_device_id *id );
77 void ( * remove ) ( struct mca_device *mca );
80 /** MCA driver table */
81 #define MCA_DRIVERS __table ( struct mca_driver, "mca_drivers" )
83 /** Declare an MCA driver */
84 #define __mca_driver __table_entry ( MCA_DRIVERS, 01 )
87 * Set MCA driver-private data
90 * @v priv Private data
92 static inline void mca_set_drvdata ( struct mca_device *mca, void *priv ) {
97 * Get MCA driver-private data
100 * @ret priv Private data
102 static inline void * mca_get_drvdata ( struct mca_device *mca ) {