4 * Abstracted from 3c509.c.
8 FILE_LICENCE ( GPL2_OR_LATER
);
13 #include <gpxe/isa_ids.h>
14 #include <gpxe/device.h>
15 #include <gpxe/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
54 const char *driver_name
;
57 #define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
62 struct mca_device_id
*ids
;
63 /** Number of entries in MCA ID table */
64 unsigned int id_count
;
69 * @v id Matching entry in ID table
70 * @ret rc Return status code
72 int ( * probe
) ( struct mca_device
*mca
,
73 const struct mca_device_id
*id
);
79 void ( * remove
) ( struct mca_device
*mca
);
82 /** MCA driver table */
83 #define MCA_DRIVERS __table ( struct mca_driver, "mca_drivers" )
85 /** Declare an MCA driver */
86 #define __mca_driver __table_entry ( MCA_DRIVERS, 01 )
89 * Set MCA driver-private data
92 * @v priv Private data
94 static inline void mca_set_drvdata ( struct mca_device
*mca
, void *priv
) {
99 * Get MCA driver-private data
102 * @ret priv Private data
104 static inline void * mca_get_drvdata ( struct mca_device
*mca
) {