projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a395894
)
add a callback for dumping device status information
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 27 Mar 2011 17:08:24 +0000
(19:08 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 27 Mar 2011 17:08:24 +0000
(19:08 +0200)
device.h
patch
|
blob
|
history
ubus.c
patch
|
blob
|
history
diff --git
a/device.h
b/device.h
index bf93ebc770ab8684d29b308a29f4086f92a8f439..9ceeff5365211697fa0023c30d487a0e3ff71682 100644
(file)
--- a/
device.h
+++ b/
device.h
@@
-11,6
+11,7
@@
typedef int (*device_state_cb)(struct device *, bool up);
struct device_type {
const char *name;
+ void (*dump_status)(struct device *, struct blob_buf *buf);
int (*check_state)(struct device *);
void (*free)(struct device *);
};
diff --git
a/ubus.c
b/ubus.c
index 0723300b438db39bf525a97cc1f8ce41a81b82a3..2bb42f1ff52a9dcfe20f18505efce24d470eea67 100644
(file)
--- a/
ubus.c
+++ b/
ubus.c
@@
-151,6
+151,9
@@
static int netifd_handle_status(struct ubus_context *ctx, struct ubus_object *ob
else
/* use a different field for virtual devices */
blobmsg_add_string(&b, "link", dev->ifname);
+
+ if (dev->type->dump_status)
+ dev->type->dump_status(dev, &b);
}
ubus_send_reply(ctx, req, b.head);