aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:30 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:30 +0000
commitd1c585d4b1b2fa3128dd4aa358fbcda84bb217b8 (patch)
treef4e77ae5556207bac9894d4f51c6f5932b234531 /target/linux
parent332310fba2ac3a0651c76877e94028e274e993e0 (diff)
downloadupstream-d1c585d4b1b2fa3128dd4aa358fbcda84bb217b8.tar.gz
upstream-d1c585d4b1b2fa3128dd4aa358fbcda84bb217b8.tar.bz2
upstream-d1c585d4b1b2fa3128dd4aa358fbcda84bb217b8.zip
generic: ar8216: add vtu_load_vlan field to ar8xxx_chip
SVN-Revision: 31002
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 54d57d5499..d514ec724f 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -45,6 +45,7 @@ struct ar8xxx_chip {
u32 ingress, u32 members, u32 pvid);
int (*atu_flush)(struct ar8216_priv *priv);
void (*vtu_flush)(struct ar8216_priv *priv);
+ void (*vtu_load_vlan)(struct ar8216_priv *priv, u32 vid, u32 port_mask);
};
struct ar8216_priv {
@@ -489,6 +490,15 @@ ar8216_vtu_flush(struct ar8216_priv *priv)
ar8216_vtu_op(priv, AR8216_VTU_OP_FLUSH, 0);
}
+static void
+ar8216_vtu_load_vlan(struct ar8216_priv *priv, u32 vid, u32 port_mask)
+{
+ u32 op;
+
+ op = AR8216_VTU_OP_LOAD | (vid << AR8216_VTU_VID_S);
+ ar8216_vtu_op(priv, op, port_mask);
+}
+
static int
ar8216_atu_flush(struct ar8216_priv *priv)
{
@@ -578,10 +588,8 @@ ar8216_hw_apply(struct switch_dev *dev)
portmask[i] |= vp & ~mask;
}
- ar8216_vtu_op(priv,
- AR8216_VTU_OP_LOAD |
- (priv->vlan_id[j] << AR8216_VTU_VID_S),
- priv->vlan_table[j]);
+ priv->chip->vtu_load_vlan(priv, priv->vlan_id[j],
+ priv->vlan_table[j]);
}
} else {
/* vlan disabled:
@@ -768,6 +776,7 @@ static const struct ar8xxx_chip ar8216_chip = {
.setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
+ .vtu_load_vlan = ar8216_vtu_load_vlan,
};
static const struct ar8xxx_chip ar8236_chip = {
@@ -776,6 +785,7 @@ static const struct ar8xxx_chip ar8236_chip = {
.setup_port = ar8236_setup_port,
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
+ .vtu_load_vlan = ar8216_vtu_load_vlan,
};
static const struct ar8xxx_chip ar8316_chip = {
@@ -784,6 +794,7 @@ static const struct ar8xxx_chip ar8316_chip = {
.setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
+ .vtu_load_vlan = ar8216_vtu_load_vlan,
};
static int