diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-04-29 18:29:31 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-04-29 18:29:31 +0000 |
commit | 2341f7444dd5bb73c201abfb7ccc27c4afbc0aaf (patch) | |
tree | cb5fdd0c5bab931e5c32765829c0818c9214f4cf /target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | |
parent | bd9308390ccc22454bac9952df6ba7519788e97b (diff) | |
download | upstream-2341f7444dd5bb73c201abfb7ccc27c4afbc0aaf.tar.gz upstream-2341f7444dd5bb73c201abfb7ccc27c4afbc0aaf.tar.bz2 upstream-2341f7444dd5bb73c201abfb7ccc27c4afbc0aaf.zip |
linux: rtl836x: add a generic reset_switch function
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31536 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/rtl8366_smi.c')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366_smi.c | 25 |
1 files changed, 25 insertions, 0 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 434cbfbb85..271e2b513a 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366_smi.c @@ -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); |