diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-12-14 15:51:13 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-12-14 15:59:12 +0100 |
commit | 2851c3bcde8c23f6535b13c80fc486569c288ec7 (patch) | |
tree | a8f7be8b96ddfab627b91b551b5d92a90e328f8d /device.c | |
parent | 0d5c827cd976886b1dce86bbefc74fc8303bac99 (diff) |
Revert "netifd: Link layer state support on device level"
This reverts commit c439b52400978dd3799c66e1f632ee68d2c7c9eb.
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 29 |
1 files changed, 2 insertions, 27 deletions
@@ -207,7 +207,7 @@ int device_claim(struct device_user *dep) return 0; dep->claimed = true; - D(DEVICE, "Claim %s %s, new active count: %d\n", dev->type->name, dev->ifname, dev->active + 1); + D(DEVICE, "Claim %s %s, new refcount: %d\n", dev->type->name, dev->ifname, dev->active + 1); if (++dev->active != 1) return 0; @@ -233,7 +233,7 @@ void device_release(struct device_user *dep) dep->claimed = false; dev->active--; - D(DEVICE, "Release %s %s, new active count: %d\n", dev->type->name, dev->ifname, dev->active); + D(DEVICE, "Release %s %s, new refcount: %d\n", dev->type->name, dev->ifname, dev->active); assert(dev->active >= 0); if (dev->active) @@ -390,26 +390,6 @@ void device_set_present(struct device *dev, bool state) device_refresh_present(dev); } -void device_set_link(struct device *dev, bool state) -{ - if (dev->link_active == state) - return; - - netifd_log_message(L_NOTICE, "%s '%s' link is %s\n", dev->type->name, dev->ifname, state ? "up" : "down" ); - - dev->link_active = state; - device_broadcast_event(dev, state ? DEV_EVENT_LINK_UP : DEV_EVENT_LINK_DOWN); -} - -void device_set_ifindex(struct device *dev, int ifindex) -{ - if (dev->ifindex == ifindex) - return; - - dev->ifindex = ifindex; - device_broadcast_event(dev, DEV_EVENT_UPDATE_IFINDEX); -} - static int device_refcount(struct device *dev) { struct list_head *list; @@ -451,9 +431,6 @@ void device_add_user(struct device_user *dep, struct device *dev) dep->cb(dep, DEV_EVENT_ADD); if (dev->active) dep->cb(dep, DEV_EVENT_UP); - - if (dev->link_active) - dep->cb(dep, DEV_EVENT_LINK_UP); } } @@ -686,8 +663,6 @@ device_dump_status(struct blob_buf *b, struct device *dev) return; blobmsg_add_u8(b, "up", !!dev->active); - blobmsg_add_u8(b, "carrier", !!dev->link_active); - if (dev->type->dump_info) dev->type->dump_info(dev, b); else |