From: Gabor Juhos Date: Thu, 15 Jul 2010 13:05:29 +0000 (+0000) Subject: generic: rtl8366: make rtl8366_{g,s}et_pvid static X-Git-Tag: reboot~19408 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e110321fce65b665a56d59e2673b80e09fdfe560;p=openwrt%2Fstaging%2Fchunkeey.git generic: rtl8366: make rtl8366_{g,s}et_pvid static SVN-Revision: 22198 --- 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 b1f455696a..a596c311c1 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -349,45 +349,7 @@ int rtl8366_set_vlan(struct rtl8366_smi *smi, int vid, u32 member, u32 untag, } EXPORT_SYMBOL_GPL(rtl8366_set_vlan); -int rtl8366_reset_vlan(struct rtl8366_smi *smi) -{ - struct rtl8366_vlan_mc vlanmc; - int err; - int i; - - /* clear VLAN member configurations */ - vlanmc.vid = 0; - vlanmc.priority = 0; - vlanmc.member = 0; - vlanmc.untag = 0; - vlanmc.fid = 0; - for (i = 0; i < smi->num_vlan_mc; i++) { - err = smi->ops->set_vlan_mc(smi, i, &vlanmc); - if (err) - return err; - } - - for (i = 0; i < smi->num_ports; i++) { - if (i == smi->cpu_port) - continue; - - err = rtl8366_set_vlan(smi, (i + 1), - (1 << i) | (1 << smi->cpu_port), - (1 << i) | (1 << smi->cpu_port), - 0); - if (err) - return err; - - err = rtl8366_set_pvid(smi, i, (i + 1)); - if (err) - return err; - } - - return 0; -} -EXPORT_SYMBOL_GPL(rtl8366_reset_vlan); - -int rtl8366_get_pvid(struct rtl8366_smi *smi, int port, int *val) +static int rtl8366_get_pvid(struct rtl8366_smi *smi, int port, int *val) { struct rtl8366_vlan_mc vlanmc; int err; @@ -404,9 +366,9 @@ int rtl8366_get_pvid(struct rtl8366_smi *smi, int port, int *val) *val = vlanmc.vid; return 0; } -EXPORT_SYMBOL_GPL(rtl8366_get_pvid); -int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, unsigned vid) +static int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, + unsigned vid) { struct rtl8366_vlan_mc vlanmc; struct rtl8366_vlan_4k vlan4k; @@ -486,7 +448,44 @@ int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, unsigned vid) return -ENOSPC; } -EXPORT_SYMBOL_GPL(rtl8366_set_pvid); + +int rtl8366_reset_vlan(struct rtl8366_smi *smi) +{ + struct rtl8366_vlan_mc vlanmc; + int err; + int i; + + /* clear VLAN member configurations */ + vlanmc.vid = 0; + vlanmc.priority = 0; + vlanmc.member = 0; + vlanmc.untag = 0; + vlanmc.fid = 0; + for (i = 0; i < smi->num_vlan_mc; i++) { + err = smi->ops->set_vlan_mc(smi, i, &vlanmc); + if (err) + return err; + } + + for (i = 0; i < smi->num_ports; i++) { + if (i == smi->cpu_port) + continue; + + err = rtl8366_set_vlan(smi, (i + 1), + (1 << i) | (1 << smi->cpu_port), + (1 << i) | (1 << smi->cpu_port), + 0); + if (err) + return err; + + err = rtl8366_set_pvid(smi, i, (i + 1)); + if (err) + return err; + } + + return 0; +} +EXPORT_SYMBOL_GPL(rtl8366_reset_vlan); #ifdef CONFIG_RTL8366S_PHY_DEBUG_FS int rtl8366_debugfs_open(struct inode *inode, struct file *file) 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 f9008f9fcc..d27d94768e 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.h @@ -98,8 +98,6 @@ int rtl8366_smi_rmwr(struct rtl8366_smi *smi, u32 addr, u32 mask, u32 data); int rtl8366_set_vlan(struct rtl8366_smi *smi, int vid, u32 member, u32 untag, u32 fid); int rtl8366_reset_vlan(struct rtl8366_smi *smi); -int rtl8366_get_pvid(struct rtl8366_smi *smi, int port, int *val); -int rtl8366_set_pvid(struct rtl8366_smi *smi, unsigned port, unsigned vid); #ifdef CONFIG_RTL8366S_PHY_DEBUG_FS int rtl8366_debugfs_open(struct inode *inode, struct file *file);