vpd_reader.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2016 General Electric Company
  4. */
  5. #include "common.h"
  6. struct vpd_cache;
  7. /*
  8. * Read VPD from given data, verify content, call callback for each vital
  9. * product data block.
  10. *
  11. * cache: structure used by process block to store VPD information
  12. * process_block: callback called for each VPD data block
  13. *
  14. * Returns Non-zero on error. Negative numbers encode errno.
  15. */
  16. int read_i2c_vpd(struct vpd_cache *cache,
  17. int (*process_block)(struct vpd_cache *, u8 id, u8 version,
  18. u8 type, size_t size, u8 const *data));
  19. /*
  20. * Read VPD from given data, verify content, call callback for each vital
  21. * product data block.
  22. *
  23. * size: size of the raw VPD data in bytes
  24. * data: raw VPD data read from device
  25. * cache: structure used by process block to store VPD information
  26. * process_block: callback called for each VPD data block
  27. *
  28. * Returns Non-zero on error. Negative numbers encode errno.
  29. */
  30. int vpd_reader(size_t size, u8 *data, struct vpd_cache *cache,
  31. int (*process_block)(struct vpd_cache *, u8 id, u8 version, u8 type,
  32. size_t size, u8 const *data));