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 *******************************************************************************/
22 /* header include files -- defines (.h) */
23 #include "envopt.h" /* environment options */
24 #include "envdep.h" /* environment dependent */
25 #include "envind.h" /* environment independent */
26 #include "gen.h" /* general layer */
27 #include "ssi.h" /* system service interface */
28 #include "cm_hash.h" /* common hash list */
29 #include "cm_mblk.h" /* common memory link list library */
30 #include "cm_llist.h" /* common linked list library */
31 #include "cm_err.h" /* common error */
32 #include "cm_lte.h" /* common LTE */
33 #include "lrg.h" /* Layer manager interface includes*/
34 #include "crg.h" /* CRG interface includes*/
35 #include "rgu.h" /* RGU interface includes*/
36 #include "tfu.h" /* TFU interface includes */
37 #include "rg_sch_inf.h" /* SCH interface includes */
38 #include "rg_prg.h" /* PRG (MAC-MAC) interface includes*/
39 #include "rg_env.h" /* MAC environmental includes*/
40 #include "rg.h" /* MAC includes*/
41 #include "rg_err.h" /* MAC error includes*/
44 /* header/extern include files (.x) */
45 #include "gen.x" /* general layer typedefs */
46 #include "ssi.x" /* system services typedefs */
47 #include "cm5.x" /* common timers */
48 #include "cm_hash.x" /* common hash list */
49 #include "cm_lib.x" /* common library */
50 #include "cm_llist.x" /* common linked list */
51 #include "cm_mblk.x" /* memory management */
52 #include "cm_tkns.x" /* common tokens */
53 #include "cm_lte.x" /* common tokens */
54 #include "rgu.x" /* RGU types */
55 #include "tfu.x" /* RGU types */
56 #include "lrg.x" /* layer management typedefs for MAC */
57 #include "crg.x" /* CRG interface includes */
58 #include "rg_sch_inf.x" /* SCH interface typedefs */
59 #include "rg_prg.x" /* PRG (MAC-MAC) Interface typedefs */
60 #include "du_app_mac_inf.h"
62 #include "rg.x" /* typedefs for MAC */
64 /*******************************************************************
66 * @brief De-mux of MAC-Sub PDUs from Rx Data Ind Pdu
70 * Function : unpackRxData
73 * De-mux of MAC-Sub PDUs from Rx Data Ind Pdu
75 * @params[in] Pointer to PDU received
80 * ****************************************************************/
81 int unpackRxData(SlotIndInfo timingInfo, RxDataIndPdu *rxDataIndPdu)
90 pduLen = rxDataIndPdu->pduLength;
91 rxDataPdu = rxDataIndPdu->pduData;
95 /* LC id is the 6 LSB in 1st octet */
96 lcId = (~((~0) << 6)) & rxDataPdu[idx];
104 /* for UL CCCH,fixed length of MAC SDU */
107 /* Allocating sharable memory to send ul ccch msg to du app*/
108 MAC_ALLOC_SHRABL_BUF(pdu, length);
111 DU_LOG("\nMAC : UL CCCH PDU memory allocation failed");
115 memcpy(pdu, &rxDataPdu[idx], length);
120 * Fill and send UL-CCCH Indication to DU APP
125 case MAC_DEDLC_MIN_LCID ... MAC_DEDLC_MAX_LCID :
128 case MAC_LCID_RESERVED_MIN ... MAC_LCID_RESERVED_MAX :
131 case MAC_LCID_CCCH_48BIT :
134 case MAC_LCID_BIT_RATE_QUERY :
137 case MAC_LCID_MULT_PHR_FOUR_OCT :
140 case MAC_LCID_CFG_GRANT_CFM :
143 case MAC_LCID_MULT_PHR_ONE_OCT:
146 case MAC_LCID_SINGLE_PHR :
149 case MAC_LCID_CRNTI :
152 case MAC_LCID_SHORT_TRUNC_BSR :
155 case MAC_LCID_LONG_TRUNC_BSR :
158 case MAC_LCID_SHORT_BSR :
161 case MAC_LCID_LONG_BSR :
164 case MAC_LCID_PADDING :
171 DU_LOG("\nMAC : Invalid LC Id %d", lcId);
174 } /* End of switch */
176 if(lcId == MAC_LCID_PADDING)
182 } /* End of unpackRxData */
184 /**********************************************************************
186 **********************************************************************/