aboutsummaryrefslogtreecommitdiff
path: root/lib/netdev-provider.h
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-05-16 14:40:03 -0700
committerEthan Jackson <ethan@nicira.com>2011-05-20 12:55:36 -0700
commit1670c579a82921fedd8b2c20818919f6b5a9c330 (patch)
tree08307d089369c7f554cb44e59025ce0f02a318c2 /lib/netdev-provider.h
parentc64540e3fe43a83bbe8687c53fb7fdec95b94195 (diff)
netdev: Take responsibility for polling MII registers.
This patch moves miimon logic from the bond module to netdev-linux. This greatly simplifies the bonding code while adding minimal complexity to netdev-linux. The bonding code is so high level, it really has no business worrying about how precisely slave status is determined.
Diffstat (limited to 'lib/netdev-provider.h')
-rw-r--r--lib/netdev-provider.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h
index 6887e7f9..23de420f 100644
--- a/lib/netdev-provider.h
+++ b/lib/netdev-provider.h
@@ -263,13 +263,17 @@ struct netdev_class {
*/
int (*get_carrier)(const struct netdev *netdev, bool *carrier);
- /* Sets 'miimon' to true if 'netdev' is up according to its MII. If
- * 'netdev' does not support MII, may fall back to another method or return
- * EOPNOTSUPP.
+ /* Forces ->get_carrier() to poll 'netdev''s MII registers for link status
+ * instead of checking 'netdev''s carrier. 'netdev''s MII registers will
+ * be polled once ever 'interval' milliseconds. If 'netdev' does not
+ * support MII, another method may be used as a fallback. If 'interval' is
+ * less than or equal to zero, reverts ->get_carrier() to its normal
+ * behavior.
*
- * This function may be set to null if it would always return EOPNOTSUPP.
+ * Most network devices won't support this feature and will set this
+ * function pointer to NULL, which is equivalent to returning EOPNOTSUPP.
*/
- int (*get_miimon)(const struct netdev *netdev, bool *miimon);
+ int (*set_miimon_interval)(struct netdev *netdev, long long int interval);
/* Retrieves current device stats for 'netdev' into 'stats'.
*