@@ -841,8 +841,11 @@ def new_attr(self, elem, value):
841841 t = TypeBitfield32 (self .family , self , elem , value )
842842 elif elem ['type' ] == 'nest' :
843843 t = TypeNest (self .family , self , elem , value )
844- elif elem ['type' ] == 'array-nest' :
845- t = TypeArrayNest (self .family , self , elem , value )
844+ elif elem ['type' ] == 'indexed-array' and 'sub-type' in elem :
845+ if elem ["sub-type" ] == 'nest' :
846+ t = TypeArrayNest (self .family , self , elem , value )
847+ else :
848+ raise Exception (f'new_attr: unsupported sub-type { elem ["sub-type" ]} ' )
846849 elif elem ['type' ] == 'nest-type-value' :
847850 t = TypeNestTypeValue (self .family , self , elem , value )
848851 else :
@@ -1055,7 +1058,7 @@ def _load_nested_sets(self):
10551058 if nested in self .root_sets :
10561059 raise Exception ("Inheriting members to a space used as root not supported" )
10571060 inherit .update (set (spec ['type-value' ]))
1058- elif spec ['type' ] == 'array-nest ' :
1061+ elif spec ['type' ] == 'indexed-array ' :
10591062 inherit .add ('idx' )
10601063 self .pure_nested_structs [nested ].set_inherited (inherit )
10611064
@@ -1619,9 +1622,12 @@ def _multi_parse(ri, struct, init_lines, local_vars):
16191622 multi_attrs = set ()
16201623 needs_parg = False
16211624 for arg , aspec in struct .member_list ():
1622- if aspec ['type' ] == 'array-nest' :
1623- local_vars .append (f'const struct nlattr *attr_{ aspec .c_name } ;' )
1624- array_nests .add (arg )
1625+ if aspec ['type' ] == 'indexed-array' and 'sub-type' in aspec :
1626+ if aspec ["sub-type" ] == 'nest' :
1627+ local_vars .append (f'const struct nlattr *attr_{ aspec .c_name } ;' )
1628+ array_nests .add (arg )
1629+ else :
1630+ raise Exception (f'Not supported sub-type { aspec ["sub-type" ]} ' )
16251631 if 'multi-attr' in aspec :
16261632 multi_attrs .add (arg )
16271633 needs_parg |= 'nested-attributes' in aspec
0 commit comments