linux/drivers/char/ipmi/bt-bmc.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (c) 2015-2016, IBM Corporation.
 */

#include <linux/atomic.h>
#include <linux/bt-bmc.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/timer.h>

/*
 * This is a BMC device used to communicate to the host
 */
#define DEVICE_NAME

#define BT_IO_BASE
#define BT_IRQ

#define BT_CR0
#define BT_CR0_IO_BASE
#define BT_CR0_IRQ
#define BT_CR0_EN_CLR_SLV_RDP
#define BT_CR0_EN_CLR_SLV_WRP
#define BT_CR0_ENABLE_IBT
#define BT_CR1
#define BT_CR1_IRQ_H2B
#define BT_CR1_IRQ_HBUSY
#define BT_CR2
#define BT_CR2_IRQ_H2B
#define BT_CR2_IRQ_HBUSY
#define BT_CR3
#define BT_CTRL
#define BT_CTRL_B_BUSY
#define BT_CTRL_H_BUSY
#define BT_CTRL_OEM0
#define BT_CTRL_SMS_ATN
#define BT_CTRL_B2H_ATN
#define BT_CTRL_H2B_ATN
#define BT_CTRL_CLR_RD_PTR
#define BT_CTRL_CLR_WR_PTR
#define BT_BMC2HOST
#define BT_INTMASK
#define BT_INTMASK_B2H_IRQEN
#define BT_INTMASK_B2H_IRQ
#define BT_INTMASK_BMC_HWRST

#define BT_BMC_BUFFER_SIZE

struct bt_bmc {};

static atomic_t open_count =;

static u8 bt_inb(struct bt_bmc *bt_bmc, int reg)
{}

static void bt_outb(struct bt_bmc *bt_bmc, u8 data, int reg)
{}

static void clr_rd_ptr(struct bt_bmc *bt_bmc)
{}

static void clr_wr_ptr(struct bt_bmc *bt_bmc)
{}

static void clr_h2b_atn(struct bt_bmc *bt_bmc)
{}

static void set_b_busy(struct bt_bmc *bt_bmc)
{}

static void clr_b_busy(struct bt_bmc *bt_bmc)
{}

static void set_b2h_atn(struct bt_bmc *bt_bmc)
{}

static u8 bt_read(struct bt_bmc *bt_bmc)
{}

static ssize_t bt_readn(struct bt_bmc *bt_bmc, u8 *buf, size_t n)
{}

static void bt_write(struct bt_bmc *bt_bmc, u8 c)
{}

static ssize_t bt_writen(struct bt_bmc *bt_bmc, u8 *buf, size_t n)
{}

static void set_sms_atn(struct bt_bmc *bt_bmc)
{}

static struct bt_bmc *file_bt_bmc(struct file *file)
{}

static int bt_bmc_open(struct inode *inode, struct file *file)
{}

/*
 * The BT (Block Transfer) interface means that entire messages are
 * buffered by the host before a notification is sent to the BMC that
 * there is data to be read. The first byte is the length and the
 * message data follows. The read operation just tries to capture the
 * whole before returning it to userspace.
 *
 * BT Message format :
 *
 *    Byte 1  Byte 2     Byte 3  Byte 4  Byte 5:N
 *    Length  NetFn/LUN  Seq     Cmd     Data
 *
 */
static ssize_t bt_bmc_read(struct file *file, char __user *buf,
			   size_t count, loff_t *ppos)
{}

/*
 * BT Message response format :
 *
 *    Byte 1  Byte 2     Byte 3  Byte 4  Byte 5  Byte 6:N
 *    Length  NetFn/LUN  Seq     Cmd     Code    Data
 */
static ssize_t bt_bmc_write(struct file *file, const char __user *buf,
			    size_t count, loff_t *ppos)
{}

static long bt_bmc_ioctl(struct file *file, unsigned int cmd,
			 unsigned long param)
{}

static int bt_bmc_release(struct inode *inode, struct file *file)
{}

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

static const struct file_operations bt_bmc_fops =;

static void poll_timer(struct timer_list *t)
{}

static irqreturn_t bt_bmc_irq(int irq, void *arg)
{}

static int bt_bmc_config_irq(struct bt_bmc *bt_bmc,
			     struct platform_device *pdev)
{}

static int bt_bmc_probe(struct platform_device *pdev)
{}

static void bt_bmc_remove(struct platform_device *pdev)
{}

static const struct of_device_id bt_bmc_match[] =;

static struct platform_driver bt_bmc_driver =;

module_platform_driver();

MODULE_DEVICE_TABLE(of, bt_bmc_match);
MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();