- case MAC_LCID_CCCH :
- {
- pduLen--;
-
- /* for UL CCCH,fixed length of MAC SDU */
- length = 6;
-
- /* Allocating sharable memory to send ul ccch msg to du app*/
- MAC_ALLOC_SHRABL_BUF(pdu, length);
- if(!pdu)
- {
- DU_LOG("\nMAC : UL CCCH PDU memory allocation failed");
- return RFAILED;
- }
- idx++;
- memcpy(pdu, &rxDataPdu[idx], length);
- pduLen -= length;
- idx = idx + length;
-
- /* store msg3 pdu in macRaCb for CRI value */
- memcpy(&macCb.macCell->macRaCb[0].msg3Pdu, pdu, length);
-
- /* TODO:
- * Fill and send UL-CCCH Indication to DU APP
- */
- break;
- }
-
- case MAC_DEDLC_MIN_LCID ... MAC_DEDLC_MAX_LCID :
- break;
-
- case MAC_LCID_RESERVED_MIN ... MAC_LCID_RESERVED_MAX :
- break;
-
- case MAC_LCID_CCCH_48BIT :
- break;
-
- case MAC_LCID_BIT_RATE_QUERY :
- break;
-
- case MAC_LCID_MULT_PHR_FOUR_OCT :
- break;
-
- case MAC_LCID_CFG_GRANT_CFM :
- break;
-
- case MAC_LCID_MULT_PHR_ONE_OCT:
- break;
-
- case MAC_LCID_SINGLE_PHR :
- break;
-
- case MAC_LCID_CRNTI :
- break;
-
- case MAC_LCID_SHORT_TRUNC_BSR :
- break;
-
- case MAC_LCID_LONG_TRUNC_BSR :
- break;
-
- case MAC_LCID_SHORT_BSR :
- break;
-
- case MAC_LCID_LONG_BSR :
- break;
-
- case MAC_LCID_PADDING :
- {
- break;
- }
-
- default:
- {
- DU_LOG("\nMAC : Invalid LC Id %d", lcId);
- return RFAILED;
- }
+ case MAC_LCID_CCCH :
+ {
+ pduLen--;
+
+ /* for UL CCCH,fixed length of MAC SDU */
+ length = 6;
+
+ /* Allocating sharable memory to send ul ccch msg to du app*/
+ MAC_ALLOC_SHRABL_BUF(pdu, length);
+ if(!pdu)
+ {
+ DU_LOG("\nERROR --> MAC : UL CCCH PDU memory allocation failed");
+ return RFAILED;
+ }
+ idx++;
+ memcpy(pdu, &rxDataPdu[idx], length);
+ pduLen -= length;
+ idx = idx + length;
+
+ /* store msg3 pdu in macRaCb for CRI value */
+ memcpy(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg3Pdu, pdu, length);
+
+ /* Send UL-CCCH Indication to DU APP */
+ ret = macProcUlCcchInd(macCb.macCell[cellIdx]->cellId, rxDataIndPdu->rnti, length, pdu);
+ break;
+ }
+
+ case MAC_LCID_MIN ... MAC_LCID_MAX :
+ {
+ DU_LOG("\nINFO --> MAC : PDU received for LC ID %d", lcId);
+ pduLen--;
+ idx++;
+
+ length = rxDataPdu[idx];
+ if(fBit)
+ {
+ pduLen--;
+ idx++;
+ length = (length << 8) & rxDataPdu[idx];
+ }
+
+ /* Copying the payload to send to RLC */
+ MAC_ALLOC_SHRABL_BUF(pdu, length);
+ if(!pdu)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed while demuxing Rx Data PDU");
+ return RFAILED;
+ }
+ pduLen--;
+ idx++;
+ memcpy(pdu, &rxDataPdu[idx], length);
+ pduLen -= length;
+ idx = idx + length;
+
+ /* Delete RA cb once RRC setup complete received */
+ if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == rxDataIndPdu->rnti)
+ {
+ MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4Pdu, \
+ macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4PduLen);
+ MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TxPdu, \
+ macCb.macCell[cellIdx]->macRaCb[ueIdx].msg4TbSize);
+ memset(&macCb.macCell[cellIdx]->macRaCb[ueIdx], 0, sizeof(MacRaCbInfo));
+ }
+
+ /* Send UL Data to RLC */
+ ret = macProcUlData(cellId, rxDataIndPdu->rnti, slotInfo, lcId, length, pdu);
+
+ break;
+ }
+ case MAC_LCID_RESERVED_MIN ... MAC_LCID_RESERVED_MAX :
+ break;
+
+ case MAC_LCID_CCCH_48BIT :
+ break;
+
+ case MAC_LCID_BIT_RATE_QUERY :
+ break;
+
+ case MAC_LCID_MULT_PHR_FOUR_OCT :
+ break;
+
+ case MAC_LCID_CFG_GRANT_CFM :
+ break;
+
+ case MAC_LCID_MULT_PHR_ONE_OCT:
+ break;
+
+ case MAC_LCID_SINGLE_PHR :
+ break;
+
+ case MAC_LCID_CRNTI :
+ break;
+
+ case MAC_LCID_SHORT_TRUNC_BSR :
+ break;
+
+ case MAC_LCID_LONG_TRUNC_BSR :
+ break;
+
+ case MAC_LCID_SHORT_BSR :
+ {
+ uint8_t lcgId = 0;
+ uint8_t bufferSizeIdx = 0;
+ uint8_t crnti = 0;
+ uint32_t bufferSize = 0;
+
+ pduLen--;
+
+ idx++;
+ crnti = rxDataIndPdu->rnti;
+ /* 5 LSB bits in pdu represent buffer size */
+ bufferSizeIdx = (~((~0) << 5)) & rxDataPdu[idx];
+ /* first 3 MSB bits in pdu represent LCGID */
+ lcgId = (rxDataPdu[idx]) >> 5;
+ /* determine actual number of bytes requested */
+ bufferSize = shortBsrBytesTable[bufferSizeIdx];
+ ret = macProcShortBsr(macCb.macCell[cellIdx]->cellId, crnti, lcgId, bufferSize);
+ pduLen--;
+ idx++;
+
+ break;
+ }
+
+ case MAC_LCID_LONG_BSR :
+ break;
+
+ case MAC_LCID_PADDING :
+ break;
+
+ default:
+ {
+ DU_LOG("\nERROR --> MAC : Invalid LC Id %d", lcId);
+ return RFAILED;
+ }