11 #include <gpxe/list.h>
12 #include <gpxe/tables.h>
14 /** A PCI device description */
15 struct pci_device_description {
18 * Must be @c BUS_TYPE_PCI.
20 unsigned int bus_type;
21 /** Bus:dev.fn address
23 * As constructed by PCI_BUSDEVFN().
25 unsigned int busdevfn;
33 #define BUS_TYPE_PCI 1
35 /** An ISAPnP device description */
36 struct isapnp_device_description {
39 * Must be @c BUS_TYPE_ISAPNP.
41 unsigned int bus_type;
45 #define BUS_TYPE_ISAPNP 2
47 /** A hardware device description */
48 union device_description {
51 * This must be a BUS_TYPE_XXX constant.
53 unsigned int bus_type;
54 /** PCI device description */
55 struct pci_device_description pci;
56 /** ISAPnP device description */
57 struct isapnp_device_description isapnp;
60 /** A hardware device */
64 /** Device description */
65 union device_description desc;
66 /** Devices on the same bus */
67 struct list_head siblings;
68 /** Devices attached to this device */
69 struct list_head children;
71 struct device *parent;
77 * Root devices are system buses such as PCI, EISA, etc.
83 * A root device has a NULL parent field.
86 /** Root device driver */
87 struct root_driver *driver;
90 /** A root device driver */
95 * @v rootdev Root device
96 * @ret rc Return status code
98 * Called from probe_devices() for all root devices in the build.
100 int ( * probe ) ( struct root_device *rootdev );
104 * @v rootdev Root device
106 * Called from remove_device() for all successfully-probed
109 void ( * remove ) ( struct root_device *rootdev );
112 /** Declare a root device */
113 #define __root_device __table ( struct root_device, root_devices, 01 )
115 extern int probe_devices ( void );
116 extern void remove_devices ( void );
118 #endif /* _GPXE_DEVICE_H */