netlink: specs: ethtool: define header-flags as an enum
authorJakub Kicinski <kuba@kernel.org>
Sat, 6 Apr 2024 05:22:38 +0000 (22:22 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Apr 2024 05:26:30 +0000 (22:26 -0700)
Recent changes added header flags to the spec.
Use an enum instead of defines for more seamless codegen.

[Jakub: drop the already applied parts and rewrite message]

Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Link: https://lore.kernel.org/r/20240403212931.128541-6-rrameshbabu@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/netlink/specs/ethtool.yaml
include/uapi/linux/ethtool_netlink.h

index b76916394ec93f4265a66b1ebf89671cccb041e7..87ae7b3979844a4d9e16658c0cd67af11619ca56 100644 (file)
@@ -18,7 +18,6 @@ definitions:
     entries: []
   -
     name: header-flags
-    enum-name:
     type: flags
     entries: [ compact-bitsets, omit-reply, stats ]
 
index 708272026d803d225167037fc2960a065520fed1..e06a34cded78206bc864fc7f79e04a352880a76f 100644 (file)
@@ -117,12 +117,11 @@ enum {
 
 /* request header */
 
-/* use compact bitsets in reply */
-#define ETHTOOL_FLAG_COMPACT_BITSETS   (1 << 0)
-/* provide optional reply for SET or ACT requests */
-#define ETHTOOL_FLAG_OMIT_REPLY        (1 << 1)
-/* request statistics, if supported by the driver */
-#define ETHTOOL_FLAG_STATS             (1 << 2)
+enum ethtool_header_flags {
+       ETHTOOL_FLAG_COMPACT_BITSETS    = 1 << 0,       /* use compact bitsets in reply */
+       ETHTOOL_FLAG_OMIT_REPLY         = 1 << 1,       /* provide optional reply for SET or ACT requests */
+       ETHTOOL_FLAG_STATS              = 1 << 2,       /* request statistics, if supported by the driver */
+};
 
 #define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
                          ETHTOOL_FLAG_OMIT_REPLY | \