1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef __LAN966X_IFH_H__
4 #define __LAN966X_IFH_H__
5 
6 /* Fields with description (*) should just be cleared upon injection
7  * IFH is transmitted MSByte first (Highest bit pos sent as MSB of first byte)
8  */
9 
10 #define IFH_LEN                      7
11 
12 /* Timestamp for frame */
13 #define IFH_POS_TIMESTAMP            192
14 
15 /* Bypass analyzer with a prefilled IFH */
16 #define IFH_POS_BYPASS               191
17 
18 /* Masqueraded injection with masq_port defining logical source port */
19 #define IFH_POS_MASQ                 190
20 
21 /* Masqueraded port number for injection */
22 #define IFH_POS_MASQ_PORT            186
23 
24 /* Frame length (*) */
25 #define IFH_POS_LEN                  178
26 
27 /* Cell filling mode. Full(0),Etype(1), LlctOpt(2), Llct(3) */
28 #define IFH_POS_WRDMODE              176
29 
30 /* Frame has 16 bits rtag removed compared to line data */
31 #define IFH_POS_RTAG48               175
32 
33 /* Frame has a redundancy tag */
34 #define IFH_POS_HAS_RED_TAG          174
35 
36 /* Frame has been cut through forwarded (*) */
37 #define IFH_POS_CUTTHRU              173
38 
39 /* Rewriter command */
40 #define IFH_POS_REW_CMD              163
41 
42 /* Enable OAM-related rewriting. PDU_TYPE encodes OAM type. */
43 #define IFH_POS_REW_OAM              162
44 
45 /* PDU type. Encoding: (0-NONE, 1-Y1731_CCM, 2-MRP_TST, 3-MRP_ITST, 4-DLR_BCN,
46  * 5-DLR_ADV, 6-RTE_NULL_INJ, 7-IPV4, 8-IPV6, 9-Y1731_NON_CCM).
47  */
48 #define IFH_POS_PDU_TYPE             158
49 
50 /* Update FCS before transmission */
51 #define IFH_POS_FCS_UPD              157
52 
53 /* Classified DSCP value of frame */
54 #define IFH_POS_DSCP                 151
55 
56 /* Yellow indication */
57 #define IFH_POS_DP                   150
58 
59 /* Process in RTE/inbound */
60 #define IFH_POS_RTE_INB_UPDATE       149
61 
62 /* Number of tags to pop from frame */
63 #define IFH_POS_POP_CNT              147
64 
65 /* Number of tags in front of the ethertype */
66 #define IFH_POS_ETYPE_OFS            145
67 
68 /* Logical source port of frame (*) */
69 #define IFH_POS_SRCPORT              141
70 
71 /* Sequence number in redundancy tag */
72 #define IFH_POS_SEQ_NUM              120
73 
74 /* Stagd flag and classified TCI of frame (PCP/DEI/VID) */
75 #define IFH_POS_TCI                  103
76 
77 /* Classified internal priority for queuing */
78 #define IFH_POS_QOS_CLASS            100
79 
80 /* Bit mask with eight cpu copy classses */
81 #define IFH_POS_CPUQ                 92
82 
83 /* Relearn + learn flags (*) */
84 #define IFH_POS_LEARN_FLAGS          90
85 
86 /* SFLOW identifier for frame (0-8: Tx port, 9: Rx sampling, 15: No sampling) */
87 #define IFH_POS_SFLOW_ID             86
88 
89 /* Set if an ACL/S2 rule was hit (*).
90  * Super priority: acl_hit=0 and acl_hit(4)=1.
91  */
92 #define IFH_POS_ACL_HIT              85
93 
94 /* S2 rule index hit (*) */
95 #define IFH_POS_ACL_IDX              79
96 
97 /* ISDX as classified by S1 */
98 #define IFH_POS_ISDX                 71
99 
100 /* Destination ports for frame */
101 #define IFH_POS_DSTS                 62
102 
103 /* Storm policer to be applied: None/Uni/Multi/Broad (*) */
104 #define IFH_POS_FLOOD                60
105 
106 /* Redundancy tag operation */
107 #define IFH_POS_SEQ_OP               58
108 
109 /* Classified internal priority for resourcemgt, tagging etc */
110 #define IFH_POS_IPV                  55
111 
112 /* Frame is for AFI use */
113 #define IFH_POS_AFI                  54
114 
115 /* Internal aging value (*) */
116 #define IFH_POS_AGED                 52
117 
118 /* RTP Identifier */
119 #define IFH_POS_RTP_ID               42
120 
121 /* RTP MRPD flow */
122 #define IFH_POS_RTP_SUBID            41
123 
124 /* Profinet DataStatus or opcua GroupVersion MSB */
125 #define IFH_POS_PN_DATA_STATUS       33
126 
127 /* Profinet transfer status (1 iff the status is 0) */
128 #define IFH_POS_PN_TRANSF_STATUS_ZERO 32
129 
130 /* Profinet cycle counter or opcua NetworkMessageNumber */
131 #define IFH_POS_PN_CC                16
132 
133 #define IFH_WID_TIMESTAMP            32
134 #define IFH_WID_BYPASS               1
135 #define IFH_WID_MASQ                 1
136 #define IFH_WID_MASQ_PORT            4
137 #define IFH_WID_LEN                  14
138 #define IFH_WID_WRDMODE              2
139 #define IFH_WID_RTAG48               1
140 #define IFH_WID_HAS_RED_TAG          1
141 #define IFH_WID_CUTTHRU              1
142 #define IFH_WID_REW_CMD              10
143 #define IFH_WID_REW_OAM              1
144 #define IFH_WID_PDU_TYPE             4
145 #define IFH_WID_FCS_UPD              1
146 #define IFH_WID_DSCP                 6
147 #define IFH_WID_DP                   1
148 #define IFH_WID_RTE_INB_UPDATE       1
149 #define IFH_WID_POP_CNT              2
150 #define IFH_WID_ETYPE_OFS            2
151 #define IFH_WID_SRCPORT              4
152 #define IFH_WID_SEQ_NUM              16
153 #define IFH_WID_TCI                  17
154 #define IFH_WID_QOS_CLASS            3
155 #define IFH_WID_CPUQ                 8
156 #define IFH_WID_LEARN_FLAGS          2
157 #define IFH_WID_SFLOW_ID             4
158 #define IFH_WID_ACL_HIT              1
159 #define IFH_WID_ACL_IDX              6
160 #define IFH_WID_ISDX                 8
161 #define IFH_WID_DSTS                 9
162 #define IFH_WID_FLOOD                2
163 #define IFH_WID_SEQ_OP               2
164 #define IFH_WID_IPV                  3
165 #define IFH_WID_AFI                  1
166 #define IFH_WID_AGED                 2
167 #define IFH_WID_RTP_ID               10
168 #define IFH_WID_RTP_SUBID            1
169 #define IFH_WID_PN_DATA_STATUS       8
170 #define IFH_WID_PN_TRANSF_STATUS_ZERO 1
171 #define IFH_WID_PN_CC                16
172 
173 #endif /* __LAN966X_IFH_H__ */
174