summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:26 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:26 +0000
commit332310fba2ac3a0651c76877e94028e274e993e0 (patch)
treec8273ff8dc371793ab0674446c4d0a08af88c8dd /target/linux/generic/files/drivers
parentd964410cbcac717353fcaec8244e99c8824e1c81 (diff)
downloadmtk-20170518-332310fba2ac3a0651c76877e94028e274e993e0.zip
mtk-20170518-332310fba2ac3a0651c76877e94028e274e993e0.tar.gz
mtk-20170518-332310fba2ac3a0651c76877e94028e274e993e0.tar.bz2
generic: ar8216: add vtu_flush field to ar8xxx_chip
SVN-Revision: 31001
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 485cb52..54d57d5 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -44,6 +44,7 @@ struct ar8xxx_chip {
void (*setup_port)(struct ar8216_priv *priv, int port, u32 egress,
u32 ingress, u32 members, u32 pvid);
int (*atu_flush)(struct ar8216_priv *priv);
+ void (*vtu_flush)(struct ar8216_priv *priv);
};
struct ar8216_priv {
@@ -482,6 +483,12 @@ ar8216_vtu_op(struct ar8216_priv *priv, u32 op, u32 val)
priv->write(priv, AR8216_REG_VTU, op);
}
+static void
+ar8216_vtu_flush(struct ar8216_priv *priv)
+{
+ ar8216_vtu_op(priv, AR8216_VTU_OP_FLUSH, 0);
+}
+
static int
ar8216_atu_flush(struct ar8216_priv *priv)
{
@@ -553,7 +560,7 @@ ar8216_hw_apply(struct switch_dev *dev)
mutex_lock(&priv->reg_mutex);
/* flush all vlan translation unit entries */
- ar8216_vtu_op(priv, AR8216_VTU_OP_FLUSH, 0);
+ priv->chip->vtu_flush(priv);
memset(portmask, 0, sizeof(portmask));
if (!priv->init) {
@@ -760,6 +767,7 @@ static const struct ar8xxx_chip ar8216_chip = {
.init_port = ar8216_init_port,
.setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush,
+ .vtu_flush = ar8216_vtu_flush,
};
static const struct ar8xxx_chip ar8236_chip = {
@@ -767,6 +775,7 @@ static const struct ar8xxx_chip ar8236_chip = {
.init_port = ar8216_init_port,
.setup_port = ar8236_setup_port,
.atu_flush = ar8216_atu_flush,
+ .vtu_flush = ar8216_vtu_flush,
};
static const struct ar8xxx_chip ar8316_chip = {
@@ -774,6 +783,7 @@ static const struct ar8xxx_chip ar8316_chip = {
.init_port = ar8216_init_port,
.setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush,
+ .vtu_flush = ar8216_vtu_flush,
};
static int