• Linus Walleij's avatar
    net: dsa: rtl8366: Refactor VLAN/PVID init · 7e1301ed
    Linus Walleij authored
    The VLANs and PVIDs on the RTL8366 utilizes a "member
    configuration" (MC) which is largely unexplained in the
    code.
    
    This set-up requires a special ordering: rtl8366_set_pvid()
    must be called first, followed by rtl8366_set_vlan(),
    else the MC will not be properly allocated. Relax this
    by factoring out the code obtaining an MC and reuse
    the helper in both rtl8366_set_pvid() and
    rtl8366_set_vlan() so we remove this strict ordering
    requirement.
    
    In the process, add some better comments and debug prints
    so people who read the code understand what is going on.
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7e1301ed
realtek-smi-core.h 4.26 KB