Commit 96673a30 authored by Arkadi Sharshevsky's avatar Arkadi Sharshevsky Committed by David S. Miller

rocker: Add support for querying supported bridge flags

Add support for querying supported bridge flags.
Signed-off-by: default avatarArkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8cc186a4
...@@ -112,6 +112,10 @@ struct rocker_world_ops { ...@@ -112,6 +112,10 @@ struct rocker_world_ops {
struct switchdev_trans *trans); struct switchdev_trans *trans);
int (*port_attr_bridge_flags_get)(const struct rocker_port *rocker_port, int (*port_attr_bridge_flags_get)(const struct rocker_port *rocker_port,
unsigned long *p_brport_flags); unsigned long *p_brport_flags);
int (*port_attr_bridge_flags_support_get)(const struct rocker_port *
rocker_port,
unsigned long *
p_brport_flags);
int (*port_attr_bridge_ageing_time_set)(struct rocker_port *rocker_port, int (*port_attr_bridge_ageing_time_set)(struct rocker_port *rocker_port,
u32 ageing_time, u32 ageing_time,
struct switchdev_trans *trans); struct switchdev_trans *trans);
......
...@@ -1584,6 +1584,20 @@ rocker_world_port_attr_bridge_flags_get(const struct rocker_port *rocker_port, ...@@ -1584,6 +1584,20 @@ rocker_world_port_attr_bridge_flags_get(const struct rocker_port *rocker_port,
return wops->port_attr_bridge_flags_get(rocker_port, p_brport_flags); return wops->port_attr_bridge_flags_get(rocker_port, p_brport_flags);
} }
static int
rocker_world_port_attr_bridge_flags_support_get(const struct rocker_port *
rocker_port,
unsigned long *
p_brport_flags_support)
{
struct rocker_world_ops *wops = rocker_port->rocker->wops;
if (!wops->port_attr_bridge_flags_support_get)
return -EOPNOTSUPP;
return wops->port_attr_bridge_flags_support_get(rocker_port,
p_brport_flags_support);
}
static int static int
rocker_world_port_attr_bridge_ageing_time_set(struct rocker_port *rocker_port, rocker_world_port_attr_bridge_ageing_time_set(struct rocker_port *rocker_port,
u32 ageing_time, u32 ageing_time,
...@@ -2053,6 +2067,10 @@ static int rocker_port_attr_get(struct net_device *dev, ...@@ -2053,6 +2067,10 @@ static int rocker_port_attr_get(struct net_device *dev,
err = rocker_world_port_attr_bridge_flags_get(rocker_port, err = rocker_world_port_attr_bridge_flags_get(rocker_port,
&attr->u.brport_flags); &attr->u.brport_flags);
break; break;
case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT:
err = rocker_world_port_attr_bridge_flags_support_get(rocker_port,
&attr->u.brport_flags_support);
break;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
...@@ -2642,6 +2642,16 @@ ofdpa_port_attr_bridge_flags_get(const struct rocker_port *rocker_port, ...@@ -2642,6 +2642,16 @@ ofdpa_port_attr_bridge_flags_get(const struct rocker_port *rocker_port,
return 0; return 0;
} }
static int
ofdpa_port_attr_bridge_flags_support_get(const struct rocker_port *
rocker_port,
unsigned long *
p_brport_flags_support)
{
*p_brport_flags_support = BR_LEARNING;
return 0;
}
static int static int
ofdpa_port_attr_bridge_ageing_time_set(struct rocker_port *rocker_port, ofdpa_port_attr_bridge_ageing_time_set(struct rocker_port *rocker_port,
u32 ageing_time, u32 ageing_time,
...@@ -2989,6 +2999,7 @@ struct rocker_world_ops rocker_ofdpa_ops = { ...@@ -2989,6 +2999,7 @@ struct rocker_world_ops rocker_ofdpa_ops = {
.port_attr_stp_state_set = ofdpa_port_attr_stp_state_set, .port_attr_stp_state_set = ofdpa_port_attr_stp_state_set,
.port_attr_bridge_flags_set = ofdpa_port_attr_bridge_flags_set, .port_attr_bridge_flags_set = ofdpa_port_attr_bridge_flags_set,
.port_attr_bridge_flags_get = ofdpa_port_attr_bridge_flags_get, .port_attr_bridge_flags_get = ofdpa_port_attr_bridge_flags_get,
.port_attr_bridge_flags_support_get = ofdpa_port_attr_bridge_flags_support_get,
.port_attr_bridge_ageing_time_set = ofdpa_port_attr_bridge_ageing_time_set, .port_attr_bridge_ageing_time_set = ofdpa_port_attr_bridge_ageing_time_set,
.port_obj_vlan_add = ofdpa_port_obj_vlan_add, .port_obj_vlan_add = ofdpa_port_obj_vlan_add,
.port_obj_vlan_del = ofdpa_port_obj_vlan_del, .port_obj_vlan_del = ofdpa_port_obj_vlan_del,
......
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