diff options
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/linux/aspeed-mctp.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/uapi/linux/aspeed-mctp.h b/include/uapi/linux/aspeed-mctp.h new file mode 100644 index 000000000000..9819b6029d19 --- /dev/null +++ b/include/uapi/linux/aspeed-mctp.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2020 Intel Corporation */ + +#ifndef _UAPI_LINUX_ASPEED_MCTP_H +#define _UAPI_LINUX_ASPEED_MCTP_H + +#include <linux/ioctl.h> +#include <linux/types.h> + +/* + * aspeed-mctp is a simple device driver exposing a read/write interface: + * +----------------------+ + * | PCIe VDM Header | 16 bytes (Big Endian) + * +----------------------+ + * | MCTP Message Payload | 64/128/256/512 bytes (Big Endian) + * +----------------------+ + * + * MCTP packet description can be found in DMTF DSP0238, + * MCTP PCIe VDM Transport Specification. + */ + +#define ASPEED_MCTP_PCIE_VDM_HDR_SIZE 16 + +/* + * uevents generated by aspeed-mctp driver + */ +#define ASPEED_MCTP_READY "PCIE_READY" + +/* + * MCTP operations + * @ASPEED_MCTP_IOCTL_FILTER_EID: enable/disable filter incoming packets based + * on Endpoint ID (BROKEN) + * @ASPEED_MCTP_IOCTL_GET_BDF: read PCI bus/device/function of MCTP Controller + * @ASPEED_MCTP_IOCTL_GET_MEDIUM_ID: read MCTP physical medium identifier + * related to PCIe revision + * @ASPEED_MCTP_IOCTL_GET_MTU: read max transmission unit (in bytes) + */ + +struct aspeed_mctp_filter_eid { + __u8 eid; + bool enable; +}; + +struct aspeed_mctp_get_bdf { + __u16 bdf; +}; + +struct aspeed_mctp_get_medium_id { + __u8 medium_id; +}; + +struct aspeed_mctp_get_mtu { + __u8 mtu; +}; + +#define ASPEED_MCTP_IOCTL_BASE 0x4d + +#define ASPEED_MCTP_IOCTL_FILTER_EID \ + _IOW(ASPEED_MCTP_IOCTL_BASE, 0, struct aspeed_mctp_filter_eid) +#define ASPEED_MCTP_IOCTL_GET_BDF \ + _IOR(ASPEED_MCTP_IOCTL_BASE, 1, struct aspeed_mctp_get_bdf) +#define ASPEED_MCTP_IOCTL_GET_MEDIUM_ID \ + _IOR(ASPEED_MCTP_IOCTL_BASE, 2, struct aspeed_mctp_get_medium_id) +#define ASPEED_MCTP_IOCTL_GET_MTU \ + _IOR(ASPEED_MCTP_IOCTL_BASE, 3, struct aspeed_mctp_get_mtu) + +#endif /* _UAPI_LINUX_ASPEED_MCTP_H */ |
