static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev)
{
- struct dsa_port *dp = dsa_user_to_port(dev);
struct ethhdr *hdr;
u8 *tag;
tag = skb_put(skb, KSZ_INGRESS_TAG_LEN);
hdr = skb_eth_hdr(skb);
- *tag = 1 << dp->index;
+ *tag = dsa_xmit_port_mask(skb, dev);
if (is_link_local_ether_addr(hdr->h_dest))
*tag |= KSZ8795_TAIL_TAG_OVERRIDE;
tag = skb_put(skb, KSZ9477_INGRESS_TAG_LEN);
hdr = skb_eth_hdr(skb);
- val = BIT(dp->index);
-
+ val = dsa_xmit_port_mask(skb, dev);
val |= FIELD_PREP(KSZ9477_TAIL_TAG_PRIO, prio);
if (is_link_local_ether_addr(hdr->h_dest))
val |= KSZ9477_TAIL_TAG_OVERRIDE;
- if (dev->features & NETIF_F_HW_HSR_DUP) {
- struct net_device *hsr_dev = dp->hsr_dev;
- struct dsa_port *other_dp;
-
- dsa_hsr_foreach_port(other_dp, dp->ds, hsr_dev)
- val |= BIT(other_dp->index);
- }
-
*tag = cpu_to_be16(val);
return ksz_defer_xmit(dp, skb);
tag = skb_put(skb, KSZ_INGRESS_TAG_LEN);
hdr = skb_eth_hdr(skb);
- *tag = BIT(dp->index);
-
+ *tag = dsa_xmit_port_mask(skb, dev);
*tag |= FIELD_PREP(KSZ9893_TAIL_TAG_PRIO, prio);
if (is_link_local_ether_addr(hdr->h_dest))
tag = skb_put(skb, LAN937X_EGRESS_TAG_LEN);
- val = BIT(dp->index);
-
+ val = dsa_xmit_port_mask(skb, dev);
val |= FIELD_PREP(LAN937X_TAIL_TAG_PRIO, prio);
if (is_link_local_ether_addr(hdr->h_dest))