13b6d082fSHaiyue Wang /* SPDX-License-Identifier: GPL-2.0 */ 23b6d082fSHaiyue Wang /* 33b6d082fSHaiyue Wang * Copyright (c) 2015-2018, Intel Corporation. 43b6d082fSHaiyue Wang */ 520d60f61SHaiyue Wang 620d60f61SHaiyue Wang #ifndef __KCS_BMC_H__ 720d60f61SHaiyue Wang #define __KCS_BMC_H__ 820d60f61SHaiyue Wang 9d4e7ac68SAndrew Jeffery #include <linux/list.h> 10faae6e39SAndrew Jeffery 11*28651e6cSAndrew Jeffery #define KCS_BMC_EVENT_TYPE_OBE BIT(0) 12*28651e6cSAndrew Jeffery #define KCS_BMC_EVENT_TYPE_IBF BIT(1) 13*28651e6cSAndrew Jeffery 14faae6e39SAndrew Jeffery #define KCS_BMC_STR_OBF BIT(0) 15faae6e39SAndrew Jeffery #define KCS_BMC_STR_IBF BIT(1) 16faae6e39SAndrew Jeffery #define KCS_BMC_STR_CMD_DAT BIT(3) 17faae6e39SAndrew Jeffery 1820d60f61SHaiyue Wang /* IPMI 2.0 - 9.5, KCS Interface Registers 1920d60f61SHaiyue Wang * @idr: Input Data Register 2020d60f61SHaiyue Wang * @odr: Output Data Register 2120d60f61SHaiyue Wang * @str: Status Register 2220d60f61SHaiyue Wang */ 2320d60f61SHaiyue Wang struct kcs_ioreg { 2420d60f61SHaiyue Wang u32 idr; 2520d60f61SHaiyue Wang u32 odr; 2620d60f61SHaiyue Wang u32 str; 2720d60f61SHaiyue Wang }; 2820d60f61SHaiyue Wang 29faae6e39SAndrew Jeffery struct kcs_bmc_device_ops; 30d4e7ac68SAndrew Jeffery struct kcs_bmc_client; 31faae6e39SAndrew Jeffery 32d4e7ac68SAndrew Jeffery struct kcs_bmc_device { 33d4e7ac68SAndrew Jeffery struct list_head entry; 34d4e7ac68SAndrew Jeffery 35d7096970SAndrew Jeffery struct device *dev; 3620d60f61SHaiyue Wang u32 channel; 3720d60f61SHaiyue Wang 3820d60f61SHaiyue Wang struct kcs_ioreg ioreg; 3920d60f61SHaiyue Wang 40d4e7ac68SAndrew Jeffery const struct kcs_bmc_device_ops *ops; 4120d60f61SHaiyue Wang 42d4e7ac68SAndrew Jeffery spinlock_t lock; 43d4e7ac68SAndrew Jeffery struct kcs_bmc_client *client; 4420d60f61SHaiyue Wang }; 45d4e7ac68SAndrew Jeffery 463b6d082fSHaiyue Wang #endif /* __KCS_BMC_H__ */ 47