]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: rtl8366: Refactor VLAN/PVID init
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 1 Sep 2020 22:09:35 +0000 (00:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Sep 2020 21:13:35 +0000 (14:13 -0700)
commit0e4685e21d60d953ce10cfc65c43bebb3ecb1622
treeaa0ae8fe12420b66378109668c5209aed3432210
parent3d3b066289d094137d03d59533164acd5dce59c5
net: dsa: rtl8366: Refactor VLAN/PVID init

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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/realtek-smi-core.h
drivers/net/dsa/rtl8366.c