1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: LTE RLC file for downlink and non real time tasks
25 Desc: This file contains helper macros for RLC downlink
26 and non real time task
30 *********************************************************************21*/
32 @brief RLC Downlink helper macros
38 #define KW_MAX_RNG_DEQ_INDX 8
40 /* Below are the status used within RLC */
41 #define KW_SDU_OPAT_NOUPDATE 0
42 #define KW_SDU_OPAT_UPD_TX 1
43 #define KW_SDU_OPAT_UPD_RETX 2
45 /* Below are the status which needs to be updated to MAC */
46 #define KW_RGU_SDU_OPAT_NOUPDATE 0
47 #define KW_RGU_SDU_OPAT_UPDATE 1
48 #define KW_RGU_SDU_OPAT_BREACH 2
50 /* PDB Values for various QCI bearers : This value is considered
51 after taking into account a 20ms delay at the network */
52 #define KW_PDB_VALUE_FOR_QCI1 80
53 #define KW_PDB_VALUE_FOR_QCI2 130
54 #define KW_PDB_VALUE_FOR_QCI3 30
55 #define KW_PDB_VALUE_FOR_QCI4 280
56 #define KW_PDB_VALUE_FOR_QCI5 80
57 #define KW_PDB_VALUE_FOR_QCI6 280
58 #define KW_PDB_VALUE_FOR_QCI7 80
59 #define KW_PDB_VALUE_FOR_QCI8 280
60 #define KW_PDB_VALUE_FOR_QCI9 280
62 #define KW_DATA_BITMASK 0x80 /* Data bitmask is used to fill D/C bit for data*/
64 * @def KW_MEAS_IS_DL_IP_MEAS_ON_FOR_RB
66 * This macro is used to check if DL IP throughput measurement is ON
67 * or off for the passed rb
69 * Returns TRUE (non-zero) if measurement is ON else FALSE (zero)
71 * @param[in] _gCb RLC DL Cb
72 * @param[in] _rbCb RLC downlink control block
76 #define KW_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(_gCb, _rbCb) \
77 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
78 (_gCb->u.dlCb->kwL2Cb.measOn[_rbCb->qci]))
80 #define KW_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \
81 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
82 (_gCb->u.dlCb->kwL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_IP) && \
83 (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_DL_IP))
85 #define KW_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) \
86 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
87 (_gCb->u.dlCb->kwL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_DELAY))
89 #define KW_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(_gCb, _rbCb) \
90 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
91 (_gCb->u.dlCb->kwL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UU_LOSS))
92 #define KW_UPD_PDCP_L2_DLDELAY_STS(_kwCb, _kwRbCb, _delay) \
94 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
95 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_DL_DELAY)) \
97 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_DL_DELAY]->dlPjSduDelay.sduDelay += _delay; \
98 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_DL_DELAY]->dlPjSduDelay.numSdus++; \
102 #define KW_UPD_L2_UU_LOSS_PKTS(_kwCb, _kwRbCb, _val) \
104 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
105 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \
107 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_UU_LOSS]->uuLoss.dLoss += _val; \
110 #define KW_UPD_L2_UU_LOSS_POS_PKTS(_kwCb,_kwRbCb,_val) \
112 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
113 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \
115 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_UU_LOSS]->uuLoss.posPkts += _val; \
118 /* Discard new changes starts */
119 #define KW_UPD_L2_DL_DISC_SDU_STS(_kwCb,_kwRbCb) \
121 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
122 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
124 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_DL_DISC]->dlDisc.discSdus++; \
128 #define KW_UPD_L2_DL_TOT_SDU_STS(_kwCb,_kwRbCb) \
130 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
131 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
133 (_kwRbCb)->rbL2Cb.l2Sts[KW_L2MEAS_DL_DISC]->dlDisc.totSdus++; \
137 #define KW_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_kwCb, _kwRbCb) \
139 if(((_kwRbCb)->rlcId.rbType == CM_LTE_DRB) && \
140 ((_kwCb)->u.dlCb->kwL2Cb.measOn[_kwRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
143 for (idx1 = 0; idx1 < LKW_MAX_L2MEAS; idx1++) \
145 if(_kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.measType & LKW_L2MEAS_DL_DISC) \
147 if(_kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_kwRbCb)->qci].totDrbsPerQci > 0) \
149 _kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_kwRbCb)->qci].totDrbsPerQci--; \
150 if (_kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_kwRbCb)->qci].totDrbsPerQci == 0) \
152 _kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.qci[(_kwRbCb)->qci] = 0; \
153 cmMemset((U8 *)&_kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_kwRbCb)->qci], 0, \
154 sizeof(_kwCb->u.dlCb->kwL2Cb.kwL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_kwRbCb)->qci])); \
162 #define KW_UPD_PDCP_L2_DLDELAY_STS(_kwCb, _kwRbCb, _delay)
163 #define KW_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb)
164 #define KW_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb)
165 #define KW_UPD_L2_DL_DISC_SDU_STS(_kwCb,_kwRbCb)
166 #define KW_UPD_L2_DL_TOT_SDU_STS(_kwCb, _kwRbCb)
167 #define KW_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_kwCb, _kwRbCb)
171 #endif /* __KW_DLH__ */
173 /********************************************************************30**
176 **********************************************************************/