summaryrefslogtreecommitdiff
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-10-19 08:28:15 -0700
committerDavid S. Miller <davem@davemloft.net>2023-10-20 12:47:33 +0100
commit20c6e05bd33deaa6fa890252d7ffc5ad54a0942c (patch)
tree3644eb3caabcb054f2c09fb390a1b03b8282780c /include/linux/ethtool.h
parentb4a11b2033b7d3dfdd46592f7036a775b18cecd1 (diff)
ethtool: untangle the linkmode and ethtool headers
Commit 26c5334d344d ("ethtool: Add forced speed to supported link modes maps") added a dependency between ethtool.h and linkmode.h. The dependency in the opposite direction already exists so the new code was inserted in an awkward place. The reason for ethtool.h to include linkmode.h, is that ethtool_forced_speed_maps_init() is a static inline helper. That's not really necessary. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Paul Greenwalt <paul.greenwalt@intel.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 8e91e8b8a693..226a36ed5aa1 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -13,7 +13,6 @@
#ifndef _LINUX_ETHTOOL_H
#define _LINUX_ETHTOOL_H
-#include <linux/linkmode.h>
#include <linux/bitmap.h>
#include <linux/compat.h>
#include <linux/if_ether.h>
@@ -1070,23 +1069,6 @@ struct ethtool_forced_speed_map {
.arr_size = ARRAY_SIZE(prefix##_##value), \
}
-/**
- * ethtool_forced_speed_maps_init
- * @maps: Pointer to an array of Ethtool forced speed map
- * @size: Array size
- *
- * Initialize an array of Ethtool forced speed map to Ethtool link modes. This
- * should be called during driver module init.
- */
-static inline void
-ethtool_forced_speed_maps_init(struct ethtool_forced_speed_map *maps, u32 size)
-{
- for (u32 i = 0; i < size; i++) {
- struct ethtool_forced_speed_map *map = &maps[i];
-
- linkmode_set_bit_array(map->cap_arr, map->arr_size, map->caps);
- map->cap_arr = NULL;
- map->arr_size = 0;
- }
-}
+void
+ethtool_forced_speed_maps_init(struct ethtool_forced_speed_map *maps, u32 size);
#endif /* _LINUX_ETHTOOL_H */