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 *******************************************************************************/
18 #include "common_def.h"
24 #include "du_app_mac_inf.h"
25 #include "mac_sch_interface.h"
27 #include "sch_utils.h"
30 * @brief Process CRC indication
34 * Function : SchProcCrcInd
36 * This function process CRC indication
38 * @param[in] CrcIndInfo *crcInd, recvd crc indication
39 * @param[in] Inst schInst, scheduler inst
44 uint8_t SchProcCrcInd(Pst *pst, CrcIndInfo *crcInd)
48 SchUlHqProcCb *hqP = NULLP;
49 Inst schInst = pst->dstInst - SCH_INST_START;
50 SchCellCb *cell = schCb[schInst].cells[schInst];
52 while(count <crcInd->numCrcInd)
54 GET_UE_ID(crcInd->crnti, ueId);
55 if (cell->raCb[ueId-1].raState == SCH_RA_STATE_MSG3_PENDING)
57 if (crcInd->crcInd[count])
60 if (cell->raCb[ueId-1].msg3HqProc.tbInfo.txCntr < cell->maxMsg3Tx)
62 cell->api->SchCrcInd(cell, ueId);
63 cell->raCb[ueId - 1].retxMsg3HqProc = &cell->raCb[ueId - 1].msg3HqProc;
67 /*Release all contexts of the UE RA*/
73 /*Dedicated preamble case need to be added*/
74 cell->raCb[ueId-1].raState = SCH_RA_STATE_MSG4_PENDING;
75 /*HARQ init part is in ADD UE CONFIG now, could be moved here*/
80 if (cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.count == 0)
82 DU_LOG("\n ERROR no harq stored in ul hq map at slot %d ue id %d\n",crcInd->timingInfo.slot, ueId);
85 if (cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.first == 0)
87 DU_LOG("\n ERROR NULL harq stored in ul hq map at slot %d ue id %d\n",crcInd->timingInfo.slot, ueId);
90 hqP = (SchUlHqProcCb*) cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList.first->node;
97 if (crcInd->crcInd[count])
100 schUlHqProcessNack(hqP);
105 schUlHqProcessAck(hqP);
108 cmLListDelFrm(&(cell->ueCb[ueId-1].hqUlmap[crcInd->timingInfo.slot]->hqList), &hqP->ulSlotLnk);
114 /**********************************************************************
116 **********************************************************************/