X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=device.h;h=733763f753f82619423059df8de95e7e9363cd5f;hp=0f8d3827794e2cf416d3a7eef38bd6e5cadea036;hb=49e68df7c8e99c66084612007d89c43d9ab2a975;hpb=273550337f70b8b2175875e0c4f0bbd483cfe326 diff --git a/device.h b/device.h index 0f8d382..733763f 100644 --- a/device.h +++ b/device.h @@ -119,25 +119,29 @@ struct device_hotplug_ops { int (*del)(struct device *main, struct device *member); }; +extern const struct config_param_list device_attr_list; + +struct device *device_create(struct blob_attr *attr, struct uci_section *s); + +void device_init_virtual(struct device *dev, const struct device_type *type, const char *name); +int device_init(struct device *iface, const struct device_type *type, const char *ifname); +void device_cleanup(struct device *iface); +struct device *device_get(const char *name, bool create); +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); +int device_claim(struct device *dev); +void device_release(struct device *dev); +int check_device_state(struct device *dev); + static inline void -free_device(struct device *dev) +device_free(struct device *dev) { dev->type->free(dev); } -void init_virtual_device(struct device *dev, const struct device_type *type, const char *name); -int init_device(struct device *iface, const struct device_type *type, const char *ifname); -void cleanup_device(struct device *iface); -struct device *get_device(const char *name, bool create); -void add_device_user(struct device_user *dep, struct device *iface); -void remove_device_user(struct device_user *dep); - -void set_device_present(struct device *dev, bool state); -int claim_device(struct device *dev); -void release_device(struct device *dev); -int check_device_state(struct device *dev); - -void cleanup_devices(void); +void device_free_all(void); struct device *get_vlan_device_chain(const char *ifname, bool create); struct device *bridge_create(const char *name, struct uci_section *s);