From f11f6fe4002f7b5a83f064f7d339d3258f50810c Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Fri, 16 Apr 2010 19:32:40 +0000 Subject: swconfig: Add cpu port index to help output. Let swconfig provide the cpu port index in its help page. This is needed as e.g. Atheros switches have their cpu port at port 0, not port 5. This could allow e.g. luci to get a rough overview of the layout of the switch. Signed-off-by: Jonas Gorski git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20939 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/swconfig/src/swlib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'package/swconfig/src/swlib.c') diff --git a/package/swconfig/src/swlib.c b/package/swconfig/src/swlib.c index 8a9fd7a29c..59456a33d9 100644 --- a/package/swconfig/src/swlib.c +++ b/package/swconfig/src/swlib.c @@ -586,6 +586,8 @@ add_switch(struct nl_msg *msg, void *arg) dev->ports = nla_get_u32(tb[SWITCH_ATTR_PORTS]); if (tb[SWITCH_ATTR_VLANS]) dev->vlans = nla_get_u32(tb[SWITCH_ATTR_VLANS]); + if (tb[SWITCH_ATTR_CPU_PORT]) + dev->cpu_port = nla_get_u32(tb[SWITCH_ATTR_CPU_PORT]); if (!sa->head) { sa->head = dev; -- cgit v1.2.3