diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-04-28 19:16:17 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-04-28 19:16:17 +0000 |
commit | 8ec2ad91ad317942c48972624312088eaaa79188 (patch) | |
tree | 917d00b889e8154c4c9ec27fdb14f3bd0a3237f5 /target/linux/generic-2.6/files/drivers/net/phy/swconfig.c | |
parent | 2d0ccf7f5e0d98cb621550f88f19f7380fc06728 (diff) | |
download | upstream-8ec2ad91ad317942c48972624312088eaaa79188.tar.gz upstream-8ec2ad91ad317942c48972624312088eaaa79188.tar.bz2 upstream-8ec2ad91ad317942c48972624312088eaaa79188.zip |
swconfig: add a generic switch reset call
SVN-Revision: 15470
Diffstat (limited to 'target/linux/generic-2.6/files/drivers/net/phy/swconfig.c')
-rw-r--r-- | target/linux/generic-2.6/files/drivers/net/phy/swconfig.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c index 8bae667081..7207e46592 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c @@ -133,9 +133,19 @@ swconfig_apply_config(struct switch_dev *dev, const struct switch_attr *attr, st return dev->apply_config(dev); } +static int +swconfig_reset_switch(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) +{ + /* don't complain if not supported by the switch driver */ + if (!dev->reset_switch) + return 0; + + return dev->reset_switch(dev); +} enum global_defaults { GLOBAL_APPLY, + GLOBAL_RESET, }; enum vlan_defaults { @@ -152,6 +162,12 @@ static struct switch_attr default_global[] = { .name = "apply", .description = "Activate changes in the hardware", .set = swconfig_apply_config, + }, + [GLOBAL_RESET] = { + .type = SWITCH_TYPE_NOVAL, + .name = "reset", + .description = "Reset the switch", + .set = swconfig_reset_switch, } }; @@ -190,6 +206,7 @@ static void swconfig_defaults_init(struct switch_dev *dev) /* always present, can be no-op */ set_bit(GLOBAL_APPLY, &dev->def_global); + set_bit(GLOBAL_RESET, &dev->def_global); } |