X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=device.c;h=56fc3f787713ce5eb0d9e3bf6833b460d1d264cd;hp=53971c8dffc9a86d5516cd4cb7dbfe94cbf5e881;hb=134775b1f41fa19a816768268b9d0f8dad86bd90;hpb=9c5fe49282cd15e81c8cf771aa271db10facc5b1 diff --git a/device.c b/device.c index 53971c8..56fc3f7 100644 --- a/device.c +++ b/device.c @@ -31,12 +31,12 @@ static struct avl_tree devices; static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = { - [DEV_ATTR_TYPE] = { "type", BLOBMSG_TYPE_STRING }, - [DEV_ATTR_IFNAME] = { "ifname", BLOBMSG_TYPE_ARRAY }, - [DEV_ATTR_MTU] = { "mtu", BLOBMSG_TYPE_INT32 }, - [DEV_ATTR_MACADDR] = { "macaddr", BLOBMSG_TYPE_STRING }, - [DEV_ATTR_TXQUEUELEN] = { "txqueuelen", BLOBMSG_TYPE_INT32 }, - [DEV_ATTR_ENABLED] = { "enabled", BLOBMSG_TYPE_BOOL }, + [DEV_ATTR_TYPE] = { .name = "type", .type = BLOBMSG_TYPE_STRING }, + [DEV_ATTR_IFNAME] = { .name = "ifname", .type = BLOBMSG_TYPE_ARRAY }, + [DEV_ATTR_MTU] = { .name = "mtu", .type = BLOBMSG_TYPE_INT32 }, + [DEV_ATTR_MACADDR] = { .name = "macaddr", .type = BLOBMSG_TYPE_STRING }, + [DEV_ATTR_TXQUEUELEN] = { .name = "txqueuelen", .type = BLOBMSG_TYPE_INT32 }, + [DEV_ATTR_ENABLED] = { .name = "enabled", .type = BLOBMSG_TYPE_BOOL }, }; const struct uci_blob_param_list device_attr_list = { @@ -216,7 +216,7 @@ int device_claim(struct device_user *dep) if (ret == 0) device_broadcast_event(dev, DEV_EVENT_UP); else { - D(DEVICE, "claim device %s failed: %d\n", dev->ifname, ret); + D(DEVICE, "claim %s %s failed: %d\n", dev->type->name, dev->ifname, ret); dev->active = 0; dep->claimed = false; }