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 /**********************************************************************
25 Desc: Defines required by LTE-MAC
29 **********************************************************************/
32 @brief This file contains definitons for Mac.
39 #include "rl_interface.h"
40 #include "rl_common.h"
44 #include "gen.x" /* general layer */
45 #include "ssi.x" /* system service interface */
53 #define RG_MAC_HDR_SIZE 250
54 #define RG_MAC_CE_SIZE 250
55 uint32_t MacPtrAddress;
56 uint32_t macHeader[2];
58 #define RG_ADD_DBuf(_dBuf,_size,_mBuf)\
60 SsMsgInfo *mInfo = NULLP; \
61 mInfo = (SsMsgInfo *)_mBuf->b_rptr; \
62 ssGetDBufOfSize(mInfo->region,_size, &_dBuf); \
63 SUpdMsg(_mBuf, _dBuf,0);\
64 _dBuf->b_wptr = _dBuf->b_rptr = (_dBuf->b_datap->db_base + 5);\
65 MacPtrAddress = (uint32_t)_dBuf->b_wptr;\
71 #define RGLAYERNAME "MAC"
72 #define RG_MAX_TB_PER_UE 2
73 #define RG_MAX_BCCH_DLSCH 2
74 #define RG_INVALID_RNTI 0x0000
76 #define RG_MAX_NUM_DED_LC 10 /* maximum dedicated logical channels in a UE */
77 #define RG_MAX_NUM_CMN_LC 5 /* maximum number of common logical
79 #define RG_MAX_LCG_PER_UE 4
80 #define RG_CON_RES_ID_SZ 6
81 #define RG_MAX_RA_RNTI 60
83 /* Added support for SPS*/
85 #define RG_ADDL_SPS_OCC_FOR_EXP_REL 2
87 #define RG_SPS_SID_PACKET_SIZE 10
88 #define RG_SPS_LCG_ID 1
92 /* Well known RNTIS */
93 #define RG_SI_RNTI 0xffff
94 #define RG_P_RNTI 0xfffe
96 #define RG_MAX_UPPERSAP 3
97 #define RG_MAX_LOWERSAP 1
98 #define RG_TQ_SIZE 10 /* Timing Queue Size */
99 #define RG_MAX_TIMER RG_MAX_LOWERSAP /* MAX number of MAC timers */
100 #define RG_NMB_CELL_HASHBIN 10 /* Number of Hash Bins for cell hash
102 #define RG_NMB_UE_HASHBIN 10 /* Number of Hash Bins for UE hash
104 #define RG_BNDREQ_TMR 1 /* Bind Request timer event value */
105 #define RG_MAX_BNDRETRY 2 /* Max number of Bind Retries for TFU SAP */
108 #define RG_UE_TQ_SIZE 10 /* Timing Queue Size */
110 #define RG_INVALID_SCHD_TYPE 255
111 #define RG_MAX_UE_PER_CELL 0xFFFF /*!< Maximum number of UEs per cell */
112 #ifdef EIGHT_UE_PER_TTI_CHANGES
113 #define RG_MAX_UE_BIN_PER_CELL 1024 /*!< Maximum number of UE bins per cell */
115 #define RG_MAX_UE_BIN_PER_CELL 128 /*!< Maximum number of UE bins per cell */
117 #define RG_MIN_DL_BW 6 /*!< Minimum Downlink bandwidth in RBs */
118 #define RG_MAX_DL_BW 110 /*!< Maximum Downlink bandwidth in RBs */
119 #define RG_MIN_UL_BW 6 /*!< Minimum Uplink bandwidth in RBs */
120 #define RG_MAX_UL_BW 110 /*!< Maximum Uplink bandwidth in RBs */
121 #define RG_MIN_CFI_VAL 1 /*!< Minimum value for CFI */
122 #define RG_MAX_CFI_VAL 3 /*!< Maximum value for CFI */
123 #define RG_QM_BPSK 2 /*!< Qm value for BPSK */
124 #define RG_QM_QPSK 4 /*!< Qm value for QPSK */
125 #define RG_QM_64QAM 6 /*!< Qm value for 64QAM */
126 #define RG_MIN_SRS_SFCFG_IDX 0 /*!< Minimum value for SRS subframe
127 configurtion index */
128 #define RG_MAX_SRS_SFCFG_IDX 15 /*!< Maximum value for SRS subframe
129 configurtion index */
130 #define RG_MAX_SRS_TX_OFFSET 8 /*!< Maximum number of SRS transmission
132 #define RG_MIN_MAC_RNTI 10 /*!< Minimum value of RNTI to be managed by
135 /* HARQ related MACROs */
136 #define RG_NUM_DL_HQ_PROC 8
137 #define RG_NUM_UL_HQ_PROC 8
138 #define RG_MIN_HQ_TX 1
140 /* Group power related MACROs */
141 #define RG_MAX_GRP_PWR_FMT3_IDX 15 /*!< Maximum index value for group power format 3 */
142 #define RG_MAX_GRP_PWR_FMT3A_IDX 31 /*!< Maximum index value for group power format 3A */
144 /* MACROs to indicate cell specific config for cell to be active */
145 #define RG_BCCH_BCH_CFG_DONE (1<<0)
146 #define RG_BCCH_DLSCH_CFG1_DONE (1<<1)
147 #define RG_BCCH_DLSCH_CFG2_DONE (1<<2)
148 #define RG_PCCH_CFG_DONE (1<<3)
149 #define RG_UL_CCCH_CFG_DONE (1<<4)
150 #define RG_DL_CCCH_CFG_DONE (1<<5)
151 #define RG_SCHD_CFG_DONE (1<<6)
152 #define RG_CELL_ACTIVE (RG_BCCH_BCH_CFG_DONE | RG_BCCH_DLSCH_CFG1_DONE | RG_BCCH_DLSCH_CFG2_DONE | RG_PCCH_CFG_DONE | RG_UL_CCCH_CFG_DONE | RG_DL_CCCH_CFG_DONE)
153 /* Logical channel realated MACROs */
154 #define RG_INVALID_LCG_ID 255
155 #define RG_INVALID_LC_ID 255
156 #define RG_BCCH_BCH_IDX 0
157 #define RG_BCCH_DLSCH_IDX 1
158 #define RG_PCCH_IDX 2
160 /* constants for MIN & MAX qci*/
164 /* PUCCH related macros */
165 #define RG_PUCCH_MAXVAL_CS 7 /*!< Maximum value for cyclic shift of PUCCH */
166 #define RG_PUCCH_MINVAL_DS 1 /*!< Mininmum value for delta shift of PUCCH */
167 #define RG_PUCCH_MAXVAL_DS 3 /*!< Maximum value for delta shift of PUCCH */
169 /* DUX related macros */
170 #define RG_LCID_MASK 0x3F
172 #define RG_LCID_LEN 0x6
173 #define RG_CCCH_LCID 0x00
174 #define RG_DEDLC_MIN_LCID 0x01
175 #define RG_DEDLC_MAX_LCID 0x0A
176 #define RG_RES_MIN_LCID 0x0B
177 #define RG_RES_MAX_LCID 0x18
178 #define RG_EXT_PHR_LCID 0x19
179 #define RG_PHR_LCID 0x1A
180 #define RG_CRNTI_LCID 0X1B
181 #define RG_TRUNC_BSR_LCID 0X1C
182 #define RG_SHORT_BSR_LCID 0X1D
183 #define RG_LONG_BSR_LCID 0X1E
184 #define RG_PAD_LCID 0x3F
185 #define RG_MAX_EXTN_PAD_SUBHDRS 0x02
186 #define RG_REF_PCMAX 0xFF
188 #define RG_CCCH_SDU_PRSNT (1<<0)
189 #define RG_CRNTI_CE_PRSNT (1<<1)
190 #define RG_PHR_CE_PRSNT (1<<2)
191 #define RG_TRUNC_BSR_CE_PRSNT (1<<3)
192 #define RG_SHORT_BSR_CE_PRSNT (1<<4)
193 #define RG_LONG_BSR_CE_PRSNT (1<<5)
195 #define RG_ACTIVE_LC_PRSNT (1<<6)
198 #define RG_UL_SPS_ACT_PRSNT (1<<7)
200 #define RG_EXT_PHR_CE_PRSNT (1<<8)
202 /* LOGICAL CHANNEL */
203 #define RG_MAX_LC_PER_UE 10
204 /* Maximum number of common logical channel control blocks */
205 #define RG_MAX_CMN_LC_CB 3
206 #define RG_MAX_BCCH 2
209 #define RG_MAX_SCELL_PER_UE 7 /*!< MAX SCell can be Added per Cell */
212 #define RG_OPTM_NUM_DED_LC 3
214 /* Random access related MACROs */
215 #define RG_MAX_RA_PREAMBLE_FMT 3 /*!< Maximun value of Random access preamble
217 #define RG_MAX_RA_WINSIZE 10 /*!< Maximum size of Random access response
218 window in subframes */
219 #define RG_MIN_RA_WINSIZE 2 /*!< Minimum size of Random access response
220 window in subframes */
221 #define RG_MIN_NUM_RA_PREAMBLE 4 /*!< Minimum number of Random access
223 #define RG_MAX_NUM_RA_PREAMBLE 64 /*!< Maximim number of Random access
225 #define RG_NUM_RA_RB 6
227 #define RG_MAX_RA_RSP_ALLOC 4 /*!< Maximum number of Random access
229 #define RG_CRG_CFG 1 /* CRG configuration element */
230 #define RG_RGR_CFG 2 /* RGR configuration element */
232 #define RG_NUM_ITBS 27
233 #define RG_MAX_NUM_RB 110
235 #define RG_MAX_NUM_PAD_HDRS 2
237 /* Changes for MIMO feature addition */
238 /* Removed dependency on MIMO compile-time flag */
239 #define RG_MAX_LYR_PERCW 2
242 #define RG_MAX_DL_HARQ_NUM 15
244 #define RG_MAX_DL_HARQ_NUM 8
247 /* Free shared memory, received through LWLC */
248 #define MAC_FREE_MEM(_region, _pool, _datPtr, _size) \
250 SPutSBuf(_region, _pool,(Data *)_datPtr, _size); \
253 #define RG_LCG_ISCFGD(lcg) ((lcg)->lcgId != RG_INVALID_LCG_ID)
254 /* Corrected the check for dlCcchId */
255 #define RG_DLCCCH_ISCFGD(cell) ((cell)->dlCcchId != RG_INVALID_LC_ID)
256 #define RG_ULCCCH_ISCFGD(cell) ((cell)->ulCcchId != RG_INVALID_LC_ID)
257 /* After merging from 2.1 to 2.2 */
258 #define RG_CALC_SF_DIFF(_time1, _time2)\
259 (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)?\
260 ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.slot) -\
261 (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot) : \
262 (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)
263 /*LTE_L2_MEAS_PHASE2*/
264 #define RG_CALC_SFN_SF_DIFF(_time1,_sfnCycle, _time2)\
265 (((_time1.sfn+RG_MAX_SFN * _sfnCycle)*RG_NUM_SUB_FRAMES_5G) + _time1.slot -\
266 (_time2.sfn*RG_NUM_SUB_FRAMES_5G + _time2.slot))
268 #define RG_EXT_LCID(_lcId, _byte) {\
269 (_lcId) = (_byte) & RG_LCID_MASK; \
271 #define RG_EXT_FORMT_BIT(_fmtBit, _byte) {\
272 (_fmtBit) = ((_byte) >> RG_LCID_LEN) & 0x01; \
275 #define RG_EXT_EXTN_BIT(_extnBit, _byte) {\
276 (_extnBit) = ((_byte) >> RG_LCID_LEN) & 0x01; \
279 #ifndef MS_MBUF_CORRUPTION
280 #define MS_BUF_ADD_ALLOC_CALLER()
283 #define RG_PACK_PAD(_padBuf,_size,_sduBuf) { \
284 Buffer *sduEnd = NULLP; \
285 SsMsgInfo *mInfo = NULLP; \
286 mInfo = (SsMsgInfo *)_sduBuf->b_rptr; \
287 ssGetDBufOfSize(mInfo->region,_size, &_padBuf); \
288 if (_padBuf == NULLP) \
290 DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_CEHDR_FAIL");\
293 if (mInfo->endptr == NULLP) { \
298 sduEnd = mInfo->endptr; \
300 sduEnd->b_cont = _padBuf; \
301 padBuf->b_wptr += _size; \
302 mInfo = (SsMsgInfo *)_sduBuf->b_rptr; \
303 mInfo->endptr = _padBuf; \
304 mInfo->len += _size; \
307 #define RG_PACK_SDU(_sdusBuf, _sduBuf, _ret) {\
308 _ret = SCatMsg(_sdusBuf, _sduBuf, M1M2);\
311 #define RG_PACK_LAST_SDU_SHDR(_subHdr, _lcId, _mBuf, _ret) {\
314 _subHdr.shData[0] = (0x1F & _lcId);\
315 MS_BUF_ADD_ALLOC_CALLER(); \
316 _ret = SAddPstMsgMult(&_subHdr.shData[0], _subHdr.shLen, _mBuf);\
319 #define RGADDTOCRNTTIME(crntTime, toFill, incr) \
320 if ((crntTime.slot + incr) > (RG_NUM_SUB_FRAMES_5G - 1)) \
321 toFill.sfn = (crntTime.sfn + 1); \
323 toFill.sfn = crntTime.sfn; \
324 toFill.slot = (crntTime.slot + incr) % RG_NUM_SUB_FRAMES_5G; \
325 if (toFill.sfn >= RG_MAX_SFN) \
327 toFill.sfn%=RG_MAX_SFN; \
330 #define RGSUBFRMCRNTTIME(crntTime, toFill, dcr) \
332 if (crntTime.sfn == 0) \
334 if ((crntTime.slot - (dcr)) < 0) \
336 toFill.sfn = RG_MAX_SFN - 1; \
340 toFill.sfn = crntTime.sfn; \
345 if ((crntTime.slot - (dcr)) < 0) \
347 toFill.sfn = crntTime.sfn - 1; \
350 toFill.sfn = crntTime.sfn; \
352 toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAMES_5G); \
355 #define RGCPYTIMEINFO(src, dst) \
358 #define RG_TIMEINFO_SAME(x, y) ((x.sfn == y.sfn) && (x.slot == y.slot))
361 #define rgPBuf(_inst) rgCb[_inst].rgInit.prntBuf
363 /* Debug Prints for MAC */
365 #define RGDBGERRNEW(_inst,_args) \
366 DBGP(&rgCb[_inst].rgInit, RGLAYERNAME, DBGMASK_ERR, _args)
367 #define RGDBGINFONEW(_inst,_args) \
368 DBGP(&rgCb[_inst].rgInit, RGLAYERNAME, DBGMASK_INFO, _args)
370 #define RGDBGERRNEW(_inst,_args)
371 #define RGDBGINFONEW(_inst,_args)
372 #endif /* #ifdef DEBUGP */
373 #define RGDBGPRM(_inst,_args)
374 #define RGDBGERR(_inst,_args)
375 #define RGDBGINFO(_inst,_args)
378 #define RG_NULL_CHECK(_inst, _ptr ) \
379 if((_ptr) == NULLP) \
381 DU_LOG("\nERROR --> MAC : Null Pointer detected");\
384 #define RG_ARRAY_BOUND_CHECK(_inst, _array, _idxVal) \
385 if((_idxVal) >= (sizeof(_array)/sizeof(_array[0]))) \
387 DU_LOG("\nERROR --> MAC : Array Bound Check Failed");\
391 #define RG_NULL_CHECK(_inst, _ptr )
392 #define RG_ARRAY_BOUND_CHECK(_inst, _array, _idxVal)
395 /* Macro to free the message buffer and initialize it to zero */
396 /***********************************************************
400 * Desc : Macro to free the message buffer and initialize it to zero
402 * Input : mBuf - message buffer pointer to be retunrned
408 **********************************************************/
409 #define RG_FREE_MSG(_buf)\
411 if (NULLP != (_buf)) \
418 #define RG_FREE_MEM(_mem)\
420 if (NULLP != (_mem)) \
428 #define RG_FREE_TB(_tb)\
430 uint32_t lchIdx, pduIdx;\
431 SResetMBuf(_tb->macHdr);\
432 SResetMBuf(_tb->macCes);\
433 _tb->tbPres = FALSE;\
436 for(lchIdx = 0; lchIdx < _tb->numLch; lchIdx++) \
438 for(pduIdx = 0; pduIdx < _tb->lchInfo[lchIdx].numPdu; pduIdx++)\
440 if(_tb->lchInfo[lchIdx].mBuf[pduIdx] != NULL)\
442 SPutMsg(_tb->lchInfo[lchIdx].mBuf[pduIdx]);\
443 _tb->lchInfo[lchIdx].freeBuff = FALSE;\
445 _tb->lchInfo[lchIdx].mBuf[pduIdx] = NULL;\
447 _tb->lchInfo[lchIdx].numPdu = 0;\
452 #define RG_FREE_SAVED_TB(_tb)\
454 uint32_t lchIdx, pduIdx;\
455 RG_FREE_MSG(_tb->macHdr);\
456 RG_FREE_MSG(_tb->macCes);\
457 _tb->tbPres = FALSE;\
460 for(lchIdx = 0; lchIdx < 10; lchIdx++) \
462 for(pduIdx = 0; pduIdx < 4; pduIdx++)\
464 if(_tb->lchInfo[lchIdx].freeBuff == TRUE)\
466 SPutMsg(_tb->lchInfo[lchIdx].mBuf[pduIdx]);\
467 _tb->lchInfo[lchIdx].freeBuff = FALSE;\
469 _tb->lchInfo[lchIdx].mBuf[pduIdx] = NULL;\
471 _tb->lchInfo[lchIdx].numPdu = 0;\
478 /***********************************************************
480 * Name : RG_DROP_RGUDDATREQ_MBUF
482 * Desc : Macro to free the message buffers and initialize them to zero
484 * Input : _datreq - Dedicated Data Request pointer which has mBufs
491 **********************************************************/
492 #define RG_DROP_RGUDDATREQ_MBUF(_datReq)\
494 uint32_t idx5,idx6,idx7;\
495 for (idx5=0; idx5 < _datReq.nmbOfTbs; idx5++)\
497 for (idx6=0; idx6 < _datReq.datReqTb[idx5].nmbLch; idx6++)\
500 idx7 < _datReq.datReqTb[idx5].lchData[idx6].pdu.numPdu; \
503 RG_FREE_MSG(_datReq.datReqTb[idx5].\
504 lchData[idx6].pdu.mBuf[idx7]);\
510 /***********************************************************
512 * Name : RG_DROP_RGUCDATREQ_MBUF
514 * Desc : Macro to free the message buffers and initialize them to zero
516 * Input : _datreq - Common Data Request pointer which has mBufs
523 **********************************************************/
524 #define RG_DROP_RGUCDATREQ_MBUF(_datReq)\
526 if (_datReq != NULLP)\
528 RG_FREE_MSG(_datReq->pdu);\
533 #define RG_UPD_GBR_PRB(_cellCb, _qci, _prbUsed) {\
534 if(_qci <= RG_MAX_QCI_REPORTS)\
536 _cellCb->qcisUlPrbCnt[_qci-1] += _prbUsed;\
541 /* Macros for memory region and pool determination */
542 #define RG_GET_MEM_REGION(rgCb) (rgCb.rgInit.region)
543 #define RG_GET_MEM_POOL(rgCb) (rgCb.rgInit.pool)
546 /* MUX related macros */
547 #define RG_RAR_SHDR_LEN 1
548 #define RG_RAR_ELEM_LEN 6
549 #define RG_MAX_SDU_SUB_HDR_LEN 3
550 #define RG_MAX_PAD_ARR_SZ 4096 /* Changing from 400 to 4096 */
551 #define RG_PAD_BYTE 0x00
553 #define RG_HDR_TYPE_CRES 1
554 #define RG_HDR_TYPE_TA 2
556 #define RG_HDR_TYPE_SCELL_ACT 3
559 #define RG_SDU_SHDR_LEN 1
560 #define RG_FIXDSZ_CE_SHDR_LEN 1
561 #define RG_PAD_SHDR_LEN 1
562 #define RG_CRES_LEN 6
565 #define RG_SCELL_ACT_CE_LEN 1
566 #define RG_SCELL_CE_ELM_LEN (RG_FIXDSZ_CE_SHDR_LEN+RG_SCELL_ACT_CE_LEN)
568 #define RG_CRES_ELM_LEN (RG_FIXDSZ_CE_SHDR_LEN+RG_CRES_LEN)
569 #define RG_TA_ELM_LEN (RG_FIXDSZ_CE_SHDR_LEN+RG_TA_LEN)
572 /* Values of below macros not yet defined in 5G-NR hence using LTE values till
575 #define RG_CRES_LCID_IDX 0x1C
576 #define RG_TA_LCID_IDX 0x1D
578 #define RG_SCELL_LCID_IDX 0x1B
580 #define RG_PAD_LCID_IDX 0x3F
582 /* Structure member offset computation macro */
583 #define OffsetOf(type, field) \
584 (PTR) (&(((type *) NULLP)->field))
586 #define RG_MAX_SUBFRAMES_IN_SFN 9
587 #define RG_MAX_SFN 1024
589 #define RG_NUM_SUB_FRAMES 50
591 #define RG_NUM_SUB_FRAMES 10
593 #define RG_NUM_SUB_FRAMES_5G 50
595 #define RG_MAX_QCI_REPORTS 4
599 #define RG_NUM_UL_SUB_FRAMES 16
600 #define RG_MAX_QCI_VALUE 10
602 #ifdef EIGHT_UE_PER_TTI_CHANGES
603 /* Tuned according to TDD Cfg Mode2 and 2UE/TTI.
604 * * Need to tune if NumUE/TTI is increased */
605 #define RG_MAX_DFRD_FREE_BUFS 64 /* 64 - 8UE/TTI */
606 #define RG_MAX_FREE_BUFS_PERTTI 16 /* 16 - 8UE/TTI */
609 #define RG_CALC_SF_DIFF(_time1, _time2)\
610 (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) < (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)?\
611 ((_time1.sfn+RG_MAX_SFN)*RG_NUM_SUB_FRAMES_5G+_time1.slot) -\
612 (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot) : \
613 (_time1.sfn*RG_NUM_SUB_FRAMES_5G+_time1.slot) - (_time2.sfn*RG_NUM_SUB_FRAMES_5G+_time2.slot)
615 #define RG_TTI_CYCLE_INVLD 0xFFFFFFFF
616 #define RG_CALC_TTI_CNT(_cellCb, _ttiCnt)\
617 _ttiCnt = (RG_NUM_SUB_FRAMES_5G * (_cellCb->crntTime.sfn + (_cellCb->ttiCycle * 1024)) )+\
618 _cellCb->crntTime.slot;
619 #endif /* LTE_L2_MEAS */
621 /* Tuned according to TDD Cfg Mode2 and 2UE/TTI.
622 * Need to tune if NumUE/TTI is increased */
623 #define RG_MAX_DFRD_FREE_BUFS 32 /* 16- 2 UE per TTI 32 - 4UE/TTI */
624 #define RG_MAX_FREE_BUFS_PERTTI 8 /* 4 - 2 Ue per TTI, 8 - 4UE/TTI */
627 /* Define for the block size for memory allocation */
628 /* RG_BLKSZ changed from 2048 to 1500*/
629 #define RG_BLKSZ 1500
631 /* Defines for RGU Statistics types */
632 #define RG_RGU_SDU_DROP 1
633 #define RG_RGU_SDU_RCVD 2
635 /* MACROS for General Statistics */
639 #define RG_HQ_FDB_IND_CB_TYPE_HQ_ENT 1
640 #define RG_HQ_FDB_IND_CB_TYPE_RA_CB 2
642 /* MACRO for validating the mac instance id */
643 #define RG_IS_INST_VALID(_inst)\
645 if(_inst >= RG_MAX_INST)\
652 * Removed unused hash-define which defines the
653 * index for releasing the subframe.
656 /* Value used to set nDmrs in uplink grant if nDmrs is not applicable */
657 #define RG_INVALID_NDMRS 10
659 #define RG_SEND_TRC_IND(_inst,_mBuf, _event) rgLMMTrcInd(_inst,_mBuf, _event)
661 /* Note: Any changes to these enums should reflect to */
662 /** @details Enums for special argument
671 #define RG_DIAG_LVL0(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
673 if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL0) \
675 ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL0, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\
679 /** @details Macro definition for LTE-MAC error logs
682 #define RG_DIAG_LVL1(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
684 if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL1) \
686 ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL1, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\
690 /** @details Macro definition for LTE-MAC critical logs
693 #define RG_DIAG_LVL2(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
695 if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL2) \
697 ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL2, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\
701 /** @details Macro definition for LTE-MAC logs
704 #define RG_DIAG_LVL3(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
706 if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL3) \
708 ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL3, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\
712 /** @details Macro definition for LTE-MAC logs
715 #define RG_DIAG_LVL4(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
717 if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL4) \
719 ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL4, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\
725 #define RG_DIAG_LVL0(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
729 /** @details Macro definition for LTE-MAC error logs
732 #define RG_DIAG_LVL1(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
736 /** @details Macro definition for LTE-MAC critical logs
739 #define RG_DIAG_LVL2(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
743 /** @details Macro definition for LTE-MAC logs
746 #define RG_DIAG_LVL3(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
750 /** @details Macro definition for LTE-MAC logs
753 #define RG_DIAG_LVL4(_inst,_tknId, _splArgEnum, _splArg, _string, _arg1, _arg2, _arg3, _arg4) \
759 /**********************************************************************
761 **********************************************************************/