xref: /openbmc/linux/drivers/char/ipmi/kcs_bmc.h (revision a266ef69)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2015-2018, Intel Corporation.
4  */
5 
6 #ifndef __KCS_BMC_H__
7 #define __KCS_BMC_H__
8 
9 #include <linux/list.h>
10 
11 #define KCS_BMC_EVENT_TYPE_OBE	BIT(0)
12 #define KCS_BMC_EVENT_TYPE_IBF	BIT(1)
13 
14 #define KCS_BMC_STR_OBF		BIT(0)
15 #define KCS_BMC_STR_IBF		BIT(1)
16 #define KCS_BMC_STR_CMD_DAT	BIT(3)
17 
18 /* IPMI 2.0 - 9.5, KCS Interface Registers
19  * @idr: Input Data Register
20  * @odr: Output Data Register
21  * @str: Status Register
22  */
23 struct kcs_ioreg {
24 	u32 idr;
25 	u32 odr;
26 	u32 str;
27 };
28 
29 struct kcs_bmc_device_ops;
30 struct kcs_bmc_client;
31 
32 struct kcs_bmc_device {
33 	struct list_head entry;
34 
35 	struct device *dev;
36 	u32 channel;
37 
38 	struct kcs_ioreg ioreg;
39 
40 	const struct kcs_bmc_device_ops *ops;
41 
42 	spinlock_t lock;
43 	struct kcs_bmc_client *client;
44 };
45 
46 #endif /* __KCS_BMC_H__ */
47