<p dir="ltr">Le 16 déc. 2015 09:19, "Rafał Miłecki" <<a href="mailto:zajec5@gmail.com">zajec5@gmail.com</a>> a écrit :<br>
><br>
> So far we were sending link data as a string. It got some drawbacks:<br>
> 1) Didn't allow writing clean user space apps reading link state. It was<br>
>    needed to do some screen scraping.<br>
> 2) Forced whole PORT_LINK communication to be string based. Adding<br>
>    support for *setting* port link required passing string and parting<br>
>    it in the kernel space.<br>
><br>
> Signed-off-by: Rafał Miłecki <<a href="mailto:zajec5@gmail.com">zajec5@gmail.com</a>><br>
> ---</p>
<p dir="ltr">[snip]</p>
<p dir="ltr">(struct sk_buff *msg, struct genl_info *info, int attr,<br>
> +                  const struct switch_port_link *link)<br>
> +{<br>
> +       struct nlattr *p = NULL;<br>
> +       int err = 0;<br>
> +<br>
> +       p = nla_nest_start(msg, attr);<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_LINK, link->link))</p>
<p dir="ltr"> Boolean?</p>
<p dir="ltr">> +               goto nla_put_failure;<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_DUPLEX, link->duplex))</p>
<p dir="ltr">Same here</p>
<p dir="ltr">> +               goto nla_put_failure;<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_ANEG, link->aneg))</p>
<p dir="ltr">And here</p>
<p dir="ltr">> +               goto nla_put_failure;<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_TX_FLOW, link->tx_flow))</p>
<p dir="ltr">And here</p>
<p dir="ltr">> +               goto nla_put_failure;<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_RX_FLOW, link->rx_flow))</p>
<p dir="ltr">And here too</p>
<p dir="ltr">> +               goto nla_put_failure;<br>
> +       if (nla_put_u32(msg, SWITCH_LINK_SPEED, link->speed))<br>
> +               goto nla_put_failure;<br>
> +       if (link->eee & ADVERTISED_100baseT_Full) {<br>
> +               if (nla_put_flag(msg, SWITCH_LINK_FLAG_ADVERTISED_100BASET_FULL))<br>
> +                       goto nla_put_failure;<br>
> +       }<br>
> +       if (link->eee & ADVERTISED_1000baseT_Full) {<br>
> +               if (nla_put_flag(msg, SWITCH_LINK_FLAG_ADVERTISED_1000BASET_FULL))<br>
> +                       goto nla_put_failure;<br>
> +       }</p>
<p dir="ltr">As mentioned by Stefan, these should reflect that is is EEE-related.<br>
--<br>
Florian</p>