diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-05-09 19:22:41 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-09 20:26:09 +0200 |
commit | d24645bebce2b13b3c5c49ff392cfb7f3efe0d76 (patch) | |
tree | 5a434f3e71e4d5e42ebeeb1c5658403e5c1f9916 /drivers/net/dsa/mv88e6xxx.h | |
parent | net: dsa: mv88e6xxx: factorize PHY indirect access (diff) | |
download | linux-d24645bebce2b13b3c5c49ff392cfb7f3efe0d76.tar.xz linux-d24645bebce2b13b3c5c49ff392cfb7f3efe0d76.zip |
net: dsa: mv88e6xxx: factorize EEPROM access
Add a MV88E6XXX_FLAG_EEPROM flag to describe switch models featuring an
EEPROM and distribute the EEPROM access routines to all models.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx.h')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 597257123ca7..0181f6775bfc 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -351,6 +351,11 @@ enum mv88e6xxx_family { }; enum mv88e6xxx_cap { + /* EEPROM Command and Data registers. + * See GLOBAL2_EEPROM_OP and GLOBAL2_EEPROM_DATA. + */ + MV88E6XXX_CAP_EEPROM, + /* PHY Polling Unit. * See GLOBAL_CONTROL_PPU_ENABLE and GLOBAL_STATUS_PPU_POLLING. */ @@ -364,6 +369,7 @@ enum mv88e6xxx_cap { }; /* Bitmask of capabilities */ +#define MV88E6XXX_FLAG_EEPROM BIT(MV88E6XXX_CAP_EEPROM) #define MV88E6XXX_FLAG_PPU BIT(MV88E6XXX_CAP_PPU) #define MV88E6XXX_FLAG_SMI_PHY BIT(MV88E6XXX_CAP_SMI_PHY) @@ -379,13 +385,15 @@ enum mv88e6xxx_cap { MV88E6XXX_FLAG_PPU #define MV88E6XXX_FLAGS_FAMILY_6320 \ - MV88E6XXX_FLAG_SMI_PHY + (MV88E6XXX_FLAG_EEPROM | \ + MV88E6XXX_FLAG_SMI_PHY) #define MV88E6XXX_FLAGS_FAMILY_6351 \ MV88E6XXX_FLAG_SMI_PHY #define MV88E6XXX_FLAGS_FAMILY_6352 \ - MV88E6XXX_FLAG_SMI_PHY + (MV88E6XXX_FLAG_EEPROM | \ + MV88E6XXX_FLAG_SMI_PHY) struct mv88e6xxx_info { enum mv88e6xxx_family family; @@ -521,8 +529,10 @@ int mv88e6xxx_get_temp(struct dsa_switch *ds, int *temp); int mv88e6xxx_get_temp_limit(struct dsa_switch *ds, int *temp); int mv88e6xxx_set_temp_limit(struct dsa_switch *ds, int temp); int mv88e6xxx_get_temp_alarm(struct dsa_switch *ds, bool *alarm); -int mv88e6xxx_eeprom_load_wait(struct dsa_switch *ds); -int mv88e6xxx_eeprom_busy_wait(struct dsa_switch *ds); +int mv88e6xxx_get_eeprom(struct dsa_switch *ds, struct ethtool_eeprom *eeprom, + u8 *data); +int mv88e6xxx_set_eeprom(struct dsa_switch *ds, struct ethtool_eeprom *eeprom, + u8 *data); int mv88e6xxx_get_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e); int mv88e6xxx_set_eee(struct dsa_switch *ds, int port, struct phy_device *phydev, struct ethtool_eee *e); |