diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-04-17 20:24:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-18 01:54:15 +0300 |
commit | cd5a2c82bad9e59f2674befc07c12effa0aea49d (patch) | |
tree | ff58463a9b3b654a19ed7e5f104bf9cbac0fc140 | |
parent | 009a2b9843bf0b1a85fbf79f76e1de4995de527c (diff) | |
download | linux-cd5a2c82bad9e59f2674befc07c12effa0aea49d.tar.xz |
net: dsa: mv88e6xxx: add number of db to info
Add the number of databases to the info structure.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/mv88e6123.c | 3 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6131.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6171.c | 4 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6352.c | 6 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 19 | ||||
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.h | 1 |
6 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/dsa/mv88e6123.c b/drivers/net/dsa/mv88e6123.c index 0bf43bb17993..534ebc84de84 100644 --- a/drivers/net/dsa/mv88e6123.c +++ b/drivers/net/dsa/mv88e6123.c @@ -22,16 +22,19 @@ static const struct mv88e6xxx_info mv88e6123_table[] = { .prod_num = PORT_SWITCH_ID_PROD_NUM_6123, .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6123", + .num_databases = 4096, .num_ports = 3, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6161, .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6161", + .num_databases = 4096, .num_ports = 6, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6165, .family = MV88E6XXX_FAMILY_6165, .name = "Marvell 88E6165", + .num_databases = 4096, .num_ports = 6, } }; diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c index c01bbb1e857e..c3eb9a884cfd 100644 --- a/drivers/net/dsa/mv88e6131.c +++ b/drivers/net/dsa/mv88e6131.c @@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6131_table[] = { .prod_num = PORT_SWITCH_ID_PROD_NUM_6095, .family = MV88E6XXX_FAMILY_6095, .name = "Marvell 88E6095/88E6095F", + .num_databases = 256, .num_ports = 11, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6085, .family = MV88E6XXX_FAMILY_6097, .name = "Marvell 88E6085", + .num_databases = 4096, .num_ports = 10, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6131, .family = MV88E6XXX_FAMILY_6185, .name = "Marvell 88E6131", + .num_databases = 256, .num_ports = 8, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6185, .family = MV88E6XXX_FAMILY_6185, .name = "Marvell 88E6185", + .num_databases = 256, .num_ports = 10, } }; diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 172824fe1dc0..841ffe14ef75 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c @@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6171_table[] = { .prod_num = PORT_SWITCH_ID_PROD_NUM_6171, .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6171", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6175, .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6175", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6350, .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6350", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6351, .family = MV88E6XXX_FAMILY_6351, .name = "Marvell 88E6351", + .num_databases = 4096, .num_ports = 7, } }; diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c index 12b9a7b5cb31..4afc24df56b8 100644 --- a/drivers/net/dsa/mv88e6352.c +++ b/drivers/net/dsa/mv88e6352.c @@ -27,31 +27,37 @@ static const struct mv88e6xxx_info mv88e6352_table[] = { .prod_num = PORT_SWITCH_ID_PROD_NUM_6320, .family = MV88E6XXX_FAMILY_6320, .name = "Marvell 88E6320", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6321, .family = MV88E6XXX_FAMILY_6320, .name = "Marvell 88E6321", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6172, .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6172", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6176, .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6176", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6240, .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6240", + .num_databases = 4096, .num_ports = 7, }, { .prod_num = PORT_SWITCH_ID_PROD_NUM_6352, .family = MV88E6XXX_FAMILY_6352, .name = "Marvell 88E6352", + .num_databases = 4096, .num_ports = 7, } }; diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index c952d91a5b88..67b1dd1c22f7 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -458,24 +458,7 @@ static unsigned int mv88e6xxx_num_databases(struct dsa_switch *ds) { struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); - /* The following devices have 4-bit identifiers for 16 databases */ - if (ps->id == PORT_SWITCH_ID_6061) - return 16; - - /* The following devices have 6-bit identifiers for 64 databases */ - if (ps->id == PORT_SWITCH_ID_6065) - return 64; - - /* The following devices have 8-bit identifiers for 256 databases */ - if (mv88e6xxx_6095_family(ds) || mv88e6xxx_6185_family(ds)) - return 256; - - /* The following devices have 12-bit identifiers for 4096 databases */ - if (mv88e6xxx_6097_family(ds) || mv88e6xxx_6165_family(ds) || - mv88e6xxx_6351_family(ds) || mv88e6xxx_6352_family(ds)) - return 4096; - - return 0; + return ps->info->num_databases; } static bool mv88e6xxx_has_fid_reg(struct dsa_switch *ds) diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h index 801486aefe78..8eeafff27a82 100644 --- a/drivers/net/dsa/mv88e6xxx.h +++ b/drivers/net/dsa/mv88e6xxx.h @@ -385,6 +385,7 @@ struct mv88e6xxx_info { enum mv88e6xxx_family family; u16 prod_num; const char *name; + unsigned int num_databases; unsigned int num_ports; }; |