Lines Matching full:descriptor
34 * the interface descriptor). As each is processed we remove it from
45 static void release_manifest_descriptor(struct manifest_desc *descriptor) in release_manifest_descriptor() argument
47 list_del(&descriptor->links); in release_manifest_descriptor()
48 kfree(descriptor); in release_manifest_descriptor()
53 struct manifest_desc *descriptor; in release_manifest_descriptors() local
56 list_for_each_entry_safe(descriptor, next, &intf->manifest_descs, links) in release_manifest_descriptors()
57 release_manifest_descriptor(descriptor); in release_manifest_descriptors()
78 struct manifest_desc *descriptor; in get_next_bundle_desc() local
81 list_for_each_entry_safe(descriptor, next, &intf->manifest_descs, links) in get_next_bundle_desc()
82 if (descriptor->type == GREYBUS_TYPE_BUNDLE) in get_next_bundle_desc()
83 return descriptor; in get_next_bundle_desc()
89 * Validate the given descriptor. Its reported size must fit within
95 * Returns the (non-zero) number of bytes consumed by the descriptor,
102 struct manifest_desc *descriptor; in identify_descriptor() local
114 dev_err(&intf->dev, "descriptor too big (%zu > %zu)\n", in identify_descriptor()
119 /* Descriptor needs to at least have a header */ in identify_descriptor()
141 dev_err(&intf->dev, "invalid descriptor type (%u)\n", in identify_descriptor()
147 dev_err(&intf->dev, "%s descriptor too small (%zu < %zu)\n", in identify_descriptor()
153 /* Descriptor bigger than what we expect */ in identify_descriptor()
155 dev_warn(&intf->dev, "%s descriptor size mismatch (want %zu got %zu)\n", in identify_descriptor()
160 descriptor = kzalloc(sizeof(*descriptor), GFP_KERNEL); in identify_descriptor()
161 if (!descriptor) in identify_descriptor()
164 descriptor->size = desc_size; in identify_descriptor()
165 descriptor->data = (char *)desc + sizeof(*desc_header); in identify_descriptor()
166 descriptor->type = desc_header->type; in identify_descriptor()
167 list_add_tail(&descriptor->links, &intf->manifest_descs); in identify_descriptor()
175 * Find the string descriptor having the given id, validate it, and
183 * descriptor string, or an error-coded pointer on failure.
188 struct manifest_desc *descriptor; in gb_string_get() local
196 list_for_each_entry(descriptor, &intf->manifest_descs, links) { in gb_string_get()
197 if (descriptor->type != GREYBUS_TYPE_STRING) in gb_string_get()
200 desc_string = descriptor->data; in gb_string_get()
217 release_manifest_descriptor(descriptor); in gb_string_get()
291 /* Release the cport descriptor */ in gb_manifest_parse_cports()
329 /* Done with this bundle descriptor */ in gb_manifest_parse_bundles()
409 /* Release the interface descriptor, now that we're done with it */ in gb_manifest_parse_interface()
412 /* An interface must have at least one bundle descriptor */ in gb_manifest_parse_interface()
442 * Next we scan the descriptors, looking for an interface descriptor;
444 * information it contains, and then remove that descriptor (and any
457 struct manifest_desc *descriptor; in gb_manifest_parse() local
463 /* Manifest descriptor list should be empty here */ in gb_manifest_parse()
507 /* There must be a single interface descriptor */ in gb_manifest_parse()
508 list_for_each_entry(descriptor, &intf->manifest_descs, links) { in gb_manifest_parse()
509 if (descriptor->type == GREYBUS_TYPE_INTERFACE) in gb_manifest_parse()
511 interface_desc = descriptor; in gb_manifest_parse()
514 dev_err(&intf->dev, "manifest must have 1 interface descriptor (%u found)\n", in gb_manifest_parse()
520 /* Parse the manifest, starting with the interface descriptor */ in gb_manifest_parse()