diff --git a/home/nipa/nipa_out/862105/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/862105/ynl/new-code/ethtool-user.c index a24a477247db..1ffb0d786dbf 100644 --- a/home/nipa/nipa_out/862105/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/862105/ynl/new-code/ethtool-user.c @@ -104,6 +104,26 @@ const char *ethtool_header_flags_str(enum ethtool_header_flags value) return ethtool_header_flags_strmap[value]; } +static const char * const ethtool_c33_pse_ext_state_strmap[] = { + [0] = "none", + [1] = "ethtool_c33_pse_ext_state_class_num_events", + [2] = "ethtool_c33_pse_ext_state_error_condition", + [3] = "ethtool_c33_pse_ext_state_mr_pse_enable", + [4] = "ethtool_c33_pse_ext_state_option_detect_ted", + [5] = "ethtool_c33_pse_ext_state_option_vport_lim", + [6] = "ethtool_c33_pse_ext_state_ovld_detected", + [7] = "ethtool_c33_pse_ext_state_pd_dll_power_type", + [8] = "ethtool_c33_pse_ext_state_power_not_available", + [9] = "ethtool_c33_pse_ext_state_short_detected", +}; + +const char *ethtool_c33_pse_ext_state_str(int value) +{ + if (value < 0 || value >= (int)YNL_ARRAY_SIZE(ethtool_c33_pse_ext_state_strmap)) + return NULL; + return ethtool_c33_pse_ext_state_strmap[value]; +} + /* Policies */ const struct ynl_policy_attr ethtool_header_policy[ETHTOOL_A_HEADER_MAX + 1] = { [ETHTOOL_A_HEADER_DEV_INDEX] = { .name = "dev-index", .type = YNL_PT_U32, }, @@ -638,6 +658,11 @@ const struct ynl_policy_attr ethtool_pse_policy[ETHTOOL_A_PSE_MAX + 1] = { [ETHTOOL_A_C33_PSE_ADMIN_STATE] = { .name = "c33-pse-admin-state", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_ADMIN_CONTROL] = { .name = "c33-pse-admin-control", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_PW_D_STATUS] = { .name = "c33-pse-pw-d-status", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PW_CLASS] = { .name = "c33-pse-pw-class", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_ACTUAL_PW] = { .name = "c33-pse-actual-pw", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_EXT_STATE] = { .name = "c33-pse-ext-state", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_EXT_SUBSTATE] = { .name = "c33-pse-ext-substate", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PW_LIMIT] = { .name = "c33-pse-pw-limit", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ethtool_pse_nest = { @@ -5553,6 +5578,31 @@ int ethtool_pse_get_rsp_parse(const struct nlmsghdr *nlh, return YNL_PARSE_CB_ERROR; dst->_present.c33_pse_pw_d_status = 1; dst->c33_pse_pw_d_status = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PW_CLASS) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_pw_class = 1; + dst->c33_pse_pw_class = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_ACTUAL_PW) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_actual_pw = 1; + dst->c33_pse_actual_pw = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_EXT_STATE) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_ext_state = 1; + dst->c33_pse_ext_state = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_EXT_SUBSTATE) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_ext_substate = 1; + dst->c33_pse_ext_substate = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PW_LIMIT) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_pw_limit = 1; + dst->c33_pse_pw_limit = ynl_attr_get_u32(attr); } } @@ -5672,6 +5722,16 @@ int ethtool_pse_set(struct ynl_sock *ys, struct ethtool_pse_set_req *req) ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ADMIN_CONTROL, req->c33_pse_admin_control); if (req->_present.c33_pse_pw_d_status) ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_D_STATUS, req->c33_pse_pw_d_status); + if (req->_present.c33_pse_pw_class) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_CLASS, req->c33_pse_pw_class); + if (req->_present.c33_pse_actual_pw) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_ACTUAL_PW, req->c33_pse_actual_pw); + if (req->_present.c33_pse_ext_state) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_EXT_STATE, req->c33_pse_ext_state); + if (req->_present.c33_pse_ext_substate) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_EXT_SUBSTATE, req->c33_pse_ext_substate); + if (req->_present.c33_pse_pw_limit) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PW_LIMIT, req->c33_pse_pw_limit); err = ynl_exec(ys, nlh, &yrs); if (err < 0) diff --git a/home/nipa/nipa_out/862105/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/862105/ynl/new-code/ethtool-user.h index 20088a1862bf..3e4d4031c334 100644 --- a/home/nipa/nipa_out/862105/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/862105/ynl/new-code/ethtool-user.h @@ -21,6 +21,7 @@ const char *ethtool_op_str(int op); 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); +const char *ethtool_c33_pse_ext_state_str(int value); /* Common nested types */ struct ethtool_header { @@ -4694,6 +4695,11 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_admin_state:1; __u32 c33_pse_admin_control:1; __u32 c33_pse_pw_d_status:1; + __u32 c33_pse_pw_class:1; + __u32 c33_pse_actual_pw:1; + __u32 c33_pse_ext_state:1; + __u32 c33_pse_ext_substate:1; + __u32 c33_pse_pw_limit:1; } _present; struct ethtool_header header; @@ -4703,6 +4709,11 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_admin_state; __u32 c33_pse_admin_control; __u32 c33_pse_pw_d_status; + __u32 c33_pse_pw_class; + __u32 c33_pse_actual_pw; + int c33_pse_ext_state; + __u32 c33_pse_ext_substate; + __u32 c33_pse_pw_limit; }; void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp); @@ -4778,6 +4789,11 @@ struct ethtool_pse_set_req { __u32 c33_pse_admin_state:1; __u32 c33_pse_admin_control:1; __u32 c33_pse_pw_d_status:1; + __u32 c33_pse_pw_class:1; + __u32 c33_pse_actual_pw:1; + __u32 c33_pse_ext_state:1; + __u32 c33_pse_ext_substate:1; + __u32 c33_pse_pw_limit:1; } _present; struct ethtool_header header; @@ -4787,6 +4803,11 @@ struct ethtool_pse_set_req { __u32 c33_pse_admin_state; __u32 c33_pse_admin_control; __u32 c33_pse_pw_d_status; + __u32 c33_pse_pw_class; + __u32 c33_pse_actual_pw; + int c33_pse_ext_state; + __u32 c33_pse_ext_substate; + __u32 c33_pse_pw_limit; }; static inline struct ethtool_pse_set_req *ethtool_pse_set_req_alloc(void) @@ -4864,6 +4885,41 @@ ethtool_pse_set_req_set_c33_pse_pw_d_status(struct ethtool_pse_set_req *req, req->_present.c33_pse_pw_d_status = 1; req->c33_pse_pw_d_status = c33_pse_pw_d_status; } +static inline void +ethtool_pse_set_req_set_c33_pse_pw_class(struct ethtool_pse_set_req *req, + __u32 c33_pse_pw_class) +{ + req->_present.c33_pse_pw_class = 1; + req->c33_pse_pw_class = c33_pse_pw_class; +} +static inline void +ethtool_pse_set_req_set_c33_pse_actual_pw(struct ethtool_pse_set_req *req, + __u32 c33_pse_actual_pw) +{ + req->_present.c33_pse_actual_pw = 1; + req->c33_pse_actual_pw = c33_pse_actual_pw; +} +static inline void +ethtool_pse_set_req_set_c33_pse_ext_state(struct ethtool_pse_set_req *req, + int c33_pse_ext_state) +{ + req->_present.c33_pse_ext_state = 1; + req->c33_pse_ext_state = c33_pse_ext_state; +} +static inline void +ethtool_pse_set_req_set_c33_pse_ext_substate(struct ethtool_pse_set_req *req, + __u32 c33_pse_ext_substate) +{ + req->_present.c33_pse_ext_substate = 1; + req->c33_pse_ext_substate = c33_pse_ext_substate; +} +static inline void +ethtool_pse_set_req_set_c33_pse_pw_limit(struct ethtool_pse_set_req *req, + __u32 c33_pse_pw_limit) +{ + req->_present.c33_pse_pw_limit = 1; + req->c33_pse_pw_limit = c33_pse_pw_limit; +} /* * Set Power Sourcing Equipment params.