Commit cd5a2c82 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: mv88e6xxx: add number of db to info

Add the number of databases to the info structure.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 009a2b98
...@@ -22,16 +22,19 @@ static const struct mv88e6xxx_info mv88e6123_table[] = { ...@@ -22,16 +22,19 @@ static const struct mv88e6xxx_info mv88e6123_table[] = {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6123, .prod_num = PORT_SWITCH_ID_PROD_NUM_6123,
.family = MV88E6XXX_FAMILY_6165, .family = MV88E6XXX_FAMILY_6165,
.name = "Marvell 88E6123", .name = "Marvell 88E6123",
.num_databases = 4096,
.num_ports = 3, .num_ports = 3,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6161, .prod_num = PORT_SWITCH_ID_PROD_NUM_6161,
.family = MV88E6XXX_FAMILY_6165, .family = MV88E6XXX_FAMILY_6165,
.name = "Marvell 88E6161", .name = "Marvell 88E6161",
.num_databases = 4096,
.num_ports = 6, .num_ports = 6,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6165, .prod_num = PORT_SWITCH_ID_PROD_NUM_6165,
.family = MV88E6XXX_FAMILY_6165, .family = MV88E6XXX_FAMILY_6165,
.name = "Marvell 88E6165", .name = "Marvell 88E6165",
.num_databases = 4096,
.num_ports = 6, .num_ports = 6,
} }
}; };
......
...@@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6131_table[] = { ...@@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6131_table[] = {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6095, .prod_num = PORT_SWITCH_ID_PROD_NUM_6095,
.family = MV88E6XXX_FAMILY_6095, .family = MV88E6XXX_FAMILY_6095,
.name = "Marvell 88E6095/88E6095F", .name = "Marvell 88E6095/88E6095F",
.num_databases = 256,
.num_ports = 11, .num_ports = 11,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6085, .prod_num = PORT_SWITCH_ID_PROD_NUM_6085,
.family = MV88E6XXX_FAMILY_6097, .family = MV88E6XXX_FAMILY_6097,
.name = "Marvell 88E6085", .name = "Marvell 88E6085",
.num_databases = 4096,
.num_ports = 10, .num_ports = 10,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6131, .prod_num = PORT_SWITCH_ID_PROD_NUM_6131,
.family = MV88E6XXX_FAMILY_6185, .family = MV88E6XXX_FAMILY_6185,
.name = "Marvell 88E6131", .name = "Marvell 88E6131",
.num_databases = 256,
.num_ports = 8, .num_ports = 8,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6185, .prod_num = PORT_SWITCH_ID_PROD_NUM_6185,
.family = MV88E6XXX_FAMILY_6185, .family = MV88E6XXX_FAMILY_6185,
.name = "Marvell 88E6185", .name = "Marvell 88E6185",
.num_databases = 256,
.num_ports = 10, .num_ports = 10,
} }
}; };
......
...@@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6171_table[] = { ...@@ -22,21 +22,25 @@ static const struct mv88e6xxx_info mv88e6171_table[] = {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6171, .prod_num = PORT_SWITCH_ID_PROD_NUM_6171,
.family = MV88E6XXX_FAMILY_6351, .family = MV88E6XXX_FAMILY_6351,
.name = "Marvell 88E6171", .name = "Marvell 88E6171",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6175, .prod_num = PORT_SWITCH_ID_PROD_NUM_6175,
.family = MV88E6XXX_FAMILY_6351, .family = MV88E6XXX_FAMILY_6351,
.name = "Marvell 88E6175", .name = "Marvell 88E6175",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6350, .prod_num = PORT_SWITCH_ID_PROD_NUM_6350,
.family = MV88E6XXX_FAMILY_6351, .family = MV88E6XXX_FAMILY_6351,
.name = "Marvell 88E6350", .name = "Marvell 88E6350",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6351, .prod_num = PORT_SWITCH_ID_PROD_NUM_6351,
.family = MV88E6XXX_FAMILY_6351, .family = MV88E6XXX_FAMILY_6351,
.name = "Marvell 88E6351", .name = "Marvell 88E6351",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
} }
}; };
......
...@@ -27,31 +27,37 @@ static const struct mv88e6xxx_info mv88e6352_table[] = { ...@@ -27,31 +27,37 @@ static const struct mv88e6xxx_info mv88e6352_table[] = {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6320, .prod_num = PORT_SWITCH_ID_PROD_NUM_6320,
.family = MV88E6XXX_FAMILY_6320, .family = MV88E6XXX_FAMILY_6320,
.name = "Marvell 88E6320", .name = "Marvell 88E6320",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6321, .prod_num = PORT_SWITCH_ID_PROD_NUM_6321,
.family = MV88E6XXX_FAMILY_6320, .family = MV88E6XXX_FAMILY_6320,
.name = "Marvell 88E6321", .name = "Marvell 88E6321",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6172, .prod_num = PORT_SWITCH_ID_PROD_NUM_6172,
.family = MV88E6XXX_FAMILY_6352, .family = MV88E6XXX_FAMILY_6352,
.name = "Marvell 88E6172", .name = "Marvell 88E6172",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6176, .prod_num = PORT_SWITCH_ID_PROD_NUM_6176,
.family = MV88E6XXX_FAMILY_6352, .family = MV88E6XXX_FAMILY_6352,
.name = "Marvell 88E6176", .name = "Marvell 88E6176",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6240, .prod_num = PORT_SWITCH_ID_PROD_NUM_6240,
.family = MV88E6XXX_FAMILY_6352, .family = MV88E6XXX_FAMILY_6352,
.name = "Marvell 88E6240", .name = "Marvell 88E6240",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
}, { }, {
.prod_num = PORT_SWITCH_ID_PROD_NUM_6352, .prod_num = PORT_SWITCH_ID_PROD_NUM_6352,
.family = MV88E6XXX_FAMILY_6352, .family = MV88E6XXX_FAMILY_6352,
.name = "Marvell 88E6352", .name = "Marvell 88E6352",
.num_databases = 4096,
.num_ports = 7, .num_ports = 7,
} }
}; };
......
...@@ -458,24 +458,7 @@ static unsigned int mv88e6xxx_num_databases(struct dsa_switch *ds) ...@@ -458,24 +458,7 @@ static unsigned int mv88e6xxx_num_databases(struct dsa_switch *ds)
{ {
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
/* The following devices have 4-bit identifiers for 16 databases */ return ps->info->num_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;
} }
static bool mv88e6xxx_has_fid_reg(struct dsa_switch *ds) static bool mv88e6xxx_has_fid_reg(struct dsa_switch *ds)
......
...@@ -385,6 +385,7 @@ struct mv88e6xxx_info { ...@@ -385,6 +385,7 @@ struct mv88e6xxx_info {
enum mv88e6xxx_family family; enum mv88e6xxx_family family;
u16 prod_num; u16 prod_num;
const char *name; const char *name;
unsigned int num_databases;
unsigned int num_ports; unsigned int num_ports;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment