aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 03d2894a0f8a..241c2a1684cb 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -181,6 +181,17 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev)
181 return dst->ops->xmit(skb, dev); 181 return dst->ops->xmit(skb, dev);
182} 182}
183 183
184static netdev_tx_t dsa_slave_notag_xmit(struct sk_buff *skb,
185 struct net_device *dev)
186{
187 struct dsa_slave_priv *p = netdev_priv(dev);
188
189 skb->dev = p->parent->dst->master_netdev;
190 dev_queue_xmit(skb);
191
192 return NETDEV_TX_OK;
193}
194
184 195
185/* ethtool operations *******************************************************/ 196/* ethtool operations *******************************************************/
186static int 197static int
@@ -314,6 +325,11 @@ static const struct net_device_ops dsa_slave_netdev_ops = {
314 .ndo_do_ioctl = dsa_slave_ioctl, 325 .ndo_do_ioctl = dsa_slave_ioctl,
315}; 326};
316 327
328static const struct dsa_device_ops notag_netdev_ops = {
329 .xmit = dsa_slave_notag_xmit,
330 .rcv = NULL,
331};
332
317static void dsa_slave_adjust_link(struct net_device *dev) 333static void dsa_slave_adjust_link(struct net_device *dev)
318{ 334{
319 struct dsa_slave_priv *p = netdev_priv(dev); 335 struct dsa_slave_priv *p = netdev_priv(dev);
@@ -415,7 +431,8 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
415 break; 431 break;
416#endif 432#endif
417 default: 433 default:
418 BUG(); 434 ds->dst->ops = &notag_netdev_ops;
435 break;
419 } 436 }
420 437
421 SET_NETDEV_DEV(slave_dev, parent); 438 SET_NETDEV_DEV(slave_dev, parent);