aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/qca8k.h
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2022-02-02 01:03:28 +0100
committerDavid S. Miller <davem@davemloft.net>2022-02-02 14:43:59 +0000
commitcddbec19466a1dfb4d45ddd507d9f09f991d54ae (patch)
treef9c87afb5472bc9e391c00b9173f7336c3a8970e /drivers/net/dsa/qca8k.h
parentnet: dsa: tag_qca: add support for handling mgmt and MIB Ethernet packet (diff)
downloadlinux-dev-cddbec19466a1dfb4d45ddd507d9f09f991d54ae.tar.xz
linux-dev-cddbec19466a1dfb4d45ddd507d9f09f991d54ae.zip
net: dsa: qca8k: add tracking state of master port
MDIO/MIB Ethernet require the master port and the tagger availabale to correctly work. Use the new api master_state_change to track when master is operational or not and set a bool in qca8k_priv. We cache the first cached master available and we check if other cpu port are operational when the cached one goes down. This cached master will later be used by mdio read/write and mib request to correctly use the working function. qca8k implementation for MDIO/MIB Ethernet is bad. CPU port0 is the only one that answers with the ack packet or sends MIB Ethernet packets. For this reason the master_state_change ignore CPU port6 and only checks CPU port0 if it's operational and enables this mode. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/qca8k.h')
-rw-r--r--drivers/net/dsa/qca8k.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
index ab4a417b25a9..b81aad98a116 100644
--- a/drivers/net/dsa/qca8k.h
+++ b/drivers/net/dsa/qca8k.h
@@ -353,6 +353,7 @@ struct qca8k_priv {
struct dsa_switch_ops ops;
struct gpio_desc *reset_gpio;
unsigned int port_mtu[QCA8K_NUM_PORTS];
+ struct net_device *mgmt_master; /* Track if mdio/mib Ethernet is available */
};
struct qca8k_mib_desc {