]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - net/dsa/tag_dsa.c
net: dsa: add slave to port helper
[thirdparty/kernel/linux.git] / net / dsa / tag_dsa.c
index c77218f173d1b9c68ab55463623845b41166e00a..fe3c9700a8c849211a2f16cd801c3bbefad0ac0f 100644 (file)
@@ -18,7 +18,7 @@
 
 static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       struct dsa_slave_priv *p = netdev_priv(dev);
+       struct dsa_port *dp = dsa_slave_to_port(dev);
        u8 *dsa_header;
 
        /*
@@ -34,8 +34,8 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
                 * Construct tagged FROM_CPU DSA tag from 802.1q tag.
                 */
                dsa_header = skb->data + 2 * ETH_ALEN;
-               dsa_header[0] = 0x60 | p->dp->ds->index;
-               dsa_header[1] = p->dp->index << 3;
+               dsa_header[0] = 0x60 | dp->ds->index;
+               dsa_header[1] = dp->index << 3;
 
                /*
                 * Move CFI field from byte 2 to byte 1.
@@ -55,8 +55,8 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
                 * Construct untagged FROM_CPU DSA tag.
                 */
                dsa_header = skb->data + 2 * ETH_ALEN;
-               dsa_header[0] = 0x40 | p->dp->ds->index;
-               dsa_header[1] = p->dp->index << 3;
+               dsa_header[0] = 0x40 | dp->ds->index;
+               dsa_header[1] = dp->index << 3;
                dsa_header[2] = 0x00;
                dsa_header[3] = 0x00;
        }