linux/drivers/platform/x86/intel/pmt/crashlog.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Intel Platform Monitoring Technology Crashlog driver
 *
 * Copyright (c) 2020, Intel Corporation.
 * All Rights Reserved.
 *
 * Author: "Alexander Duyck" <[email protected]>
 */

#include <linux/auxiliary_bus.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/overflow.h>

#include "../vsec.h"
#include "class.h"

/* Crashlog discovery header types */
#define CRASH_TYPE_OOBMSM

/* Control Flags */
#define CRASHLOG_FLAG_DISABLE

/*
 * Bits 29 and 30 control the state of bit 31.
 *
 * Bit 29 will clear bit 31, if set, allowing a new crashlog to be captured.
 * Bit 30 will immediately trigger a crashlog to be generated, setting bit 31.
 * Bit 31 is the read-only status with a 1 indicating log is complete.
 */
#define CRASHLOG_FLAG_TRIGGER_CLEAR
#define CRASHLOG_FLAG_TRIGGER_EXECUTE
#define CRASHLOG_FLAG_TRIGGER_COMPLETE
#define CRASHLOG_FLAG_TRIGGER_MASK

/* Crashlog Discovery Header */
#define CONTROL_OFFSET
#define GUID_OFFSET
#define BASE_OFFSET
#define SIZE_OFFSET
#define GET_ACCESS(v)
#define GET_TYPE(v)
#define GET_VERSION(v)
/* size is in bytes */
#define GET_SIZE(v)

struct crashlog_entry {};

struct pmt_crashlog_priv {};

/*
 * I/O
 */
static bool pmt_crashlog_complete(struct intel_pmt_entry *entry)
{}

static bool pmt_crashlog_disabled(struct intel_pmt_entry *entry)
{}

static bool pmt_crashlog_supported(struct intel_pmt_entry *entry)
{}

static void pmt_crashlog_set_disable(struct intel_pmt_entry *entry,
				     bool disable)
{}

static void pmt_crashlog_set_clear(struct intel_pmt_entry *entry)
{}

static void pmt_crashlog_set_execute(struct intel_pmt_entry *entry)
{}

/*
 * sysfs
 */
static ssize_t
enable_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t
enable_store(struct device *dev, struct device_attribute *attr,
	    const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(enable);

static ssize_t
trigger_show(struct device *dev, struct device_attribute *attr, char *buf)
{}

static ssize_t
trigger_store(struct device *dev, struct device_attribute *attr,
	    const char *buf, size_t count)
{}
static DEVICE_ATTR_RW(trigger);

static struct attribute *pmt_crashlog_attrs[] =;

static const struct attribute_group pmt_crashlog_group =;

static int pmt_crashlog_header_decode(struct intel_pmt_entry *entry,
				      struct device *dev)
{}

static DEFINE_XARRAY_ALLOC(crashlog_array);
static struct intel_pmt_namespace pmt_crashlog_ns =;

/*
 * initialization
 */
static void pmt_crashlog_remove(struct auxiliary_device *auxdev)
{}

static int pmt_crashlog_probe(struct auxiliary_device *auxdev,
			      const struct auxiliary_device_id *id)
{}

static const struct auxiliary_device_id pmt_crashlog_id_table[] =;
MODULE_DEVICE_TABLE(auxiliary, pmt_crashlog_id_table);

static struct auxiliary_driver pmt_crashlog_aux_driver =;

static int __init pmt_crashlog_init(void)
{}

static void __exit pmt_crashlog_exit(void)
{}

module_init();
module_exit(pmt_crashlog_exit);

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