Skip to content

Commit 3856fb7

Browse files
committed
mi: Additional define options for older systems with SIOCMCTPALLOC
Older systems (WSL for example) may not include SIOCMCTPALLOC defines and structs and when enabling in MCTP code will cause build errors. This is a workaround. Signed-off-by: Chuck Horkin <[email protected]>
1 parent 0454a99 commit 3856fb7

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/nvme/mi-mctp.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,35 @@ struct sockaddr_mctp {
7676

7777
#endif /* !AF_MCTP */
7878

79+
#if !defined(MCTP_TAG_PREALLOC)
80+
/*Adding this here for users with older build MCTP header
81+
*that require SIOCMCTPALLOC/DROP
82+
*/
83+
#define MCTP_TAG_PREALLOC 0x10
84+
85+
#define SIOCMCTPALLOCTAG (SIOCPROTOPRIVATE + 0)
86+
#define SIOCMCTPDROPTAG (SIOCPROTOPRIVATE + 1)
87+
88+
/* Deprecated: use mctp_ioc_tag_ctl2 / TAG2 ioctls instead, which defines the
89+
* MCTP network ID as part of the allocated tag. Using this assumes the default
90+
* net ID for allocated tags, which may not give correct behaviour on system
91+
* with multiple networks configured.
92+
*/
93+
struct mctp_ioc_tag_ctl {
94+
mctp_eid_t peer_addr;
95+
96+
/* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
97+
* populate with the allocated tag value. Returned tag value will
98+
* always have TO and PREALLOC set.
99+
*
100+
* For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
101+
* a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
102+
*/
103+
__u8 tag;
104+
__u16 flags;
105+
};
106+
#endif /* !MCTP_TAG_PREALLOC */
107+
79108
#define MCTP_TYPE_NVME 0x04
80109
#define MCTP_TYPE_MIC 0x80
81110

0 commit comments

Comments
 (0)