1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-25 08:13:20 +02:00

generic: ar8216: add vtu_flush field to ar8xxx_chip

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31001 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2012-03-18 22:06:26 +00:00
parent d29edcf013
commit 6934b97c4e

View File

@ -44,6 +44,7 @@ struct ar8xxx_chip {
void (*setup_port)(struct ar8216_priv *priv, int port, u32 egress, void (*setup_port)(struct ar8216_priv *priv, int port, u32 egress,
u32 ingress, u32 members, u32 pvid); u32 ingress, u32 members, u32 pvid);
int (*atu_flush)(struct ar8216_priv *priv); int (*atu_flush)(struct ar8216_priv *priv);
void (*vtu_flush)(struct ar8216_priv *priv);
}; };
struct ar8216_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); 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 static int
ar8216_atu_flush(struct ar8216_priv *priv) ar8216_atu_flush(struct ar8216_priv *priv)
{ {
@ -553,7 +560,7 @@ ar8216_hw_apply(struct switch_dev *dev)
mutex_lock(&priv->reg_mutex); mutex_lock(&priv->reg_mutex);
/* flush all vlan translation unit entries */ /* 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)); memset(portmask, 0, sizeof(portmask));
if (!priv->init) { if (!priv->init) {
@ -760,6 +767,7 @@ static const struct ar8xxx_chip ar8216_chip = {
.init_port = ar8216_init_port, .init_port = ar8216_init_port,
.setup_port = ar8216_setup_port, .setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush, .atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
}; };
static const struct ar8xxx_chip ar8236_chip = { static const struct ar8xxx_chip ar8236_chip = {
@ -767,6 +775,7 @@ static const struct ar8xxx_chip ar8236_chip = {
.init_port = ar8216_init_port, .init_port = ar8216_init_port,
.setup_port = ar8236_setup_port, .setup_port = ar8236_setup_port,
.atu_flush = ar8216_atu_flush, .atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
}; };
static const struct ar8xxx_chip ar8316_chip = { static const struct ar8xxx_chip ar8316_chip = {
@ -774,6 +783,7 @@ static const struct ar8xxx_chip ar8316_chip = {
.init_port = ar8216_init_port, .init_port = ar8216_init_port,
.setup_port = ar8216_setup_port, .setup_port = ar8216_setup_port,
.atu_flush = ar8216_atu_flush, .atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
}; };
static int static int