~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/mctp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*
  3  * Management Component Transport Protocol (MCTP)
  4  *
  5  * Copyright (c) 2021 Code Construct
  6  * Copyright (c) 2021 Google
  7  */
  8 
  9 #ifndef __UAPI_MCTP_H
 10 #define __UAPI_MCTP_H
 11 
 12 #include <linux/types.h>
 13 #include <linux/socket.h>
 14 #include <linux/netdevice.h>
 15 
 16 typedef __u8                    mctp_eid_t;
 17 
 18 struct mctp_addr {
 19         mctp_eid_t              s_addr;
 20 };
 21 
 22 struct sockaddr_mctp {
 23         __kernel_sa_family_t    smctp_family;
 24         __u16                   __smctp_pad0;
 25         unsigned int            smctp_network;
 26         struct mctp_addr        smctp_addr;
 27         __u8                    smctp_type;
 28         __u8                    smctp_tag;
 29         __u8                    __smctp_pad1;
 30 };
 31 
 32 struct sockaddr_mctp_ext {
 33         struct sockaddr_mctp    smctp_base;
 34         int                     smctp_ifindex;
 35         __u8                    smctp_halen;
 36         __u8                    __smctp_pad0[3];
 37         __u8                    smctp_haddr[MAX_ADDR_LEN];
 38 };
 39 
 40 #define MCTP_NET_ANY            0x0
 41 
 42 #define MCTP_ADDR_NULL          0x00
 43 #define MCTP_ADDR_ANY           0xff
 44 
 45 #define MCTP_TAG_MASK           0x07
 46 #define MCTP_TAG_OWNER          0x08
 47 #define MCTP_TAG_PREALLOC       0x10
 48 
 49 #define MCTP_OPT_ADDR_EXT       1
 50 
 51 #define SIOCMCTPALLOCTAG        (SIOCPROTOPRIVATE + 0)
 52 #define SIOCMCTPDROPTAG         (SIOCPROTOPRIVATE + 1)
 53 #define SIOCMCTPALLOCTAG2       (SIOCPROTOPRIVATE + 2)
 54 #define SIOCMCTPDROPTAG2        (SIOCPROTOPRIVATE + 3)
 55 
 56 /* Deprecated: use mctp_ioc_tag_ctl2 / TAG2 ioctls instead, which defines the
 57  * MCTP network ID as part of the allocated tag. Using this assumes the default
 58  * net ID for allocated tags, which may not give correct behaviour on system
 59  * with multiple networks configured.
 60  */
 61 struct mctp_ioc_tag_ctl {
 62         mctp_eid_t      peer_addr;
 63 
 64         /* For SIOCMCTPALLOCTAG: must be passed as zero, kernel will
 65          * populate with the allocated tag value. Returned tag value will
 66          * always have TO and PREALLOC set.
 67          *
 68          * For SIOCMCTPDROPTAG: userspace provides tag value to drop, from
 69          * a prior SIOCMCTPALLOCTAG call (and so must have TO and PREALLOC set).
 70          */
 71         __u8            tag;
 72         __u16           flags;
 73 };
 74 
 75 struct mctp_ioc_tag_ctl2 {
 76         /* Peer details: network ID, peer EID, local EID. All set by the
 77          * caller.
 78          *
 79          * Local EID must be MCTP_ADDR_NULL or MCTP_ADDR_ANY in current
 80          * kernels.
 81          */
 82         unsigned int    net;
 83         mctp_eid_t      peer_addr;
 84         mctp_eid_t      local_addr;
 85 
 86         /* Set by caller, but no flags defined currently. Must be 0 */
 87         __u16           flags;
 88 
 89         /* For SIOCMCTPALLOCTAG2: must be passed as zero, kernel will
 90          * populate with the allocated tag value. Returned tag value will
 91          * always have TO and PREALLOC set.
 92          *
 93          * For SIOCMCTPDROPTAG2: userspace provides tag value to drop, from
 94          * a prior SIOCMCTPALLOCTAG2 call (and so must have TO and PREALLOC set).
 95          */
 96         __u8            tag;
 97 
 98 };
 99 
100 #endif /* __UAPI_MCTP_H */
101 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php