Re: [PATCH net-next v2] net: dsa: Mock-up driver

2017-04-01 Thread David Miller
From: Florian Fainelli Date: Thu, 30 Mar 2017 18:43:21 -0700 > This patch adds support for a DSA mock-up driver which essentially does > the following: > > - registers/unregisters 4 fixed PHYs to the slave network devices > - uses eth0 (configurable) as the master netdev > - registers the switch

Re: [PATCH net-next v2] net: dsa: Mock-up driver

2017-03-31 Thread Andrew Lunn
> Actually we do not, because netdev_uses_dsa() returns true only when > dst->rcv is different from NULL. When dst->rcv is NULL we completely > bypass the DSA hook in eth_type_trans() and everything is well, the > master network device is the one receiving packets. static inline bool netdev_uses_d

Re: [PATCH net-next v2] net: dsa: Mock-up driver

2017-03-31 Thread Florian Fainelli
Hi Andrew, On 03/31/2017 09:06 AM, Andrew Lunn wrote: > Hi Florian > >> +static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds) >> +{ >> +dev_dbg(ds->dev, "%s\n", __func__); >> + >> +return DSA_TAG_PROTO_NONE; >> +} > > I'm wondering how safe this is: > > static const

Re: [PATCH net-next v2] net: dsa: Mock-up driver

2017-03-31 Thread Andrew Lunn
Hi Florian > +static enum dsa_tag_protocol dsa_loop_get_protocol(struct dsa_switch *ds) > +{ > + dev_dbg(ds->dev, "%s\n", __func__); > + > + return DSA_TAG_PROTO_NONE; > +} I'm wondering how safe this is: static const struct dsa_device_ops none_ops = { .xmit = dsa_slave_notag_x

[PATCH net-next v2] net: dsa: Mock-up driver

2017-03-30 Thread Florian Fainelli
This patch adds support for a DSA mock-up driver which essentially does the following: - registers/unregisters 4 fixed PHYs to the slave network devices - uses eth0 (configurable) as the master netdev - registers the switch as a fixed MDIO device against the fixed MDIO bus at address 31 - includ