Committing in PDCP code
[o-du/l2.git] / src / 5gnrpdcp / pj_ul.h
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:     LTE PDCP file 
22     
23         Type:     C include file
24   
25         Desc:     This file contain the hash definations for PDCP
26  
27         File:     pj_ul.h
28   
29 *********************************************************************21*/
30 /** @file pj_ul.h
31 @brief PDCP Hash definitions
32 */
33
34 #ifndef __PJ_ULH__
35 #define __PJ_ULH__
36 #define PJ_MAX_NUM_OF_BITS 4096
37
38 #define PJ_DBM_FETCH_UL_RBCB(_rbId, _rbType, _ueCb, _rbCb)     \
39 {                                                           \
40    _rbCb = (_rbType==CM_LTE_SRB)?_ueCb->srbCb[_rbId]:_ueCb->drbCb[_rbId];\
41 }
42
43 /* HO_FIX: Changed the success value to ROK as RRC expects
44            ROK or RFAILED */
45 #define  PJ_FILL_UL_SDU_CFM_INFO(_cb,_cfmInfo,_tempDlStaInfo,_ueCb)                    \
46 {                                                                 \
47    U8 _rbCnt;                                                     \
48    U8 _numRb = 0;                                                 \
49    PjUlHoCfmInfo *_hoCfmInfo;                                       \
50    CpjSduStaInfo  *_staInfo;                                      \
51    Bool _rbPres;                                                  \
52    _cfmInfo->ueId    = _ueCb->key.ueId;                           \
53    _cfmInfo->cellId  = _ueCb->key.cellId;                         \
54    _cfmInfo->transId = _ueCb->hoInfo->transId;                    \
55    for(_rbCnt = 0; _rbCnt < PJ_MAX_DRB_PER_UE && _numRb < CPJ_MAX_DRB; _rbCnt++)          \
56    {                                                              \
57        _rbPres     = FALSE;                                       \
58       _hoCfmInfo   =  &_ueCb->hoInfo->hoCfmInfo[_rbCnt];          \
59       _staInfo     =  &_cfmInfo->sduStaInfo[_numRb];              \
60       if(_hoCfmInfo->pres == TRUE)                                \
61       {                                                           \
62       _rbPres = TRUE;                                             \
63       _staInfo->rbId  =  _hoCfmInfo->rbId;                        \
64       _staInfo->dir   |= _hoCfmInfo->dir;                         \
65       _staInfo->ulSduStaInfo.numBits   =  _hoCfmInfo->numBits; \
66       _staInfo->ulSduStaInfo.ulBitMap  =  _hoCfmInfo->ulBitMap;\
67       _staInfo->ulSduStaInfo.count     =  _hoCfmInfo->count;   \
68       _hoCfmInfo->ulBitMap          =  NULLP;                  \
69       }                                                        \
70       if(tempDlStaInfo[_rbCnt].dlSduStaInfo.hoPres == TRUE)  \
71       {                                                                \
72        _rbPres = TRUE;                                                 \
73        _staInfo->rbId  =  _tempDlStaInfo[_rbCnt].rbId;        \
74        _staInfo->dir   |= _tempDlStaInfo[_rbCnt].dir;                         \
75        _staInfo->dlSduStaInfo.count = _tempDlStaInfo[_rbCnt].dlSduStaInfo.count; \
76       }                                                        \
77       if(_rbPres != TRUE)                                      \
78       {                                                        \
79          continue;                                             \
80       }                                                        \
81       else                                                     \
82       {                                                        \
83         _numRb++;                                              \
84       }                                                        \
85   }                                                              \
86    _cfmInfo->numRb = _numRb;                                   \
87    _cfmInfo->status = ROK;                                     \
88    _cfmInfo->reason = CPJ_CFG_REAS_NONE;                          \
89    PJ_FREE(_cb,_ueCb->hoInfo->hoCfmInfo,                          \
90               (PJ_MAX_DRB_PER_UE * sizeof(PjUlHoCfmInfo)));       \
91    PJ_FREE(_cb,_ueCb->hoInfo, sizeof(PjUlHoInfo));                \
92 }
93
94 #define PJ_DBM_DELETE_UL_RBCB(_cb, _rbCb)                           \
95 {                                                           \
96    /* Free memory for rbCb */                               \
97    PJ_FREE(_cb, _rbCb, sizeof(PjUlRbCb));                            \
98    PJ_LMM_RB_STS_DEC(_cb);                                     \
99 }
100
101 #endif /* __PJH__ */
102 \f  
103 /********************************************************************30**
104   
105          End of file
106 **********************************************************************/