diff options
| author | Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com> | 2020-12-03 12:48:12 +0300 |
|---|---|---|
| committer | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2021-11-05 10:22:11 +0300 |
| commit | 0bfc3696d261e559fe6bf659637f2cd28244142e (patch) | |
| tree | 7571f7df87ed3e299a98ce1f4585987b08e12cfa /include/uapi/linux | |
| parent | a83904cfec0535f3ae268105af4bc07d8c4e291f (diff) | |
| download | linux-0bfc3696d261e559fe6bf659637f2cd28244142e.tar.xz | |
soc: aspeed: mctp: Add API to register client for MCTP type
MCTP client can register for receiving packets with selected
MCTP message type or PCIE vendor defined message type.
Vendor defined type is 2 bytes but in Intel VDMs the first byte
is variable and only the second byte contains constant message
type - to support this use case we have to specify 2 byte mask
that is applied to packet type before comparing with registered
vendor type.
When MCTP packet arrives its header is compared with a list
of registered (vendor) types.
If no client registered for packet's (vendor) type then
the packet is dispatched to the default client.
Fragmented packets are not considered for type matching.
Only one client can register for given (vendor) type.
Client can register for multiple (vendor) types.
All packet fields must be specified in big endian byte
order.
This feature allows to support multiple clients simultaneously
but only one client per (vendor) message type.
For example we can have PECI client in kernel that uses PECI
vendor message type, dcpmm daemon in user space that handles
NVDIMM vendor type messages and mctpd service that handles MCTP
control and PLDM message types.
tested with peci_mctp_test application
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/aspeed-mctp.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/uapi/linux/aspeed-mctp.h b/include/uapi/linux/aspeed-mctp.h index f47a5bd57a77..2e8882133513 100644 --- a/include/uapi/linux/aspeed-mctp.h +++ b/include/uapi/linux/aspeed-mctp.h @@ -37,6 +37,10 @@ * @ASPEED_MCTP_IOCTL_REGISTER_DEFAULT_HANDLER Register client as default * handler that receives all MCTP messages that were not dispatched to other * clients + * @ASPEED_MCTP_IOCTL_REGISTER_TYPE_HANDLER Register client to receive all + * 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 */ struct aspeed_mctp_filter_eid { @@ -56,6 +60,14 @@ struct aspeed_mctp_get_mtu { __u8 mtu; }; +struct aspeed_mctp_type_handler_ioctl { + __u8 mctp_type; /* MCTP message type as per DSP239*/ + /* Below params must be 0 if mctp_type is not Vendor Defined PCI */ + __u16 pci_vendor_id; /* PCI Vendor ID */ + __u16 vendor_type; /* Vendor specific type */ + __u16 vendor_type_mask; /* Mask applied to vendor type */ +}; + #define ASPEED_MCTP_IOCTL_BASE 0x4d #define ASPEED_MCTP_IOCTL_FILTER_EID \ @@ -68,5 +80,9 @@ struct aspeed_mctp_get_mtu { _IOR(ASPEED_MCTP_IOCTL_BASE, 3, struct aspeed_mctp_get_mtu) #define ASPEED_MCTP_IOCTL_REGISTER_DEFAULT_HANDLER \ _IO(ASPEED_MCTP_IOCTL_BASE, 4) +#define ASPEED_MCTP_IOCTL_REGISTER_TYPE_HANDLER \ + _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) #endif /* _UAPI_LINUX_ASPEED_MCTP_H */ |
