diff --git a/home/nipa/nipa_out/987108/ynl/old-code/ethtool-user.c b/home/nipa/nipa_out/987108/ynl/new-code/ethtool-user.c index f130f6ffbdf3..81fdea40ced3 100644 --- a/home/nipa/nipa_out/987108/ynl/old-code/ethtool-user.c +++ b/home/nipa/nipa_out/987108/ynl/new-code/ethtool-user.c @@ -5655,31 +5655,6 @@ int ethtool_module_eeprom_get_rsp_parse(const struct nlmsghdr *nlh, parg.data = &dst->header; if (ethtool_header_parse(&parg, attr)) return YNL_PARSE_CB_ERROR; - } else if (type == ETHTOOL_A_MODULE_EEPROM_OFFSET) { - if (ynl_attr_validate(yarg, attr)) - return YNL_PARSE_CB_ERROR; - dst->_present.offset = 1; - dst->offset = ynl_attr_get_u32(attr); - } else if (type == ETHTOOL_A_MODULE_EEPROM_LENGTH) { - if (ynl_attr_validate(yarg, attr)) - return YNL_PARSE_CB_ERROR; - dst->_present.length = 1; - dst->length = ynl_attr_get_u32(attr); - } else if (type == ETHTOOL_A_MODULE_EEPROM_PAGE) { - if (ynl_attr_validate(yarg, attr)) - return YNL_PARSE_CB_ERROR; - dst->_present.page = 1; - dst->page = ynl_attr_get_u8(attr); - } else if (type == ETHTOOL_A_MODULE_EEPROM_BANK) { - if (ynl_attr_validate(yarg, attr)) - return YNL_PARSE_CB_ERROR; - dst->_present.bank = 1; - dst->bank = ynl_attr_get_u8(attr); - } else if (type == ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS) { - if (ynl_attr_validate(yarg, attr)) - return YNL_PARSE_CB_ERROR; - dst->_present.i2c_address = 1; - dst->i2c_address = ynl_attr_get_u8(attr); } else if (type == ETHTOOL_A_MODULE_EEPROM_DATA) { unsigned int len; @@ -5712,6 +5687,16 @@ ethtool_module_eeprom_get(struct ynl_sock *ys, if (req->_present.header) ethtool_header_put(nlh, ETHTOOL_A_MODULE_EEPROM_HEADER, &req->header); + if (req->_present.offset) + ynl_attr_put_u32(nlh, ETHTOOL_A_MODULE_EEPROM_OFFSET, req->offset); + if (req->_present.length) + ynl_attr_put_u32(nlh, ETHTOOL_A_MODULE_EEPROM_LENGTH, req->length); + if (req->_present.page) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_PAGE, req->page); + if (req->_present.bank) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_BANK, req->bank); + if (req->_present.i2c_address) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS, req->i2c_address); rsp = calloc(1, sizeof(*rsp)); yrs.yarg.data = rsp; @@ -5773,6 +5758,16 @@ ethtool_module_eeprom_get_dump(struct ynl_sock *ys, if (req->_present.header) ethtool_header_put(nlh, ETHTOOL_A_MODULE_EEPROM_HEADER, &req->header); + if (req->_present.offset) + ynl_attr_put_u32(nlh, ETHTOOL_A_MODULE_EEPROM_OFFSET, req->offset); + if (req->_present.length) + ynl_attr_put_u32(nlh, ETHTOOL_A_MODULE_EEPROM_LENGTH, req->length); + if (req->_present.page) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_PAGE, req->page); + if (req->_present.bank) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_BANK, req->bank); + if (req->_present.i2c_address) + ynl_attr_put_u8(nlh, ETHTOOL_A_MODULE_EEPROM_I2C_ADDRESS, req->i2c_address); err = ynl_exec_dump(ys, nlh, &yds); if (err < 0) diff --git a/home/nipa/nipa_out/987108/ynl/old-code/ethtool-user.h b/home/nipa/nipa_out/987108/ynl/new-code/ethtool-user.h index 486dcd5f1b78..83c92d76ccd2 100644 --- a/home/nipa/nipa_out/987108/ynl/old-code/ethtool-user.h +++ b/home/nipa/nipa_out/987108/ynl/new-code/ethtool-user.h @@ -5057,9 +5057,19 @@ int ethtool_fec_set(struct ynl_sock *ys, struct ethtool_fec_set_req *req); struct ethtool_module_eeprom_get_req { struct { __u32 header:1; + __u32 offset:1; + __u32 length:1; + __u32 page:1; + __u32 bank:1; + __u32 i2c_address:1; } _present; struct ethtool_header header; + __u32 offset; + __u32 length; + __u8 page; + __u8 bank; + __u8 i2c_address; }; static inline struct ethtool_module_eeprom_get_req * @@ -5105,26 +5115,51 @@ ethtool_module_eeprom_get_req_set_header_phy_index(struct ethtool_module_eeprom_ req->header._present.phy_index = 1; req->header.phy_index = phy_index; } +static inline void +ethtool_module_eeprom_get_req_set_offset(struct ethtool_module_eeprom_get_req *req, + __u32 offset) +{ + req->_present.offset = 1; + req->offset = offset; +} +static inline void +ethtool_module_eeprom_get_req_set_length(struct ethtool_module_eeprom_get_req *req, + __u32 length) +{ + req->_present.length = 1; + req->length = length; +} +static inline void +ethtool_module_eeprom_get_req_set_page(struct ethtool_module_eeprom_get_req *req, + __u8 page) +{ + req->_present.page = 1; + req->page = page; +} +static inline void +ethtool_module_eeprom_get_req_set_bank(struct ethtool_module_eeprom_get_req *req, + __u8 bank) +{ + req->_present.bank = 1; + req->bank = bank; +} +static inline void +ethtool_module_eeprom_get_req_set_i2c_address(struct ethtool_module_eeprom_get_req *req, + __u8 i2c_address) +{ + req->_present.i2c_address = 1; + req->i2c_address = i2c_address; +} struct ethtool_module_eeprom_get_rsp { struct { __u32 header:1; - __u32 offset:1; - __u32 length:1; - __u32 page:1; - __u32 bank:1; - __u32 i2c_address:1; } _present; struct { __u32 data; } _len; struct ethtool_header header; - __u32 offset; - __u32 length; - __u8 page; - __u8 bank; - __u8 i2c_address; void *data; }; @@ -5142,9 +5177,19 @@ ethtool_module_eeprom_get(struct ynl_sock *ys, struct ethtool_module_eeprom_get_req_dump { struct { __u32 header:1; + __u32 offset:1; + __u32 length:1; + __u32 page:1; + __u32 bank:1; + __u32 i2c_address:1; } _present; struct ethtool_header header; + __u32 offset; + __u32 length; + __u8 page; + __u8 bank; + __u8 i2c_address; }; static inline struct ethtool_module_eeprom_get_req_dump * @@ -5190,6 +5235,41 @@ ethtool_module_eeprom_get_req_dump_set_header_phy_index(struct ethtool_module_ee req->header._present.phy_index = 1; req->header.phy_index = phy_index; } +static inline void +ethtool_module_eeprom_get_req_dump_set_offset(struct ethtool_module_eeprom_get_req_dump *req, + __u32 offset) +{ + req->_present.offset = 1; + req->offset = offset; +} +static inline void +ethtool_module_eeprom_get_req_dump_set_length(struct ethtool_module_eeprom_get_req_dump *req, + __u32 length) +{ + req->_present.length = 1; + req->length = length; +} +static inline void +ethtool_module_eeprom_get_req_dump_set_page(struct ethtool_module_eeprom_get_req_dump *req, + __u8 page) +{ + req->_present.page = 1; + req->page = page; +} +static inline void +ethtool_module_eeprom_get_req_dump_set_bank(struct ethtool_module_eeprom_get_req_dump *req, + __u8 bank) +{ + req->_present.bank = 1; + req->bank = bank; +} +static inline void +ethtool_module_eeprom_get_req_dump_set_i2c_address(struct ethtool_module_eeprom_get_req_dump *req, + __u8 i2c_address) +{ + req->_present.i2c_address = 1; + req->i2c_address = i2c_address; +} struct ethtool_module_eeprom_get_list { struct ethtool_module_eeprom_get_list *next;