diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-05-09 20:22:38 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-09 21:26:08 +0300 |
commit | b5058d7a308035233db18032edc17135cb17ae27 (patch) | |
tree | d6186f71ffd9c59947f872c632a6197e156f953b /drivers/net/dsa/mv88e6xxx.h | |
parent | 908578e7d5f69087241434c872f8f4a8ab70045f (diff) | |
download | linux-b5058d7a308035233db18032edc17135cb17ae27.tar.xz |
net: dsa: mv88e6xxx: add flags to info
Add a flags bitmap to the info structure in order to identify features
supported or not by the different switch 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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 4f455d219859..c67b72af9af1 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -350,12 +350,27 @@ enum mv88e6xxx_family { MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */ }; +#define MV88E6XXX_FLAGS_FAMILY_6095 0 + +#define MV88E6XXX_FLAGS_FAMILY_6097 0 + +#define MV88E6XXX_FLAGS_FAMILY_6165 0 + +#define MV88E6XXX_FLAGS_FAMILY_6185 0 + +#define MV88E6XXX_FLAGS_FAMILY_6320 0 + +#define MV88E6XXX_FLAGS_FAMILY_6351 0 + +#define MV88E6XXX_FLAGS_FAMILY_6352 0 + struct mv88e6xxx_info { enum mv88e6xxx_family family; u16 prod_num; const char *name; unsigned int num_databases; unsigned int num_ports; + unsigned long flags; }; struct mv88e6xxx_atu_entry { @@ -449,6 +464,12 @@ struct mv88e6xxx_hw_stat { enum stat_type type; }; +static inline bool mv88e6xxx_has(struct mv88e6xxx_priv_state *ps, + unsigned long flags) +{ + return (ps->info->flags & flags) == flags; +} + int mv88e6xxx_switch_reset(struct mv88e6xxx_priv_state *ps, bool ppu_active); const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, int sw_addr, void **priv, |