blob: 3045b7e21e22f2c0080fb3c4b0d290de53ca0aed [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Martyn Welchb418dfe2017-11-08 15:35:15 +00002/*
3 * Copyright 2016 General Electric Company
Martyn Welchb418dfe2017-11-08 15:35:15 +00004 */
5
6#include "common.h"
7
Denis Zalevskiy4dcbccf2018-10-17 10:33:30 +02008struct vpd_cache;
9
Martyn Welchb418dfe2017-11-08 15:35:15 +000010/*
Denis Zalevskiy4dcbccf2018-10-17 10:33:30 +020011 * Read VPD from given data, verify content, call callback for each vital
12 * product data block.
13 *
14 * cache: structure used by process block to store VPD information
15 * process_block: callback called for each VPD data block
Martyn Welchb418dfe2017-11-08 15:35:15 +000016 *
17 * Returns Non-zero on error. Negative numbers encode errno.
18 */
Denis Zalevskiy4dcbccf2018-10-17 10:33:30 +020019int read_vpd(struct vpd_cache *cache,
20 int (*process_block)(struct vpd_cache *,
21 u8 id, u8 version, u8 type,
22 size_t size, u8 const *data));