static int af_link_ioctl(unsigned long command, const void *arg);
#endif
-static void netdev_bsd_run(void);
+static void netdev_bsd_run(const struct netdev_class *);
static int netdev_bsd_get_mtu(const struct netdev *netdev_, int *mtup);
static bool
* interface status changes, and eventually calls all the user callbacks.
*/
static void
-netdev_bsd_run(void)
+netdev_bsd_run(const struct netdev_class *netdev_class OVS_UNUSED)
{
rtbsd_notifier_run();
}
* be called.
*/
static void
-netdev_bsd_wait(void)
+netdev_bsd_wait(const struct netdev_class *netdev_class OVS_UNUSED)
{
rtbsd_notifier_wait();
}
}
static void
-netdev_dummy_run(void)
+netdev_dummy_run(const struct netdev_class *netdev_class OVS_UNUSED)
{
struct netdev_dummy *dev;
}
static void
-netdev_dummy_wait(void)
+netdev_dummy_wait(const struct netdev_class *netdev_class OVS_UNUSED)
{
struct netdev_dummy *dev;
* changes in the device miimon status, so we can use atomic_count. */
static atomic_count miimon_cnt = ATOMIC_COUNT_INIT(0);
-static void netdev_linux_run(void);
+static void netdev_linux_run(const struct netdev_class *);
static int netdev_linux_do_ethtool(const char *name, struct ethtool_cmd *,
int cmd, const char *cmd_name);
}
static void
-netdev_linux_run(void)
+netdev_linux_run(const struct netdev_class *netdev_class OVS_UNUSED)
{
struct nl_sock *sock;
int error;
}
static void
-netdev_linux_wait(void)
+netdev_linux_wait(const struct netdev_class *netdev_class OVS_UNUSED)
{
struct nl_sock *sock;
int (*init)(void);
/* Performs periodic work needed by netdevs of this class. May be null if
- * no periodic work is necessary. */
- void (*run)(void);
+ * no periodic work is necessary.
+ *
+ * 'netdev_class' points to the class. It is useful in case the same
+ * function is used to implement different classes. */
+ void (*run)(const struct netdev_class *netdev_class);
/* Arranges for poll_block() to wake up if the "run" member function needs
* to be called. Implementations are additionally required to wake
* whenever something changes in any of its netdevs which would cause their
* ->change_seq() function to change its result. May be null if nothing is
- * needed here. */
- void (*wait)(void);
+ * needed here.
+ *
+ * 'netdev_class' points to the class. It is useful in case the same
+ * function is used to implement different classes. */
+ void (*wait)(const struct netdev_class *netdev_class);
/* ## ---------------- ## */
/* ## netdev Functions ## */
}
static void
-netdev_vport_run(void)
+netdev_vport_run(const struct netdev_class *netdev_class OVS_UNUSED)
{
uint64_t seq;
}
static void
-netdev_vport_wait(void)
+netdev_vport_wait(const struct netdev_class *netdev_class OVS_UNUSED)
{
uint64_t seq;
struct netdev_registered_class *rc;
CMAP_FOR_EACH (rc, cmap_node, &netdev_classes) {
if (rc->class->run) {
- rc->class->run();
+ rc->class->run(rc->class);
}
}
}
struct netdev_registered_class *rc;
CMAP_FOR_EACH (rc, cmap_node, &netdev_classes) {
if (rc->class->wait) {
- rc->class->wait();
+ rc->class->wait(rc->class);
}
}
}