Commit ccd37cff authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-mv88e6xxx-switch-factorization'

Vivien Didelot says:

====================
net: dsa: mv88e6xxx: factorize switch info

This patchset factorizes the mv88e6xxx code by sharing a new extendable
info structure to store static data such as switch family, product
number, number of ports, number of databases and the name.

The next step is to add a "flags" bitmap member to the info structure in
order to simplify the shared code with a feature-based logic instead of
checking their family/ID.

This is a step forward having a single mv88e6xxx driver supporting many
similar devices, like any usual Linux driver.

Changes v3 -> v4:
  - constify probed name in DSA
  - rebase patchset above conflicting commit 48ace4ef

Changes v2 -> v3:
  - update commit messages and add Andrew's tags
  - keep the info lookup code in a separated function
  - split the single switch ID reading in probe in a new commit

Changes v1 -> v2:
  - define PORT_SWITCH_ID_PROD_NUM_* values
  - use plain struct mv88e6xxx_info
  - remove non used yet ps->rev
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents efde611b d967ecbc
...@@ -135,9 +135,9 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds) ...@@ -135,9 +135,9 @@ static int bcm_sf2_sw_get_sset_count(struct dsa_switch *ds)
return BCM_SF2_STATS_SIZE; return BCM_SF2_STATS_SIZE;
} }
static char *bcm_sf2_sw_drv_probe(struct device *dsa_dev, static const char *bcm_sf2_sw_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **_priv) void **_priv)
{ {
struct bcm_sf2_priv *priv; struct bcm_sf2_priv *priv;
......
...@@ -51,7 +51,7 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val) ...@@ -51,7 +51,7 @@ static int reg_write(struct dsa_switch *ds, int addr, int reg, u16 val)
return __ret; \ return __ret; \
}) })
static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr) static const char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
{ {
int ret; int ret;
...@@ -69,13 +69,13 @@ static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr) ...@@ -69,13 +69,13 @@ static char *mv88e6060_get_name(struct mii_bus *bus, int sw_addr)
return NULL; return NULL;
} }
static char *mv88e6060_drv_probe(struct device *dsa_dev, static const char *mv88e6060_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **_priv) void **_priv)
{ {
struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev); struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev);
struct mv88e6060_priv *priv; struct mv88e6060_priv *priv;
char *name; const char *name;
name = mv88e6060_get_name(bus, sw_addr); name = mv88e6060_get_name(bus, sw_addr);
if (name) { if (name) {
......
...@@ -17,21 +17,31 @@ ...@@ -17,21 +17,31 @@
#include <net/dsa.h> #include <net/dsa.h>
#include "mv88e6xxx.h" #include "mv88e6xxx.h"
static const struct mv88e6xxx_switch_id mv88e6123_table[] = { static const struct mv88e6xxx_info mv88e6123_table[] = {
{ PORT_SWITCH_ID_6123, "Marvell 88E6123" }, {
{ PORT_SWITCH_ID_6123_A1, "Marvell 88E6123 (A1)" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6123,
{ PORT_SWITCH_ID_6123_A2, "Marvell 88E6123 (A2)" }, .family = MV88E6XXX_FAMILY_6165,
{ PORT_SWITCH_ID_6161, "Marvell 88E6161" }, .name = "Marvell 88E6123",
{ PORT_SWITCH_ID_6161_A1, "Marvell 88E6161 (A1)" }, .num_databases = 4096,
{ PORT_SWITCH_ID_6161_A2, "Marvell 88E6161 (A2)" }, .num_ports = 3,
{ PORT_SWITCH_ID_6165, "Marvell 88E6165" }, }, {
{ PORT_SWITCH_ID_6165_A1, "Marvell 88E6165 (A1)" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6161,
{ PORT_SWITCH_ID_6165_A2, "Marvell 88e6165 (A2)" }, .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,
}
}; };
static char *mv88e6123_drv_probe(struct device *dsa_dev, static const char *mv88e6123_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **priv) void **priv)
{ {
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
mv88e6123_table, mv88e6123_table,
...@@ -76,27 +86,12 @@ static int mv88e6123_setup_global(struct dsa_switch *ds) ...@@ -76,27 +86,12 @@ static int mv88e6123_setup_global(struct dsa_switch *ds)
static int mv88e6123_setup(struct dsa_switch *ds) static int mv88e6123_setup(struct dsa_switch *ds)
{ {
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
int ret; int ret;
ps->ds = ds;
ret = mv88e6xxx_setup_common(ds); ret = mv88e6xxx_setup_common(ds);
if (ret < 0) if (ret < 0)
return ret; return ret;
switch (ps->id) {
case PORT_SWITCH_ID_6123:
ps->num_ports = 3;
break;
case PORT_SWITCH_ID_6161:
case PORT_SWITCH_ID_6165:
ps->num_ports = 6;
break;
default:
return -ENODEV;
}
ret = mv88e6xxx_switch_reset(ds, false); ret = mv88e6xxx_switch_reset(ds, false);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -17,17 +17,37 @@ ...@@ -17,17 +17,37 @@
#include <net/dsa.h> #include <net/dsa.h>
#include "mv88e6xxx.h" #include "mv88e6xxx.h"
static const struct mv88e6xxx_switch_id mv88e6131_table[] = { static const struct mv88e6xxx_info mv88e6131_table[] = {
{ PORT_SWITCH_ID_6085, "Marvell 88E6085" }, {
{ PORT_SWITCH_ID_6095, "Marvell 88E6095/88E6095F" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6095,
{ PORT_SWITCH_ID_6131, "Marvell 88E6131" }, .family = MV88E6XXX_FAMILY_6095,
{ PORT_SWITCH_ID_6131_B2, "Marvell 88E6131 (B2)" }, .name = "Marvell 88E6095/88E6095F",
{ PORT_SWITCH_ID_6185, "Marvell 88E6185" }, .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,
}
}; };
static char *mv88e6131_drv_probe(struct device *dsa_dev, static const char *mv88e6131_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **priv) void **priv)
{ {
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
mv88e6131_table, mv88e6131_table,
...@@ -98,33 +118,14 @@ static int mv88e6131_setup_global(struct dsa_switch *ds) ...@@ -98,33 +118,14 @@ static int mv88e6131_setup_global(struct dsa_switch *ds)
static int mv88e6131_setup(struct dsa_switch *ds) static int mv88e6131_setup(struct dsa_switch *ds)
{ {
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
int ret; int ret;
ps->ds = ds;
ret = mv88e6xxx_setup_common(ds); ret = mv88e6xxx_setup_common(ds);
if (ret < 0) if (ret < 0)
return ret; return ret;
mv88e6xxx_ppu_state_init(ds); mv88e6xxx_ppu_state_init(ds);
switch (ps->id) {
case PORT_SWITCH_ID_6085:
case PORT_SWITCH_ID_6185:
ps->num_ports = 10;
break;
case PORT_SWITCH_ID_6095:
ps->num_ports = 11;
break;
case PORT_SWITCH_ID_6131:
case PORT_SWITCH_ID_6131_B2:
ps->num_ports = 8;
break;
default:
return -ENODEV;
}
ret = mv88e6xxx_switch_reset(ds, false); ret = mv88e6xxx_switch_reset(ds, false);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -140,7 +141,7 @@ static int mv88e6131_port_to_phy_addr(struct dsa_switch *ds, int port) ...@@ -140,7 +141,7 @@ static int mv88e6131_port_to_phy_addr(struct dsa_switch *ds, int port)
{ {
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
if (port >= 0 && port < ps->num_ports) if (port >= 0 && port < ps->info->num_ports)
return port; return port;
return -EINVAL; return -EINVAL;
......
...@@ -17,16 +17,37 @@ ...@@ -17,16 +17,37 @@
#include <net/dsa.h> #include <net/dsa.h>
#include "mv88e6xxx.h" #include "mv88e6xxx.h"
static const struct mv88e6xxx_switch_id mv88e6171_table[] = { static const struct mv88e6xxx_info mv88e6171_table[] = {
{ PORT_SWITCH_ID_6171, "Marvell 88E6171" }, {
{ PORT_SWITCH_ID_6175, "Marvell 88E6175" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6171,
{ PORT_SWITCH_ID_6350, "Marvell 88E6350" }, .family = MV88E6XXX_FAMILY_6351,
{ PORT_SWITCH_ID_6351, "Marvell 88E6351" }, .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,
}
}; };
static char *mv88e6171_drv_probe(struct device *dsa_dev, static const char *mv88e6171_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **priv) void **priv)
{ {
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
mv88e6171_table, mv88e6171_table,
...@@ -73,17 +94,12 @@ static int mv88e6171_setup_global(struct dsa_switch *ds) ...@@ -73,17 +94,12 @@ static int mv88e6171_setup_global(struct dsa_switch *ds)
static int mv88e6171_setup(struct dsa_switch *ds) static int mv88e6171_setup(struct dsa_switch *ds)
{ {
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
int ret; int ret;
ps->ds = ds;
ret = mv88e6xxx_setup_common(ds); ret = mv88e6xxx_setup_common(ds);
if (ret < 0) if (ret < 0)
return ret; return ret;
ps->num_ports = 7;
ret = mv88e6xxx_switch_reset(ds, true); ret = mv88e6xxx_switch_reset(ds, true);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -22,24 +22,49 @@ ...@@ -22,24 +22,49 @@
#include <net/dsa.h> #include <net/dsa.h>
#include "mv88e6xxx.h" #include "mv88e6xxx.h"
static const struct mv88e6xxx_switch_id mv88e6352_table[] = { static const struct mv88e6xxx_info mv88e6352_table[] = {
{ PORT_SWITCH_ID_6172, "Marvell 88E6172" }, {
{ PORT_SWITCH_ID_6176, "Marvell 88E6176" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6320,
{ PORT_SWITCH_ID_6240, "Marvell 88E6240" }, .family = MV88E6XXX_FAMILY_6320,
{ PORT_SWITCH_ID_6320, "Marvell 88E6320" }, .name = "Marvell 88E6320",
{ PORT_SWITCH_ID_6320_A1, "Marvell 88E6320 (A1)" }, .num_databases = 4096,
{ PORT_SWITCH_ID_6320_A2, "Marvell 88e6320 (A2)" }, .num_ports = 7,
{ PORT_SWITCH_ID_6321, "Marvell 88E6321" }, }, {
{ PORT_SWITCH_ID_6321_A1, "Marvell 88E6321 (A1)" }, .prod_num = PORT_SWITCH_ID_PROD_NUM_6321,
{ PORT_SWITCH_ID_6321_A2, "Marvell 88e6321 (A2)" }, .family = MV88E6XXX_FAMILY_6320,
{ PORT_SWITCH_ID_6352, "Marvell 88E6352" }, .name = "Marvell 88E6321",
{ PORT_SWITCH_ID_6352_A0, "Marvell 88E6352 (A0)" }, .num_databases = 4096,
{ PORT_SWITCH_ID_6352_A1, "Marvell 88E6352 (A1)" }, .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,
}
}; };
static char *mv88e6352_drv_probe(struct device *dsa_dev, static const char *mv88e6352_drv_probe(struct device *dsa_dev,
struct device *host_dev, struct device *host_dev, int sw_addr,
int sw_addr, void **priv) void **priv)
{ {
return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv, return mv88e6xxx_drv_probe(dsa_dev, host_dev, sw_addr, priv,
mv88e6352_table, mv88e6352_table,
...@@ -87,14 +112,10 @@ static int mv88e6352_setup(struct dsa_switch *ds) ...@@ -87,14 +112,10 @@ static int mv88e6352_setup(struct dsa_switch *ds)
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
int ret; int ret;
ps->ds = ds;
ret = mv88e6xxx_setup_common(ds); ret = mv88e6xxx_setup_common(ds);
if (ret < 0) if (ret < 0)
return ret; return ret;
ps->num_ports = 7;
mutex_init(&ps->eeprom_mutex); mutex_init(&ps->eeprom_mutex);
ret = mv88e6xxx_switch_reset(ds, true); ret = mv88e6xxx_switch_reset(ds, true);
......
This diff is collapsed.
...@@ -68,52 +68,23 @@ ...@@ -68,52 +68,23 @@
#define PORT_PCS_CTRL_UNFORCED 0x03 #define PORT_PCS_CTRL_UNFORCED 0x03
#define PORT_PAUSE_CTRL 0x02 #define PORT_PAUSE_CTRL 0x02
#define PORT_SWITCH_ID 0x03 #define PORT_SWITCH_ID 0x03
#define PORT_SWITCH_ID_PROD_NUM_MASK 0xfff0 #define PORT_SWITCH_ID_PROD_NUM_6085 0x04a
#define PORT_SWITCH_ID_REV_MASK 0x000f #define PORT_SWITCH_ID_PROD_NUM_6095 0x095
#define PORT_SWITCH_ID_6031 0x0310 #define PORT_SWITCH_ID_PROD_NUM_6131 0x106
#define PORT_SWITCH_ID_6035 0x0350 #define PORT_SWITCH_ID_PROD_NUM_6320 0x115
#define PORT_SWITCH_ID_6046 0x0480 #define PORT_SWITCH_ID_PROD_NUM_6123 0x121
#define PORT_SWITCH_ID_6061 0x0610 #define PORT_SWITCH_ID_PROD_NUM_6161 0x161
#define PORT_SWITCH_ID_6065 0x0650 #define PORT_SWITCH_ID_PROD_NUM_6165 0x165
#define PORT_SWITCH_ID_6085 0x04a0 #define PORT_SWITCH_ID_PROD_NUM_6171 0x171
#define PORT_SWITCH_ID_6092 0x0970 #define PORT_SWITCH_ID_PROD_NUM_6172 0x172
#define PORT_SWITCH_ID_6095 0x0950 #define PORT_SWITCH_ID_PROD_NUM_6175 0x175
#define PORT_SWITCH_ID_6096 0x0980 #define PORT_SWITCH_ID_PROD_NUM_6176 0x176
#define PORT_SWITCH_ID_6097 0x0990 #define PORT_SWITCH_ID_PROD_NUM_6185 0x1a7
#define PORT_SWITCH_ID_6108 0x1070 #define PORT_SWITCH_ID_PROD_NUM_6240 0x240
#define PORT_SWITCH_ID_6121 0x1040 #define PORT_SWITCH_ID_PROD_NUM_6321 0x310
#define PORT_SWITCH_ID_6122 0x1050 #define PORT_SWITCH_ID_PROD_NUM_6352 0x352
#define PORT_SWITCH_ID_6123 0x1210 #define PORT_SWITCH_ID_PROD_NUM_6350 0x371
#define PORT_SWITCH_ID_6123_A1 0x1212 #define PORT_SWITCH_ID_PROD_NUM_6351 0x375
#define PORT_SWITCH_ID_6123_A2 0x1213
#define PORT_SWITCH_ID_6131 0x1060
#define PORT_SWITCH_ID_6131_B2 0x1066
#define PORT_SWITCH_ID_6152 0x1a40
#define PORT_SWITCH_ID_6155 0x1a50
#define PORT_SWITCH_ID_6161 0x1610
#define PORT_SWITCH_ID_6161_A1 0x1612
#define PORT_SWITCH_ID_6161_A2 0x1613
#define PORT_SWITCH_ID_6165 0x1650
#define PORT_SWITCH_ID_6165_A1 0x1652
#define PORT_SWITCH_ID_6165_A2 0x1653
#define PORT_SWITCH_ID_6171 0x1710
#define PORT_SWITCH_ID_6172 0x1720
#define PORT_SWITCH_ID_6175 0x1750
#define PORT_SWITCH_ID_6176 0x1760
#define PORT_SWITCH_ID_6182 0x1a60
#define PORT_SWITCH_ID_6185 0x1a70
#define PORT_SWITCH_ID_6240 0x2400
#define PORT_SWITCH_ID_6320 0x1150
#define PORT_SWITCH_ID_6320_A1 0x1151
#define PORT_SWITCH_ID_6320_A2 0x1152
#define PORT_SWITCH_ID_6321 0x3100
#define PORT_SWITCH_ID_6321_A1 0x3101
#define PORT_SWITCH_ID_6321_A2 0x3102
#define PORT_SWITCH_ID_6350 0x3710
#define PORT_SWITCH_ID_6351 0x3750
#define PORT_SWITCH_ID_6352 0x3520
#define PORT_SWITCH_ID_6352_A0 0x3521
#define PORT_SWITCH_ID_6352_A1 0x3522
#define PORT_CONTROL 0x04 #define PORT_CONTROL 0x04
#define PORT_CONTROL_USE_CORE_TAG BIT(15) #define PORT_CONTROL_USE_CORE_TAG BIT(15)
#define PORT_CONTROL_DROP_ON_LOCK BIT(14) #define PORT_CONTROL_DROP_ON_LOCK BIT(14)
...@@ -367,9 +338,24 @@ ...@@ -367,9 +338,24 @@
#define MV88E6XXX_N_FID 4096 #define MV88E6XXX_N_FID 4096
struct mv88e6xxx_switch_id { enum mv88e6xxx_family {
u16 id; MV88E6XXX_FAMILY_NONE,
char *name; MV88E6XXX_FAMILY_6065, /* 6031 6035 6061 6065 */
MV88E6XXX_FAMILY_6095, /* 6092 6095 */
MV88E6XXX_FAMILY_6097, /* 6046 6085 6096 6097 */
MV88E6XXX_FAMILY_6165, /* 6123 6161 6165 */
MV88E6XXX_FAMILY_6185, /* 6108 6121 6122 6131 6152 6155 6182 6185 */
MV88E6XXX_FAMILY_6320, /* 6320 6321 */
MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */
MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */
};
struct mv88e6xxx_info {
enum mv88e6xxx_family family;
u16 prod_num;
const char *name;
unsigned int num_databases;
unsigned int num_ports;
}; };
struct mv88e6xxx_atu_entry { struct mv88e6xxx_atu_entry {
...@@ -397,6 +383,8 @@ struct mv88e6xxx_priv_port { ...@@ -397,6 +383,8 @@ struct mv88e6xxx_priv_port {
}; };
struct mv88e6xxx_priv_state { struct mv88e6xxx_priv_state {
const struct mv88e6xxx_info *info;
/* The dsa_switch this private structure is related to */ /* The dsa_switch this private structure is related to */
struct dsa_switch *ds; struct dsa_switch *ds;
...@@ -438,9 +426,6 @@ struct mv88e6xxx_priv_state { ...@@ -438,9 +426,6 @@ struct mv88e6xxx_priv_state {
*/ */
struct mutex eeprom_mutex; struct mutex eeprom_mutex;
int id; /* switch product id */
int num_ports; /* number of switch ports */
struct mv88e6xxx_priv_port ports[DSA_MAX_PORTS]; struct mv88e6xxx_priv_port ports[DSA_MAX_PORTS];
DECLARE_BITMAP(port_state_update_mask, DSA_MAX_PORTS); DECLARE_BITMAP(port_state_update_mask, DSA_MAX_PORTS);
...@@ -462,10 +447,10 @@ struct mv88e6xxx_hw_stat { ...@@ -462,10 +447,10 @@ struct mv88e6xxx_hw_stat {
}; };
int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active); int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev, const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
int sw_addr, void **priv, int sw_addr, void **priv,
const struct mv88e6xxx_switch_id *table, const struct mv88e6xxx_info *table,
unsigned int num); unsigned int num);
int mv88e6xxx_setup_ports(struct dsa_switch *ds); int mv88e6xxx_setup_ports(struct dsa_switch *ds);
int mv88e6xxx_setup_common(struct dsa_switch *ds); int mv88e6xxx_setup_common(struct dsa_switch *ds);
......
...@@ -217,8 +217,9 @@ struct dsa_switch_driver { ...@@ -217,8 +217,9 @@ struct dsa_switch_driver {
/* /*
* Probing and setup. * Probing and setup.
*/ */
char *(*probe)(struct device *dsa_dev, struct device *host_dev, const char *(*probe)(struct device *dsa_dev,
int sw_addr, void **priv); struct device *host_dev, int sw_addr,
void **priv);
int (*setup)(struct dsa_switch *ds); int (*setup)(struct dsa_switch *ds);
int (*set_addr)(struct dsa_switch *ds, u8 *addr); int (*set_addr)(struct dsa_switch *ds, u8 *addr);
u32 (*get_phy_flags)(struct dsa_switch *ds, int port); u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
......
...@@ -52,11 +52,11 @@ EXPORT_SYMBOL_GPL(unregister_switch_driver); ...@@ -52,11 +52,11 @@ EXPORT_SYMBOL_GPL(unregister_switch_driver);
static struct dsa_switch_driver * static struct dsa_switch_driver *
dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr, dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
char **_name, void **priv) const char **_name, void **priv)
{ {
struct dsa_switch_driver *ret; struct dsa_switch_driver *ret;
struct list_head *list; struct list_head *list;
char *name; const char *name;
ret = NULL; ret = NULL;
name = NULL; name = NULL;
...@@ -383,7 +383,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, ...@@ -383,7 +383,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
struct dsa_switch_driver *drv; struct dsa_switch_driver *drv;
struct dsa_switch *ds; struct dsa_switch *ds;
int ret; int ret;
char *name; const char *name;
void *priv; void *priv;
/* /*
......
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