summaryrefslogtreecommitdiffhomepage
path: root/device.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-07 15:58:32 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-06-07 15:58:32 +0200
commit1850d0350d3af11514744961d827a8b9facdaf00 (patch)
tree8a07b6adbf30921d23bd56a154ddea7029941154 /device.h
parent3bd580e340d2075194cb353da32e10393b006c55 (diff)
device: make device_set_disabled inline, add device_set_deferred
Diffstat (limited to 'device.h')
-rw-r--r--device.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/device.h b/device.h
index d41042b..c76c472 100644
--- a/device.h
+++ b/device.h
@@ -115,6 +115,7 @@ struct device {
int active;
bool external;
bool disabled;
+ bool deferred;
bool current_config;
bool default_config;
@@ -164,7 +165,7 @@ void device_add_user(struct device_user *dep, struct device *iface);
void device_remove_user(struct device_user *dep);
void device_set_present(struct device *dev, bool state);
-void device_set_disabled(struct device *dev, bool value);
+void device_refresh_present(struct device *dev);
int device_claim(struct device_user *dep);
void device_release(struct device_user *dep);
int device_check_state(struct device *dev);
@@ -176,4 +177,18 @@ void device_free_unused(struct device *dev);
struct device *get_vlan_device_chain(const char *ifname, bool create);
void alias_notify_device(const char *name, struct device *dev);
+static inline void
+device_set_deferred(struct device *dev, bool value)
+{
+ dev->deferred = value;
+ device_refresh_present(dev);
+}
+
+static inline void
+device_set_disabled(struct device *dev, bool value)
+{
+ dev->disabled = value;
+ device_refresh_present(dev);
+}
+
#endif