Lines Matching +full:entry +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0+
39 while (offset <= len - sizeof(*node) && in validate_device_path()
40 node->length >= sizeof(*node) && in validate_device_path()
41 node->length <= len - offset) { in validate_device_path()
42 offset += node->length; in validate_device_path()
44 if ((node->type == EFI_DEV_END_PATH || in validate_device_path()
45 node->type == EFI_DEV_END_PATH2) && in validate_device_path()
46 node->sub_type == EFI_DEV_END_ENTIRE) in validate_device_path()
53 * If we're here then either node->length pointed past the end in validate_device_path()
64 /* An array of 16-bit integers */ in validate_boot_order()
91 /* A valid entry must be at least 8 bytes */ in validate_load_option()
101 desclength = ucs2_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2; in validate_load_option()
103 /* Each boot entry must have a descriptor */ in validate_load_option()
126 /* A single 16-bit integer */ in validate_uint16()
152 char *name; member
165 * Note that it's sorted by {vendor,name}, but globbed names must come after
166 * any other name with the same prefix.
191 * @var_name: an array of @len non-NUL characters.
192 * @match_name: a NUL-terminated pattern string, optionally ending in "*". A
195 * @match: on output, the number of non-wildcard characters in @match_name
217 * We've reached a non-wildcard char in @match_name. in variable_matches()
244 for (i = 0; variable_validate[i].name[0] != '\0'; i++) { in efivar_validate()
245 const char *name = variable_validate[i].name; in efivar_validate() local
251 if (variable_matches(utf8_name, utf8_size+1, name, &match)) { in efivar_validate()
274 for (i = 0; variable_validate[i].name[0] != '\0'; i++) { in efivar_variable_is_removable()
279 variable_validate[i].name, &match)) { in efivar_variable_is_removable()
294 struct efivar_entry *entry, *n; in variable_is_present() local
299 list_for_each_entry_safe(entry, n, head, list) { in variable_is_present()
300 strsize2 = ucs2_strsize(entry->var.VariableName, 1024); in variable_is_present()
302 !memcmp(variable_name, &(entry->var.VariableName), in variable_is_present()
304 !efi_guidcmp(entry->var.VendorGuid, in variable_is_present()
325 * The variable name is, by definition, a NULL-terminated in var_name_strnsize()
330 c = variable_name[(len / sizeof(c)) - 1]; in var_name_strnsize()
355 printk(KERN_WARNING "efivars: duplicate variable: %s-%pUl\n", in dup_variable_bug()
361 * efivar_init - build the initial list of EFI variables
363 * @data: function-specific data to pass to @func
384 return -ENOMEM; in efivar_init()
410 * same variable name on multiple calls to in efivar_init()
413 * we'll ever see a different variable name, in efivar_init()
429 err = -EOPNOTSUPP; in efivar_init()
435 pr_warn("efivars: Variable name size exceeds maximum (%lu > 512)\n", in efivar_init()
455 * efivar_entry_add - add entry to variable list
456 * @entry: entry to add to list
461 int efivar_entry_add(struct efivar_entry *entry, struct list_head *head) in efivar_entry_add() argument
468 list_add(&entry->list, head); in efivar_entry_add()
475 * __efivar_entry_add - add entry to variable list
476 * @entry: entry to add to list
479 void __efivar_entry_add(struct efivar_entry *entry, struct list_head *head) in __efivar_entry_add() argument
481 list_add(&entry->list, head); in __efivar_entry_add()
485 * efivar_entry_remove - remove entry from variable list
486 * @entry: entry to remove from list
490 void efivar_entry_remove(struct efivar_entry *entry) in efivar_entry_remove() argument
492 list_del(&entry->list); in efivar_entry_remove()
496 * efivar_entry_list_del_unlock - remove entry from variable list
497 * @entry: entry to remove
499 * Remove @entry from the variable list and release the list lock.
501 * NOTE: slightly weird locking semantics here - we expect to be
506 static void efivar_entry_list_del_unlock(struct efivar_entry *entry) in efivar_entry_list_del_unlock() argument
508 list_del(&entry->list); in efivar_entry_list_del_unlock()
513 * efivar_entry_delete - delete variable and remove entry from list
514 * @entry: entry containing variable to delete
516 * Delete the variable from the firmware and remove @entry from the
517 * variable list. It is the caller's responsibility to free @entry
520 * Returns 0 on success, -EINTR if we can't grab the semaphore,
523 int efivar_entry_delete(struct efivar_entry *entry) in efivar_entry_delete() argument
532 status = efivar_set_variable_locked(entry->var.VariableName, in efivar_entry_delete()
533 &entry->var.VendorGuid, in efivar_entry_delete()
540 efivar_entry_list_del_unlock(entry); in efivar_entry_delete()
545 * efivar_entry_size - obtain the size of a variable
546 * @entry: entry for this variable
549 int efivar_entry_size(struct efivar_entry *entry, unsigned long *size) in efivar_entry_size() argument
560 status = efivar_get_variable(entry->var.VariableName, in efivar_entry_size()
561 &entry->var.VendorGuid, NULL, size, NULL); in efivar_entry_size()
571 * __efivar_entry_get - call get_variable()
572 * @entry: read data for this variable
581 int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in __efivar_entry_get() argument
586 status = efivar_get_variable(entry->var.VariableName, in __efivar_entry_get()
587 &entry->var.VendorGuid, in __efivar_entry_get()
594 * efivar_entry_get - call get_variable()
595 * @entry: read data for this variable
600 int efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in efivar_entry_get() argument
608 err = __efivar_entry_get(entry, attributes, size, data); in efivar_entry_get()
615 * efivar_entry_set_get_size - call set_variable() and get new size (atomic)
616 * @entry: entry containing variable to set and get
624 * Atomically call set_variable() for @entry and if the call is
628 * Returns 0 on success, -EINVAL if the variable data is invalid,
629 * -ENOSPC if the firmware does not have enough available space, or a
634 * (EFI_NOT_FOUND), @entry is removed from the variable list.
636 int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes, in efivar_entry_set_get_size() argument
639 efi_char16_t *name = entry->var.VariableName; in efivar_entry_set_get_size() local
640 efi_guid_t *vendor = &entry->var.VendorGuid; in efivar_entry_set_get_size()
646 if (efivar_validate(*vendor, name, data, *size) == false) in efivar_entry_set_get_size()
647 return -EINVAL; in efivar_entry_set_get_size()
658 status = efivar_set_variable_locked(name, vendor, attributes, *size, in efivar_entry_set_get_size()
674 status = efivar_get_variable(entry->var.VariableName, in efivar_entry_set_get_size()
675 &entry->var.VendorGuid, in efivar_entry_set_get_size()
679 efivar_entry_list_del_unlock(entry); in efivar_entry_set_get_size()
695 * efivar_entry_iter - iterate over variable list
698 * @data: function-specific data to pass to callback
701 * entry on the list. It is safe for @func to remove entries in the
705 * - a non-zero return value indicates an error and terminates the loop
706 * - @func is called from atomic context
711 struct efivar_entry *entry, *n; in efivar_entry_iter() local
718 list_for_each_entry_safe(entry, n, head, list) { in efivar_entry_iter()
719 err = func(entry, data); in efivar_entry_iter()