0001
0002
0003
0004
0005
0006 #ifndef EFIVAR_FS_INTERNAL_H
0007 #define EFIVAR_FS_INTERNAL_H
0008
0009 #include <linux/list.h>
0010 #include <linux/efi.h>
0011
0012 struct efi_variable {
0013 efi_char16_t VariableName[EFI_VAR_NAME_LEN/sizeof(efi_char16_t)];
0014 efi_guid_t VendorGuid;
0015 unsigned long DataSize;
0016 __u8 Data[1024];
0017 efi_status_t Status;
0018 __u32 Attributes;
0019 } __attribute__((packed));
0020
0021 struct efivar_entry {
0022 struct efi_variable var;
0023 struct list_head list;
0024 struct kobject kobj;
0025 };
0026
0027 int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
0028 void *data, bool duplicates, struct list_head *head);
0029
0030 int efivar_entry_add(struct efivar_entry *entry, struct list_head *head);
0031 void __efivar_entry_add(struct efivar_entry *entry, struct list_head *head);
0032 void efivar_entry_remove(struct efivar_entry *entry);
0033 int efivar_entry_delete(struct efivar_entry *entry);
0034
0035 int efivar_entry_size(struct efivar_entry *entry, unsigned long *size);
0036 int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
0037 unsigned long *size, void *data);
0038 int efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
0039 unsigned long *size, void *data);
0040 int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes,
0041 unsigned long *size, void *data, bool *set);
0042
0043 int efivar_entry_iter(int (*func)(struct efivar_entry *, void *),
0044 struct list_head *head, void *data);
0045
0046 bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,
0047 unsigned long data_size);
0048 bool efivar_variable_is_removable(efi_guid_t vendor, const char *name,
0049 size_t len);
0050
0051 extern const struct file_operations efivarfs_file_operations;
0052 extern const struct inode_operations efivarfs_dir_inode_operations;
0053 extern bool efivarfs_valid_name(const char *str, int len);
0054 extern struct inode *efivarfs_get_inode(struct super_block *sb,
0055 const struct inode *dir, int mode, dev_t dev,
0056 bool is_removable);
0057
0058 extern struct list_head efivarfs_list;
0059
0060 #endif