00001 #ifndef _GPXE_NVO_H 00002 #define _GPXE_NVO_H 00003 00004 /** @file 00005 * 00006 * Non-volatile stored options 00007 * 00008 */ 00009 00010 FILE_LICENCE ( GPL2_OR_LATER ); 00011 00012 #include <stdint.h> 00013 #include <gpxe/dhcpopts.h> 00014 #include <gpxe/settings.h> 00015 00016 struct nvs_device; 00017 struct refcnt; 00018 00019 /** 00020 * A fragment of a non-volatile storage device used for stored options 00021 */ 00022 struct nvo_fragment { 00023 /** Starting address of fragment within NVS device */ 00024 unsigned int address; 00025 /** Length of fragment */ 00026 size_t len; 00027 }; 00028 00029 /** 00030 * A block of non-volatile stored options 00031 */ 00032 struct nvo_block { 00033 /** Settings block */ 00034 struct settings settings; 00035 /** Underlying non-volatile storage device */ 00036 struct nvs_device *nvs; 00037 /** List of option-containing fragments 00038 * 00039 * The list is terminated by a fragment with a length of zero. 00040 */ 00041 struct nvo_fragment *fragments; 00042 /** Total length of option-containing fragments */ 00043 size_t total_len; 00044 /** Option-containing data */ 00045 void *data; 00046 /** DHCP options block */ 00047 struct dhcp_options dhcpopts; 00048 }; 00049 00050 extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs, 00051 struct nvo_fragment *fragments, struct refcnt *refcnt ); 00052 extern int register_nvo ( struct nvo_block *nvo, struct settings *parent ); 00053 extern void unregister_nvo ( struct nvo_block *nvo ); 00054 00055 #endif /* _GPXE_NVO_H */
1.5.7.1