Commit e1230246 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

staging: fsl-dpaa2: ethsw: Handle PORT_PRE_BRIDGE_FLAGS

In preparation for removing SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT,
handle the SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS attribute and check
that the bridge port flags being configured are supported.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c19c44f8
...@@ -666,6 +666,16 @@ static int port_attr_stp_state_set(struct net_device *netdev, ...@@ -666,6 +666,16 @@ static int port_attr_stp_state_set(struct net_device *netdev,
return ethsw_port_set_stp_state(port_priv, state); return ethsw_port_set_stp_state(port_priv, state);
} }
static int port_attr_br_flags_pre_set(struct net_device *netdev,
struct switchdev_trans *trans,
unsigned long flags)
{
if (flags & ~(BR_LEARNING | BR_FLOOD))
return -EINVAL;
return 0;
}
static int port_attr_br_flags_set(struct net_device *netdev, static int port_attr_br_flags_set(struct net_device *netdev,
struct switchdev_trans *trans, struct switchdev_trans *trans,
unsigned long flags) unsigned long flags)
...@@ -698,6 +708,10 @@ static int swdev_port_attr_set(struct net_device *netdev, ...@@ -698,6 +708,10 @@ static int swdev_port_attr_set(struct net_device *netdev,
err = port_attr_stp_state_set(netdev, trans, err = port_attr_stp_state_set(netdev, trans,
attr->u.stp_state); attr->u.stp_state);
break; break;
case SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS:
err = port_attr_br_flags_pre_set(netdev, trans,
attr->u.brport_flags);
break;
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
err = port_attr_br_flags_set(netdev, trans, err = port_attr_br_flags_set(netdev, trans,
attr->u.brport_flags); attr->u.brport_flags);
......
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