[nvo] Remove the non-volatile options fragment list

Since its implementation several years ago, no driver has used a
fragment list containing more than a single fragment.  Simplify the
NVO core and the drivers that use it by removing the whole concept of
the fragment list, and using a simple (address,length) pair instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-11-30 01:10:38 +00:00
parent 8f8b55f187
commit 1651d4f6d7
6 changed files with 50 additions and 111 deletions

View File

@@ -16,16 +16,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
struct nvs_device;
struct refcnt;
/**
* A fragment of a non-volatile storage device used for stored options
*/
struct nvo_fragment {
/** Starting address of fragment within NVS device */
unsigned int address;
/** Length of fragment */
size_t len;
};
/**
* A block of non-volatile stored options
*/
@@ -34,13 +24,10 @@ struct nvo_block {
struct settings settings;
/** Underlying non-volatile storage device */
struct nvs_device *nvs;
/** List of option-containing fragments
*
* The list is terminated by a fragment with a length of zero.
*/
struct nvo_fragment *fragments;
/** Total length of option-containing fragments */
size_t total_len;
/** Address within NVS device */
unsigned int address;
/** Length of options data */
size_t len;
/** Option-containing data */
void *data;
/** DHCP options block */
@@ -48,7 +35,7 @@ struct nvo_block {
};
extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
struct nvo_fragment *fragments, struct refcnt *refcnt );
size_t address, 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 );