linux/drivers/nvmem/layouts/onie-tlv.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ONIE tlv NVMEM cells provider
 *
 * Copyright (C) 2022 Open Compute Group ONIE
 * Author: Miquel Raynal <[email protected]>
 * Based on the nvmem driver written by: Vadym Kochan <[email protected]>
 * Inspired by the first layout written by: Rafał Miłecki <[email protected]>
 */

#include <linux/crc32.h>
#include <linux/etherdevice.h>
#include <linux/nvmem-consumer.h>
#include <linux/nvmem-provider.h>
#include <linux/of.h>

#define ONIE_TLV_MAX_LEN
#define ONIE_TLV_CRC_FIELD_SZ
#define ONIE_TLV_CRC_SZ
#define ONIE_TLV_HDR_ID

struct onie_tlv_hdr {} __packed;

struct onie_tlv {} __packed;

static const char *onie_tlv_cell_name(u8 type)
{}

static int onie_tlv_mac_read_cb(void *priv, const char *id, int index,
				unsigned int offset, void *buf,
				size_t bytes)
{}

static nvmem_cell_post_process_t onie_tlv_read_cb(u8 type, u8 *buf)
{}

static int onie_tlv_add_cells(struct device *dev, struct nvmem_device *nvmem,
			      size_t data_len, u8 *data)
{}

static bool onie_tlv_hdr_is_valid(struct device *dev, struct onie_tlv_hdr *hdr)
{}

static bool onie_tlv_crc_is_valid(struct device *dev, size_t table_len, u8 *table)
{}

static int onie_tlv_parse_table(struct nvmem_layout *layout)
{}

static int onie_tlv_probe(struct nvmem_layout *layout)
{}

static void onie_tlv_remove(struct nvmem_layout *layout)
{}

static const struct of_device_id onie_tlv_of_match_table[] =;
MODULE_DEVICE_TABLE(of, onie_tlv_of_match_table);

static struct nvmem_layout_driver onie_tlv_layout =;
module_nvmem_layout_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();