+out:
+ netdev_dev->cache_valid |= VALID_FEATURES;
+ netdev_dev->get_features_error = error;
+}
+
+/* Stores the features supported by 'netdev' into each of '*current',
+ * '*advertised', '*supported', and '*peer' that are non-null. Each value is a
+ * bitmap of NETDEV_* bits. Returns 0 if successful, otherwise a positive
+ * errno value. */
+static int
+netdev_linux_get_features(const struct netdev *netdev_,
+ enum netdev_features *current,
+ enum netdev_features *advertised,
+ enum netdev_features *supported,
+ enum netdev_features *peer)
+{
+ struct netdev_dev_linux *netdev_dev =
+ netdev_dev_linux_cast(netdev_get_dev(netdev_));
+
+ netdev_linux_read_features(netdev_dev);
+
+ if (!netdev_dev->get_features_error) {
+ *current = netdev_dev->current;
+ *advertised = netdev_dev->advertised;
+ *supported = netdev_dev->supported;
+ *peer = netdev_dev->peer;
+ }
+ return netdev_dev->get_features_error;