[OpenWrt-Devel] [PATCH 1/3] swconfig: add SWITCH_TYPE_LINK and support sending link info to user space

Rafał Miłecki zajec5 at gmail.com
Mon Dec 21 01:24:01 EST 2015


On 20 December 2015 at 19:23, Stefan Rompf <stefan at loplof.de> wrote:
> On Mittwoch, 16. Dezember 2015 18:19:01 Rafał Miłecki wrote:
>
>> So far we were sending link data as a string. It got some drawbacks:
>> 1) Didn't allow writing clean user space apps reading link state. It was
>>    needed to do some screen scraping.
>> 2) Forced whole PORT_LINK communication to be string based. Adding
>>    support for *setting* port link required passing string and parting
>>    it in the kernel space.
>
> indeed, this interface looks a lot better than passing a string. It will make
> setting the link parameters easier.
>
> Minor nitpick: I'm not sure about the naming of these attributes:
>
>> +     SWITCH_LINK_FLAG_ADVERTISED_100BASET_FULL,
>> +     SWITCH_LINK_FLAG_ADVERTISED_1000BASET_FULL,
>
> As far as I understand the code, they specify whether EEE should be
> adverstised / is enabled for a specific speed. Therefore maybe they should be
> called f.e.
>
> SWITCH_LINK_EEE_100BASET and
> SWITCH_LINK_EEE_1000BASET

In the current code swconfig_get_link does following:
link.eee & ADVERTISED_100baseT_Full ? "eee100 " : "",
link.eee & ADVERTISED_1000baseT_Full ? "eee1000 " : "",
this is what made me call flags like that. I'll rename them.

-- 
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list