Committing in PDCP code
[o-du/l2.git] / src / 5gnrpdcp / pj_dl.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_dl.h
28   
29 *********************************************************************21*/
30 /** @file pj_dl.h
31 @brief PDCP Hash definitions
32 */
33
34 #ifndef __PJ_DLH__
35 #define __PJ_DLH__
36
37 \f 
38 #define PJ_DBM_FETCH_DL_RBCB(_rbId, _rbType, _ueCb, _rbCb)     \
39 {                                                           \
40    _rbCb = (_rbType==CM_LTE_SRB)?_ueCb->srbCb[_rbId]:_ueCb->drbCb[_rbId];\
41 }
42
43 /* HO_FIX: RRC expects the results as ROK or RFAILED 
44            Hence, changing the vlaue to ROK from CPJ_CFG_CFM_OK */
45 #define  PJ_FILL_DL_SDU_CFM_INFO(_cb,_cfmInfo, _ueCb)                    \
46 {                                                                 \
47    U8 _rbCnt;                                                     \
48    U8 _numRb = 0;                                                 \
49    PjDlHoCfmInfo *_hoCfmInfo;                                       \
50    UdxSduStaInfo  *_staInfo;                                      \
51    _cfmInfo->ueId    = _ueCb->key.ueId;                           \
52    _cfmInfo->cellId  = _ueCb->key.cellId;                         \
53    _cfmInfo->transId = _ueCb->hoInfo->transId;                    \
54    for(_rbCnt = 0; _rbCnt < PJ_MAX_DRB_PER_UE && _numRb < CPJ_MAX_DRB; _rbCnt++)          \
55    {                                                              \
56       _hoCfmInfo   =  &_ueCb->hoInfo->hoCfmInfo[_rbCnt];          \
57       _staInfo     =  &_cfmInfo->sduStaInfo[_numRb];              \
58       if(_hoCfmInfo->pres != TRUE)                                \
59       {                                                           \
60          continue;                                                \
61       }                                                           \
62                                                                   \
63       _staInfo->rbId  =  _hoCfmInfo->rbId;                        \
64       _staInfo->dir   =  _hoCfmInfo->dir;                         \
65       _staInfo->dlSduStaInfo.count     =  _hoCfmInfo->count;   \
66       _staInfo->dlSduStaInfo.hoPres    =  TRUE;                \
67       _numRb++;                                                   \
68    }                                                              \
69    _cfmInfo->numRb = _numRb;                                      \
70    _cfmInfo->status = ROK;                                      \
71    _cfmInfo->reason = CPJ_CFG_REAS_NONE;                                      \
72    PJ_FREE(_cb,_ueCb->hoInfo->hoCfmInfo,                          \
73               (PJ_MAX_DRB_PER_UE * sizeof(PjDlHoCfmInfo))) \
74    PJ_FREE(_cb,_ueCb->hoInfo, sizeof(PjDlHoInfo));                      \
75 }
76 #define PJ_DBM_DELETE_DL_RBCB(_cb, _rbCb)                           \
77 {                                                           \
78    /* Free memory for rbCb */                               \
79    PJ_FREE(_cb, _rbCb, sizeof(PjDlRbCb));                            \
80    PJ_LMM_RB_STS_DEC(_cb);                                     \
81 }
82
83 #endif /* __PJH__ */
84 \f  
85 /********************************************************************30**
86   
87          End of file
88 **********************************************************************/