2019-06-04 08:11:33 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-02-08 16:27:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Red Hat, Inc.
|
|
|
|
* Copyright (C) 2012 Jeremy Kerr <jeremy.kerr@canonical.com>
|
|
|
|
*/
|
|
|
|
#ifndef EFIVAR_FS_INTERNAL_H
|
|
|
|
#define EFIVAR_FS_INTERNAL_H
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
2022-06-20 16:19:43 +00:00
|
|
|
#include <linux/efi.h>
|
|
|
|
|
2023-10-19 22:46:39 +00:00
|
|
|
struct efivarfs_mount_opts {
|
|
|
|
kuid_t uid;
|
|
|
|
kgid_t gid;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct efivarfs_fs_info {
|
|
|
|
struct efivarfs_mount_opts mount_opts;
|
2023-12-08 16:39:29 +00:00
|
|
|
struct list_head efivarfs_list;
|
2023-11-07 05:40:55 +00:00
|
|
|
struct super_block *sb;
|
|
|
|
struct notifier_block nb;
|
2023-10-19 22:46:39 +00:00
|
|
|
};
|
|
|
|
|
2022-06-20 16:19:43 +00:00
|
|
|
struct efi_variable {
|
|
|
|
efi_char16_t VariableName[EFI_VAR_NAME_LEN/sizeof(efi_char16_t)];
|
|
|
|
efi_guid_t VendorGuid;
|
|
|
|
__u32 Attributes;
|
2024-03-28 20:50:32 +00:00
|
|
|
};
|
2022-06-20 16:19:43 +00:00
|
|
|
|
|
|
|
struct efivar_entry {
|
|
|
|
struct efi_variable var;
|
|
|
|
struct list_head list;
|
|
|
|
struct kobject kobj;
|
|
|
|
};
|
|
|
|
|
2023-12-08 16:39:29 +00:00
|
|
|
int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *,
|
|
|
|
struct list_head *),
|
2024-02-24 17:48:14 +00:00
|
|
|
void *data, struct list_head *head);
|
2022-06-20 16:19:43 +00:00
|
|
|
|
|
|
|
int efivar_entry_add(struct efivar_entry *entry, struct list_head *head);
|
|
|
|
void __efivar_entry_add(struct efivar_entry *entry, struct list_head *head);
|
|
|
|
void efivar_entry_remove(struct efivar_entry *entry);
|
|
|
|
int efivar_entry_delete(struct efivar_entry *entry);
|
|
|
|
|
|
|
|
int efivar_entry_size(struct efivar_entry *entry, unsigned long *size);
|
|
|
|
int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
|
|
|
|
unsigned long *size, void *data);
|
|
|
|
int efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
|
|
|
|
unsigned long *size, void *data);
|
|
|
|
int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes,
|
|
|
|
unsigned long *size, void *data, bool *set);
|
|
|
|
|
|
|
|
int efivar_entry_iter(int (*func)(struct efivar_entry *, void *),
|
|
|
|
struct list_head *head, void *data);
|
|
|
|
|
|
|
|
bool efivar_validate(efi_guid_t vendor, efi_char16_t *var_name, u8 *data,
|
|
|
|
unsigned long data_size);
|
|
|
|
bool efivar_variable_is_removable(efi_guid_t vendor, const char *name,
|
|
|
|
size_t len);
|
2013-02-08 16:27:24 +00:00
|
|
|
|
|
|
|
extern const struct file_operations efivarfs_file_operations;
|
|
|
|
extern const struct inode_operations efivarfs_dir_inode_operations;
|
|
|
|
extern bool efivarfs_valid_name(const char *str, int len);
|
|
|
|
extern struct inode *efivarfs_get_inode(struct super_block *sb,
|
2016-02-08 19:48:15 +00:00
|
|
|
const struct inode *dir, int mode, dev_t dev,
|
|
|
|
bool is_removable);
|
2013-02-08 16:27:24 +00:00
|
|
|
|
|
|
|
#endif /* EFIVAR_FS_INTERNAL_H */
|