Lines Matching +full:entry +full:- +full:name
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43 * 2) ->ops calls
64 while (offset <= len - sizeof(*node) && in validate_device_path()
65 node->length >= sizeof(*node) && in validate_device_path()
66 node->length <= len - offset) { in validate_device_path()
67 offset += node->length; in validate_device_path()
69 if ((node->type == EFI_DEV_END_PATH || in validate_device_path()
70 node->type == EFI_DEV_END_PATH2) && in validate_device_path()
71 node->sub_type == EFI_DEV_END_ENTIRE) in validate_device_path()
78 * If we're here then either node->length pointed past the end in validate_device_path()
89 /* An array of 16-bit integers */ in validate_boot_order()
116 /* A valid entry must be at least 8 bytes */ in validate_load_option()
126 desclength = ucs2_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2; in validate_load_option()
128 /* Each boot entry must have a descriptor */ in validate_load_option()
151 /* A single 16-bit integer */ in validate_uint16()
177 char *name; member
190 * Note that it's sorted by {vendor,name}, but globbed names must come after
191 * any other name with the same prefix.
216 * @var_name: an array of @len non-NUL characters.
217 * @match_name: a NUL-terminated pattern string, optionally ending in "*". A
220 * @match: on output, the number of non-wildcard characters in @match_name
242 * We've reached a non-wildcard char in @match_name. in variable_matches()
269 for (i = 0; variable_validate[i].name[0] != '\0'; i++) { in efivar_validate()
270 const char *name = variable_validate[i].name; in efivar_validate() local
276 if (variable_matches(utf8_name, utf8_size+1, name, &match)) { in efivar_validate()
300 for (i = 0; variable_validate[i].name[0] != '\0'; i++) { in efivar_variable_is_removable()
305 variable_validate[i].name, &match)) { in efivar_variable_is_removable()
326 fops = __efivars->ops; in check_var_size()
328 if (!fops->query_variable_store) in check_var_size()
331 return fops->query_variable_store(attributes, size, false); in check_var_size()
342 fops = __efivars->ops; in check_var_size_nonblocking()
344 if (!fops->query_variable_store) in check_var_size_nonblocking()
347 return fops->query_variable_store(attributes, size, true); in check_var_size_nonblocking()
353 struct efivar_entry *entry, *n; in variable_is_present() local
358 list_for_each_entry_safe(entry, n, head, list) { in variable_is_present()
359 strsize2 = ucs2_strsize(entry->var.VariableName, 1024); in variable_is_present()
361 !memcmp(variable_name, &(entry->var.VariableName), in variable_is_present()
363 !efi_guidcmp(entry->var.VendorGuid, in variable_is_present()
384 * The variable name is, by definition, a NULL-terminated in var_name_strnsize()
389 c = variable_name[(len / sizeof(c)) - 1]; in var_name_strnsize()
421 printk(KERN_WARNING "efivars: duplicate variable: %s-%pUl\n", in dup_variable_bug()
427 * efivar_init - build the initial list of EFI variables
429 * @data: function-specific data to pass to @func
430 * @atomic: do we need to execute the @func-loop atomically?
450 return -EFAULT; in efivar_init()
452 ops = __efivars->ops; in efivar_init()
457 return -ENOMEM; in efivar_init()
461 err = -EINTR; in efivar_init()
467 * the variable name and variable data is 1024 bytes. in efivar_init()
473 status = ops->get_next_variable(&variable_name_size, in efivar_init()
486 * same variable name on multiple calls to in efivar_init()
489 * we'll ever see a different variable name, in efivar_init()
507 err = -EINTR; in efivar_init()
533 * efivar_entry_add - add entry to variable list
534 * @entry: entry to add to list
539 int efivar_entry_add(struct efivar_entry *entry, struct list_head *head) in efivar_entry_add() argument
542 return -EINTR; in efivar_entry_add()
543 list_add(&entry->list, head); in efivar_entry_add()
551 * efivar_entry_remove - remove entry from variable list
552 * @entry: entry to remove from list
556 int efivar_entry_remove(struct efivar_entry *entry) in efivar_entry_remove() argument
559 return -EINTR; in efivar_entry_remove()
560 list_del(&entry->list); in efivar_entry_remove()
568 * efivar_entry_list_del_unlock - remove entry from variable list
569 * @entry: entry to remove
571 * Remove @entry from the variable list and release the list lock.
573 * NOTE: slightly weird locking semantics here - we expect to be
578 static void efivar_entry_list_del_unlock(struct efivar_entry *entry) in efivar_entry_list_del_unlock() argument
580 list_del(&entry->list); in efivar_entry_list_del_unlock()
585 * __efivar_entry_delete - delete an EFI variable
586 * @entry: entry containing EFI variable to delete
588 * Delete the variable from the firmware but leave @entry on the
592 * not remove @entry from the variable list. Also, it is safe to be
599 int __efivar_entry_delete(struct efivar_entry *entry) in __efivar_entry_delete() argument
604 return -EINVAL; in __efivar_entry_delete()
606 status = __efivars->ops->set_variable(entry->var.VariableName, in __efivar_entry_delete()
607 &entry->var.VendorGuid, in __efivar_entry_delete()
615 * efivar_entry_delete - delete variable and remove entry from list
616 * @entry: entry containing variable to delete
618 * Delete the variable from the firmware and remove @entry from the
619 * variable list. It is the caller's responsibility to free @entry
622 * Returns 0 on success, -EINTR if we can't grab the semaphore,
625 int efivar_entry_delete(struct efivar_entry *entry) in efivar_entry_delete() argument
631 return -EINTR; in efivar_entry_delete()
635 return -EINVAL; in efivar_entry_delete()
637 ops = __efivars->ops; in efivar_entry_delete()
638 status = ops->set_variable(entry->var.VariableName, in efivar_entry_delete()
639 &entry->var.VendorGuid, in efivar_entry_delete()
646 efivar_entry_list_del_unlock(entry); in efivar_entry_delete()
652 * efivar_entry_set - call set_variable()
653 * @entry: entry containing the EFI variable to write
666 * the entry is already on the list.
668 * Returns 0 on success, -EINTR if we can't grab the semaphore,
669 * -EEXIST if a lookup is performed and the entry already exists on
672 int efivar_entry_set(struct efivar_entry *entry, u32 attributes, in efivar_entry_set() argument
677 efi_char16_t *name = entry->var.VariableName; in efivar_entry_set() local
678 efi_guid_t vendor = entry->var.VendorGuid; in efivar_entry_set()
681 return -EINTR; in efivar_entry_set()
685 return -EINVAL; in efivar_entry_set()
687 ops = __efivars->ops; in efivar_entry_set()
688 if (head && efivar_entry_find(name, vendor, head, false)) { in efivar_entry_set()
690 return -EEXIST; in efivar_entry_set()
693 status = check_var_size(attributes, size + ucs2_strsize(name, 1024)); in efivar_entry_set()
695 status = ops->set_variable(name, &vendor, in efivar_entry_set()
706 * efivar_entry_set_nonblocking - call set_variable_nonblocking()
712 * efivars_lock. Instead, it returns -EBUSY.
715 efivar_entry_set_nonblocking(efi_char16_t *name, efi_guid_t vendor, in efivar_entry_set_nonblocking() argument
722 return -EBUSY; in efivar_entry_set_nonblocking()
726 return -EINVAL; in efivar_entry_set_nonblocking()
730 size + ucs2_strsize(name, 1024)); in efivar_entry_set_nonblocking()
733 return -ENOSPC; in efivar_entry_set_nonblocking()
736 ops = __efivars->ops; in efivar_entry_set_nonblocking()
737 status = ops->set_variable_nonblocking(name, &vendor, attributes, in efivar_entry_set_nonblocking()
745 * efivar_entry_set_safe - call set_variable() if enough space in firmware
746 * @name: buffer containing the variable name
757 * Returns 0 on success, -ENOSPC if the firmware does not have enough
761 int efivar_entry_set_safe(efi_char16_t *name, efi_guid_t vendor, u32 attributes, in efivar_entry_set_safe() argument
768 return -EINVAL; in efivar_entry_set_safe()
770 ops = __efivars->ops; in efivar_entry_set_safe()
771 if (!ops->query_variable_store) in efivar_entry_set_safe()
772 return -ENOSYS; in efivar_entry_set_safe()
775 * If the EFI variable backend provides a non-blocking in efivar_entry_set_safe()
776 * ->set_variable() operation and we're in a context where we in efivar_entry_set_safe()
777 * cannot block, then we need to use it to avoid live-locks, in efivar_entry_set_safe()
778 * since the implication is that the regular ->set_variable() in efivar_entry_set_safe()
781 * If no ->set_variable_nonblocking() is provided then in efivar_entry_set_safe()
782 * ->set_variable() is assumed to be non-blocking. in efivar_entry_set_safe()
784 if (!block && ops->set_variable_nonblocking) in efivar_entry_set_safe()
785 return efivar_entry_set_nonblocking(name, vendor, attributes, in efivar_entry_set_safe()
790 return -EBUSY; in efivar_entry_set_safe()
793 return -EINTR; in efivar_entry_set_safe()
796 status = check_var_size(attributes, size + ucs2_strsize(name, 1024)); in efivar_entry_set_safe()
799 return -ENOSPC; in efivar_entry_set_safe()
802 status = ops->set_variable(name, &vendor, attributes, size, data); in efivar_entry_set_safe()
811 * efivar_entry_find - search for an entry
812 * @name: the EFI variable name
815 * @remove: should we remove the entry from the list?
817 * Search for an entry on the variable list that has the EFI variable
818 * name @name and vendor guid @guid. If an entry is found on the list
819 * and @remove is true, the entry is removed from the list.
825 * Returns the entry if found on the list, %NULL otherwise.
827 struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid, in efivar_entry_find() argument
830 struct efivar_entry *entry, *n; in efivar_entry_find() local
834 list_for_each_entry_safe(entry, n, head, list) { in efivar_entry_find()
835 strsize1 = ucs2_strsize(name, 1024); in efivar_entry_find()
836 strsize2 = ucs2_strsize(entry->var.VariableName, 1024); in efivar_entry_find()
838 !memcmp(name, &(entry->var.VariableName), strsize1) && in efivar_entry_find()
839 !efi_guidcmp(guid, entry->var.VendorGuid)) { in efivar_entry_find()
849 if (entry->scanning) { in efivar_entry_find()
851 * The entry will be deleted in efivar_entry_find()
854 entry->deleting = true; in efivar_entry_find()
856 list_del(&entry->list); in efivar_entry_find()
859 return entry; in efivar_entry_find()
864 * efivar_entry_size - obtain the size of a variable
865 * @entry: entry for this variable
868 int efivar_entry_size(struct efivar_entry *entry, unsigned long *size) in efivar_entry_size() argument
876 return -EINTR; in efivar_entry_size()
879 return -EINVAL; in efivar_entry_size()
881 ops = __efivars->ops; in efivar_entry_size()
882 status = ops->get_variable(entry->var.VariableName, in efivar_entry_size()
883 &entry->var.VendorGuid, NULL, size, NULL); in efivar_entry_size()
894 * __efivar_entry_get - call get_variable()
895 * @entry: read data for this variable
904 int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in __efivar_entry_get() argument
910 return -EINVAL; in __efivar_entry_get()
912 status = __efivars->ops->get_variable(entry->var.VariableName, in __efivar_entry_get()
913 &entry->var.VendorGuid, in __efivar_entry_get()
921 * efivar_entry_get - call get_variable()
922 * @entry: read data for this variable
927 int efivar_entry_get(struct efivar_entry *entry, u32 *attributes, in efivar_entry_get() argument
933 return -EINTR; in efivar_entry_get()
937 return -EINVAL; in efivar_entry_get()
940 status = __efivars->ops->get_variable(entry->var.VariableName, in efivar_entry_get()
941 &entry->var.VendorGuid, in efivar_entry_get()
950 * efivar_entry_set_get_size - call set_variable() and get new size (atomic)
951 * @entry: entry containing variable to set and get
959 * Atomically call set_variable() for @entry and if the call is
963 * Returns 0 on success, -EINVAL if the variable data is invalid,
964 * -ENOSPC if the firmware does not have enough available space, or a
969 * (EFI_NOT_FOUND), @entry is removed from the variable list.
971 int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes, in efivar_entry_set_get_size() argument
975 efi_char16_t *name = entry->var.VariableName; in efivar_entry_set_get_size() local
976 efi_guid_t *vendor = &entry->var.VendorGuid; in efivar_entry_set_get_size()
982 if (efivar_validate(*vendor, name, data, *size) == false) in efivar_entry_set_get_size()
983 return -EINVAL; in efivar_entry_set_get_size()
991 return -EINTR; in efivar_entry_set_get_size()
994 err = -EINVAL; in efivar_entry_set_get_size()
1001 status = check_var_size(attributes, *size + ucs2_strsize(name, 1024)); in efivar_entry_set_get_size()
1009 err = -ENOSPC; in efivar_entry_set_get_size()
1014 ops = __efivars->ops; in efivar_entry_set_get_size()
1016 status = ops->set_variable(name, vendor, attributes, *size, data); in efivar_entry_set_get_size()
1031 status = ops->get_variable(entry->var.VariableName, in efivar_entry_set_get_size()
1032 &entry->var.VendorGuid, in efivar_entry_set_get_size()
1036 efivar_entry_list_del_unlock(entry); in efivar_entry_set_get_size()
1053 * efivar_entry_iter_begin - begin iterating the variable list
1055 * Lock the variable list to prevent entry insertion and removal until
1066 * efivar_entry_iter_end - finish iterating the variable list
1077 * __efivar_entry_iter - iterate over variable list
1080 * @data: function-specific data to pass to callback
1081 * @prev: entry to begin iterating from
1084 * entry on the list. It is safe for @func to remove entries in the
1090 * It is possible to begin iteration from an arbitrary entry within
1092 * the last entry passed to @func. To begin iterating from the
1102 struct efivar_entry *entry, *n; in __efivar_entry_iter() local
1106 list_for_each_entry_safe(entry, n, head, list) { in __efivar_entry_iter()
1107 err = func(entry, data); in __efivar_entry_iter()
1113 *prev = entry; in __efivar_entry_iter()
1130 * efivar_entry_iter - iterate over variable list
1133 * @data: function-specific data to pass to callback
1136 * entry on the list. It is safe for @func to remove entries in the
1140 * - a non-zero return value indicates an error and terminates the loop
1141 * - @func is called from atomic context
1159 * efivars_kobject - get the kobject for the registered efivars
1169 return __efivars->kobject; in efivars_kobject()
1174 * efivar_run_worker - schedule the efivar worker thread
1184 * efivars_register - register an efivars
1187 * @kobject: @efivars-specific kobject
1196 return -EINTR; in efivars_register()
1198 efivars->ops = ops; in efivars_register()
1199 efivars->kobject = kobject; in efivars_register()
1212 * efivars_unregister - unregister an efivars
1215 * The caller must have already removed every entry from the list,
1223 return -EINTR; in efivars_unregister()
1227 rv = -EINVAL; in efivars_unregister()
1232 rv = -EINVAL; in efivars_unregister()