Lines Matching refs:family
45 def __init__(self, family, attr_set, attr, value): argument
46 super().__init__(family, attr_set, attr, value)
61 if self.nested_attrs == family.name:
66 if self.nested_attrs in self.family.consts:
83 elif value in self.family.consts:
297 def __init__(self, family, attr_set, attr, value): argument
298 super().__init__(family, attr_set, attr, value)
305 enum = self.family.consts[self.attr['enum']]
337 self.is_bitfield = self.family.consts[self.attr['enum']]['type'] == 'flags'
342 self.type_name = self.family.consts[self.attr['enum']].user_type
351 enum = self.family.consts[self.attr['enum']]
354 flags = self.family.consts[self.checks['flags-mask']]
509 enum = self.family.consts[self.attr['enum']]
526 return self.family.pure_nested_structs[self.nested_attrs].recursive
559 for _, attr in ri.family.pure_nested_structs[self.nested_attrs].member_list():
566 def __init__(self, family, attr_set, attr, value, base_type): argument
567 super().__init__(family, attr_set, attr, value)
686 def __init__(self, family, space_name, type_list=None, inherited=None): argument
687 self.family = family
689 self.attr_set = family.attr_sets[space_name]
695 if family.name == c_lower(space_name):
696 self.render_name = c_lower(family.ident_name)
698 self.render_name = c_lower(family.ident_name + '-' + space_name)
700 if self.nested and space_name in family.consts:
763 def __init__(self, family, yaml): argument
764 self.render_name = c_lower(family.ident_name + '-' + yaml['name'])
782 super().__init__(family, yaml)
798 def __init__(self, family, yaml): argument
799 super().__init__(family, yaml)
804 elif self.name == family.name:
805 pfx = family.ident_name + '-a-'
812 self.name_prefix = family.attr_sets[self.subset_of].name_prefix
813 self.max_name = family.attr_sets[self.subset_of].max_name
814 self.cnt_name = family.attr_sets[self.subset_of].cnt_name
824 if self.c_name == self.family.c_name:
829 t = TypeScalar(self.family, self, elem, value)
831 t = TypeUnused(self.family, self, elem, value)
833 t = TypePad(self.family, self, elem, value)
835 t = TypeFlag(self.family, self, elem, value)
837 t = TypeString(self.family, self, elem, value)
839 t = TypeBinary(self.family, self, elem, value)
841 t = TypeBitfield32(self.family, self, elem, value)
843 t = TypeNest(self.family, self, elem, value)
846 t = TypeArrayNest(self.family, self, elem, value)
850 t = TypeNestTypeValue(self.family, self, elem, value)
855 t = TypeMultiAttr(self.family, self, elem, value, t)
861 def __init__(self, family, yaml, req_value, rsp_value): argument
862 super().__init__(family, yaml, req_value, rsp_value)
864 self.render_name = c_lower(family.ident_name + '_' + self.name)
879 self.enum_name = self.family.op_prefix + c_upper(self.name)
881 self.enum_name = self.family.async_op_prefix + c_upper(self.name)
1151 def __init__(self, cw, family, ku_space, op, op_mode, attr_set=None): argument
1152 self.family = family
1182 if attr_set in family.consts:
1195 self.struct[op_dir] = Struct(family, self.attr_set, type_list=type_list)
1197 … self.struct['reply'] = Struct(family, self.attr_set, type_list=op['event']['attributes'])
1545 def put_op_name_fwd(family, cw): argument
1549 def put_op_name(family, cw): argument
1552 for op_name, op in family.msgs.items():
1556 if family.rsp_by_value[op.rsp_value] != op:
1567 _put_enum_to_str_helper(cw, family.c_name + '_op', map_name, 'op')
1570 def put_enum_to_str_fwd(family, cw, enum): argument
1575 def put_enum_to_str(family, cw, enum): argument
2101 if terminate and ri and policy_should_be_static(struct.family):
2107 if ri and policy_should_be_static(struct.family):
2135 def kernel_can_gen_family_struct(family): argument
2136 return family.proto == 'genetlink'
2139 def policy_should_be_static(family): argument
2140 return family.kernel_policy == 'split' or kernel_can_gen_family_struct(family)
2143 def print_kernel_policy_ranges(family, cw): argument
2145 for _, attr_set in family.attr_sets.items():
2172 def print_kernel_op_table_fwd(family, cw, terminate): argument
2173 exported = not kernel_can_gen_family_struct(family)
2181 struct_type = pol_to_struct[family.kernel_policy]
2185 elif family.kernel_policy == 'split':
2187 for op in family.ops.values():
2193 cnt = len(family.ops)
2206 for name in family.hooks['pre']['do']['list']:
2210 for name in family.hooks['post']['do']['list']:
2214 for name in family.hooks['pre']['dump']['list']:
2217 for name in family.hooks['post']['dump']['list']:
2223 for op_name, op in family.ops.items():
2239 def print_kernel_op_table_hdr(family, cw): argument
2240 print_kernel_op_table_fwd(family, cw, terminate=True)
2243 def print_kernel_op_table(family, cw): argument
2244 print_kernel_op_table_fwd(family, cw, terminate=False)
2245 if family.kernel_policy == 'global' or family.kernel_policy == 'per-op':
2246 for op_name, op in family.ops.items():
2261 if family.kernel_policy == 'per-op':
2262 struct = Struct(family, op['attribute-set'],
2272 elif family.kernel_policy == 'split':
2276 for op_name, op in family.ops.items():
2304 struct = Struct(family, op['attribute-set'],
2323 def print_kernel_mcgrp_hdr(family, cw): argument
2324 if not family.mcgrps['list']:
2328 for grp in family.mcgrps['list']:
2335 def print_kernel_mcgrp_src(family, cw): argument
2336 if not family.mcgrps['list']:
2339 cw.block_start('static const struct genl_multicast_group ' + family.c_name + '_nl_mcgrps[] =')
2340 for grp in family.mcgrps['list']:
2348 def print_kernel_family_struct_hdr(family, cw): argument
2349 if not kernel_can_gen_family_struct(family):
2354 if 'sock-priv' in family.kernel_family:
2360 def print_kernel_family_struct_src(family, cw): argument
2361 if not kernel_can_gen_family_struct(family):
2365 cw.p('.name\t\t= ' + family.fam_key + ',')
2366 cw.p('.version\t= ' + family.ver_key + ',')
2370 if family.kernel_policy == 'per-op':
2373 elif family.kernel_policy == 'split':
2376 if family.mcgrps['list']:
2379 if 'sock-priv' in family.kernel_family:
2387 def uapi_enum_start(family, cw, obj, ckey='', enum_name='enum-name'): argument
2393 start_line = 'enum ' + family.c_name + '_' + c_lower(obj[ckey])
2397 def render_uapi(family, cw): argument
2403 defines = [(family.fam_key, family["name"]),
2404 (family.ver_key, family.get('version', 1))]
2409 for const in family['definitions']:
2417 enum = family.consts[const['name']]
2431 uapi_enum_start(family, cw, const, 'name')
2453 defines.append([c_upper(family.get('c-define-name',
2461 max_by_define = family.get('max-by-define', False)
2463 for _, attr_set in family.attr_sets.items():
2470 uapi_enum_start(family, cw, attr_set.yaml, 'enum-name')
2488 separate_ntf = 'async-prefix' in family['operations']
2490 max_name = c_upper(family.get('cmd-max-name', f"{family.op_prefix}MAX"))
2491 cnt_name = c_upper(family.get('cmd-cnt-name', f"__{family.op_prefix}MAX"))
2494 uapi_enum_start(family, cw, family['operations'], 'enum-name')
2496 for op in family.msgs.values():
2516 uapi_enum_start(family, cw, family['operations'], enum_name='async-enum')
2517 for op in family.msgs.values():
2530 for grp in family.mcgrps['list']:
2551 def render_user_family(family, cw, prototype): argument
2557 if family.ntfs:
2559 for ntf_op_name, ntf_op in family.ntfs.items():
2561 op = family.ops[ntf_op['notify']]
2562 ri = RenderInfo(cw, family, "user", op, "notify")
2564 ri = RenderInfo(cw, family, "user", ntf_op, "event")
2568 for op_name, op in family.ops.items():
2571 ri = RenderInfo(cw, family, "user", op, "event")
2578 if family.fixed_header:
2582 if family.ntfs:
2588 def family_contains_bitfield32(family): argument
2589 for _, attr_set in family.attr_sets.items():