comparison src/gpf3/ccd/ccddata_pdi.c @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul : ccddata_pdi.c
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : contains table with information to decode airmessages
18 | depending on the carrier-primitive
19 +-----------------------------------------------------------------------------
20 */
21
22 #include "pdi.h"
23 #include "ccdtable.h"
24 #include "mconst.cdg"
25 #include "pconst.cdg"
26
27 /* declaration of special ccdmsg preparation handlers */
28 int invoke_ccd_setStore(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
29 int mphX_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
30 int mphp_sing_block_req_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
31 int mphp_sing_block_con_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
32 int mphp_sing_block_con_edge_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
33 int mphp_polling_resp_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
34 int mac_data_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
35 int mac_poll_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
36 int rlc_data_0_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
37 int rlc_data_1_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len);
38
39 /* declaration of primitive members to be collected */
40 static char* ccd_loadstore_elements[]=
41 {
42 "loadstore_val0",
43 "loadstore_val1",
44 NULL
45 };
46
47 static char* mphX_constrainer[]=
48 {
49 "error_flag",
50 NULL
51 };
52
53 static char* mphp_sing_block_constrainer[]=
54 {
55 "purpose",
56 NULL
57 };
58
59 static char* mphp_sing_block_con_edge_constrainer[]=
60 {
61 "purpose",
62 "sb_status",
63 "dl_error",
64 NULL
65 };
66
67 static char* mphp_polling_resp_constrainer[] =
68 {
69 "poll_resp_type",
70 NULL
71 };
72
73 static char* mac_data_constrainer[] =
74 {
75 "block_status",
76 NULL
77 };
78
79 static char* rlc_data_constrainer[] =
80 {
81 "rlc_id",
82 NULL
83 };
84
85
86 /* decode info filter */
87 static T_PDI_DECODEINFO m_dinfo[]={
88 /* type */ /* attrib */ /* prim */ /* entity */ /* mt */ /* pdi_prepare_ccdmsg */ /* primmbr */
89 {PDI_DECODETYPE_L3PDU_N, "sdu", "PH_*", "", 0xff, NULL, NULL},
90 {PDI_DECODETYPE_L3PDU_N, "sdu", "MPH_*", "", 0xff, NULL, NULL},
91 {PDI_DECODETYPE_RR_SHORT, "sdu", "DL_SHORT*", "RR_SHORT", 0xff, NULL, NULL},
92 #ifdef DL_DATA_REQ
93 #if (DL_DATA_REQ & 0x4000)
94 /* Toggle direction for old-style DL_* primtives */
95 {PDI_DECODETYPE_L3PDU_N, "sdu", "DL_*", "", 0xff, NULL, NULL},
96 #endif
97 #endif
98
99 {PDI_DECODETYPE_NOPD_N, "sdu", "XX_CCD_ASN1_DECODE_REQ", "ASN1_MSG", 0xff, NULL, NULL},
100 {PDI_DECODETYPE_NOPD, "sdu", "XX_CCD_ASN1_CODE_IND", "ASN1_MSG", 0xff, NULL, NULL},
101 {PDI_DECODETYPE_NOPD_N, "sdu", "XX_DYNARR_DECODE_REQ", "ASN1_MSG", 0xff, NULL, NULL},
102 {PDI_DECODETYPE_NOPD, "sdu", "XX_DYNARR_CODE_IND", "ASN1_MSG", 0xff, NULL, NULL},
103 {PDI_DECODETYPE_MAC_H_CHECK, "dl_block", "MAC_DATA_IND", "GRR", 0xff,
104 mac_data_checker, mac_data_constrainer},
105 {PDI_DECODETYPE_MAC_H_CHECK, "dl_block", "MAC_DATA_IND_EGPRS", "GRR", 0xff,
106 mac_data_checker, mac_data_constrainer},
107 {PDI_DECODETYPE_MAC_H_CHECK, "ul_block", "MAC_EGPRS_DATA_REQ", "GRR", 0xff,
108 mac_data_checker, mac_data_constrainer},
109 {PDI_DECODETYPE_MAC_H_CHECK, "ul_block", "MAC_DATA_REQ", "GRR", 0xff,
110 mac_data_checker, mac_data_constrainer},
111 {PDI_DECODETYPE_MAC_H_CHECK, "ul_block", "MAC_POLL_REQ", "GRR", 0xff,
112 mac_poll_checker, mac_data_constrainer},
113 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_GPRS_SI13_IND", "RR", 0xff, NULL, NULL},
114 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_IA_IND", "RR", 0xff, NULL, NULL},
115 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_DATA_IND", "RR", 0xff, NULL, NULL},
116 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_IA_DOWNLINK_IND", "RR", 0xff, NULL, NULL},
117 {PDI_DECODETYPE_NOPD_N, "sdu", "RRGRR_SI_STATUS_IND", "GRR", 0xff, NULL, NULL},
118 {PDI_DECODETYPE_NOPD_N, "sdu", "TB_NCELL_SI_DATA_IND", "RR", 0xff, NULL, NULL},
119 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_IAEXT_IND", "RR", 0xff, NULL, NULL},
120 {PDI_DECODETYPE_NOPD, "sdu", "RRGRR_DATA_REQ", "RR", 0xff, NULL, NULL},
121 {PDI_DECODETYPE_NOPD_N, "sdu", "TB_SCELL_SI_DATA_IND", "RR", 0xff, NULL, NULL},
122 #ifdef MPHP_DATA_IND
123 /* toggle direction for old 16bit MPHP* */
124 #if (MPHP_DATA_IND & 0x80000000)
125 {PDI_DECODETYPE_MAC_H_CHECK, "frame_array", "MPHP_DATA_IND", "GRR", 0xff,
126 mphX_checker, mphX_constrainer},
127 {PDI_DECODETYPE_MAC_H_CHECK, "data_array", "MPHP_SINGLE_BLOCK_CON", "GRR",
128 0xff, NULL, NULL},
129 {PDI_DECODETYPE_MAC_H_CHECK, "data_array", "MPHP_SINGLE_BLOCK_REQ", "GRR",
130 0xff, mphp_sing_block_req_checker,
131 mphp_sing_block_constrainer},
132 #else
133 {PDI_DECODETYPE_MAC_H_N_CHECK, "l2_frame", "MPHP_DATA_IND", "GRR", 0xff,
134 mphX_checker, mphX_constrainer},
135 {PDI_DECODETYPE_MAC_H_N_CHECK, "l2_frame", "MPHP_SINGLE_BLOCK_CON", "GRR",
136 0xff, mphp_sing_block_con_edge_checker,
137 mphp_sing_block_con_edge_constrainer},
138 {PDI_DECODETYPE_MAC_H_CHECK, "l2_frame", "MPHP_SINGLE_BLOCK_REQ", "GRR",
139 0xff, mphp_sing_block_req_checker,
140 mphp_sing_block_constrainer},
141 #endif
142 {PDI_DECODETYPE_MAC_H_CHECK, "poll_data", "MPHP_POLLING_RESPONSE_REQ",
143 "GRR", 0xff, mphp_polling_resp_checker,
144 mphp_polling_resp_constrainer},
145 #endif
146 #ifdef MPHC_DATA_IND
147 /* toggle direction for old 16bit MPHC* */
148 #if (MPHC_DATA_IND & 0x80000000)
149 {PDI_DECODETYPE_AIM_CHECK, "l2_frame", "MPHC_NCELL_BCCH_IND", "RR", 0xff,
150 mphX_checker, mphX_constrainer},
151 {PDI_DECODETYPE_AIM_CHECK, "l2_frame", "MPHC_DATA_IND", "RR", 0xff,
152 mphX_checker, mphX_constrainer},
153 #else
154 {PDI_DECODETYPE_AIM_N_CHECK, "l2_frame", "MPHC_NCELL_BCCH_IND", "RR", 0xff,
155 mphX_checker, mphX_constrainer},
156 {PDI_DECODETYPE_AIM_N_CHECK, "l2_frame", "MPHC_DATA_IND", "RR", 0xff,
157 mphX_checker, mphX_constrainer},
158 #endif
159 #endif
160 {PDI_DECODETYPE_MAC_H, "data_array", "CGRLC_DATA_*", "GRR", 0xff, NULL, NULL},
161
162 #ifdef CCDENT_UMTS_AS_ASN1_MSG
163
164 // real sdu in test primitives
165 // UMTS_AS_ASN1_UL_DCCH_MSG_MSG
166 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TEST_SDU_UM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_DCCH_MSG_MSG, rlc_data_1_checker, rlc_data_constrainer},
167 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_UM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_DCCH_MSG_MSG, rlc_data_1_checker, rlc_data_constrainer}, //rlc_id=1
168 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_UM_DATA_IND", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_DL_DCCH_MSG_MSG, NULL, NULL},
169 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TEST_SDU_AM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_DCCH_MSG_MSG, NULL, NULL},
170 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TEST_SDU_AM_DATA_IND", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_DL_DCCH_MSG_MSG, NULL, NULL},
171 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_AM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_DCCH_MSG_MSG, NULL, NULL},
172 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_AM_DATA_IND", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_DL_DCCH_MSG_MSG, NULL, NULL},
173 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TEST_SDU_UM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_CCCH_MSG_MSG, rlc_data_0_checker, rlc_data_constrainer},
174 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_UM_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_CCCH_MSG_MSG, rlc_data_0_checker, rlc_data_constrainer}, //rlc_id=0
175 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TEST_SDU_TR_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_CCCH_MSG_MSG, NULL, NULL},
176 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TR_DATA_REQ", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_UL_CCCH_MSG_MSG, NULL, NULL},
177 {PDI_DECODETYPE_NOPD_NOTYPE, "sdu", "RLC_TR_DATA_IND", "UMTS_AS_ASN1_MSG", UMTS_AS_ASN1_DL_CCCH_MSG_MSG, NULL, NULL},
178 //RLC_AM_RETRANSMIT_CNF
179 //RLC_CTCH_DATA_IND
180
181 // only as mem handles, not suported yet
182 // UMTS_AS_ASN1_DL_CCCH_MSG_MSG
183 // UMTS_AS_ASN1_BCCH_BCH_MSG_MSG
184 // UMTS_AS_ASN1_DL_DCCH_MSG_MSG
185 // UMTS_AS_ASN1_DL_SHCCH_MSG_MSG
186 // UMTS_AS_ASN1_UL_SHCCH_MSG_MSG
187 // UMTS_AS_ASN1_PCCH_MSG_MSG
188 // UMTS_AS_ASN1_HO_TO_UTRANCOMMAND_MSG
189 // UMTS_AS_ASN1_MASTER_INFO_BLOCK_MSG
190 // UMTS_AS_ASN1_BCCH_FACH_MSG_MSG
191 // UMTS_AS_ASN1_PDSCH_SYS_INFO_LIST_MSG
192 // UMTS_AS_ASN1_PUSCH_SYS_INFO_LIST_MSG
193
194 /* the following make little sence to decode since they always
195 comes cutted up in small peaces inside a UMTS_AS_ASN1_BCCH_BCH_MSG_MSG */
196 // UMTS_AS_ASN1_SYS_INFO_TYPE_1_MSG
197 // UMTS_AS_ASN1_SYS_INFO_TYPE_2_MSG
198 // UMTS_AS_ASN1_SYS_INFO_TYPE_3_MSG
199 // UMTS_AS_ASN1_SYS_INFO_TYPE_4_MSG
200 // UMTS_AS_ASN1_SYS_INFO_TYPE_5_MSG
201 // UMTS_AS_ASN1_SYS_INFO_TYPE_6_MSG
202 // UMTS_AS_ASN1_SYS_INFO_TYPE_7_MSG
203 // UMTS_AS_ASN1_SYS_INFO_TYPE_8_MSG
204 // UMTS_AS_ASN1_SYS_INFO_TYPE_9_MSG
205 // UMTS_AS_ASN1_SYS_INFO_TYPE_10_MSG
206 // UMTS_AS_ASN1_SYS_INFO_TYPE_11_MSG
207 // UMTS_AS_ASN1_SYS_INFO_TYPE_12_MSG
208 // UMTS_AS_ASN1_SYS_INFO_TYPE_13_MSG
209 // UMTS_AS_ASN1_SYS_INFO_TYPE_13_1_MSG
210 // UMTS_AS_ASN1_SYS_INFO_TYPE_13_2_MSG
211 // UMTS_AS_ASN1_SYS_INFO_TYPE_13_3_MSG
212 // UMTS_AS_ASN1_SYS_INFO_TYPE_13_4_MSG
213 // UMTS_AS_ASN1_SYS_INFO_TYPE_14_MSG
214 // UMTS_AS_ASN1_SYS_INFO_TYPE_15_MSG
215 // UMTS_AS_ASN1_SYS_INFO_TYPE_15_1_MSG
216 // UMTS_AS_ASN1_SYS_INFO_TYPE_15_2_MSG
217 // UMTS_AS_ASN1_SYS_INFO_TYPE_15_3_MSG
218 // UMTS_AS_ASN1_SYS_INFO_TYPE_15_4_MSG
219 // UMTS_AS_ASN1_SYS_INFO_TYPE_16_MSG
220 // UMTS_AS_ASN1_SYS_INFO_TYPE_17_MSG
221 // UMTS_AS_ASN1_SYS_INFO_TYPE_18_MSG
222 // UMTS_AS_ASN1_SYS_INFO_TYPE_SB_1_MSG
223 // UMTS_AS_ASN1_SYS_INFO_TYPE_SB_2_MSG
224 #endif /* CCDENT_UMTS_AS_ASN1_MSG */
225
226 /* test stack primitives */
227 {PDI_DECODETYPE_L3PDU_N, "sdu", "XX_TAP*", "", 0xff, NULL, NULL},
228 {PDI_DECODETYPE_NOPD_N, "sdu", "XX_LOADSTORE_*", "XX_CSN1", 0xff, invoke_ccd_setStore, ccd_loadstore_elements},
229 {PDI_DECODETYPE_NOPD_N, "sdu", "XX_CCD_2*", "XX_CSN1", 0xff, NULL, NULL},
230 {PDI_DECODETYPE_NOPD_N, "sdu", "XX_*", "XX", 0xff, NULL, NULL},
231
232 /* all other primitives */
233 {PDI_DECODETYPE_L3PDU, "sdu", "*", "", 0xff, NULL, NULL}
234 };
235 #define DINFO_COUNT (sizeof(m_dinfo) / sizeof(*m_dinfo))
236
237 int ccddata_get_pdi_dinfo (const T_PDI_DECODEINFO* (*dinfo) )
238 {
239 *dinfo=m_dinfo;
240 return DINFO_COUNT;
241 }
242
243 /* definition of special ccdmsg preparation handlers */
244 int invoke_ccd_setStore(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
245 {
246 int q;
247 for (q=0; q<len; q++)
248 {
249 ccd_setStore(q,values[q]);
250 }
251
252 return PDI_CCDMSG;
253 }
254
255 int mphX_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
256 {
257 if (len >= 1 && values[0] == 0) //error_flag
258 {
259 return PDI_CCDMSG;
260 }
261 else
262 {
263 return PDI_NONE;
264 }
265 }
266
267 int mphp_sing_block_req_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
268 {
269 if (len >= 1 && (values[0] == 4 || values[0] == 5)) //purpose
270 {
271 return PDI_CCDMSG;
272 }
273 else
274 {
275 return PDI_NONE;
276 }
277 }
278
279 int mphp_sing_block_con_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
280 {
281 if (len >= 1 && values[0] == 3) //purpose
282 {
283 return PDI_CCDMSG;
284 }
285 else
286 {
287 return PDI_NONE;
288 }
289 }
290
291 int mphp_polling_resp_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
292 {
293 if (len >= 1 && values[0] == 3) //poll_resp_type
294 {
295 return PDI_CCDMSG;
296 }
297 else
298 {
299 return PDI_NONE;
300 }
301 }
302
303 int mphp_sing_block_con_edge_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
304 {
305 if (len >= 3 && values[0] == 3 //purpose
306 && values[1] == 3 //sb_status
307 && values[2] == 0) //dl_error
308 {
309 return PDI_CCDMSG;
310 }
311 else
312 {
313 return PDI_NONE;
314 }
315 }
316
317 int mac_data_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
318 {
319 if (len >= 1 && values[0] == 2) //block_status
320 {
321 return PDI_CCDMSG;
322 }
323 else
324 {
325 return PDI_NONE;
326 }
327 }
328
329 int mac_poll_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
330 {
331 if (len >= 1 && values[0] == 3) //block_status
332 {
333 return PDI_CCDMSG;
334 }
335 else
336 {
337 return PDI_NONE;
338 }
339 }
340
341 int rlc_data_0_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
342 {
343 if (len >= 1 && values[0] == 0) //rlc_id
344 {
345 return PDI_CCDMSG;
346 }
347 else
348 {
349 return PDI_NONE;
350 }
351 }
352
353 int rlc_data_1_checker(T_PDI_CCDMSG* ccdmsg, ULONG values[], int len)
354 {
355 if (len >= 1 && values[0] == 1) //rlc_id
356 {
357 return PDI_CCDMSG;
358 }
359 else
360 {
361 return PDI_NONE;
362 }
363 }