#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"
enum kcs_ipmi_phases { … };
enum kcs_ipmi_errors { … };
struct kcs_bmc_ipmi { … };
#define DEVICE_NAME …
#define KCS_MSG_BUFSIZ …
#define KCS_ZERO_DATA …
#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 …
enum kcs_states { … };
#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(…) …;