Committing in PDCP code
[o-du/l2.git] / src / 5gnrpdcp / pj_ptmi.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /********************************************************************20**
20
21         Name:     PDCP Layer Management interface
22
23         Type:     C source file
24
25         Desc:     This file contains source code for RLC layer management
26                   interface primitives. It includes the definition of the
27                   following functions and their portable function
28                   definitions.
29                      -- PjMiLpjCfgCfm
30                      -- PjMiLpjCntrlCfm
31                      -- PjMiLpjStaInd
32
33
34         File:     pj_ptmi.c
35
36 *********************************************************************21*/
37
38 \f
39 /* header (.h) include files */
40 #include "envopt.h"        /* environment options */
41 #include "envdep.h"        /* environment dependent */
42 #include "envind.h"        /* environment independent */
43
44 #include "gen.h"           /* general */
45 #include "ssi.h"           /* system services */
46 #include "cm5.h"           /* common timer defines */
47 #include "cm_tkns.h"       /* common tokens defines */
48 #include "cm_mblk.h"       /* common memory allocation library defines */
49 #include "cm_llist.h"      /* common link list  defines  */
50 #include "cm_hash.h"       /* common hash list  defines */
51 #include "cm_lte.h"        /* common LTE defines */
52 #include "lpj.h"           /* LPJ defines */
53
54
55 /* extern (.x) include files */
56 #include "gen.x"           /* general */
57 #include "ssi.x"           /* system services */
58
59 #include "cm5.x"           /* common timer library */
60 #include "cm_tkns.x"       /* common tokens */
61 #include "cm_mblk.x"       /* common memory allocation */
62 #include "cm_llist.x"      /* common link list */
63 #include "cm_hash.x"       /* common hash list */
64 #include "cm_lte.x"        /* common LTE includes */
65 #include "cm_lib.x"        /* common memory allocation library */
66 #include "lpj.x"           /* LPJ */
67
68
69 /* local defines */
70 #ifndef LCPJMILPJ
71 #define PTPJLPJ
72 #endif
73
74 #ifndef SM
75 #define PTPJLPJ
76 #endif
77
78
79 #ifdef PTPJLPJ
80
81 EXTERN S16 PtMiLpjCfgCfm ARGS((Pst * pst, PjMngmt * cfgCfm));
82
83 EXTERN S16 PtMiLpjCntrlCfm ARGS((Pst * pst, PjMngmt * cntlCfm));
84
85 EXTERN S16 PtMiLpjStaInd ARGS((Pst * pst, PjMngmt * staInd));
86
87 EXTERN S16 PtMiLpjStaCfm ARGS((Pst * pst, PjMngmt * staCfm));
88
89 EXTERN S16 PtMiLpjStsCfm ARGS((Pst * pst, Action actn, PjMngmt * stsCfm));
90
91 EXTERN S16 PtMiLpjTrcInd ARGS((Pst * pst, PjMngmt * trc, Buffer * mBuf));
92
93 /* kw005.201 added support for L2 Measurement */
94 #ifdef LTE_L2_MEAS
95 EXTERN S16 PtMiLpjL2MeasCfm   ARGS((Pst *pst, PjL2MeasCfmEvt *measEvt));
96 PRIVATE S16 PtMiLpjL2MeasStopCfm   ARGS((Pst *pst, U16 measType,U8 status));
97 #endif /*  LTE_L2_MEAS */
98
99 #endif /*--#ifdef PTPJLPJ--*/
100
101 /*********************************************************************
102  *             Primitives for LPJ interface 
103  ********************************************************************/
104 PRIVATE CONSTANT LpjCfgCfm PjMiLpjCfgCfmMt[] =
105 {
106 #ifdef LCPJMILPJ
107    cmPkLpjCfgCfm,
108 #else
109    PtMiLpjCfgCfm,
110 #endif
111 #ifdef SM
112    SmMiLpjCfgCfm,
113 #else
114    PtMiLpjCfgCfm,
115 #endif
116 };
117
118
119 PRIVATE CONSTANT LpjCntrlCfm PjMiLpjCntrlCfmMt[] =
120 {
121 #ifdef LCPJMILPJ
122    cmPkLpjCntrlCfm,
123 #else
124    PtMiLpjCntrlCfm,
125 #endif
126 #ifdef SM
127    SmMiLpjCntrlCfm,
128 #else
129    PtMiLpjCntrlCfm,
130 #endif
131 };
132
133
134 PRIVATE CONSTANT LpjStaInd PjMiLpjStaIndMt[] =
135 {
136 #ifdef LCPJMILPJ
137    cmPkLpjStaInd,
138 #else
139    PtMiLpjStaInd,
140 #endif
141 #ifdef SM
142    SmMiLpjStaInd,
143 #else
144    PtMiLpjStaInd,
145 #endif
146 };
147
148
149 PRIVATE CONSTANT LpjStaCfm PjMiLpjStaCfmMt[] =
150 {
151 #ifdef LCPJMILPJ
152    cmPkLpjStaCfm,
153 #else
154    PtMiLpjStaCfm,
155 #endif
156 #ifdef SM
157    SmMiLpjStaCfm,
158 #else
159    PtMiLpjStaCfm,
160 #endif
161 };
162
163
164 PRIVATE CONSTANT LpjStsCfm PjMiLpjStsCfmMt[] =
165 {
166 #ifdef LCPJMILPJ
167    cmPkLpjStsCfm,
168 #else
169    PtMiLpjStsCfm,
170 #endif
171 #ifdef SM
172    SmMiLpjStsCfm,
173 #else
174    PtMiLpjStsCfm,
175 #endif
176 };
177
178
179 PRIVATE CONSTANT LpjTrcInd PjMiLpjTrcIndMt[] =
180 {
181 #ifdef LCPJMILPJ
182    cmPkLpjTrcInd,
183 #else
184    PtMiLpjTrcInd,
185 #endif
186 #ifdef SM
187    SmMiLpjTrcInd,
188 #else
189    PtMiLpjTrcInd,
190 #endif
191 };
192
193 /* kw005.201 added support for L2 Measurement */
194 #ifdef LTE_L2_MEAS
195 PRIVATE CONSTANT LpjL2MeasCfm PjMiLpjL2MeasCfmMt[] =
196 {
197 #ifdef LCPJMILPJ
198    cmPkLpjL2MeasCfm,
199 #else
200    PtMiLpjL2MeasCfm,
201 #endif
202 #ifdef SM
203    SmMiLpjL2MeasCfm,
204 #else
205    PtMiLpjL2MeasCfm,
206 #endif
207 };
208 PRIVATE CONSTANT LpjL2MeasStopCfm PjMiLpjL2MeasStopCfmMt[] =
209 {
210 #ifdef LCPJMILPJ
211    cmPkLpjL2MeasStopCfm,
212 #else
213    PtMiLpjL2MeasStopCfm,
214 #endif
215 #ifdef SM
216    SmMiLpjL2MeasStopCfm,
217 #else
218    PtMiLpjL2MeasStopCfm,
219 #endif
220 };
221 #endif /*  LTE_L2_MEAS */
222
223 /****************************************************************************
224  *                         LPJ Interface Mt functions
225  ***************************************************************************/
226 #ifdef ANSI
227 PUBLIC S16 PjMiLpjCfgCfm
228 (
229 Pst * pst,
230 PjMngmt * cfgCfm
231 )
232 #else
233 PUBLIC S16 PjMiLpjCfgCfm(pst, cfgCfm)
234 Pst * pst;
235 PjMngmt * cfgCfm;
236 #endif
237 {
238
239    TRC3(PjMiLpjCfgCfm)
240
241    (*PjMiLpjCfgCfmMt[pst->selector])(pst, cfgCfm);
242
243    RETVALUE(ROK);
244
245 }
246
247
248 #ifdef ANSI
249 PUBLIC S16 PjMiLpjCntrlCfm
250 (
251 Pst * pst,
252 PjMngmt * cntlCfm
253 )
254 #else
255 PUBLIC S16 PjMiLpjCntrlCfm(pst, cntlCfm)
256 Pst * pst;
257 PjMngmt * cntlCfm;
258 #endif
259 {
260
261    TRC3(PjMiLpjCntrlCfm)
262
263    (*PjMiLpjCntrlCfmMt[pst->selector])(pst, cntlCfm);
264
265    RETVALUE(ROK);
266
267 }
268
269
270 #ifdef ANSI
271 PUBLIC S16 PjMiLpjStaInd
272 (
273 Pst * pst,
274 PjMngmt * staInd
275 )
276 #else
277 PUBLIC S16 PjMiLpjStaInd(pst, staInd)
278 Pst * pst;
279 PjMngmt * staInd;
280 #endif
281 {
282
283    TRC3(PjMiLpjStaInd)
284
285    (*PjMiLpjStaIndMt[pst->selector])(pst, staInd);
286
287    RETVALUE(ROK);
288
289 }
290
291
292 #ifdef ANSI
293 PUBLIC S16 PjMiLpjStaCfm
294 (
295 Pst * pst,
296 PjMngmt * staCfm
297 )
298 #else
299 PUBLIC S16 PjMiLpjStaCfm(pst, staCfm)
300 Pst * pst;
301 PjMngmt * staCfm;
302 #endif
303 {
304
305    TRC3(PjMiLpjStaCfm)
306
307    (*PjMiLpjStaCfmMt[pst->selector])(pst, staCfm);
308
309    RETVALUE(ROK);
310
311 }
312
313
314 #ifdef ANSI
315 PUBLIC S16 PjMiLpjStsCfm
316 (
317 Pst * pst,
318 Action actn,
319 PjMngmt * stsCfm
320 )
321 #else
322 PUBLIC S16 PjMiLpjStsCfm(pst, actn, stsCfm)
323 Pst * pst;
324 Action actn;
325 PjMngmt * stsCfm;
326 #endif
327 {
328
329    TRC3(PjMiLpjStsCfm)
330
331    (*PjMiLpjStsCfmMt[pst->selector])(pst, actn, stsCfm);
332
333    RETVALUE(ROK);
334
335 }
336
337
338 #ifdef ANSI
339 PUBLIC S16 PjMiLpjTrcInd
340 (
341 Pst * pst,
342 PjMngmt * trc,
343 Buffer * mBuf
344 )
345 #else
346 PUBLIC S16 PjMiLpjTrcInd(pst, trc, mBuf)
347 Pst * pst;
348 PjMngmt * trc;
349 Buffer * mBuf;
350 #endif
351 {
352
353    TRC3(PjMiLpjTrcInd)
354
355    (*PjMiLpjTrcIndMt[pst->selector])(pst, trc, mBuf);
356
357    RETVALUE(ROK);
358
359 }
360
361 /* kw005.201 added support for L2 Measurement */
362 #ifdef LTE_L2_MEAS
363 #ifdef ANSI
364 PUBLIC S16 PjMiLpjL2MeasCfm
365 (
366 Pst * pst,
367 PjL2MeasCfmEvt *measEvt
368 )
369 #else
370 PUBLIC S16 PjMiLpjL2MeasCfm(pst, trc, mBuf)
371 Pst * pst;
372 PjL2MeasCfmEvt *measEvt;
373 #endif
374 {
375
376    TRC3(PjMiLpjL2MeasCfm)
377
378    (*PjMiLpjL2MeasCfmMt[pst->selector])(pst, measEvt);
379
380    RETVALUE(ROK);
381
382 }
383 #ifdef ANSI
384 PUBLIC S16 PjMiLpjL2MeasStopCfm
385 (  
386 Pst *pst,
387 U16  measType,
388 U8  status
389 )
390 #else
391 PUBLIC S16 PjMiLpjL2MeasStopCfm(pst, measType,status)
392 Pst *pst;
393 U16  measType;
394 U8  status;
395 #endif
396 {
397
398    TRC3(PjMiLpjL2MeasStopCfm)
399
400    (*PjMiLpjL2MeasStopCfmMt[pst->selector])(pst, measType,status);
401
402    RETVALUE(ROK);
403
404 }
405 #endif /*  LTE_L2_MEAS */
406
407
408 #ifdef PTPJLPJ
409
410
411 #ifdef ANSI
412 PUBLIC S16 PtMiLpjCfgCfm
413 (
414 Pst * pst,
415 PjMngmt * cfgCfm
416 )
417 #else
418 PUBLIC S16 PtMiLpjCfgCfm(pst, cfgCfm)
419 Pst * pst;
420 PjMngmt * cfgCfm;
421 #endif
422 {
423
424    TRC3(PtMiLpjCfgCfm)
425
426    UNUSED(pst);
427    UNUSED(cfgCfm);
428
429    RETVALUE(ROK);
430
431 }
432
433
434 #ifdef ANSI
435 PUBLIC S16 PtMiLpjCntrlCfm
436 (
437 Pst * pst,
438 PjMngmt * cntlCfm
439 )
440 #else
441 PUBLIC S16 PtMiLpjCntrlCfm(pst, cntlCfm)
442 Pst * pst;
443 PjMngmt * cntlCfm;
444 #endif
445 {
446
447    TRC3(PtMiLpjCntrlCfm)
448
449    UNUSED(pst);
450    UNUSED(cntlCfm);
451
452    RETVALUE(ROK);
453
454 }
455
456
457 #ifdef ANSI
458 PUBLIC S16 PtMiLpjStaInd
459 (
460 Pst * pst,
461 PjMngmt * staInd
462 )
463 #else
464 PUBLIC S16 PtMiLpjStaInd(pst, staInd)
465 Pst * pst;
466 PjMngmt * staInd;
467 #endif
468 {
469
470    TRC3(PtMiLpjStaInd)
471
472    UNUSED(pst);
473    UNUSED(staInd);
474
475    RETVALUE(ROK);
476
477 }
478
479
480 #ifdef ANSI
481 PUBLIC S16 PtMiLpjStaCfm
482 (
483 Pst * pst,
484 PjMngmt * staCfm
485 )
486 #else
487 PUBLIC S16 PtMiLpjStaCfm(pst, staCfm)
488 Pst * pst;
489 PjMngmt * staCfm;
490 #endif
491 {
492
493    TRC3(PtMiLpjStaCfm)
494
495    UNUSED(pst);
496    UNUSED(staCfm);
497
498    RETVALUE(ROK);
499
500 }
501
502
503 #ifdef ANSI
504 PUBLIC S16 PtMiLpjStsCfm
505 (
506 Pst * pst,
507 Action actn,
508 PjMngmt * stsCfm
509 )
510 #else
511 PUBLIC S16 PtMiLpjStsCfm(pst, actn, stsCfm)
512 Pst * pst;
513 Action actn;
514 PjMngmt * stsCfm;
515 #endif
516 {
517
518    TRC3(PtMiLpjStsCfm)
519
520    UNUSED(pst);
521    UNUSED(actn);
522    UNUSED(stsCfm);
523
524    RETVALUE(ROK);
525
526 }
527
528
529 #ifdef ANSI
530 PUBLIC S16 PtMiLpjTrcInd
531 (
532 Pst * pst,
533 PjMngmt * trc,
534 Buffer * mBuf
535 )
536 #else
537 PUBLIC S16 PtMiLpjTrcInd(pst, trc, mBuf)
538 Pst * pst;
539 PjMngmt * trc;
540 Buffer * mBuf;
541 #endif
542 {
543
544    TRC3(PtMiLpjTrcInd)
545
546    UNUSED(pst);
547    UNUSED(trc);
548    UNUSED(mBuf);
549
550    RETVALUE(ROK);
551
552 }
553
554 /* kw005.201 added support for L2 Measurement */
555 #ifdef LTE_L2_MEAS
556 #ifdef ANSI
557 PUBLIC S16 PtMiLpjL2MeasCfm
558 (
559 Pst * pst,
560 PjL2MeasCfmEvt * measEvt
561 )
562 #else
563 PUBLIC S16 PtMiLpjL2MeasCfm(pst, measEvt)
564 Pst * pst;
565 PjL2MeasCfmEvt * measEvt;
566 #endif
567 {
568
569    TRC3(PtMiLpjL2MeasCfm)
570
571    UNUSED(pst);
572    UNUSED(measEvt);
573
574    RETVALUE(ROK);
575
576 }
577 #ifdef ANSI
578 PRIVATE S16 PtMiLpjL2MeasStopCfm
579 (
580 Pst * pst,
581 U16 measType,
582 U8 status
583 )
584 #else
585 PRIVATE S16 PtMiLpjL2MeasStopCfm(pst, measType,status)
586 Pst * pst;
587 U16  measType;
588 U8  status;
589 #endif
590 {
591
592    TRC3(PtMiLpjL2MeasStopCfm)
593
594    UNUSED(pst);
595    UNUSED(measType);
596    UNUSED(status);
597
598    RETVALUE(ROK);
599
600 }
601 #endif /*  LTE_L2_MEAS */
602 #endif /*--ifdef PTPJLPJ--*/
603
604 /********************************************************************30**
605
606          End of file
607 **********************************************************************/