Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torvalds/linux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-08-23 07:08:09 +0300
committerDavid S. Miller <davem@davemloft.net>2016-08-23 07:09:11 +0300
commite55dddfe7e0deaa3282e0f346d6ed97c4e481388 (patch)
tree70311be3e51976320ada27f2bef73c667ff76d90 /net
parent1ae292a2457cd692828da2be87cb967260993ad0 (diff)
parentf027e0cc8255a8af8197835f2f44910dc63e2fa5 (diff)
Merge branch 'dsa-fix-MV88E6131-tagging'
Andrew Lunn says: ==================== Fix MV88E6131 tagging Marvell has two different tagging protocols for frames passed to a swicth. There is the older DSA and the newer EDSA. Somewhere along the way, we broke support for switches which only support DSA, by trying to configure them to use EDSA. These patches add back support for switches which only support DSA, by allowing the drivers to dynamically indicate the tagging protocol they support to the DSA core. This needs to be dynamic since the mv88e6xxx has to support two protocols. Thanks go to Jamie Lentin for reporting the problem, helping debug it, providing some of the fix, and testing. ==================== Tested-By: Jamie Lentin <jm@lentin.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dsa/dsa.c5
-rw-r--r--net/dsa/dsa2.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 8bda74e595a5..8d3a28d4e99d 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -354,7 +354,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
* switch.
*/
if (dst->cpu_switch == index) {
- dst->tag_ops = dsa_resolve_tag_protocol(drv->tag_protocol);
+ enum dsa_tag_protocol tag_protocol;
+
+ tag_protocol = drv->get_tag_protocol(ds);
+ dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
if (IS_ERR(dst->tag_ops)) {
ret = PTR_ERR(dst->tag_ops);
goto out;
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index f30bad9678f0..2e343221464c 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -443,6 +443,7 @@ static int dsa_cpu_parse(struct device_node *port, u32 index,
struct dsa_switch_tree *dst,
struct dsa_switch *ds)
{
+ enum dsa_tag_protocol tag_protocol;
struct net_device *ethernet_dev;
struct device_node *ethernet;
@@ -465,7 +466,8 @@ static int dsa_cpu_parse(struct device_node *port, u32 index,
dst->cpu_port = index;
}
- dst->tag_ops = dsa_resolve_tag_protocol(ds->drv->tag_protocol);
+ tag_protocol = ds->drv->get_tag_protocol(ds);
+ dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
if (IS_ERR(dst->tag_ops)) {
dev_warn(ds->dev, "No tagger for this switch\n");
return PTR_ERR(dst->tag_ops);