net: dsa: Provide a slave MII bus if needed
[deliverable/linux.git] / net / dsa / tag_dsa.c
index aa780e4ac0bd9653618c2b4c582d882cfb52f94a..bce79ffe342bccad589f06b9b5402daee68998c3 100644 (file)
@@ -107,10 +107,14 @@ static int dsa_rcv(struct sk_buff *skb, struct net_device *dev,
         * Check that the source device exists and that the source
         * port is a registered DSA port.
         */
-       if (source_device >= dst->pd->nr_chips)
+       if (source_device >= DSA_MAX_SWITCHES)
                goto out_drop;
+
        ds = dst->ds[source_device];
-       if (source_port >= DSA_MAX_PORTS || ds->ports[source_port] == NULL)
+       if (!ds)
+               goto out_drop;
+
+       if (source_port >= DSA_MAX_PORTS || !ds->ports[source_port].netdev)
                goto out_drop;
 
        /*
@@ -159,7 +163,7 @@ static int dsa_rcv(struct sk_buff *skb, struct net_device *dev,
                        2 * ETH_ALEN);
        }
 
-       skb->dev = ds->ports[source_port];
+       skb->dev = ds->ports[source_port].netdev;
        skb_push(skb, ETH_HLEN);
        skb->pkt_type = PACKET_HOST;
        skb->protocol = eth_type_trans(skb, skb->dev);
This page took 0.027048 seconds and 5 git commands to generate.