1 //
2 // TEXAS INSTRUMENTS TEXT FILE LICENSE
3 //
4 // Copyright (c) 2016 Texas Instruments Incorporated
5 //
6 // All rights reserved not granted herein.
7 //
8 // Limited License.
9 //
10 // Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
11 // license under copyrights and patents it now or hereafter owns or controls to
12 // make, have made, use, import, offer to sell and sell ("Utilize") this software
13 // subject to the terms herein. With respect to the foregoing patent license,
14 // such license is granted solely to the extent that any such patent is necessary
15 // to Utilize the software alone. The patent license shall not apply to any
16 // combinations which include this software, other than combinations with devices
18 //
19 // Redistributions must preserve existing copyright notices and reproduce this license
20 // (including the above copyright notice and the disclaimer and (if applicable) source
21 // code license limitations below) in the documentation and/or other materials provided
22 // with the distribution.
23 //
24 // Redistribution and use in binary form, without modification, are permitted provided
25 // that the following conditions are met:
26 // No reverse engineering, decompilation, or disassembly of this software is
27 // permitted with respect to any software provided in binary form.
28 // Any redistribution and use are licensed by TI for use only with TI Devices.
29 // Nothing shall obligate TI to provide you with source code for the software
30 // licensed and provided to you in object code.
31 //
32 // If software source code is provided to you, modification and redistribution of the
33 // source code are permitted provided that the following conditions are met:
34 // Any redistribution and use of the source code, including any resulting derivative
35 // works, are licensed by TI for use only with TI Devices.
36 // Any redistribution and use of any object code compiled from the source code
37 // and any resulting derivative works, are licensed by TI for use only with TI Devices.
38 //
39 // Neither the name of Texas Instruments Incorporated nor the names of its suppliers
40 // may be used to endorse or promote products derived from this software without
41 // specific prior written permission.
42 //
43 // DISCLAIMER.
44 //
45 // THIS SOFTWARE IS PROVIDED BY TI AND TI\92S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED
46 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
47 // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TI AND TI\92S
48 // LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
49 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
50 // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
51 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
53 // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 //
55 //
56 //
58 #ifndef _PDSP_PROTOS_H
59 #define _PDSP_PROTOS_H 1
61 // **************************************************************************************
62 // * FILE PURPOSE: Provide srio header definitions
63 // **************************************************************************************
64 // * FILE NAME: pdsp_srio.h
65 // *
66 // * DESCRIPTION: SRIO header definitions
67 // *
68 // **************************************************************************************
70 // SRIO type 11
71 .struct struct_SrioType11
72 .u16 srcId
73 .u16 dstId
74 .u32 ctrl
75 .ends
77 #define SRIO_TYPE11_MBOX_MASK 0x3F // b0
78 #define SRIO_TYPE11_LTR_MASK 0x01C0 // w0
79 #define SRIO_TYPE11_LTR_SHIFT 6 // w0
80 #define SRIO_TYPE11_TT_MASK 0x06 // b1
81 #define SRIO_TYPE11_TT_SHIFT 1 // b1
82 #define SRIO_TYPE11_PRI_MASK 0x78 // b1
83 #define SRIO_TYPE11_PRI_SHIFT 3 // b1
84 #define SRIO_TYPE11_CC_MASK 0x0180 // w1
85 #define SRIO_TYPE11_CC_SHIFT 7 // w1
87 #define t_srio_type11_t_port16 t1
90 // SRIO type 9
91 .struct struct_SrioType9
92 .u16 srcId
93 .u16 dstId
94 .u16 streamId
95 .u8 ctrl // PRI, TT and CC
96 .u8 cos
97 .ends
99 #define SRIO_TYPE9_PRI_MASK 0x78
100 #define SRIO_TYPE9_PRI_SHIFT 3
101 #define SRIO_TYPE9_CC_MASK 0x03
102 #define SRIO_TYPE9_CC_SHIFT 0
104 #define t_srio_type9_t_port16 t2
106 // ****************************************************************************************
107 // * FILE PURPOSE: Defines the TCP and UDP headers
108 // ****************************************************************************************
109 // * FILE NAMEP pdsp_tcp_udp.h
110 // *
111 // * DESCRIPTION:
112 // *
113 // ****************************************************************************************
115 .struct struct_udp
116 .u16 src
117 .u16 dst
118 .u16 len
119 .u16 chksum
120 .ends
122 #define UDP_HEADER_LEN_BYTES 8
124 .struct struct_udpLite
125 .u16 src
126 .u16 dst
127 .u16 chkCov
128 .u16 chksum
129 .ends
131 #define UDP_TCP_DEST_PORT_GTP 2152
133 #define UDP_LITE_HEADER_LEN_BYTES 8
136 .struct struct_tcp
137 .u16 src
138 .u16 dst
139 .u32 seq
140 .u32 ackn
141 .u8 offset_ecn
142 .u8 ctrl
143 .u16 window
144 .u16 chksum
145 .u16 urgent
146 .ends
148 #define TCP_CTRL_IND_MASK 0x07 // RST|SYN|FIN: indicate control packet
149 // note ACK = 0 only when SYN=1
151 // ****************************************************************************************
152 // * FILE PURPOSE: Defines the ISEC NAT-T headers
153 // ****************************************************************************************
154 // * FILE NAME: ipsec_nat_t.h
155 // *
156 // * DESCRIPTION:
157 // *
158 // ****************************************************************************************
159 .struct struct_ipsec_nat_t
160 .u32 spi
161 .ends
163 .struct struct_ipsec_nat_t2
164 .u8 data
165 .ends
168 // ******************************************************************************
169 // * FILE PURPOSE: GTP header definitions
170 // ******************************************************************************
171 // * FILE NAME: pdsp_gtp.h
172 // *
173 // * DESCRIPTION: Defines values used for GTP v1 and GTP v2 parsing
174 // *
175 // ******************************************************************************
178 // GTP v1
179 .struct struct_gtp
180 .u8 ctrl
181 .u8 msgType
182 .u16 totalLen
183 .u32 teid
184 .u16 seqNum
185 .u8 numPdu
186 .u8 nextHdr
187 .u8 extHdrByte1
188 .u16 pduNum
189 .u8 nextHdr2
190 .ends
192 #define GTP_VER_MASK 0xE0
193 #define GTP_VER_SHIFT 5
195 // GTP Version identifiers
196 #define GTP_VER_GTP_V1 (1 << GTP_VER_SHIFT)
197 #define GTP_VER_GTP_V2 (2 << GTP_VER_SHIFT)
199 #define t_gtp_ctrl_pt_1 t4 //set: GTP1 ; clear GTP0
200 #define t_gtp_ctrl_extHdr t2
201 #define t_gtp_ctrl_segNum t1
202 #define t_gtp_ctrl_numPdu t0
203 #define GTP_CTRL_MASK 0x07 // if any of the control bits is set, the seqence number, N-PDU and next hdr is present
205 #define GTPV1_HEADER_LEN_BYTES 8
206 #define GTPV1_EXT_HDR_LEN_BYTES 4
209 #define GTP_NEXTHDR_NONE 0
210 #define GTP_NEXTHDR_PDU_NUM 0xC0
212 .struct struct_gtpv2
213 .u8 ctrl
214 .u8 msgType
215 .u16 totalLen
216 .u32 teid
217 .u16 seqNum
218 .u16 rsvd
219 .ends
221 #define t_gtpv2_ctrl_piggyBack t4
222 #define t_gtpv2_ctrl_teid t3
227 #endif // _PDSP_PROTOS_H