]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dsa: mv88e6xxx: Set DSA mode based on chip abilities
authorAndrew Lunn <andrew@lunn.ch>
Mon, 17 Aug 2015 21:52:52 +0000 (23:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Aug 2015 21:17:21 +0000 (14:17 -0700)
Older devices only support a single DSA frame format, where as newer
devices have two. Take this into account when configuring a DSA port.
The port needs to be in plain old DSA mode, since this is a DSA link,
where as the newer format can be used for the CPU port.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx.c

index 486e9792fc0558afe60fa067e2f9d63ba60e65f3..2ab3f98105935cf80c505e0af99ebaeef1fddd26 100644 (file)
@@ -1987,12 +1987,15 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
                                reg |= PORT_CONTROL_EGRESS_ADD_TAG;
                }
        }
-       if (mv88e6xxx_6352_family(ds) || mv88e6xxx_6351_family(ds) ||
-           mv88e6xxx_6165_family(ds) || mv88e6xxx_6097_family(ds) ||
-           mv88e6xxx_6095_family(ds) || mv88e6xxx_6065_family(ds) ||
-           mv88e6xxx_6320_family(ds)) {
-               if (dsa_is_dsa_port(ds, port))
+       if (dsa_is_dsa_port(ds, port)) {
+               if (mv88e6xxx_6095_family(ds) || mv88e6xxx_6185_family(ds))
+                       reg |= PORT_CONTROL_DSA_TAG;
+               if (mv88e6xxx_6352_family(ds) || mv88e6xxx_6351_family(ds) ||
+                   mv88e6xxx_6165_family(ds) || mv88e6xxx_6097_family(ds) ||
+                   mv88e6xxx_6320_family(ds)) {
                        reg |= PORT_CONTROL_FRAME_MODE_DSA;
+               }
+
                if (port == dsa_upstream_port(ds))
                        reg |= PORT_CONTROL_FORWARD_UNKNOWN |
                                PORT_CONTROL_FORWARD_UNKNOWN_MC;