- }
-}
-
-/* Initializes 'netdev' as a instance of the netdev_dev.
- *
- * This function adds 'netdev' to a netdev-owned linked list, so it is very
- * important that 'netdev' only be freed after calling netdev_close(). */
-void
-netdev_init(struct netdev *netdev, struct netdev_dev *netdev_dev)
-{
- memset(netdev, 0, sizeof *netdev);
- netdev->netdev_dev = netdev_dev;
- list_push_back(&netdev_list, &netdev->node);
-}
-
-/* Undoes the results of initialization.
- *
- * Normally this function only needs to be called from netdev_close().
- * However, it may be called by providers due to an error on opening
- * that occurs after initialization. It this case netdev_close() would
- * never be called. */
-void
-netdev_uninit(struct netdev *netdev, bool close)
-{
- /* Restore flags that we changed, if any. */
- int error = restore_flags(netdev);
- list_remove(&netdev->node);
- if (error) {
- VLOG_WARN("failed to restore network device flags on %s: %s",
- netdev_get_name(netdev), strerror(error));
- }
-
- if (close) {
- netdev_get_dev(netdev)->netdev_class->close(netdev);
- }
-}
-
-
-/* Returns the class type of 'netdev'.
- *
- * The caller must not free the returned value. */
-const char *
-netdev_get_type(const struct netdev *netdev)
-{
- return netdev_get_dev(netdev)->netdev_class->type;
-}