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()
393 * the variable name and variable data is 1024 bytes. in efivar_init()
409 * same variable name on multiple calls to in efivar_init()
412 * we'll ever see a different variable name, in efivar_init()
429 err = -EOPNOTSUPP; in efivar_init()
451 * efivar_entry_add - add entry to variable list
452 * @entry: entry to add to list
457 int efivar_entry_add(struct efivar_entry *entry, struct list_head *head) in efivar_entry_add() argument
464 list_add(&entry->list, head); in efivar_entry_add()
471 * __efivar_entry_add - add entry to variable list
472 * @entry: entry to add to list
475 void __efivar_entry_add(struct efivar_entry *entry, struct list_head *head) in __efivar_entry_add() argument
477 list_add(&entry->list, head); in __efivar_entry_add()
481 * efivar_entry_remove - remove entry from variable list
482 * @entry: entry to remove from list
486 void efivar_entry_remove(struct efivar_entry *entry) in efivar_entry_remove() argument
488 list_del(&entry->list); in efivar_entry_remove()
492 * efivar_entry_list_del_unlock - remove entry from variable list
493 * @entry: entry to remove
495 * Remove @entry from the variable list and release the list lock.
497 * NOTE: slightly weird locking semantics here - we expect to be
502 static void efivar_entry_list_del_unlock(struct efivar_entry *entry) in efivar_entry_list_del_unlock() argument
504 list_del(&entry->list); in efivar_entry_list_del_unlock()
509 * efivar_entry_delete - delete variable and remove entry from list
510 * @entry: entry containing variable to delete
512 * Delete the variable from the firmware and remove @entry from the
513 * variable list. It is the caller's responsibility to free @entry
516 * Returns 0 on success, -EINTR if we can't grab the semaphore,
519 int efivar_entry_delete(struct efivar_entry *entry) in efivar_entry_delete() argument
528 status = efivar_set_variable_locked(entry->var.VariableName, in efivar_entry_delete()
529 &entry->var.VendorGuid, in efivar_entry_delete()
536 efivar_entry_list_del_unlock(entry); in efivar_entry_delete()
541 * efivar_entry_size - obtain the size of a variable
542 * @entry: entry for this variable
545 int efivar_entry_size(struct efivar_entry *entry, unsigned long *size) in efivar_entry_size() argument
556 status = efivar_get_variable(entry->var.VariableName, in efivar_entry_size()
557 &entry->var.VendorGuid, NULL, size, NULL); in efivar_entry_size()
567 * __efivar_entry_get - call get_variable()
568 * @entry: read data for this variable
577 int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in __efivar_entry_get() argument
582 status = efivar_get_variable(entry->var.VariableName, in __efivar_entry_get()
583 &entry->var.VendorGuid, in __efivar_entry_get()
590 * efivar_entry_get - call get_variable()
591 * @entry: read data for this variable
596 int efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in efivar_entry_get() argument
604 err = __efivar_entry_get(entry, attributes, size, data); in efivar_entry_get()
611 * efivar_entry_set_get_size - call set_variable() and get new size (atomic)
612 * @entry: entry containing variable to set and get
620 * Atomically call set_variable() for @entry and if the call is
624 * Returns 0 on success, -EINVAL if the variable data is invalid,
625 * -ENOSPC if the firmware does not have enough available space, or a
630 * (EFI_NOT_FOUND), @entry is removed from the variable list.
632 int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes, in efivar_entry_set_get_size() argument
635 efi_char16_t *name = entry->var.VariableName; in efivar_entry_set_get_size() local
636 efi_guid_t *vendor = &entry->var.VendorGuid; in efivar_entry_set_get_size()
642 if (efivar_validate(*vendor, name, data, *size) == false) in efivar_entry_set_get_size()
643 return -EINVAL; in efivar_entry_set_get_size()
654 status = efivar_set_variable_locked(name, vendor, attributes, *size, in efivar_entry_set_get_size()
670 status = efivar_get_variable(entry->var.VariableName, in efivar_entry_set_get_size()
671 &entry->var.VendorGuid, in efivar_entry_set_get_size()
675 efivar_entry_list_del_unlock(entry); in efivar_entry_set_get_size()
691 * efivar_entry_iter - iterate over variable list
694 * @data: function-specific data to pass to callback
697 * entry on the list. It is safe for @func to remove entries in the
701 * - a non-zero return value indicates an error and terminates the loop
702 * - @func is called from atomic context
707 struct efivar_entry *entry, *n; in efivar_entry_iter() local
714 list_for_each_entry_safe(entry, n, head, list) { in efivar_entry_iter()
715 err = func(entry, data); in efivar_entry_iter()