netdev: Take responsibility for polling MII registers.
[sliver-openvswitch.git] / lib / netdev-provider.h
index c6ebd2a..23de420 100644 (file)
@@ -210,7 +210,8 @@ struct netdev_class {
      * transmission through this interface.  This function may be set to null
      * if it would always return EOPNOTSUPP anyhow.  (This will prevent the
      * network device from being usefully used by the netdev-based "userspace
-     * datapath".) */
+     * datapath".  It will also prevent the OVS implementation of bonding from
+     * working properly over 'netdev'.) */
     int (*send)(struct netdev *netdev, const void *buffer, size_t size);
 
     /* Registers with the poll loop to wake up from the next call to
@@ -262,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'.
      *
@@ -543,7 +548,8 @@ struct netdev_class {
      *
      * This function may be set to null if it would always return EOPNOTSUPP
      * anyhow. */
-    int (*arp_lookup)(const struct netdev *netdev, uint32_t ip, uint8_t mac[6]);
+    int (*arp_lookup)(const struct netdev *netdev, ovs_be32 ip,
+                      uint8_t mac[6]);
 
     /* Retrieves the current set of flags on 'netdev' into '*old_flags'.
      * Then, turns off the flags that are set to 1 in 'off' and turns on the