X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=qemu%2Froms%2Fipxe%2Fsrc%2Finclude%2Fipxe%2Fnvo.h;fp=qemu%2Froms%2Fipxe%2Fsrc%2Finclude%2Fipxe%2Fnvo.h;h=1a629da78836c9e662c89d42c3933572f028ab9c;hb=e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb;hp=0000000000000000000000000000000000000000;hpb=9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00;p=kvmfornfv.git diff --git a/qemu/roms/ipxe/src/include/ipxe/nvo.h b/qemu/roms/ipxe/src/include/ipxe/nvo.h new file mode 100644 index 000000000..1a629da78 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/nvo.h @@ -0,0 +1,57 @@ +#ifndef _IPXE_NVO_H +#define _IPXE_NVO_H + +/** @file + * + * Non-volatile stored options + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include +#include +#include + +struct nvs_device; +struct refcnt; + +/** + * A block of non-volatile stored options + */ +struct nvo_block { + /** Settings block */ + struct settings settings; + /** Underlying non-volatile storage device */ + struct nvs_device *nvs; + /** Address within NVS device */ + unsigned int address; + /** Length of options data */ + size_t len; + /** Option-containing data */ + void *data; + /** + * Resize non-volatile stored option block + * + * @v nvo Non-volatile options block + * @v len New size + * @ret rc Return status code + */ + int ( * resize ) ( struct nvo_block *nvo, size_t len ); + /** DHCP options block */ + struct dhcp_options dhcpopts; +}; + +/** Name of non-volatile options settings block */ +#define NVO_SETTINGS_NAME "nvo" + +extern int nvo_applies ( struct settings *settings, + const struct setting *setting ); +extern 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 ); +extern int register_nvo ( struct nvo_block *nvo, struct settings *parent ); +extern void unregister_nvo ( struct nvo_block *nvo ); + +#endif /* _IPXE_NVO_H */