Commit 4d61d304 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: move VLAN filtering setter

Move the DSA port code which sets VLAN filtering on a port in port.c,
where it belongs.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cfbed329
...@@ -66,6 +66,8 @@ int dsa_port_set_state(struct dsa_port *dp, u8 state, ...@@ -66,6 +66,8 @@ int dsa_port_set_state(struct dsa_port *dp, u8 state,
void dsa_port_set_state_now(struct dsa_port *dp, u8 state); void dsa_port_set_state_now(struct dsa_port *dp, u8 state);
int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br); int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br);
void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br); void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br);
int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
struct switchdev_trans *trans);
/* slave.c */ /* slave.c */
extern const struct dsa_device_ops notag_netdev_ops; extern const struct dsa_device_ops notag_netdev_ops;
......
...@@ -111,3 +111,19 @@ void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br) ...@@ -111,3 +111,19 @@ void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br)
*/ */
dsa_port_set_state_now(dp, BR_STATE_FORWARDING); dsa_port_set_state_now(dp, BR_STATE_FORWARDING);
} }
int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
struct switchdev_trans *trans)
{
struct dsa_switch *ds = dp->ds;
/* bridge skips -EOPNOTSUPP, so skip the prepare phase */
if (switchdev_trans_ph_prepare(trans))
return 0;
if (ds->ops->port_vlan_filtering)
return ds->ops->port_vlan_filtering(ds, dp->index,
vlan_filtering);
return 0;
}
...@@ -338,22 +338,6 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -338,22 +338,6 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
static int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
struct switchdev_trans *trans)
{
struct dsa_switch *ds = dp->ds;
/* bridge skips -EOPNOTSUPP, so skip the prepare phase */
if (switchdev_trans_ph_prepare(trans))
return 0;
if (ds->ops->port_vlan_filtering)
return ds->ops->port_vlan_filtering(ds, dp->index,
vlan_filtering);
return 0;
}
static unsigned int dsa_fastest_ageing_time(struct dsa_switch *ds, static unsigned int dsa_fastest_ageing_time(struct dsa_switch *ds,
unsigned int ageing_time) unsigned int ageing_time)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment