summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-03-22 17:41:26 +0100
committerFelix Fietkau <nbd@openwrt.org>2015-03-22 17:41:26 +0100
commit1268b8222a3613c2ee36cc7d3006e1989f068a52 (patch)
tree46c7a02fb14432a27b4b0304c09cf143f85e3f49 /device.c
parent1bba3f853bf5b2974b32303c55dfbc0e78d01965 (diff)
device: add support for configuring RPS/XPS (enabled by default if available)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'device.c')
-rw-r--r--device.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/device.c b/device.c
index 2706473..3ca867c 100644
--- a/device.c
+++ b/device.c
@@ -44,6 +44,8 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = {
[DEV_ATTR_IGMPVERSION] = { .name = "igmpversion", .type = BLOBMSG_TYPE_INT32 },
[DEV_ATTR_MLDVERSION] = { .name = "mldversion", .type = BLOBMSG_TYPE_INT32 },
[DEV_ATTR_NEIGHREACHABLETIME] = { .name = "neighreachabletime", .type = BLOBMSG_TYPE_INT32 },
+ [DEV_ATTR_RPS] = { .name = "rps", .type = BLOBMSG_TYPE_BOOL },
+ [DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL },
};
const struct uci_blob_param_list device_attr_list = {
@@ -243,6 +245,16 @@ device_init_settings(struct device *dev, struct blob_attr **tb)
s->flags |= DEV_OPT_NEIGHREACHABLETIME;
}
+ if ((cur = tb[DEV_ATTR_RPS]))
+ s->rps = blobmsg_get_bool(cur);
+ else
+ s->rps = true;
+
+ if ((cur = tb[DEV_ATTR_XPS]))
+ s->xps = blobmsg_get_bool(cur);
+ else
+ s->xps = true;
+
device_set_disabled(dev, disabled);
}