Le 16 déc. 2015 09:21, "Rafał Miłecki" <zaj...@gmail.com> a écrit : > > When using cli, print link state the same way kernel used to do it. > This will allow kernel switching PORT_LINK from SWITCH_TYPE_STRING. > > Signed-off-by: Rafał Miłecki <zaj...@gmail.com> > --- [snip] > + link->eee & SWLIB_LINK_FLAG_ADVERTISED_100BASET_FULL ? "eee100 " : "", > + link->eee & SWLIB_LINK_FLAG_ADVERTISED_1000BASET_FULL ? "eee1000 " : "",
EEE needs to be advertised, supported, and enabled on both link partners to be used,what you are printing here is not very clear, as this is just the advertised side > + link->aneg ? "auto" : ""); > + else > + printf("port:%d link:down", val->port_vlan); > + break; > default: > printf("?unknown-type?"); > } > diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c > index 0dbace5..5239bf7 100644 > --- a/package/network/config/swconfig/src/swlib.c > +++ b/package/network/config/swconfig/src/swlib.c > @@ -51,6 +51,15 @@ static struct nla_policy portmap_policy[SWITCH_PORTMAP_MAX] = { > [SWITCH_PORTMAP_VIRT] = { .type = NLA_U32 }, > }; > > +static struct nla_policy link_policy[SWITCH_LINK_ATTR_MAX] = { > + [SWITCH_LINK_LINK] = { .type = NLA_U32 }, > + [SWITCH_LINK_DUPLEX] = { .type = NLA_U32 }, > + [SWITCH_LINK_ANEG] = { .type = NLA_U32 }, > + [SWITCH_LINK_SPEED] = { .type = NLA_U32 }, As mentioned in patch 1, some of this fits in a boolean. -- Florian
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel