summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-08-18 16:00:34 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-08-18 16:00:34 +0000
commit77d6cd0feb304888311bcab11215f82be7a13d67 (patch)
tree6362688e007890488b91d66ff00f04b83c95a25e /target/linux/generic/files/drivers
parent6855ac23937386d912d20f673a1808d9c20c2015 (diff)
downloadmtk-20170518-77d6cd0feb304888311bcab11215f82be7a13d67.zip
mtk-20170518-77d6cd0feb304888311bcab11215f82be7a13d67.tar.gz
mtk-20170518-77d6cd0feb304888311bcab11215f82be7a13d67.tar.bz2
generic: rtl8366: add enable_vlan{,4k} to smi_ops
SVN-Revision: 22702
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366_smi.h2
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366rb.c10
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366s.c10
3 files changed, 14 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
index 2cd4a8f..1e2ebda 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h
@@ -87,6 +87,8 @@ struct rtl8366_smi_ops {
int (*get_mib_counter)(struct rtl8366_smi *smi, int counter,
int port, unsigned long long *val);
int (*is_vlan_valid)(struct rtl8366_smi *smi, unsigned vlan);
+ int (*enable_vlan)(struct rtl8366_smi *smi, int enable);
+ int (*enable_vlan4k)(struct rtl8366_smi *smi, int enable);
};
struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent);
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
index d442d2f..27ceda1 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c
@@ -560,13 +560,13 @@ static int rtl8366rb_is_vlan_valid(struct rtl8366_smi *smi, unsigned vlan)
return 1;
}
-static int rtl8366rb_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
+static int rtl8366rb_enable_vlan(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR, RTL8366RB_SGCR_EN_VLAN,
(enable) ? RTL8366RB_SGCR_EN_VLAN : 0);
}
-static int rtl8366rb_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
+static int rtl8366rb_enable_vlan4k(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366RB_SGCR,
RTL8366RB_SGCR_EN_VLAN_4KTB,
@@ -644,9 +644,9 @@ static int rtl8366rb_sw_set_vlan_enable(struct switch_dev *dev,
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
if (attr->ofs == 1)
- return rtl8366rb_vlan_set_vlan(smi, val->value.i);
+ return rtl8366rb_enable_vlan(smi, val->value.i);
else
- return rtl8366rb_vlan_set_4ktable(smi, val->value.i);
+ return rtl8366rb_enable_vlan4k(smi, val->value.i);
}
static int rtl8366rb_sw_get_learning_enable(struct switch_dev *dev,
@@ -1028,6 +1028,8 @@ static struct rtl8366_smi_ops rtl8366rb_smi_ops = {
.set_mc_index = rtl8366rb_set_mc_index,
.get_mib_counter = rtl8366rb_get_mib_counter,
.is_vlan_valid = rtl8366rb_is_vlan_valid,
+ .enable_vlan = rtl8366rb_enable_vlan,
+ .enable_vlan4k = rtl8366rb_enable_vlan4k,
};
static int __init rtl8366rb_probe(struct platform_device *pdev)
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
index ad631ef..ab9bcc2 100644
--- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c
+++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c
@@ -579,13 +579,13 @@ static int rtl8366s_set_mc_index(struct rtl8366_smi *smi, int port, int index)
RTL8366S_PORT_VLAN_CTRL_SHIFT(port));
}
-static int rtl8366s_vlan_set_vlan(struct rtl8366_smi *smi, int enable)
+static int rtl8366s_enable_vlan(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366S_SGCR, RTL8366S_SGCR_EN_VLAN,
(enable) ? RTL8366S_SGCR_EN_VLAN : 0);
}
-static int rtl8366s_vlan_set_4ktable(struct rtl8366_smi *smi, int enable)
+static int rtl8366s_enable_vlan4k(struct rtl8366_smi *smi, int enable)
{
return rtl8366_smi_rmwr(smi, RTL8366S_VLAN_TB_CTRL_REG,
1, (enable) ? 1 : 0);
@@ -669,9 +669,9 @@ static int rtl8366s_sw_set_vlan_enable(struct switch_dev *dev,
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
if (attr->ofs == 1)
- return rtl8366s_vlan_set_vlan(smi, val->value.i);
+ return rtl8366s_enable_vlan(smi, val->value.i);
else
- return rtl8366s_vlan_set_4ktable(smi, val->value.i);
+ return rtl8366s_enable_vlan4k(smi, val->value.i);
}
static int rtl8366s_sw_get_learning_enable(struct switch_dev *dev,
@@ -1055,6 +1055,8 @@ static struct rtl8366_smi_ops rtl8366s_smi_ops = {
.set_mc_index = rtl8366s_set_mc_index,
.get_mib_counter = rtl8366_get_mib_counter,
.is_vlan_valid = rtl8366s_is_vlan_valid,
+ .enable_vlan = rtl8366s_enable_vlan,
+ .enable_vlan4k = rtl8366s_enable_vlan4k,
};
static int __init rtl8366s_probe(struct platform_device *pdev)