Skip to content

Commit 2c8e2e9

Browse files
jk-ozlabsdavem330
authored andcommitted
mctp: Add base packet definitions
Simple packet header format as defined by DMTF DSP0236. Signed-off-by: Jeremy Kerr <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8f601a1 commit 2c8e2e9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11037,6 +11037,7 @@ M: Jeremy Kerr <[email protected]>
1103711037
M: Matt Johnston <[email protected]>
1103811038
1103911039
S: Maintained
11040+
F: include/net/mctp.h
1104011041
F: net/mctp/
1104111042

1104211043
MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7

include/net/mctp.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Management Component Transport Protocol (MCTP)
4+
*
5+
* Copyright (c) 2021 Code Construct
6+
* Copyright (c) 2021 Google
7+
*/
8+
9+
#ifndef __NET_MCTP_H
10+
#define __NET_MCTP_H
11+
12+
#include <linux/bits.h>
13+
14+
/* MCTP packet definitions */
15+
struct mctp_hdr {
16+
u8 ver;
17+
u8 dest;
18+
u8 src;
19+
u8 flags_seq_tag;
20+
};
21+
22+
#define MCTP_VER_MIN 1
23+
#define MCTP_VER_MAX 1
24+
25+
/* Definitions for flags_seq_tag field */
26+
#define MCTP_HDR_FLAG_SOM BIT(7)
27+
#define MCTP_HDR_FLAG_EOM BIT(6)
28+
#define MCTP_HDR_FLAG_TO BIT(3)
29+
#define MCTP_HDR_FLAGS GENMASK(5, 3)
30+
#define MCTP_HDR_SEQ_SHIFT 4
31+
#define MCTP_HDR_SEQ_MASK GENMASK(1, 0)
32+
#define MCTP_HDR_TAG_SHIFT 0
33+
#define MCTP_HDR_TAG_MASK GENMASK(2, 0)
34+
35+
#endif /* __NET_MCTP_H */

0 commit comments

Comments
 (0)