summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorKarol Wachowski <karol.wachowski@intel.com>2020-11-24 16:59:43 +0300
committerJae Hyun Yoo <jae.hyun.yoo@linux.intel.com>2021-11-05 10:22:12 +0300
commit02f614a5d514c3c92ca7c8255c6d88bee605b813 (patch)
tree8565195d69413c0b9e2af155ff1dc405f0568270 /include/uapi
parent7558f5da7ae6a6ece7ae7e8b53d2f8a282e12727 (diff)
downloadlinux-02f614a5d514c3c92ca7c8255c6d88bee605b813.tar.xz
aspeed-mctp: Add EID information related ioctls
Implement two new ioctls for storing EID related information: * ASPEED_MCTP_IOCTL_GET_EID_INFO * ASPEED_MCTP_IOCTL_SET_EID_INFO Driver stores EID mapping in a list which is traversed when one tries to get information using ASPEED_MCTP_IOCTL_GET_EID_INFO ioctl, when given EID mapping is not found in the list, next entry is returned. When there are no entries with EIDs higher than specified in the IOCTL call -ENODEV is returned. Whenever new information about EID mapping is stored with ASPEED_MCTP_IOCTL_SET_EID_INFO ioctl driver empties exsiting list of mappings and creates new one based on user input. After insertion list is sorted by EID. Invalid input such as duplicated EIDs will cause driver to return -EINVAL. Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/aspeed-mctp.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/uapi/linux/aspeed-mctp.h b/include/uapi/linux/aspeed-mctp.h
index 2e8882133513..86ff04b71e92 100644
--- a/include/uapi/linux/aspeed-mctp.h
+++ b/include/uapi/linux/aspeed-mctp.h
@@ -27,6 +27,11 @@
#define ASPEED_MCTP_READY "PCIE_READY"
/*
+ * maximum possible number of struct eid_info elements stored in list
+ */
+#define ASPEED_MCTP_EID_INFO_MAX 256
+
+/*
* MCTP operations
* @ASPEED_MCTP_IOCTL_FILTER_EID: enable/disable filter incoming packets based
* on Endpoint ID (BROKEN)
@@ -41,6 +46,10 @@
* messages of specified MCTP type or PCI vendor defined type
* @ASPEED_MCTP_IOCTL_UNREGISTER_TYPE_HANDLER Unregister client as handler
* for specified MCTP type or PCI vendor defined message type
+ * @ASPEED_MCTP_GET_EID_INFO: read list of existing endpoint mappings
+ * returns count which is less of the two requested count and existing count
+ * @ASPEED_MCTP_SET_EID_INFO: write list of endpoint mappings
+ * overwrites already existing endpoint mappings
*/
struct aspeed_mctp_filter_eid {
@@ -68,6 +77,22 @@ struct aspeed_mctp_type_handler_ioctl {
__u16 vendor_type_mask; /* Mask applied to vendor type */
};
+struct aspeed_mctp_eid_info {
+ __u8 eid;
+ __u16 bdf;
+};
+
+struct aspeed_mctp_get_eid_info {
+ __u64 ptr;
+ __u16 count;
+ __u8 start_eid;
+};
+
+struct aspeed_mctp_set_eid_info {
+ __u64 ptr;
+ __u16 count;
+};
+
#define ASPEED_MCTP_IOCTL_BASE 0x4d
#define ASPEED_MCTP_IOCTL_FILTER_EID \
@@ -84,5 +109,9 @@ struct aspeed_mctp_type_handler_ioctl {
_IOW(ASPEED_MCTP_IOCTL_BASE, 6, struct aspeed_mctp_type_handler_ioctl)
#define ASPEED_MCTP_IOCTL_UNREGISTER_TYPE_HANDLER \
_IOW(ASPEED_MCTP_IOCTL_BASE, 7, struct aspeed_mctp_type_handler_ioctl)
+#define ASPEED_MCTP_IOCTL_GET_EID_INFO \
+ _IOWR(ASPEED_MCTP_IOCTL_BASE, 8, struct aspeed_mctp_get_eid_info)
+#define ASPEED_MCTP_IOCTL_SET_EID_INFO \
+ _IOW(ASPEED_MCTP_IOCTL_BASE, 9, struct aspeed_mctp_set_eid_info)
#endif /* _UAPI_LINUX_ASPEED_MCTP_H */