linux/drivers/firmware/google/vpd.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * vpd.c
 *
 * Driver for exporting VPD content to sysfs.
 *
 * Copyright 2017 Google Inc.
 */

#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sysfs.h>

#include "coreboot_table.h"
#include "vpd_decode.h"

#define CB_TAG_VPD
#define VPD_CBMEM_MAGIC

static struct kobject *vpd_kobj;

struct vpd_cbmem {};

struct vpd_section {};

struct vpd_attrib_info {};

static struct vpd_section ro_vpd;
static struct vpd_section rw_vpd;

static ssize_t vpd_attrib_read(struct file *filp, struct kobject *kobp,
			       struct bin_attribute *bin_attr, char *buf,
			       loff_t pos, size_t count)
{}

/*
 * vpd_section_check_key_name()
 *
 * The VPD specification supports only [a-zA-Z0-9_]+ characters in key names but
 * old firmware versions may have entries like "S/N" which are problematic when
 * exporting them as sysfs attributes. These keys present in old firmwares are
 * ignored.
 *
 * Returns VPD_OK for a valid key name, VPD_FAIL otherwise.
 *
 * @key: The key name to check
 * @key_len: key name length
 */
static int vpd_section_check_key_name(const u8 *key, s32 key_len)
{}

static int vpd_section_attrib_add(const u8 *key, u32 key_len,
				  const u8 *value, u32 value_len,
				  void *arg)
{}

static void vpd_section_attrib_destroy(struct vpd_section *sec)
{}

static ssize_t vpd_section_read(struct file *filp, struct kobject *kobp,
				struct bin_attribute *bin_attr, char *buf,
				loff_t pos, size_t count)
{}

static int vpd_section_create_attribs(struct vpd_section *sec)
{}

static int vpd_section_init(const char *name, struct vpd_section *sec,
			    phys_addr_t physaddr, size_t size)
{}

static int vpd_section_destroy(struct vpd_section *sec)
{}

static int vpd_sections_init(phys_addr_t physaddr)
{}

static int vpd_probe(struct coreboot_device *dev)
{}

static void vpd_remove(struct coreboot_device *dev)
{}

static const struct coreboot_device_id vpd_ids[] =;
MODULE_DEVICE_TABLE(coreboot, vpd_ids);

static struct coreboot_driver vpd_driver =;
module_coreboot_driver();

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