Commit 922754a4 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: qca8k: use dsa_port's bridge pointer

Now that DSA exposes the bridge device pointer to which a port belongs,
use it when programming the port based VLANs and thus remove the cache.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fae8a25e
...@@ -746,17 +746,14 @@ qca8k_port_stp_state_set(struct dsa_switch *ds, int port, u8 state) ...@@ -746,17 +746,14 @@ qca8k_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
} }
static int static int
qca8k_port_bridge_join(struct dsa_switch *ds, int port, qca8k_port_bridge_join(struct dsa_switch *ds, int port, struct net_device *br)
struct net_device *bridge)
{ {
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
int port_mask = BIT(QCA8K_CPU_PORT); int port_mask = BIT(QCA8K_CPU_PORT);
int i; int i;
priv->port_sts[port].bridge_dev = bridge;
for (i = 1; i < QCA8K_NUM_PORTS; i++) { for (i = 1; i < QCA8K_NUM_PORTS; i++) {
if (priv->port_sts[i].bridge_dev != bridge) if (ds->ports[i].bridge_dev != br)
continue; continue;
/* Add this port to the portvlan mask of the other ports /* Add this port to the portvlan mask of the other ports
* in the bridge * in the bridge
...@@ -781,8 +778,7 @@ qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br) ...@@ -781,8 +778,7 @@ qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br)
int i; int i;
for (i = 1; i < QCA8K_NUM_PORTS; i++) { for (i = 1; i < QCA8K_NUM_PORTS; i++) {
if (priv->port_sts[i].bridge_dev != if (ds->ports[i].bridge_dev != br)
priv->port_sts[port].bridge_dev)
continue; continue;
/* Remove this port to the portvlan mask of the other ports /* Remove this port to the portvlan mask of the other ports
* in the bridge * in the bridge
...@@ -791,7 +787,7 @@ qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br) ...@@ -791,7 +787,7 @@ qca8k_port_bridge_leave(struct dsa_switch *ds, int port, struct net_device *br)
QCA8K_PORT_LOOKUP_CTRL(i), QCA8K_PORT_LOOKUP_CTRL(i),
BIT(port)); BIT(port));
} }
priv->port_sts[port].bridge_dev = NULL;
/* Set the cpu port to be the only one in the portvlan mask of /* Set the cpu port to be the only one in the portvlan mask of
* this port * this port
*/ */
......
...@@ -157,7 +157,6 @@ enum qca8k_fdb_cmd { ...@@ -157,7 +157,6 @@ enum qca8k_fdb_cmd {
struct ar8xxx_port_status { struct ar8xxx_port_status {
struct ethtool_eee eee; struct ethtool_eee eee;
struct net_device *bridge_dev;
int enabled; int enabled;
}; };
......
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