generic: ar8216: add setup_port field to ar8xxx_chip

SVN-Revision: 30999
This commit is contained in:
Gabor Juhos 2012-03-18 22:06:19 +00:00
parent eb5f0067b6
commit 006b3b846e

View file

@ -40,6 +40,8 @@ struct ar8216_priv;
struct ar8xxx_chip { struct ar8xxx_chip {
int (*hw_init)(struct ar8216_priv *priv); int (*hw_init)(struct ar8216_priv *priv);
void (*setup_port)(struct ar8216_priv *priv, int port, u32 egress,
u32 ingress, u32 members, u32 pvid);
}; };
struct ar8216_priv { struct ar8216_priv {
@ -590,12 +592,8 @@ ar8216_hw_apply(struct switch_dev *dev)
ingress = AR8216_IN_PORT_ONLY; ingress = AR8216_IN_PORT_ONLY;
} }
if (priv->chip_type == AR8236) priv->chip->setup_port(priv, i, egress, ingress, portmask[i],
ar8236_setup_port(priv, i, egress, ingress, portmask[i], pvid);
pvid);
else
ar8216_setup_port(priv, i, egress, ingress, portmask[i],
pvid);
} }
mutex_unlock(&priv->reg_mutex); mutex_unlock(&priv->reg_mutex);
return 0; return 0;
@ -745,14 +743,17 @@ ar8216_init_port(struct ar8216_priv *priv, int port)
static const struct ar8xxx_chip ar8216_chip = { static const struct ar8xxx_chip ar8216_chip = {
.hw_init = ar8216_hw_init, .hw_init = ar8216_hw_init,
.setup_port = ar8216_setup_port,
}; };
static const struct ar8xxx_chip ar8236_chip = { static const struct ar8xxx_chip ar8236_chip = {
.hw_init = ar8236_hw_init, .hw_init = ar8236_hw_init,
.setup_port = ar8236_setup_port,
}; };
static const struct ar8xxx_chip ar8316_chip = { static const struct ar8xxx_chip ar8316_chip = {
.hw_init = ar8316_hw_init, .hw_init = ar8316_hw_init,
.setup_port = ar8216_setup_port,
}; };
static int static int