aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/ksz_priv.h
diff options
context:
space:
mode:
authorTristram Ha <Tristram.Ha@microchip.com>2019-02-22 16:36:51 -0800
committerDavid S. Miller <davem@davemloft.net>2019-02-24 17:49:59 -0800
commit7049f9b5d0529a8fefaae681e57baeb31bd2d40a (patch)
treec26ad7257c1ff015e2f2b9a6bdb55cb67874ea1a /drivers/net/dsa/microchip/ksz_priv.h
parentnet: dsa: microchip: remove unnecessary include headers (diff)
downloadlinux-dev-7049f9b5d0529a8fefaae681e57baeb31bd2d40a.tar.xz
linux-dev-7049f9b5d0529a8fefaae681e57baeb31bd2d40a.zip
net: dsa: microchip: add port_cleanup function
Add port_cleanup function to reset some device variables when the port is disabled. Add a mutex to make sure changing those variables is thread-safe. Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/dsa/microchip/ksz_priv.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_priv.h b/drivers/net/dsa/microchip/ksz_priv.h
index 1d2d98f35bb0..b52e5ca17ab4 100644
--- a/drivers/net/dsa/microchip/ksz_priv.h
+++ b/drivers/net/dsa/microchip/ksz_priv.h
@@ -48,6 +48,7 @@ struct ksz_device {
struct ksz_platform_data *pdata;
const char *name;
+ struct mutex dev_mutex; /* device access */
struct mutex reg_mutex; /* register access */
struct mutex stats_mutex; /* status access */
struct mutex alu_mutex; /* ALU access */
@@ -137,6 +138,7 @@ struct ksz_dev_ops {
void (*flush_dyn_mac_table)(struct ksz_device *dev, int port);
void (*phy_setup)(struct ksz_device *dev, int port,
struct phy_device *phy);
+ void (*port_cleanup)(struct ksz_device *dev, int port);
void (*port_setup)(struct ksz_device *dev, int port, bool cpu_port);
void (*r_phy)(struct ksz_device *dev, u16 phy, u16 reg, u16 *val);
void (*w_phy)(struct ksz_device *dev, u16 phy, u16 reg, u16 val);