@@ -907,7 +907,7 @@ const struct ynl_policy_attr ethtool_tsconfig_policy[ETHTOOL_A_TSCONFIG_MAX + 1]
907907 [ETHTOOL_A_TSCONFIG_HWTSTAMP_PROVIDER ] = { .name = "hwtstamp-provider" , .type = YNL_PT_NEST , .nest = & ethtool_ts_hwtstamp_provider_nest , },
908908 [ETHTOOL_A_TSCONFIG_TX_TYPES ] = { .name = "tx-types" , .type = YNL_PT_NEST , .nest = & ethtool_bitset_nest , },
909909 [ETHTOOL_A_TSCONFIG_RX_FILTERS ] = { .name = "rx-filters" , .type = YNL_PT_NEST , .nest = & ethtool_bitset_nest , },
910- [ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS ] = { .name = "hwtstamp-flags" , .type = YNL_PT_U32 , },
910+ [ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS ] = { .name = "hwtstamp-flags" , .type = YNL_PT_NEST , . nest = & ethtool_bitset_nest , },
911911};
912912
913913const struct ynl_policy_nest ethtool_tsconfig_nest = {
@@ -1530,9 +1530,10 @@ int ethtool_profile_put(struct nlmsghdr *nlh, unsigned int attr_type,
15301530 struct ethtool_profile * obj )
15311531{
15321532 struct nlattr * nest ;
1533+ unsigned int i ;
15331534
15341535 nest = ynl_attr_nest_start (nlh , attr_type );
1535- for (unsigned int i = 0 ; i < obj -> n_irq_moderation ; i ++ )
1536+ for (i = 0 ; i < obj -> n_irq_moderation ; i ++ )
15361537 ethtool_irq_moderation_put (nlh , ETHTOOL_A_PROFILE_IRQ_MODERATION , & obj -> irq_moderation [i ]);
15371538 ynl_attr_nest_end (nlh , nest );
15381539
@@ -1634,9 +1635,10 @@ int ethtool_bitset_bits_put(struct nlmsghdr *nlh, unsigned int attr_type,
16341635 struct ethtool_bitset_bits * obj )
16351636{
16361637 struct nlattr * nest ;
1638+ unsigned int i ;
16371639
16381640 nest = ynl_attr_nest_start (nlh , attr_type );
1639- for (unsigned int i = 0 ; i < obj -> n_bit ; i ++ )
1641+ for (i = 0 ; i < obj -> n_bit ; i ++ )
16401642 ethtool_bitset_bit_put (nlh , ETHTOOL_A_BITSET_BITS_BIT , & obj -> bit [i ]);
16411643 ynl_attr_nest_end (nlh , nest );
16421644
@@ -1696,9 +1698,10 @@ int ethtool_strings_put(struct nlmsghdr *nlh, unsigned int attr_type,
16961698 struct ethtool_strings * obj )
16971699{
16981700 struct nlattr * nest ;
1701+ unsigned int i ;
16991702
17001703 nest = ynl_attr_nest_start (nlh , attr_type );
1701- for (unsigned int i = 0 ; i < obj -> n_string ; i ++ )
1704+ for (i = 0 ; i < obj -> n_string ; i ++ )
17021705 ethtool_string_put (nlh , ETHTOOL_A_STRINGS_STRING , & obj -> string [i ]);
17031706 ynl_attr_nest_end (nlh , nest );
17041707
@@ -1842,13 +1845,14 @@ int ethtool_stringset_put(struct nlmsghdr *nlh, unsigned int attr_type,
18421845 struct ethtool_stringset_ * obj )
18431846{
18441847 struct nlattr * nest ;
1848+ unsigned int i ;
18451849
18461850 nest = ynl_attr_nest_start (nlh , attr_type );
18471851 if (obj -> _present .id )
18481852 ynl_attr_put_u32 (nlh , ETHTOOL_A_STRINGSET_ID , obj -> id );
18491853 if (obj -> _present .count )
18501854 ynl_attr_put_u32 (nlh , ETHTOOL_A_STRINGSET_COUNT , obj -> count );
1851- for (unsigned int i = 0 ; i < obj -> n_strings ; i ++ )
1855+ for (i = 0 ; i < obj -> n_strings ; i ++ )
18521856 ethtool_strings_put (nlh , ETHTOOL_A_STRINGSET_STRINGS , & obj -> strings [i ]);
18531857 ynl_attr_nest_end (nlh , nest );
18541858
@@ -1982,9 +1986,10 @@ int ethtool_stringsets_put(struct nlmsghdr *nlh, unsigned int attr_type,
19821986 struct ethtool_stringsets * obj )
19831987{
19841988 struct nlattr * nest ;
1989+ unsigned int i ;
19851990
19861991 nest = ynl_attr_nest_start (nlh , attr_type );
1987- for (unsigned int i = 0 ; i < obj -> n_stringset ; i ++ )
1992+ for (i = 0 ; i < obj -> n_stringset ; i ++ )
19881993 ethtool_stringset_put (nlh , ETHTOOL_A_STRINGSETS_STRINGSET , & obj -> stringset [i ]);
19891994 ynl_attr_nest_end (nlh , nest );
19901995
@@ -7270,6 +7275,7 @@ void ethtool_tsconfig_get_rsp_free(struct ethtool_tsconfig_get_rsp *rsp)
72707275 ethtool_ts_hwtstamp_provider_free (& rsp -> hwtstamp_provider );
72717276 ethtool_bitset_free (& rsp -> tx_types );
72727277 ethtool_bitset_free (& rsp -> rx_filters );
7278+ ethtool_bitset_free (& rsp -> hwtstamp_flags );
72737279 free (rsp );
72747280}
72757281
@@ -7326,7 +7332,11 @@ int ethtool_tsconfig_get_rsp_parse(const struct nlmsghdr *nlh,
73267332 if (ynl_attr_validate (yarg , attr ))
73277333 return YNL_PARSE_CB_ERROR ;
73287334 dst -> _present .hwtstamp_flags = 1 ;
7329- dst -> hwtstamp_flags = ynl_attr_get_u32 (attr );
7335+
7336+ parg .rsp_policy = & ethtool_bitset_nest ;
7337+ parg .data = & dst -> hwtstamp_flags ;
7338+ if (ethtool_bitset_parse (& parg , attr ))
7339+ return YNL_PARSE_CB_ERROR ;
73307340 }
73317341 }
73327342
@@ -7384,6 +7394,7 @@ void ethtool_tsconfig_get_list_free(struct ethtool_tsconfig_get_list *rsp)
73847394 ethtool_ts_hwtstamp_provider_free (& rsp -> obj .hwtstamp_provider );
73857395 ethtool_bitset_free (& rsp -> obj .tx_types );
73867396 ethtool_bitset_free (& rsp -> obj .rx_filters );
7397+ ethtool_bitset_free (& rsp -> obj .hwtstamp_flags );
73877398 free (rsp );
73887399 }
73897400}
@@ -7428,6 +7439,7 @@ void ethtool_tsconfig_set_req_free(struct ethtool_tsconfig_set_req *req)
74287439 ethtool_ts_hwtstamp_provider_free (& req -> hwtstamp_provider );
74297440 ethtool_bitset_free (& req -> tx_types );
74307441 ethtool_bitset_free (& req -> rx_filters );
7442+ ethtool_bitset_free (& req -> hwtstamp_flags );
74317443 free (req );
74327444}
74337445
@@ -7437,6 +7449,7 @@ void ethtool_tsconfig_set_rsp_free(struct ethtool_tsconfig_set_rsp *rsp)
74377449 ethtool_ts_hwtstamp_provider_free (& rsp -> hwtstamp_provider );
74387450 ethtool_bitset_free (& rsp -> tx_types );
74397451 ethtool_bitset_free (& rsp -> rx_filters );
7452+ ethtool_bitset_free (& rsp -> hwtstamp_flags );
74407453 free (rsp );
74417454}
74427455
@@ -7493,7 +7506,11 @@ int ethtool_tsconfig_set_rsp_parse(const struct nlmsghdr *nlh,
74937506 if (ynl_attr_validate (yarg , attr ))
74947507 return YNL_PARSE_CB_ERROR ;
74957508 dst -> _present .hwtstamp_flags = 1 ;
7496- dst -> hwtstamp_flags = ynl_attr_get_u32 (attr );
7509+
7510+ parg .rsp_policy = & ethtool_bitset_nest ;
7511+ parg .data = & dst -> hwtstamp_flags ;
7512+ if (ethtool_bitset_parse (& parg , attr ))
7513+ return YNL_PARSE_CB_ERROR ;
74977514 }
74987515 }
74997516
@@ -7521,7 +7538,7 @@ ethtool_tsconfig_set(struct ynl_sock *ys, struct ethtool_tsconfig_set_req *req)
75217538 if (req -> _present .rx_filters )
75227539 ethtool_bitset_put (nlh , ETHTOOL_A_TSCONFIG_RX_FILTERS , & req -> rx_filters );
75237540 if (req -> _present .hwtstamp_flags )
7524- ynl_attr_put_u32 (nlh , ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS , req -> hwtstamp_flags );
7541+ ethtool_bitset_put (nlh , ETHTOOL_A_TSCONFIG_HWTSTAMP_FLAGS , & req -> hwtstamp_flags );
75257542
75267543 rsp = calloc (1 , sizeof (* rsp ));
75277544 yrs .yarg .data = rsp ;
0 commit comments