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

net: dsa: mv88e6xxx: rename mv88e6xxx_ops

The mv88e6xxx_ops is used to describe how to access the chip registers.
It can be through SMI (via an MDIO bus), or via another interface such
as crafted remote management frames.

The correct BUS operations structure is chosen at runtime, depending on
the chip address and connectivity.

We will need the mv88e6xxx_ops name for future chip-wide operation
structure, thus rename mv88e6xxx_ops to more explicit mv88e6xxx_bus_ops.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4e47c0f
...@@ -98,7 +98,7 @@ static int mv88e6xxx_smi_single_chip_write(struct mv88e6xxx_chip *chip, ...@@ -98,7 +98,7 @@ static int mv88e6xxx_smi_single_chip_write(struct mv88e6xxx_chip *chip,
return 0; return 0;
} }
static const struct mv88e6xxx_ops mv88e6xxx_smi_single_chip_ops = { static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_single_chip_ops = {
.read = mv88e6xxx_smi_single_chip_read, .read = mv88e6xxx_smi_single_chip_read,
.write = mv88e6xxx_smi_single_chip_write, .write = mv88e6xxx_smi_single_chip_write,
}; };
...@@ -180,7 +180,7 @@ static int mv88e6xxx_smi_multi_chip_write(struct mv88e6xxx_chip *chip, ...@@ -180,7 +180,7 @@ static int mv88e6xxx_smi_multi_chip_write(struct mv88e6xxx_chip *chip,
return 0; return 0;
} }
static const struct mv88e6xxx_ops mv88e6xxx_smi_multi_chip_ops = { static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_multi_chip_ops = {
.read = mv88e6xxx_smi_multi_chip_read, .read = mv88e6xxx_smi_multi_chip_read,
.write = mv88e6xxx_smi_multi_chip_write, .write = mv88e6xxx_smi_multi_chip_write,
}; };
...@@ -515,7 +515,7 @@ static int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, int addr, ...@@ -515,7 +515,7 @@ static int mv88e6xxx_phy_ppu_write(struct mv88e6xxx_chip *chip, int addr,
return err; return err;
} }
static const struct mv88e6xxx_ops mv88e6xxx_phy_ppu_ops = { static const struct mv88e6xxx_bus_ops mv88e6xxx_phy_ppu_ops = {
.read = mv88e6xxx_phy_ppu_read, .read = mv88e6xxx_phy_ppu_read,
.write = mv88e6xxx_phy_ppu_write, .write = mv88e6xxx_phy_ppu_write,
}; };
...@@ -3479,12 +3479,12 @@ static struct mv88e6xxx_chip *mv88e6xxx_alloc_chip(struct device *dev) ...@@ -3479,12 +3479,12 @@ static struct mv88e6xxx_chip *mv88e6xxx_alloc_chip(struct device *dev)
return chip; return chip;
} }
static const struct mv88e6xxx_ops mv88e6xxx_g2_smi_phy_ops = { static const struct mv88e6xxx_bus_ops mv88e6xxx_g2_smi_phy_ops = {
.read = mv88e6xxx_g2_smi_phy_read, .read = mv88e6xxx_g2_smi_phy_read,
.write = mv88e6xxx_g2_smi_phy_write, .write = mv88e6xxx_g2_smi_phy_write,
}; };
static const struct mv88e6xxx_ops mv88e6xxx_phy_ops = { static const struct mv88e6xxx_bus_ops mv88e6xxx_phy_ops = {
.read = mv88e6xxx_read, .read = mv88e6xxx_read,
.write = mv88e6xxx_write, .write = mv88e6xxx_write,
}; };
......
...@@ -648,7 +648,7 @@ struct mv88e6xxx_vtu_entry { ...@@ -648,7 +648,7 @@ struct mv88e6xxx_vtu_entry {
u8 data[DSA_MAX_PORTS]; u8 data[DSA_MAX_PORTS];
}; };
struct mv88e6xxx_ops; struct mv88e6xxx_bus_ops;
struct mv88e6xxx_priv_port { struct mv88e6xxx_priv_port {
struct net_device *bridge_dev; struct net_device *bridge_dev;
...@@ -669,14 +669,14 @@ struct mv88e6xxx_chip { ...@@ -669,14 +669,14 @@ struct mv88e6xxx_chip {
/* The MII bus and the address on the bus that is used to /* The MII bus and the address on the bus that is used to
* communication with the switch * communication with the switch
*/ */
const struct mv88e6xxx_ops *smi_ops; const struct mv88e6xxx_bus_ops *smi_ops;
struct mii_bus *bus; struct mii_bus *bus;
int sw_addr; int sw_addr;
/* Handles automatic disabling and re-enabling of the PHY /* Handles automatic disabling and re-enabling of the PHY
* polling unit. * polling unit.
*/ */
const struct mv88e6xxx_ops *phy_ops; const struct mv88e6xxx_bus_ops *phy_ops;
struct mutex ppu_mutex; struct mutex ppu_mutex;
int ppu_disabled; int ppu_disabled;
struct work_struct ppu_work; struct work_struct ppu_work;
...@@ -705,7 +705,7 @@ struct mv88e6xxx_chip { ...@@ -705,7 +705,7 @@ struct mv88e6xxx_chip {
struct mii_bus *mdio_bus; struct mii_bus *mdio_bus;
}; };
struct mv88e6xxx_ops { struct mv88e6xxx_bus_ops {
int (*read)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val); int (*read)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
int (*write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val); int (*write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
}; };
......
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