static inline bool netdev_uses_dsa(struct net_device *dev)
{
#ifdef CONFIG_NET_DSA
- return dev->dsa_ptr != NULL;
-#else
- return false;
+ if (dev->dsa_ptr != NULL)
+ return dsa_uses_tagged_protocol(dev->dsa_ptr);
#endif
+ return false;
}
/**
return dst->ops->xmit(skb, dev);
}
+static netdev_tx_t dsa_slave_notag_xmit(struct sk_buff *skb,
+ struct net_device *dev)
+{
+ struct dsa_slave_priv *p = netdev_priv(dev);
+
+ skb->dev = p->parent->dst->master_netdev;
+ dev_queue_xmit(skb);
+
+ return NETDEV_TX_OK;
+}
+
/* ethtool operations *******************************************************/
static int
.ndo_do_ioctl = dsa_slave_ioctl,
};
+static const struct dsa_device_ops notag_netdev_ops = {
+ .xmit = dsa_slave_notag_xmit,
+ .rcv = NULL,
+};
+
static void dsa_slave_adjust_link(struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
break;
#endif
default:
- BUG();
+ ds->dst->ops = ¬ag_netdev_ops;
+ break;
}
SET_NETDEV_DEV(slave_dev, parent);