| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
|
| 3 |
#ifndef _MI_MCTP_COMPAT_H |
| 4 |
#define _MI_MCTP_COMPAT_H |
| 5 |
|
| 6 |
#include <linux/types.h> |
| 7 |
|
| 8 |
/* As of kernel v5.15, these AF_MCTP-related definitions are provided by |
| 9 |
* linux/mctp.h. However, we provide a set here while that header percolates |
| 10 |
* through to standard includes. |
| 11 |
* |
| 12 |
* These were all introduced in the same version as AF_MCTP was defined, |
| 13 |
* so we can key off the presence of that. |
| 14 |
*/ |
| 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 |
unsigned short int 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 |
#define MCTP_NET_ANY 0x0 |
| 33 |
|
| 34 |
#define MCTP_ADDR_NULL 0x00 |
| 35 |
#define MCTP_ADDR_ANY 0xff |
| 36 |
|
| 37 |
#define MCTP_TAG_MASK 0x07 |
| 38 |
#define MCTP_TAG_OWNER 0x08 |
| 39 |
|
| 40 |
#endif /* _MI_MCTP_COMPAT_H */ |