You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nvo.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef _GPXE_NVO_H
  2. #define _GPXE_NVO_H
  3. /** @file
  4. *
  5. * Non-volatile stored options
  6. *
  7. */
  8. #include <stdint.h>
  9. #include <gpxe/dhcpopts.h>
  10. #include <gpxe/settings.h>
  11. struct nvs_device;
  12. struct refcnt;
  13. /**
  14. * A fragment of a non-volatile storage device used for stored options
  15. */
  16. struct nvo_fragment {
  17. /** Starting address of fragment within NVS device */
  18. unsigned int address;
  19. /** Length of fragment */
  20. size_t len;
  21. };
  22. /**
  23. * A block of non-volatile stored options
  24. */
  25. struct nvo_block {
  26. /** Settings block */
  27. struct settings settings;
  28. /** Underlying non-volatile storage device */
  29. struct nvs_device *nvs;
  30. /** List of option-containing fragments
  31. *
  32. * The list is terminated by a fragment with a length of zero.
  33. */
  34. struct nvo_fragment *fragments;
  35. /** Total length of option-containing fragments */
  36. size_t total_len;
  37. /** Option-containing data */
  38. void *data;
  39. /** DHCP options block */
  40. struct dhcp_options dhcpopts;
  41. };
  42. extern void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
  43. struct nvo_fragment *fragments, struct refcnt *refcnt );
  44. extern int register_nvo ( struct nvo_block *nvo, struct settings *parent );
  45. extern void unregister_nvo ( struct nvo_block *nvo );
  46. #endif /* _GPXE_NVO_H */