mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net: dsa: add port_fdb_prepare
Push the prepare phase for FDB operations down to the DSA drivers, with a new port_fdb_prepare function. Currently only mv88e6xxx is affected. Signed-off-by: Vivien Didelot <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6e86ac120e
commit
146a32067b
6 changed files with 26 additions and 2 deletions
|
|
@ -346,10 +346,13 @@ static int dsa_slave_port_fdb_add(struct net_device *dev,
|
|||
{
|
||||
struct dsa_slave_priv *p = netdev_priv(dev);
|
||||
struct dsa_switch *ds = p->parent;
|
||||
int ret = -EOPNOTSUPP;
|
||||
int ret;
|
||||
|
||||
if (!ds->drv->port_fdb_prepare || !ds->drv->port_fdb_add)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (switchdev_trans_ph_prepare(trans))
|
||||
ret = ds->drv->port_fdb_add ? 0 : -EOPNOTSUPP;
|
||||
ret = ds->drv->port_fdb_prepare(ds, p->port, fdb, trans);
|
||||
else
|
||||
ret = ds->drv->port_fdb_add(ds, p->port, fdb->addr, fdb->vid);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue