Lines Matching +full:c +full:- +full:family +full:- +full:name
1 # SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
26 family back reference to the full family
28 name name of the entity as listed in the spec (optional)
29 ident_name name which can be safely used as identifier in code (optional)
31 def __init__(self, family, yaml): argument
33 self.family = family
35 if 'name' in self.yaml:
36 self.name = self.yaml['name']
37 self.ident_name = self.name.replace('-', '_')
40 family.add_unresolved(self)
74 yaml = {'name': yaml}
75 super().__init__(enum_set.family, yaml)
108 entries entries by name
113 def __init__(self, family, yaml): argument
114 super().__init__(family, yaml)
119 value_start = self.yaml.get('value-start', 0)
124 self.entries[e.name] = e
156 struct_name string, name of struct definition
157 sub_type string, name of sub type
161 sub_message string, name of sub message type
162 selector string, name of attribute used to select
163 sub-message type
165 is_auto_scalar bool, attr is a variable-size scalar
167 def __init__(self, family, attr_set, yaml, value): argument
168 super().__init__(family, yaml)
173 self.is_multi = yaml.get('multi-attr', False)
175 self.sub_type = yaml.get('sub-type')
176 self.byte_order = yaml.get('byte-order')
178 self.display_hint = yaml.get('display-hint')
179 self.sub_message = yaml.get('sub-message')
191 via the dictionary interface Attribute Set exposes attributes by name.
194 attrs ordered dict of all attributes (indexed by name)
198 def __init__(self, family, yaml): argument
199 super().__init__(family, yaml)
201 self.subset_of = self.yaml.get('subset-of', None)
213 self.attrs[attr.name] = attr
217 real_set = family.attr_sets[self.subset_of]
219 attr = real_set[elem['name']]
220 self.attrs[attr.name] = attr
224 return SpecAttr(self.family, self, elem, value)
247 enum string, name of the enum definition
252 def __init__(self, family, yaml): argument
253 super().__init__(family, yaml)
255 self.byte_order = yaml.get('byte-order')
258 self.display_hint = yaml.get('display-hint')
264 Represents a C struct definition.
269 def __init__(self, family, yaml): argument
270 super().__init__(family, yaml)
274 self.members.append(self.new_member(family, member))
276 def new_member(self, family, elem): argument
277 return SpecStructMember(family, elem)
287 """ Netlink sub-message definition
289 Represents a set of sub-message formats for polymorphic nlattrs
290 that contain type-specific sub messages.
293 name string, name of sub-message definition
294 formats dict of sub-message formats indexed by match value
296 def __init__(self, family, yaml): argument
297 super().__init__(family, yaml)
301 format = self.new_format(family, elem)
304 def new_format(self, family, format): argument
305 return SpecSubMessageFormat(family, format)
309 """ Netlink sub-message definition
311 Represents a set of sub-message formats for polymorphic nlattrs
312 that contain type-specific sub messages.
316 fixed_header string, name of fixed header, or None
317 attr_set string, name of attribute set, or None
319 def __init__(self, family, yaml): argument
320 super().__init__(family, yaml)
323 self.fixed_header = yaml.get('fixed-header')
324 self.attr_set = yaml.get('attribute-set')
335 req_value numerical ID when serialized, user -> kernel
336 rsp_value numerical ID when serialized, user <- kernel
340 attr_set attribute set name
341 fixed_header string, optional name of fixed header struct
345 def __init__(self, family, yaml, req_value, rsp_value): argument
346 super().__init__(family, yaml)
355 self.fixed_header = self.yaml.get('fixed-header', family.fixed_header)
364 if 'attribute-set' in self.yaml:
365 attr_set_name = self.yaml['attribute-set']
367 msg = self.family.msgs[self.yaml['notify']]
368 attr_set_name = msg['attribute-set']
372 raise Exception(f"Can't resolve attribute set for op '{self.name}'")
374 self.attr_set = self.family.attr_sets[attr_set_name]
383 netlink-raw schema. Genetlink families use dynamic ID allocation
388 name name of the mulitcast group
389 value integer id of this multicast group for netlink-raw or None
392 def __init__(self, family, yaml): argument
393 super().__init__(family, yaml)
398 """ Netlink Family Spec class.
400 Netlink family information loaded from a spec (e.g. in YAML).
409 msg_id_model enum-model for operations (unified, directional etc.)
413 msgs dict of all messages (index by name)
414 sub_msgs dict of all sub messages (index by name)
418 fixed_header string, optional name of family default fixed header struct
419 mcast_groups dict of all multicast groups (index by name)
423 prefix = '# SPDX-License-Identifier: '
439 self.msg_id_model = self.yaml['operations'].get('enum-model', 'unified')
505 self.fixed_header = self.yaml['operations'].get('fixed-header')
514 self.msgs[op.name] = op
517 self.fixed_header = self.yaml['operations'].get('fixed-header')
549 skip |= bool(exclude.match(elem['name']))
556 self.msgs[op.name] = op
558 def find_operation(self, name): argument
560 For a given operation name, find and return operation spec.
563 if name == op['name']:
573 self.consts[elem['name']] = self.new_enum(elem)
575 self.consts[elem['name']] = self.new_struct(elem)
577 self.consts[elem['name']] = elem
579 for elem in self.yaml['attribute-sets']:
581 self.attr_sets[elem['name']] = attr_set
583 for elem in self.yaml.get('sub-messages', []):
585 self.sub_msgs[sub_message.name] = sub_message
597 if not op.is_async and 'attribute-set' in op:
598 self.ops[op.name] = op
600 self.ntfs[op.name] = op
602 mcgs = self.yaml.get('mcast-groups')
606 self.mcast_groups[elem['name']] = mcg