summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-03-15 22:53:49 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-16 01:34:13 +0300
commit0f3da6afeef1f63c7254965253f7e6535dc7910c (patch)
treef5a40b417d8295bc496b39a30acda78e11c09736 /include
parente893de1ba1d39e78750ffadf7191aef8133c8fe8 (diff)
downloadlinux-0f3da6afeef1f63c7254965253f7e6535dc7910c.tar.xz
net: dsa: check out-of-range ageing time value
If a DSA switch driver cannot program an ageing time value due to it being out-of-range, switchdev will raise a stack trace before failing. To fix this, add ageing_time_min and ageing_time_max members to the dsa_switch in order for the switch drivers to optionally specify their supported ageing time limits. The DSA core will now check for provided ageing time limits and return -ERANGE from the switchdev prepare phase if the value is out-of-range. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/dsa.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index bf0e42c2a6f7..e42897fd7a96 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -233,6 +233,10 @@ struct dsa_switch {
u32 phys_mii_mask;
struct mii_bus *slave_mii_bus;
+ /* Ageing Time limits in msecs */
+ unsigned int ageing_time_min;
+ unsigned int ageing_time_max;
+
/* Dynamically allocated ports, keep last */
size_t num_ports;
struct dsa_port ports[];