[sundance] Add reset completion check
[gpxe.git] / src / include / gpxe / nvo.h
blob28068f4b0c161b206b1fd08699d6a82c5f365576
1 #ifndef _GPXE_NVO_H
2 #define _GPXE_NVO_H
4 /** @file
6 * Non-volatile stored options
8 */
10 #include <stdint.h>
11 #include <gpxe/dhcpopts.h>
12 #include <gpxe/settings.h>
14 struct nvs_device;
15 struct refcnt;
17 /**
18 * A fragment of a non-volatile storage device used for stored options
20 struct nvo_fragment {
21 /** Starting address of fragment within NVS device */
22 unsigned int address;
23 /** Length of fragment */
24 size_t len;
27 /**
28 * A block of non-volatile stored options
30 struct nvo_block {
31 /** Settings block */
32 struct settings settings;
33 /** Underlying non-volatile storage device */
34 struct nvs_device *nvs;
35 /** List of option-containing fragments
37 * The list is terminated by a fragment with a length of zero.
39 struct nvo_fragment *fragments;
40 /** Total length of option-containing fragments */
41 size_t total_len;
42 /** Option-containing data */
43 void *data;
44 /** DHCP options block */
45 struct dhcp_options dhcpopts;
48 extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
49 struct nvo_fragment *fragments, struct refcnt *refcnt );
50 extern int register_nvo ( struct nvo_block *nvo, struct settings *parent );
51 extern void unregister_nvo ( struct nvo_block *nvo );
53 #endif /* _GPXE_NVO_H */