11 #include <gpxe/list.h>
12 #include <gpxe/tables.h>
14 /** A hardware device description */
15 struct device_description
{
18 * This must be a BUS_TYPE_XXX constant.
20 unsigned int bus_type
;
23 * The interpretation of this field is bus-type-specific.
25 unsigned int location
;
39 #define BUS_TYPE_PCI 1
41 /** ISAPnP bus type */
42 #define BUS_TYPE_ISAPNP 2
45 #define BUS_TYPE_EISA 3
48 #define BUS_TYPE_MCA 4
51 #define BUS_TYPE_ISA 5
53 /** A hardware device */
57 /** Device description */
58 struct device_description desc
;
59 /** Devices on the same bus */
60 struct list_head siblings
;
61 /** Devices attached to this device */
62 struct list_head children
;
64 struct device
*parent
;
70 * Root devices are system buses such as PCI, EISA, etc.
76 * A root device has a NULL parent field.
79 /** Root device driver */
80 struct root_driver
*driver
;
83 /** A root device driver */
88 * @v rootdev Root device
89 * @ret rc Return status code
91 * Called from probe_devices() for all root devices in the build.
93 int ( * probe
) ( struct root_device
*rootdev
);
97 * @v rootdev Root device
99 * Called from remove_device() for all successfully-probed
102 void ( * remove
) ( struct root_device
*rootdev
);
105 /** Declare a root device */
106 #define __root_device __table ( struct root_device, root_devices, 01 )
108 #endif /* _GPXE_DEVICE_H */