diff --git a/home/nipa/nipa_out/959053/ynl/old-code/devlink-user.c b/home/nipa/nipa_out/959053/ynl/new-code/devlink-user.c index 32919a037cec..84123182aff1 100644 --- a/home/nipa/nipa_out/959053/ynl/old-code/devlink-user.c +++ b/home/nipa/nipa_out/959053/ynl/new-code/devlink-user.c @@ -317,6 +317,24 @@ const char *devlink_trap_type_str(enum devlink_trap_type value) return devlink_trap_type_strmap[value]; } +static const char * const devlink_var_attr_type_strmap[] = { + [1] = "u8", + [2] = "u16", + [3] = "u32", + [4] = "u64", + [5] = "string", + [6] = "flag", + [10] = "nul_string", + [11] = "binary", +}; + +const char *devlink_var_attr_type_str(enum devlink_var_attr_type value) +{ + if (value < 0 || value >= (int)YNL_ARRAY_SIZE(devlink_var_attr_type_strmap)) + return NULL; + return devlink_var_attr_type_strmap[value]; +} + /* Policies */ const struct ynl_policy_attr devlink_dl_dpipe_match_policy[DEVLINK_ATTR_MAX + 1] = { [DEVLINK_ATTR_DPIPE_MATCH_TYPE] = { .name = "dpipe-match-type", .type = YNL_PT_U32, }, diff --git a/home/nipa/nipa_out/959053/ynl/old-code/devlink-user.h b/home/nipa/nipa_out/959053/ynl/new-code/devlink-user.h index de00d71329c6..dfdc428de129 100644 --- a/home/nipa/nipa_out/959053/ynl/old-code/devlink-user.h +++ b/home/nipa/nipa_out/959053/ynl/new-code/devlink-user.h @@ -44,6 +44,7 @@ const char *devlink_param_cmode_str(enum devlink_param_cmode value); const char *devlink_flash_overwrite_str(enum devlink_flash_overwrite value); const char *devlink_trap_action_str(enum devlink_trap_action value); const char *devlink_trap_type_str(enum devlink_trap_type value); +const char *devlink_var_attr_type_str(enum devlink_var_attr_type value); /* Common nested types */ struct devlink_dl_dpipe_match { @@ -154,7 +155,7 @@ struct devlink_dl_param { } _present; char *param_name; - __u8 param_type; + enum devlink_var_attr_type param_type; }; struct devlink_dl_region_snapshot { @@ -2693,7 +2694,7 @@ struct devlink_param_set_req { char *bus_name; char *dev_name; char *param_name; - __u8 param_type; + enum devlink_var_attr_type param_type; enum devlink_param_cmode param_value_cmode; }; @@ -2735,7 +2736,7 @@ devlink_param_set_req_set_param_name(struct devlink_param_set_req *req, } static inline void devlink_param_set_req_set_param_type(struct devlink_param_set_req *req, - __u8 param_type) + enum devlink_var_attr_type param_type) { req->_present.param_type = 1; req->param_type = param_type;