11 FILE_LICENCE ( GPL2_OR_LATER
);
13 #include <gpxe/list.h>
14 #include <gpxe/tables.h>
16 /** A hardware device description */
17 struct device_description
{
20 * This must be a BUS_TYPE_XXX constant.
22 unsigned int bus_type
;
25 * The interpretation of this field is bus-type-specific.
27 unsigned int location
;
41 #define BUS_TYPE_PCI 1
43 /** ISAPnP bus type */
44 #define BUS_TYPE_ISAPNP 2
47 #define BUS_TYPE_EISA 3
50 #define BUS_TYPE_MCA 4
53 #define BUS_TYPE_ISA 5
55 /** A hardware device */
59 /** Device description */
60 struct device_description desc
;
61 /** Devices on the same bus */
62 struct list_head siblings
;
63 /** Devices attached to this device */
64 struct list_head children
;
66 struct device
*parent
;
72 * Root devices are system buses such as PCI, EISA, etc.
78 * A root device has a NULL parent field.
81 /** Root device driver */
82 struct root_driver
*driver
;
85 /** A root device driver */
90 * @v rootdev Root device
91 * @ret rc Return status code
93 * Called from probe_devices() for all root devices in the build.
95 int ( * probe
) ( struct root_device
*rootdev
);
99 * @v rootdev Root device
101 * Called from remove_device() for all successfully-probed
104 void ( * remove
) ( struct root_device
*rootdev
);
107 /** Root device table */
108 #define ROOT_DEVICES __table ( struct root_device, "root_devices" )
110 /** Declare a root device */
111 #define __root_device __table_entry ( ROOT_DEVICES, 01 )
113 #endif /* _GPXE_DEVICE_H */