summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/kcs_bmc.h
blob: fa408b802c79199545d8c30a3cf77c9b62b4ae3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2015-2018, Intel Corporation.
 */

#ifndef __KCS_BMC_H__
#define __KCS_BMC_H__

#include <linux/list.h>

#define KCS_BMC_EVENT_TYPE_OBE	BIT(0)
#define KCS_BMC_EVENT_TYPE_IBF	BIT(1)

#define KCS_BMC_STR_OBF		BIT(0)
#define KCS_BMC_STR_IBF		BIT(1)
#define KCS_BMC_STR_CMD_DAT	BIT(3)

/* IPMI 2.0 - 9.5, KCS Interface Registers
 * @idr: Input Data Register
 * @odr: Output Data Register
 * @str: Status Register
 */
struct kcs_ioreg {
	u32 idr;
	u32 odr;
	u32 str;
};

struct kcs_bmc_device_ops;
struct kcs_bmc_client;

struct kcs_bmc_device {
	struct list_head entry;

	struct device *dev;
	u32 channel;

	struct kcs_ioreg ioreg;

	const struct kcs_bmc_device_ops *ops;

	spinlock_t lock;
	struct kcs_bmc_client *client;
};

#endif /* __KCS_BMC_H__ */