<p dir="ltr">Le 16 déc. 2015 09:21, "Rafał Miłecki" <<a href="mailto:zajec5@gmail.com">zajec5@gmail.com</a>> a écrit :<br>
><br>
> When using cli, print link state the same way kernel used to do it.<br>
> This will allow kernel switching PORT_LINK from SWITCH_TYPE_STRING.<br>
><br>
> Signed-off-by: Rafał Miłecki <<a href="mailto:zajec5@gmail.com">zajec5@gmail.com</a>><br>
> ---<br>
[snip]<br>
> + link->eee & SWLIB_LINK_FLAG_ADVERTISED_100BASET_FULL ? "eee100 " : "",<br>
> + link->eee & SWLIB_LINK_FLAG_ADVERTISED_1000BASET_FULL ? "eee1000 " : "",</p>
<p dir="ltr">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</p>
<p dir="ltr">> + link->aneg ? "auto" : "");<br>
> + else<br>
> + printf("port:%d link:down", val->port_vlan);<br>
> + break;<br>
> default:<br>
> printf("?unknown-type?");<br>
> }<br>
> diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c<br>
> index 0dbace5..5239bf7 100644<br>
> --- a/package/network/config/swconfig/src/swlib.c<br>
> +++ b/package/network/config/swconfig/src/swlib.c<br>
> @@ -51,6 +51,15 @@ static struct nla_policy portmap_policy[SWITCH_PORTMAP_MAX] = {<br>
> [SWITCH_PORTMAP_VIRT] = { .type = NLA_U32 },<br>
> };<br>
><br>
> +static struct nla_policy link_policy[SWITCH_LINK_ATTR_MAX] = {<br>
> + [SWITCH_LINK_LINK] = { .type = NLA_U32 },<br>
> + [SWITCH_LINK_DUPLEX] = { .type = NLA_U32 },<br>
> + [SWITCH_LINK_ANEG] = { .type = NLA_U32 },<br>
> + [SWITCH_LINK_SPEED] = { .type = NLA_U32 },</p>
<p dir="ltr">As mentioned in patch 1, some of this fits in a boolean.<br>
--<br>
Florian</p>