1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

linux: rtl836x: add a generic reset_switch function

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31536 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2012-04-29 18:29:31 +00:00
parent 5df734f0bc
commit 1cfcccb5b0
5 changed files with 29 additions and 76 deletions

View File

@@ -933,6 +933,31 @@ static void rtl8366_smi_mii_cleanup(struct rtl8366_smi *smi)
mdiobus_free(smi->mii_bus);
}
int rtl8366_sw_reset_switch(struct switch_dev *dev)
{
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
int err;
err = smi->ops->reset_chip(smi);
if (err)
return err;
err = smi->ops->setup(smi);
if (err)
return err;
err = rtl8366_reset_vlan(smi);
if (err)
return err;
err = rtl8366_enable_vlan(smi, 1);
if (err)
return err;
return rtl8366_enable_all_ports(smi, 1);
}
EXPORT_SYMBOL_GPL(rtl8366_sw_reset_switch);
int rtl8366_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
{
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);