Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * Management Component Transport Protocol (MCTP)
0004  *
0005  * Copyright (c) 2021 Code Construct
0006  * Copyright (c) 2021 Google
0007  */
0008 
0009 #ifndef __UAPI_MCTP_H
0010 #define __UAPI_MCTP_H
0011 
0012 #include <linux/types.h>
0013 #include <linux/socket.h>
0014 #include <linux/netdevice.h>
0015 
0016 typedef __u8            mctp_eid_t;
0017 
0018 struct mctp_addr {
0019     mctp_eid_t      s_addr;
0020 };
0021 
0022 struct sockaddr_mctp {
0023     __kernel_sa_family_t    smctp_family;
0024     __u16           __smctp_pad0;
0025     unsigned int        smctp_network;
0026     struct mctp_addr    smctp_addr;
0027     __u8            smctp_type;
0028     __u8            smctp_tag;
0029     __u8            __smctp_pad1;
0030 };
0031 
0032 struct sockaddr_mctp_ext {
0033     struct sockaddr_mctp    smctp_base;
0034     int         smctp_ifindex;
0035     __u8            smctp_halen;
0036     __u8            __smctp_pad0[3];
0037     __u8            smctp_haddr[MAX_ADDR_LEN];
0038 };
0039 
0040 #define MCTP_NET_ANY        0x0
0041 
0042 #define MCTP_ADDR_NULL      0x00
0043 #define MCTP_ADDR_ANY       0xff
0044 
0045 #define MCTP_TAG_MASK       0x07
0046 #define MCTP_TAG_OWNER      0x08
0047 #define MCTP_TAG_PREALLOC   0x10
0048 
0049 #define MCTP_OPT_ADDR_EXT   1
0050 
0051 #define SIOCMCTPALLOCTAG    (SIOCPROTOPRIVATE + 0)
0052 #define SIOCMCTPDROPTAG     (SIOCPROTOPRIVATE + 1)
0053 
0054 struct mctp_ioc_tag_ctl {
0055     mctp_eid_t  peer_addr;
0056 
0057     /* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
0058      * populate with the allocated tag value. Returned tag value will
0059      * always have TO and PREALLOC set.
0060      *
0061      * For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
0062      * a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
0063      */
0064     __u8        tag;
0065     __u16       flags;
0066 };
0067 
0068 #endif /* __UAPI_MCTP_H */