diff options
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 9d4f6a963936..b00e02711393 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -42,6 +42,8 @@ struct bus_type { | |||
42 | struct klist klist_devices; | 42 | struct klist klist_devices; |
43 | struct klist klist_drivers; | 43 | struct klist klist_drivers; |
44 | 44 | ||
45 | struct blocking_notifier_head bus_notifier; | ||
46 | |||
45 | struct bus_attribute * bus_attrs; | 47 | struct bus_attribute * bus_attrs; |
46 | struct device_attribute * dev_attrs; | 48 | struct device_attribute * dev_attrs; |
47 | struct driver_attribute * drv_attrs; | 49 | struct driver_attribute * drv_attrs; |
@@ -75,6 +77,29 @@ int __must_check bus_for_each_drv(struct bus_type *bus, | |||
75 | struct device_driver *start, void *data, | 77 | struct device_driver *start, void *data, |
76 | int (*fn)(struct device_driver *, void *)); | 78 | int (*fn)(struct device_driver *, void *)); |
77 | 79 | ||
80 | /* | ||
81 | * Bus notifiers: Get notified of addition/removal of devices | ||
82 | * and binding/unbinding of drivers to devices. | ||
83 | * In the long run, it should be a replacement for the platform | ||
84 | * notify hooks. | ||
85 | */ | ||
86 | struct notifier_block; | ||
87 | |||
88 | extern int bus_register_notifier(struct bus_type *bus, | ||
89 | struct notifier_block *nb); | ||
90 | extern int bus_unregister_notifier(struct bus_type *bus, | ||
91 | struct notifier_block *nb); | ||
92 | |||
93 | /* All 4 notifers below get called with the target struct device * | ||
94 | * as an argument. Note that those functions are likely to be called | ||
95 | * with the device semaphore held in the core, so be careful. | ||
96 | */ | ||
97 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ | ||
98 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ | ||
99 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | ||
100 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | ||
101 | unbound */ | ||
102 | |||
78 | /* driverfs interface for exporting bus attributes */ | 103 | /* driverfs interface for exporting bus attributes */ |
79 | 104 | ||
80 | struct bus_attribute { | 105 | struct bus_attribute { |