diff --git a/tmp/ynl_build-tmp.MGVun8/old-code/ethtool-user.c b/tmp/ynl_build-tmp.MGVun8/new-code/ethtool-user.c index 161544ca083f..2284137b0e92 100644 --- a/tmp/ynl_build-tmp.MGVun8/old-code/ethtool-user.c +++ b/tmp/ynl_build-tmp.MGVun8/new-code/ethtool-user.c @@ -80,6 +80,22 @@ const char *ethtool_op_str(int op) return ethtool_op_strmap[op]; } +static const char * const ethtool_module_loopback_types_strmap[] = { + [0] = "media-side-output", + [1] = "media-side-input", + [2] = "host-side-output", + [3] = "host-side-input", +}; + +const char * +ethtool_module_loopback_types_str(enum ethtool_module_loopback_types value) +{ + value = ffs(value) - 1; + if (value < 0 || value >= (int)YNL_ARRAY_SIZE(ethtool_module_loopback_types_strmap)) + return NULL; + return ethtool_module_loopback_types_strmap[value]; +} + static const char * const ethtool_udp_tunnel_type_strmap[] = { [0] = "vxlan", [1] = "geneve", @@ -930,6 +946,8 @@ const struct ynl_policy_attr ethtool_module_policy[ETHTOOL_A_MODULE_MAX + 1] = { [ETHTOOL_A_MODULE_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, [ETHTOOL_A_MODULE_POWER_MODE_POLICY] = { .name = "power-mode-policy", .type = YNL_PT_U8, }, [ETHTOOL_A_MODULE_POWER_MODE] = { .name = "power-mode", .type = YNL_PT_U8, }, + [ETHTOOL_A_MODULE_LOOPBACK_CAPABILITIES] = { .name = "loopback-capabilities", .type = YNL_PT_UINT, }, + [ETHTOOL_A_MODULE_LOOPBACK_ENABLED] = { .name = "loopback-enabled", .type = YNL_PT_UINT, }, }; const struct ynl_policy_nest ethtool_module_nest = { @@ -6499,6 +6517,16 @@ int ethtool_module_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.power_mode = 1; dst->power_mode = ynl_attr_get_u8(attr); + } else if (type == ETHTOOL_A_MODULE_LOOPBACK_CAPABILITIES) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.loopback_capabilities = 1; + dst->loopback_capabilities = ynl_attr_get_uint(attr); + } else if (type == ETHTOOL_A_MODULE_LOOPBACK_ENABLED) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.loopback_enabled = 1; + dst->loopback_enabled = ynl_attr_get_uint(attr); } } @@ -6621,6 +6649,10 @@ int ethtool_module_set(struct ynl_sock *ys, struct ethtool_module_set_req *req) ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_POWER_MODE_POLICY, req->power_mode_policy); if (req->_present.power_mode) ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_POWER_MODE, req->power_mode); + if (req->_present.loopback_capabilities) + ynl_attr_put_uint(nlh, ETHTOOL_A_MODULE_LOOPBACK_CAPABILITIES, req->loopback_capabilities); + if (req->_present.loopback_enabled) + ynl_attr_put_uint(nlh, ETHTOOL_A_MODULE_LOOPBACK_ENABLED, req->loopback_enabled); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/tmp/ynl_build-tmp.MGVun8/old-code/ethtool-user.h b/tmp/ynl_build-tmp.MGVun8/new-code/ethtool-user.h index 43e10c5f442b..5d88ed29d4fb 100644 --- a/tmp/ynl_build-tmp.MGVun8/old-code/ethtool-user.h +++ b/tmp/ynl_build-tmp.MGVun8/new-code/ethtool-user.h @@ -20,6 +20,8 @@ extern const struct ynl_family ynl_ethtool_family; /* Enums */ const char *ethtool_op_str(int op); +const char * +ethtool_module_loopback_types_str(enum ethtool_module_loopback_types value); const char *ethtool_udp_tunnel_type_str(int value); const char *ethtool_stringset_str(enum ethtool_stringset value); const char *ethtool_header_flags_str(enum ethtool_header_flags value); @@ -5733,11 +5735,15 @@ struct ethtool_module_get_rsp { __u32 header:1; __u32 power_mode_policy:1; __u32 power_mode:1; + __u32 loopback_capabilities:1; + __u32 loopback_enabled:1; } _present; struct ethtool_header header; __u8 power_mode_policy; __u8 power_mode; + __u64 loopback_capabilities; + __u64 loopback_enabled; }; void ethtool_module_get_rsp_free(struct ethtool_module_get_rsp *rsp); @@ -5829,11 +5835,15 @@ struct ethtool_module_set_req { __u32 header:1; __u32 power_mode_policy:1; __u32 power_mode:1; + __u32 loopback_capabilities:1; + __u32 loopback_enabled:1; } _present; struct ethtool_header header; __u8 power_mode_policy; __u8 power_mode; + __u64 loopback_capabilities; + __u64 loopback_enabled; }; static inline struct ethtool_module_set_req *ethtool_module_set_req_alloc(void) @@ -5891,6 +5901,20 @@ ethtool_module_set_req_set_power_mode(struct ethtool_module_set_req *req, req->_present.power_mode = 1; req->power_mode = power_mode; } +static inline void +ethtool_module_set_req_set_loopback_capabilities(struct ethtool_module_set_req *req, + __u64 loopback_capabilities) +{ + req->_present.loopback_capabilities = 1; + req->loopback_capabilities = loopback_capabilities; +} +static inline void +ethtool_module_set_req_set_loopback_enabled(struct ethtool_module_set_req *req, + __u64 loopback_enabled) +{ + req->_present.loopback_enabled = 1; + req->loopback_enabled = loopback_enabled; +} /* * Set module params.