iPXE
nvo.h
Go to the documentation of this file.
1#ifndef _IPXE_NVO_H
2#define _IPXE_NVO_H
3
4/** @file
5 *
6 * Non-volatile stored options
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/dhcpopts.h>
15#include <ipxe/settings.h>
16
17struct nvs_device;
18struct refcnt;
19
20/**
21 * A block of non-volatile stored options
22 */
23struct nvo_block {
24 /** Settings block */
26 /** Underlying non-volatile storage device */
27 struct nvs_device *nvs;
28 /** Address within NVS device */
29 unsigned int address;
30 /** Length of options data */
31 size_t len;
32 /** Option-containing data */
33 void *data;
34 /**
35 * Resize non-volatile stored option block
36 *
37 * @v nvo Non-volatile options block
38 * @v len New size
39 * @ret rc Return status code
40 */
41 int ( * resize ) ( struct nvo_block *nvo, size_t len );
42 /** DHCP options block */
44};
45
46/** Name of non-volatile options settings block */
47#define NVO_SETTINGS_NAME "nvo"
48
49extern int nvo_applies ( struct settings *settings,
50 const struct setting *setting );
51extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
52 size_t address, size_t len,
53 int ( * resize ) ( struct nvo_block *nvo, size_t len ),
54 struct refcnt *refcnt );
55extern int register_nvo ( struct nvo_block *nvo, struct settings *parent );
56extern void unregister_nvo ( struct nvo_block *nvo );
57
58#endif /* _IPXE_NVO_H */
DHCP options.
ring len
Length.
Definition dwmac.h:226
uint64_t address
Base address.
Definition ena.h:13
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
Configuration settings.
void nvo_init(struct nvo_block *nvo, struct nvs_device *nvs, size_t address, size_t len, int(*resize)(struct nvo_block *nvo, size_t len), struct refcnt *refcnt)
Initialise non-volatile stored options.
Definition nvo.c:274
void unregister_nvo(struct nvo_block *nvo)
Unregister non-volatile stored options.
Definition nvo.c:325
int nvo_applies(struct settings *settings, const struct setting *setting)
int register_nvo(struct nvo_block *nvo, struct settings *parent)
Register non-volatile stored options.
Definition nvo.c:294
A DHCP options block.
Definition dhcpopts.h:16
A block of non-volatile stored options.
Definition nvo.h:23
size_t len
Length of options data.
Definition nvo.h:31
int(* resize)(struct nvo_block *nvo, size_t len)
Resize non-volatile stored option block.
Definition nvo.h:41
struct settings settings
Settings block.
Definition nvo.h:25
unsigned int address
Address within NVS device.
Definition nvo.h:29
struct dhcp_options dhcpopts
DHCP options block.
Definition nvo.h:43
void * data
Option-containing data.
Definition nvo.h:33
struct nvs_device * nvs
Underlying non-volatile storage device.
Definition nvo.h:27
A non-volatile storage device.
Definition nvs.h:16
A reference counter.
Definition refcnt.h:27
A setting.
Definition settings.h:24
A settings block.
Definition settings.h:133