generic: rtl8366: make rtl8366_{g,s}et_pvid static

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22198 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Gabor Juhos 2010-07-15 13:05:29 +00:00
parent 66dcd51b3e
commit 941938939e
2 changed files with 41 additions and 44 deletions

View File

@ -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)

View File

@ -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);