diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-07-15 13:05:25 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-07-15 13:05:25 +0000 |
commit | e561b185219b92d916cb5c9b764911d752a0573b (patch) | |
tree | de5932ba9a1743cde267da0b4052cf3afdf77efb /target/linux/generic/files/drivers | |
parent | 534480d3fb27fd5f376570defe29df04ae5bb6a1 (diff) | |
download | upstream-e561b185219b92d916cb5c9b764911d752a0573b.tar.gz upstream-e561b185219b92d916cb5c9b764911d752a0573b.tar.bz2 upstream-e561b185219b92d916cb5c9b764911d752a0573b.zip |
generic: rtl8366: add common rtl8366_sw_{get,set}_port_pvid functions
SVN-Revision: 22197
Diffstat (limited to 'target/linux/generic/files/drivers')
4 files changed, 21 insertions, 28 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c index c7e03901db..b1f455696a 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -741,6 +741,20 @@ static void rtl8366_smi_mii_cleanup(struct rtl8366_smi *smi) mdiobus_free(smi->mii_bus); } +int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val) +{ + struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); + return rtl8366_get_pvid(smi, port, val); +} +EXPORT_SYMBOL_GPL(rtl8366_sw_get_port_pvid); + +int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val) +{ + struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); + return rtl8366_set_pvid(smi, port, val); +} +EXPORT_SYMBOL_GPL(rtl8366_sw_set_port_pvid); + struct rtl8366_smi *rtl8366_smi_alloc(struct device *parent) { struct rtl8366_smi *smi; 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 86517c97ce..f9008f9fcc 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h @@ -110,4 +110,7 @@ static inline struct rtl8366_smi *sw_to_rtl8366_smi(struct switch_dev *sw) return container_of(sw, struct rtl8366_smi, sw_dev); } +int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val); +int rtl8366_sw_set_port_pvid(struct switch_dev *dev, int port, int val); + #endif /* _RTL8366_SMI_H */ diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c index 984f3861f7..f71f4f2b5b 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366rb.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366rb.c @@ -875,18 +875,6 @@ static int rtl8366rb_sw_set_vlan_ports(struct switch_dev *dev, return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0); } -static int rtl8366rb_sw_get_port_pvid(struct switch_dev *dev, int port, int *val) -{ - struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); - return rtl8366_get_pvid(smi, port, val); -} - -static int rtl8366rb_sw_set_port_pvid(struct switch_dev *dev, int port, int val) -{ - struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); - return rtl8366_set_pvid(smi, port, val); -} - static int rtl8366rb_sw_reset_switch(struct switch_dev *dev) { struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); @@ -998,8 +986,8 @@ static struct switch_dev rtl8366_switch_dev = { .get_vlan_ports = rtl8366rb_sw_get_vlan_ports, .set_vlan_ports = rtl8366rb_sw_set_vlan_ports, - .get_port_pvid = rtl8366rb_sw_get_port_pvid, - .set_port_pvid = rtl8366rb_sw_set_port_pvid, + .get_port_pvid = rtl8366_sw_get_port_pvid, + .set_port_pvid = rtl8366_sw_set_port_pvid, .reset_switch = rtl8366rb_sw_reset_switch, }; diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 34fd188595..7ed6c5fc1c 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -902,18 +902,6 @@ static int rtl8366s_sw_set_vlan_ports(struct switch_dev *dev, return rtl8366_set_vlan(smi, val->port_vlan, member, untag, 0); } -static int rtl8366s_sw_get_port_pvid(struct switch_dev *dev, int port, int *val) -{ - struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); - return rtl8366_get_pvid(smi, port, val); -} - -static int rtl8366s_sw_set_port_pvid(struct switch_dev *dev, int port, int val) -{ - struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); - return rtl8366_set_pvid(smi, port, val); -} - static int rtl8366s_sw_reset_switch(struct switch_dev *dev) { struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev); @@ -1025,8 +1013,8 @@ static struct switch_dev rtl8366_switch_dev = { .get_vlan_ports = rtl8366s_sw_get_vlan_ports, .set_vlan_ports = rtl8366s_sw_set_vlan_ports, - .get_port_pvid = rtl8366s_sw_get_port_pvid, - .set_port_pvid = rtl8366s_sw_set_port_pvid, + .get_port_pvid = rtl8366_sw_get_port_pvid, + .set_port_pvid = rtl8366_sw_set_port_pvid, .reset_switch = rtl8366s_sw_reset_switch, }; |