diff --git a/home/nipa/nipa_out/904749/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/904749/ynl/new-code/ethtool-user.c index 92fe355323b2..4ddb7059a99e 100644 --- a/home/nipa/nipa_out/904749/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/904749/ynl/new-code/ethtool-user.c @@ -61,6 +61,7 @@ static const char * const ethtool_op_strmap[] = { [44] = "module-fw-flash-ntf", [ETHTOOL_MSG_PHY_GET] = "phy-get", [46] = "phy-ntf", + [47] = "pse-ntf", }; const char *ethtool_op_str(int op) @@ -730,6 +731,12 @@ const struct ynl_policy_attr ethtool_pse_policy[ETHTOOL_A_PSE_MAX + 1] = { [ETHTOOL_A_C33_PSE_EXT_SUBSTATE] = { .name = "c33-pse-ext-substate", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT] = { .name = "c33-pse-avail-pw-limit", .type = YNL_PT_U32, }, [ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES] = { .name = "c33-pse-pw-limit-ranges", .type = YNL_PT_NEST, .nest = ðtool_c33_pse_pw_limit_nest, }, + [ETHTOOL_A_PSE_ID] = { .name = "pse-id", .type = YNL_PT_U32, }, + [ETHTOOL_A_PSE_PW_D_ID] = { .name = "pse-pw-d-id", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PRIO_SUPP_MODES] = { .name = "c33-pse-prio-supp-modes", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PRIO_MODE] = { .name = "c33-pse-prio-mode", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PRIO_MAX] = { .name = "c33-pse-prio-max", .type = YNL_PT_U32, }, + [ETHTOOL_A_C33_PSE_PRIO] = { .name = "c33-pse-prio", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ethtool_pse_nest = { @@ -819,6 +826,16 @@ const struct ynl_policy_nest ethtool_phy_nest = { .table = ethtool_phy_policy, }; +const struct ynl_policy_attr ethtool_pse_ntf_policy[ETHTOOL_A_PSE_NTF_MAX + 1] = { + [ETHTOOL_A_PSE_NTF_HEADER] = { .name = "header", .type = YNL_PT_NEST, .nest = ðtool_header_nest, }, + [ETHTOOL_A_C33_PSE_NTF_EVENTS] = { .name = "c33-pse-ntf-events", .type = YNL_PT_NEST, .nest = ðtool_bitset_nest, }, +}; + +const struct ynl_policy_nest ethtool_pse_ntf_nest = { + .max_attr = ETHTOOL_A_PSE_NTF_MAX, + .table = ethtool_pse_ntf_policy, +}; + /* Common nested types */ void ethtool_header_free(struct ethtool_header *obj) { @@ -5929,6 +5946,36 @@ int ethtool_pse_get_rsp_parse(const struct nlmsghdr *nlh, dst->c33_pse_avail_pw_limit = ynl_attr_get_u32(attr); } else if (type == ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES) { n_c33_pse_pw_limit_ranges++; + } else if (type == ETHTOOL_A_PSE_ID) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.pse_id = 1; + dst->pse_id = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_PSE_PW_D_ID) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.pse_pw_d_id = 1; + dst->pse_pw_d_id = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PRIO_SUPP_MODES) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_prio_supp_modes = 1; + dst->c33_pse_prio_supp_modes = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PRIO_MODE) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_prio_mode = 1; + dst->c33_pse_prio_mode = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PRIO_MAX) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_prio_max = 1; + dst->c33_pse_prio_max = ynl_attr_get_u32(attr); + } else if (type == ETHTOOL_A_C33_PSE_PRIO) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_prio = 1; + dst->c33_pse_prio = ynl_attr_get_u32(attr); } } @@ -6062,6 +6109,8 @@ 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_avail_pw_limit) ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT, req->c33_pse_avail_pw_limit); + if (req->_present.c33_pse_prio) + ynl_attr_put_u32(nlh, ETHTOOL_A_C33_PSE_PRIO, req->c33_pse_prio); err = ynl_exec(ys, nlh, &yrs); if (err < 0) @@ -7230,6 +7279,51 @@ void ethtool_module_fw_flash_ntf_free(struct ethtool_module_fw_flash_ntf *rsp) free(rsp); } +/* ETHTOOL_MSG_PSE_NTF - event */ +int ethtool_pse_ntf_rsp_parse(const struct nlmsghdr *nlh, + struct ynl_parse_arg *yarg) +{ + struct ethtool_pse_ntf_rsp *dst; + const struct nlattr *attr; + struct ynl_parse_arg parg; + + dst = yarg->data; + parg.ys = yarg->ys; + + ynl_attr_for_each(attr, nlh, yarg->ys->family->hdr_len) { + unsigned int type = ynl_attr_type(attr); + + if (type == ETHTOOL_A_PSE_NTF_HEADER) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.header = 1; + + parg.rsp_policy = ðtool_header_nest; + parg.data = &dst->header; + if (ethtool_header_parse(&parg, attr)) + return YNL_PARSE_CB_ERROR; + } else if (type == ETHTOOL_A_C33_PSE_NTF_EVENTS) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.c33_pse_ntf_events = 1; + + parg.rsp_policy = ðtool_bitset_nest; + parg.data = &dst->c33_pse_ntf_events; + if (ethtool_bitset_parse(&parg, attr)) + return YNL_PARSE_CB_ERROR; + } + } + + return YNL_PARSE_CB_OK; +} + +void ethtool_pse_ntf_free(struct ethtool_pse_ntf *rsp) +{ + ethtool_header_free(&rsp->obj.header); + ethtool_bitset_free(&rsp->obj.c33_pse_ntf_events); + free(rsp); +} + static const struct ynl_ntf_info ethtool_ntf_info[] = { [ETHTOOL_MSG_LINKINFO_NTF] = { .alloc_sz = sizeof(struct ethtool_linkinfo_get_ntf), @@ -7345,6 +7439,12 @@ static const struct ynl_ntf_info ethtool_ntf_info[] = { .policy = ðtool_phy_nest, .free = (void *)ethtool_phy_get_ntf_free, }, + [ETHTOOL_MSG_PSE_NTF] = { + .alloc_sz = sizeof(struct ethtool_pse_ntf), + .cb = ethtool_pse_ntf_rsp_parse, + .policy = ðtool_pse_ntf_nest, + .free = (void *)ethtool_pse_ntf_free, + }, }; const struct ynl_family ynl_ethtool_family = { diff --git a/home/nipa/nipa_out/904749/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/904749/ynl/new-code/ethtool-user.h index bde5d7750368..fa08c459191e 100644 --- a/home/nipa/nipa_out/904749/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/904749/ynl/new-code/ethtool-user.h @@ -5440,6 +5440,12 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_ext_state:1; __u32 c33_pse_ext_substate:1; __u32 c33_pse_avail_pw_limit:1; + __u32 pse_id:1; + __u32 pse_pw_d_id:1; + __u32 c33_pse_prio_supp_modes:1; + __u32 c33_pse_prio_mode:1; + __u32 c33_pse_prio_max:1; + __u32 c33_pse_prio:1; } _present; struct ethtool_header header; @@ -5456,6 +5462,12 @@ struct ethtool_pse_get_rsp { __u32 c33_pse_avail_pw_limit; unsigned int n_c33_pse_pw_limit_ranges; struct ethtool_c33_pse_pw_limit *c33_pse_pw_limit_ranges; + __u32 pse_id; + __u32 pse_pw_d_id; + __u32 c33_pse_prio_supp_modes; + __u32 c33_pse_prio_mode; + __u32 c33_pse_prio_max; + __u32 c33_pse_prio; }; void ethtool_pse_get_rsp_free(struct ethtool_pse_get_rsp *rsp); @@ -5536,12 +5548,14 @@ struct ethtool_pse_set_req { __u32 podl_pse_admin_control:1; __u32 c33_pse_admin_control:1; __u32 c33_pse_avail_pw_limit:1; + __u32 c33_pse_prio:1; } _present; struct ethtool_header header; __u32 podl_pse_admin_control; __u32 c33_pse_admin_control; __u32 c33_pse_avail_pw_limit; + __u32 c33_pse_prio; }; static inline struct ethtool_pse_set_req *ethtool_pse_set_req_alloc(void) @@ -5606,6 +5620,13 @@ ethtool_pse_set_req_set_c33_pse_avail_pw_limit(struct ethtool_pse_set_req *req, req->_present.c33_pse_avail_pw_limit = 1; req->c33_pse_avail_pw_limit = c33_pse_avail_pw_limit; } +static inline void +ethtool_pse_set_req_set_c33_pse_prio(struct ethtool_pse_set_req *req, + __u32 c33_pse_prio) +{ + req->_present.c33_pse_prio = 1; + req->c33_pse_prio = c33_pse_prio; +} /* * Set Power Sourcing Equipment params. @@ -6779,4 +6800,25 @@ struct ethtool_module_fw_flash_ntf { void ethtool_module_fw_flash_ntf_free(struct ethtool_module_fw_flash_ntf *rsp); +/* ETHTOOL_MSG_PSE_NTF - event */ +struct ethtool_pse_ntf_rsp { + struct { + __u32 header:1; + __u32 c33_pse_ntf_events:1; + } _present; + + struct ethtool_header header; + struct ethtool_bitset c33_pse_ntf_events; +}; + +struct ethtool_pse_ntf { + __u16 family; + __u8 cmd; + struct ynl_ntf_base_type *next; + void (*free)(struct ethtool_pse_ntf *ntf); + struct ethtool_pse_ntf_rsp obj __attribute__((aligned(8))); +}; + +void ethtool_pse_ntf_free(struct ethtool_pse_ntf *rsp); + #endif /* _LINUX_ETHTOOL_GEN_H */