}
static int rtl83xx_port_bridge_join(struct dsa_switch *ds, int port,
- struct net_device *bridge)
+ struct dsa_bridge bridge,
+ bool *tx_fwd_offload,
+ struct netlink_ext_ack *extack)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 port_bitmap = BIT_ULL(priv->cpu_port), v;
* and not being setup until the port becomes enabled.
*/
if (dsa_is_user_port(ds, i) && !priv->is_lagmember[i] && i != port) {
- if (dsa_to_port(ds, i)->bridge_dev != bridge)
+ if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge))
continue;
if (priv->ports[i].enable)
priv->r->traffic_enable(i, port);
}
static void rtl83xx_port_bridge_leave(struct dsa_switch *ds, int port,
- struct net_device *bridge)
+ struct dsa_bridge bridge)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 port_bitmap = 0, v;
* other port is still a VLAN-aware port.
*/
if (dsa_is_user_port(ds, i) && i != port) {
- if (dsa_to_port(ds, i)->bridge_dev != bridge)
+ if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge))
continue;
if (priv->ports[i].enable)
priv->r->traffic_disable(i, port);
}
static int rtl83xx_port_fdb_add(struct dsa_switch *ds, int port,
- const unsigned char *addr, u16 vid)
+ const unsigned char *addr, u16 vid,
+ const struct dsa_db db)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 mac = ether_addr_to_u64(addr);
}
static int rtl83xx_port_fdb_del(struct dsa_switch *ds, int port,
- const unsigned char *addr, u16 vid)
+ const unsigned char *addr, u16 vid,
+ const struct dsa_db db)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 mac = ether_addr_to_u64(addr);
}
static int rtl83xx_port_mdb_add(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_mdb *mdb)
+ const struct switchdev_obj_port_mdb *mdb,
+ const struct dsa_db db)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 mac = ether_addr_to_u64(mdb->addr);
}
int rtl83xx_port_mdb_del(struct dsa_switch *ds, int port,
- const struct switchdev_obj_port_mdb *mdb)
+ const struct switchdev_obj_port_mdb *mdb,
+ const struct dsa_db db)
{
struct rtl838x_switch_priv *priv = ds->priv;
u64 mac = ether_addr_to_u64(mdb->addr);
static int rtl83xx_port_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror,
- bool ingress)
+ bool ingress, struct netlink_ext_ack *extack)
{
/* We support 4 mirror groups, one destination port per group */
int group;
return 0;
}
-static int rtl83xx_port_lag_join(struct dsa_switch *ds, int port,
- struct net_device *lag,
- struct netdev_lag_upper_info *info)
+static int rtl83xx_port_lag_join(struct dsa_switch *ds,
+ int port,
+ struct dsa_lag lag,
+ struct netdev_lag_upper_info *info,
+ struct netlink_ext_ack *extack)
{
struct rtl838x_switch_priv *priv = ds->priv;
int i, err = 0;
- if (!rtl83xx_lag_can_offload(ds, lag, info))
+ if (!rtl83xx_lag_can_offload(ds, lag.dev, info))
return -EOPNOTSUPP;
mutex_lock(&priv->reg_mutex);
for (i = 0; i < priv->n_lags; i++) {
- if ((!priv->lag_devs[i]) || (priv->lag_devs[i] == lag))
+ if ((!priv->lag_devs[i]) || (priv->lag_devs[i] == lag.dev))
break;
}
if (port >= priv->cpu_port) {
}
pr_info("port_lag_join: group %d, port %d\n",i, port);
if (!priv->lag_devs[i])
- priv->lag_devs[i] = lag;
+ priv->lag_devs[i] = lag.dev;
if (priv->lag_primary[i] == -1) {
priv->lag_primary[i] = port;
}
static int rtl83xx_port_lag_leave(struct dsa_switch *ds, int port,
- struct net_device *lag)
+ struct dsa_lag lag)
{
int i, group = -1, err;
struct rtl838x_switch_priv *priv = ds->priv;