summaryrefslogtreecommitdiff
path: root/src/include/device/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/device/device.h')
-rw-r--r--src/include/device/device.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h
index be93f554fa..aff5616a88 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -26,6 +26,8 @@ struct chip_operations {
#define CHIP_NAME(X)
#endif
+struct bus;
+
struct device_operations {
void (*read_resources)(device_t dev);
void (*set_resources)(device_t dev);
@@ -34,6 +36,7 @@ struct device_operations {
unsigned int (*scan_bus)(device_t bus, unsigned int max);
void (*enable)(device_t dev);
void (*set_link)(device_t dev, unsigned int link);
+ void (*reset_bus)(struct bus *bus);
const struct pci_operations *ops_pci;
const struct smbus_bus_operations *ops_smbus_bus;
const struct pci_bus_operations *ops_pci_bus;
@@ -48,6 +51,8 @@ struct bus {
unsigned char secondary; /* secondary bus number */
unsigned char subordinate; /* max subordinate bus number */
unsigned char cap; /* PCi capability offset */
+ unsigned reset_needed : 1;
+ unsigned disable_relaxed_ordering : 1;
};
#define MAX_RESOURCES 12
@@ -81,7 +86,8 @@ struct device {
unsigned int resources;
/* link are (down sream) buses attached to the device, usually a leaf
- * device with no child have 0 bus attached and a bridge has 1 bus */
+ * device with no children have 0 buses attached and a bridge has 1 bus
+ */
struct bus link[MAX_LINKS];
/* number of buses attached to the device */
unsigned int links;
@@ -101,8 +107,11 @@ extern void dev_enumerate(void);
extern void dev_configure(void);
extern void dev_enable(void);
extern void dev_initialize(void);
+extern void dev_optimize(void);
/* Generic device helper functions */
+extern int reset_bus(struct bus *bus);
+extern unsigned int scan_bus(struct device *bus, unsigned int max);
extern void compute_allocate_resource(struct bus *bus, struct resource *bridge,
unsigned long type_mask, unsigned long type);
extern void assign_resources(struct bus *bus);
@@ -110,6 +119,9 @@ extern void enable_resources(struct device *dev);
extern void enumerate_static_device(void);
extern void enumerate_static_devices(void);
extern const char *dev_path(device_t dev);
+const char *bus_path(struct bus *bus);
+extern void dev_set_enabled(device_t dev, int enable);
+extern void disable_children(struct bus *bus);
/* Helper functions */
device_t find_dev_path(struct bus *parent, struct device_path *path);
@@ -134,5 +146,4 @@ extern void enable_childrens_resources(device_t dev);
extern void root_dev_enable_resources(device_t dev);
extern unsigned int root_dev_scan_bus(device_t root, unsigned int max);
extern void root_dev_init(device_t dev);
-
#endif /* DEVICE_H */