aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:19 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-18 22:06:19 +0000
commitd52cff00a413baee41f5b08b922ee64bba23da1d (patch)
tree7db36a9165d87ee9363bf671f8b4499379d2f270 /target/linux/generic
parentea9e2d7fb298fcd1e52cac989ca615d8205c16e9 (diff)
downloadmaster-187ad058-d52cff00a413baee41f5b08b922ee64bba23da1d.tar.gz
master-187ad058-d52cff00a413baee41f5b08b922ee64bba23da1d.tar.bz2
master-187ad058-d52cff00a413baee41f5b08b922ee64bba23da1d.zip
generic: ar8216: add setup_port field to ar8xxx_chip
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30999 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 34084517a3..4c64b460ba 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -40,6 +40,8 @@ struct ar8216_priv;
struct ar8xxx_chip {
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 {
@@ -590,12 +592,8 @@ ar8216_hw_apply(struct switch_dev *dev)
ingress = AR8216_IN_PORT_ONLY;
}
- if (priv->chip_type == AR8236)
- ar8236_setup_port(priv, i, egress, ingress, portmask[i],
- pvid);
- else
- ar8216_setup_port(priv, i, egress, ingress, portmask[i],
- pvid);
+ priv->chip->setup_port(priv, i, egress, ingress, portmask[i],
+ pvid);
}
mutex_unlock(&priv->reg_mutex);
return 0;
@@ -745,14 +743,17 @@ ar8216_init_port(struct ar8216_priv *priv, int port)
static const struct ar8xxx_chip ar8216_chip = {
.hw_init = ar8216_hw_init,
+ .setup_port = ar8216_setup_port,
};
static const struct ar8xxx_chip ar8236_chip = {
.hw_init = ar8236_hw_init,
+ .setup_port = ar8236_setup_port,
};
static const struct ar8xxx_chip ar8316_chip = {
.hw_init = ar8316_hw_init,
+ .setup_port = ar8216_setup_port,
};
static int