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 9*d4e7ac68SAndrew Jeffery #include <linux/list.h> 10faae6e39SAndrew Jeffery 11faae6e39SAndrew Jeffery #define KCS_BMC_STR_OBF BIT(0) 12faae6e39SAndrew Jeffery #define KCS_BMC_STR_IBF BIT(1) 13faae6e39SAndrew Jeffery #define KCS_BMC_STR_CMD_DAT BIT(3) 14faae6e39SAndrew Jeffery 1520d60f61SHaiyue Wang /* IPMI 2.0 - 9.5, KCS Interface Registers 1620d60f61SHaiyue Wang * @idr: Input Data Register 1720d60f61SHaiyue Wang * @odr: Output Data Register 1820d60f61SHaiyue Wang * @str: Status Register 1920d60f61SHaiyue Wang */ 2020d60f61SHaiyue Wang struct kcs_ioreg { 2120d60f61SHaiyue Wang u32 idr; 2220d60f61SHaiyue Wang u32 odr; 2320d60f61SHaiyue Wang u32 str; 2420d60f61SHaiyue Wang }; 2520d60f61SHaiyue Wang 26faae6e39SAndrew Jeffery struct kcs_bmc_device_ops; 27*d4e7ac68SAndrew Jeffery struct kcs_bmc_client; 28faae6e39SAndrew Jeffery 29*d4e7ac68SAndrew Jeffery struct kcs_bmc_device { 30*d4e7ac68SAndrew Jeffery struct list_head entry; 31*d4e7ac68SAndrew Jeffery 32d7096970SAndrew Jeffery struct device *dev; 3320d60f61SHaiyue Wang u32 channel; 3420d60f61SHaiyue Wang 3520d60f61SHaiyue Wang struct kcs_ioreg ioreg; 3620d60f61SHaiyue Wang 37*d4e7ac68SAndrew Jeffery const struct kcs_bmc_device_ops *ops; 3820d60f61SHaiyue Wang 39*d4e7ac68SAndrew Jeffery spinlock_t lock; 40*d4e7ac68SAndrew Jeffery struct kcs_bmc_client *client; 4120d60f61SHaiyue Wang }; 42*d4e7ac68SAndrew Jeffery 433b6d082fSHaiyue Wang #endif /* __KCS_BMC_H__ */ 44