summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/dsa/lantiq/lantiq_gswip.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c
index 2169c0814a48..91755a5972fa 100644
--- a/drivers/net/dsa/lantiq/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq/lantiq_gswip.c
@@ -1140,9 +1140,9 @@ static void gswip_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
}
static int gswip_port_fdb(struct dsa_switch *ds, int port,
- const unsigned char *addr, u16 vid, bool add)
+ struct net_device *bridge, const unsigned char *addr,
+ u16 vid, bool add)
{
- struct net_device *bridge = dsa_port_bridge_dev_get(dsa_to_port(ds, port));
struct gswip_priv *priv = ds->priv;
struct gswip_pce_table_entry mac_bridge = {0,};
unsigned int max_ports = priv->hw_info->max_ports;
@@ -1150,10 +1150,6 @@ static int gswip_port_fdb(struct dsa_switch *ds, int port,
int i;
int err;
- /* Operation not supported on the CPU port, don't throw errors */
- if (!bridge)
- return 0;
-
for (i = max_ports; i < ARRAY_SIZE(priv->vlans); i++) {
if (priv->vlans[i].bridge == bridge) {
fid = priv->vlans[i].fid;
@@ -1188,14 +1184,20 @@ static int gswip_port_fdb_add(struct dsa_switch *ds, int port,
const unsigned char *addr, u16 vid,
struct dsa_db db)
{
- return gswip_port_fdb(ds, port, addr, vid, true);
+ if (db.type != DSA_DB_BRIDGE)
+ return -EOPNOTSUPP;
+
+ return gswip_port_fdb(ds, port, db.bridge.dev, addr, vid, true);
}
static int gswip_port_fdb_del(struct dsa_switch *ds, int port,
const unsigned char *addr, u16 vid,
struct dsa_db db)
{
- return gswip_port_fdb(ds, port, addr, vid, false);
+ if (db.type != DSA_DB_BRIDGE)
+ return -EOPNOTSUPP;
+
+ return gswip_port_fdb(ds, port, db.bridge.dev, addr, vid, false);
}
static int gswip_port_fdb_dump(struct dsa_switch *ds, int port,