linux/drivers/char/ipmi/kcs_bmc_cdev_ipmi.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2015-2018, Intel Corporation.
 */

#define pr_fmt(fmt)

#include <linux/errno.h>
#include <linux/io.h>
#include <linux/ipmi_bmc.h>
#include <linux/list.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/slab.h>

#include "kcs_bmc_client.h"

/* Different phases of the KCS BMC module.
 *  KCS_PHASE_IDLE:
 *            BMC should not be expecting nor sending any data.
 *  KCS_PHASE_WRITE_START:
 *            BMC is receiving a WRITE_START command from system software.
 *  KCS_PHASE_WRITE_DATA:
 *            BMC is receiving a data byte from system software.
 *  KCS_PHASE_WRITE_END_CMD:
 *            BMC is waiting a last data byte from system software.
 *  KCS_PHASE_WRITE_DONE:
 *            BMC has received the whole request from system software.
 *  KCS_PHASE_WAIT_READ:
 *            BMC is waiting the response from the upper IPMI service.
 *  KCS_PHASE_READ:
 *            BMC is transferring the response to system software.
 *  KCS_PHASE_ABORT_ERROR1:
 *            BMC is waiting error status request from system software.
 *  KCS_PHASE_ABORT_ERROR2:
 *            BMC is waiting for idle status afer error from system software.
 *  KCS_PHASE_ERROR:
 *            BMC has detected a protocol violation at the interface level.
 */
enum kcs_ipmi_phases {};

/* IPMI 2.0 - Table 9-4, KCS Interface Status Codes */
enum kcs_ipmi_errors {};

struct kcs_bmc_ipmi {};

#define DEVICE_NAME

#define KCS_MSG_BUFSIZ

#define KCS_ZERO_DATA

/* IPMI 2.0 - Table 9-1, KCS Interface Status Register Bits */
#define KCS_STATUS_STATE(state)
#define KCS_STATUS_STATE_MASK
#define KCS_STATUS_CMD_DAT
#define KCS_STATUS_SMS_ATN
#define KCS_STATUS_IBF
#define KCS_STATUS_OBF

/* IPMI 2.0 - Table 9-2, KCS Interface State Bits */
enum kcs_states {};

/* IPMI 2.0 - Table 9-3, KCS Interface Control Codes */
#define KCS_CMD_GET_STATUS_ABORT
#define KCS_CMD_WRITE_START
#define KCS_CMD_WRITE_END
#define KCS_CMD_READ_BYTE

static inline void set_state(struct kcs_bmc_ipmi *priv, u8 state)
{}

static void kcs_bmc_ipmi_force_abort(struct kcs_bmc_ipmi *priv)
{}

static void kcs_bmc_ipmi_handle_data(struct kcs_bmc_ipmi *priv)
{}

static void kcs_bmc_ipmi_handle_cmd(struct kcs_bmc_ipmi *priv)
{}

static inline struct kcs_bmc_ipmi *client_to_kcs_bmc_ipmi(struct kcs_bmc_client *client)
{}

static irqreturn_t kcs_bmc_ipmi_event(struct kcs_bmc_client *client)
{}

static const struct kcs_bmc_client_ops kcs_bmc_ipmi_client_ops =;

static inline struct kcs_bmc_ipmi *to_kcs_bmc(struct file *filp)
{}

static int kcs_bmc_ipmi_open(struct inode *inode, struct file *filp)
{}

static __poll_t kcs_bmc_ipmi_poll(struct file *filp, poll_table *wait)
{}

static ssize_t kcs_bmc_ipmi_read(struct file *filp, char __user *buf,
			    size_t count, loff_t *ppos)
{}

static ssize_t kcs_bmc_ipmi_write(struct file *filp, const char __user *buf,
			     size_t count, loff_t *ppos)
{}

static long kcs_bmc_ipmi_ioctl(struct file *filp, unsigned int cmd,
			  unsigned long arg)
{}

static int kcs_bmc_ipmi_release(struct inode *inode, struct file *filp)
{}

static const struct file_operations kcs_bmc_ipmi_fops =;

static DEFINE_SPINLOCK(kcs_bmc_ipmi_instances_lock);
static LIST_HEAD(kcs_bmc_ipmi_instances);

static int kcs_bmc_ipmi_add_device(struct kcs_bmc_device *kcs_bmc)
{}

static int kcs_bmc_ipmi_remove_device(struct kcs_bmc_device *kcs_bmc)
{}

static const struct kcs_bmc_driver_ops kcs_bmc_ipmi_driver_ops =;

static struct kcs_bmc_driver kcs_bmc_ipmi_driver =;

static int __init kcs_bmc_ipmi_init(void)
{}
module_init();

static void __exit kcs_bmc_ipmi_exit(void)
{}
module_exit(kcs_bmc_ipmi_exit);

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