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 /* header include files -- defines (.h) */
20 #include "common_def.h"
21 #include "lrg.h" /* Layer manager interface includes*/
22 #include "lrg.x" /* layer management typedefs for MAC */
23 #include "du_app_mac_inf.h"
24 #include "mac_sch_interface.h"
25 #include "lwr_mac_upr_inf.h"
27 #include "mac_utils.h"
29 /*******************************************************************
31 * @brief De-mux of MAC-Sub PDUs from Rx Data Ind Pdu
35 * Function : unpackRxData
38 * De-mux of MAC-Sub PDUs from Rx Data Ind Pdu
40 * @params[in] Pointer to PDU received
45 * ****************************************************************/
46 uint8_t unpackRxData(uint16_t cellId, RxDataIndPdu *rxDataIndPdu)
56 GET_CELL_IDX(cellId, cellIdx);
57 pduLen = rxDataIndPdu->pduLength;
58 rxDataPdu = rxDataIndPdu->pduData;
62 /* LC id is the 6 LSB in 1st octet */
63 lcId = (~((~0) << 6)) & rxDataPdu[idx];
71 /* for UL CCCH,fixed length of MAC SDU */
74 /* Allocating sharable memory to send ul ccch msg to du app*/
75 MAC_ALLOC_SHRABL_BUF(pdu, length);
78 DU_LOG("\nMAC : UL CCCH PDU memory allocation failed");
82 memcpy(pdu, &rxDataPdu[idx], length);
86 /* store msg3 pdu in macRaCb for CRI value */
87 memcpy(macCb.macCell[cellIdx]->macRaCb[0].msg3Pdu, pdu, length);
89 /* Send UL-CCCH Indication to DU APP */
90 macSendUlCcchInd(pdu, macCb.macCell[cellIdx]->cellId, rxDataIndPdu->rnti);
94 case MAC_DEDLC_MIN_LCID ... MAC_DEDLC_MAX_LCID :
97 case MAC_LCID_RESERVED_MIN ... MAC_LCID_RESERVED_MAX :
100 case MAC_LCID_CCCH_48BIT :
103 case MAC_LCID_BIT_RATE_QUERY :
106 case MAC_LCID_MULT_PHR_FOUR_OCT :
109 case MAC_LCID_CFG_GRANT_CFM :
112 case MAC_LCID_MULT_PHR_ONE_OCT:
115 case MAC_LCID_SINGLE_PHR :
118 case MAC_LCID_CRNTI :
121 case MAC_LCID_SHORT_TRUNC_BSR :
124 case MAC_LCID_LONG_TRUNC_BSR :
127 case MAC_LCID_SHORT_BSR :
130 case MAC_LCID_LONG_BSR :
133 case MAC_LCID_PADDING :
140 DU_LOG("\nMAC : Invalid LC Id %d", lcId);
143 } /* End of switch */
145 if(lcId == MAC_LCID_PADDING)
151 } /* End of unpackRxData */
153 /**********************************************************************
155 **********************************************************************/