aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/tools/tlv_eeprom/tlv_eeprom_io.h
blob: 348bc620799082993cadc8cb01362b92c9c02454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright 2019 Ettus Research, a National Instruments Brand
 */

#pragma once

#include "tlv_eeprom.h"

/**
 * tlv_eeprom_write_to_file - write an eeprom to a file
 * @e: eeprom to write
 * @path: destination to write to
 *
 * Writes the eeprom to the specified path
 *
 * Return: zero on success, else negative error code
 */
int tlv_eeprom_write_to_file(const struct tlv_eeprom *e, const char *path);

/**
 * tlv_eeprom_read_from_file - read an eeprom from file
 * @path: path to read from
 *
 * Reads from the path into an allocated eeprom object. No validation of the
 * data is performed, and caller is responsible for free'ing this.
 *
 * Return: eeprom, or NULL if error
 */
struct tlv_eeprom *tlv_eeprom_read_from_file(const char *path);