summaryrefslogtreecommitdiffhomepage
path: root/device.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-19 03:20:09 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-19 03:20:09 +0200
commitd16871c7a55370174eb672edee24feade74cd37e (patch)
tree39995e27e86f9efbf101a8b9f5a23e7d9821bae8 /device.h
parentccca61c97d460d73f29750abdf38cea20ac440f3 (diff)
rework device hotplug handling some more, add device_lock/device_unlock to prevent use-after-free bugs
Diffstat (limited to 'device.h')
-rw-r--r--device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/device.h b/device.h
index f7718cc..3d233d7 100644
--- a/device.h
+++ b/device.h
@@ -100,6 +100,8 @@ struct device_user {
struct list_head list;
bool claimed;
+ bool hotplug;
+
struct device *dev;
void (*cb)(struct device_user *, enum device_event);
};
@@ -113,6 +115,9 @@ extern const struct config_param_list device_attr_list;
extern const struct device_type simple_device_type;
extern const struct device_type bridge_device_type;
+void device_lock(void);
+void device_unlock(void);
+
struct device *device_create(const char *name, const struct device_type *type,
struct blob_attr *config);
void device_init_settings(struct device *dev, struct blob_attr **tb);