aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-10-28 15:28:30 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-28 15:28:30 -0400
commit3923d68dc05033aa843b67d73110a6d402ac6e14 (patch)
tree84f2b9557b6d513f6127056949b4477af152c460
parentf89b7755f517cdbb755d7543eef986ee9d54e654 (diff)
parentc146b7788e5721ec15bc0197bedf75849508e7ea (diff)
Merge branch 'dsa-net'
Andrew Lunn says: ==================== DSA tagging mismatches The second patch is a fix, which should be applied to -rc. It is possible to get a DSA configuration which does not work. The patch stops this happening. The first patch detects this situation, and errors out the probe of DSA, making it more obvious something is wrong. It is not required to apply it -rc. v2 fixes the use case pointed out by Florian, that a switch driver may use DSA_TAG_PROTO_NONE which the patch did not correctly handle. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/mv88e6171.c2
-rw-r--r--net/dsa/dsa.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 1020a7af67cf..78d8e876f3aa 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -395,7 +395,7 @@ static int mv88e6171_get_sset_count(struct dsa_switch *ds)
395} 395}
396 396
397struct dsa_switch_driver mv88e6171_switch_driver = { 397struct dsa_switch_driver mv88e6171_switch_driver = {
398 .tag_protocol = DSA_TAG_PROTO_DSA, 398 .tag_protocol = DSA_TAG_PROTO_EDSA,
399 .priv_size = sizeof(struct mv88e6xxx_priv_state), 399 .priv_size = sizeof(struct mv88e6xxx_priv_state),
400 .probe = mv88e6171_probe, 400 .probe = mv88e6171_probe,
401 .setup = mv88e6171_setup, 401 .setup = mv88e6171_setup,
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 22f34cf4cb27..6317b41c99b0 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -174,8 +174,11 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
174 dst->rcv = brcm_netdev_ops.rcv; 174 dst->rcv = brcm_netdev_ops.rcv;
175 break; 175 break;
176#endif 176#endif
177 default: 177 case DSA_TAG_PROTO_NONE:
178 break; 178 break;
179 default:
180 ret = -ENOPROTOOPT;
181 goto out;
179 } 182 }
180 183
181 dst->tag_protocol = drv->tag_protocol; 184 dst->tag_protocol = drv->tag_protocol;