#include "lrg.x" /* layer management typedefs for MAC */
#include "mac_sch_interface.h"
#include "sch.h"
+#include "sch_tmr.h"
#include "sch_utils.h"
#include "math.h"
uint8_t defaultUlAckTbl[DEFAULT_UL_ACK_LIST_COUNT]= {1, 2, 3 , 4, 5, 6, 7, 8};
+uint8_t schCmnDlRvTbl[4] = {0, 2, 3, 1};
/**
* @brief Function to find first DMRS symbol in PDSCH
*
/* Check if requested number of blocks can be allocated from the current block */
if(freeBlock->numFreePrb < numPrb)
+ {
+ DU_LOG("\nINFO --> SCH: In isPrbAvailable, numFreePrb:%d is less than reqPrb:%d", freeBlock->numFreePrb, numPrb);
+ node = node->next;
continue;
-
+ }
+
/* Check if requested PRBs belong within the range of current free block */
if(((startPrb >= freeBlock->startPrb) && (startPrb <= freeBlock->endPrb)) && \
((endPrb >= freeBlock->startPrb) && (endPrb <= freeBlock->endPrb)))
**/
SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti)
{
- uint16_t ueIdx;
- GET_UE_IDX(crnti, ueIdx);
- return &(cellCb->ueCb[ueIdx -1]);
+ uint16_t ueId;
+ GET_UE_ID(crnti, ueId);
+ return &(cellCb->ueCb[ueId -1]);
}
/**
* If NULLP, FATAL FAILURE
*
* ***********************************************************************/
-LcInfo* handleLcLList(CmLListCp *lcLL, uint8_t lcId, ActionTypeLcLL action)
+LcInfo* handleLcLList(CmLListCp *lcLL, uint8_t lcId, ActionTypeLL action)
{
CmLList *node = NULLP;
LcInfo *lcNode = NULLP;
if(lcLL == NULLP)
{
- DU_LOG("\nERROR -->SCH: LcList doesnt exist");
+ DU_LOG("\nERROR --> SCH: LcList doesnt exist");
return NULLP;
}
node = lcLL->first;
lcNode = (LcInfo *)node->node;
if(lcNode->lcId == lcId)
{
- DU_LOG("\nINFO --> SCH : LcID:%d found in LL",lcId);
found = TRUE;
break;
}
/*List is empty; Initialize the LL ControlPointer*/
if(lcLL->count == 0)
{
- DU_LOG("\nINFO --> SCH: First LC:%d to add in this List",lcId);
cmLListInit(lcLL);
}
}
else
{
- DU_LOG("\nERROR --> SCH : Allocation of List failed,lcId:%d",lcId);
+ DU_LOG("\nERROR --> SCH : Allocation of List failed,lcId:%d",lcId);
return NULLP;
}
if(addNodeToLList(lcLL, lcNode, NULLP) == RFAILED)
{
- DU_LOG("\nERROR --> SCH : failed to Add Node,lcId:%d",lcId);
+ DU_LOG("\nERROR --> SCH : failed to Add Node,lcId:%d",lcId);
SCH_FREE(lcNode, sizeof(LcInfo));
return NULLP;
}
- DU_LOG("\nINFO --> SCH : Added new Node in List for lcId:%d\n",lcId);
return lcNode;
}
{
if(!found || lcNode == NULLP)
{
- DU_LOG("\nERROR --> SCH: LCID: %d not found; thus Deletion unsuccessful",lcId);
+ DU_LOG("\nERROR --> SCH: LCID%d not found; thus Deletion unsuccessful",lcId);
}
else
{
if(deleteNodeFromLList(lcLL, node) == ROK)
SCH_FREE(lcNode, sizeof(LcInfo));
- DU_LOG("\nINFO --> SCH: LCID: %d Deleted successfully",lcId);
+ DU_LOG("\nDEBUG --> SCH: LCID%d Deleted successfully",lcId);
}
return NULLP;
}
+ case PRINT:
+ case TRAVERSE_ALL:
+ {
+ break;
+ }
default:
{
- DU_LOG("\nERROR --> SCH: Action type wrong: %d",action);
+ DU_LOG("\nERROR --> SCH: Action type wrong: %d",action);
break;
}
}
uint8_t updateLcListReqPRB(CmLListCp *lcLL, uint8_t lcId, uint32_t payloadSize)
{
LcInfo *lcNode = NULLP;
-
lcNode = handleLcLList(lcLL, lcId, CREATE);
if(lcNode == NULLP)
{
- DU_LOG("\nERROR --> SCH : LC is neither present nor able to create in List lcId:%d",lcId);
+ DU_LOG("\nERROR --> SCH : LC is neither present nor able to create in List lcId:%d",lcId);
return RFAILED;
}
+
lcNode->reqBO = payloadSize;
- lcNode->allocBO = 0;
+ lcNode->allocBO = 0;
lcNode->allocPRB = 0; /*Re-Initializing the AllocPRB*/
- DU_LOG("\nINFO --> SCH : LCID:%d, reqBO:%d", lcId, lcNode->reqBO);
return ROK;
}
if(lcLL == NULLP)
{
- DU_LOG("\nINFO --> SCH: LcList doesnt exist");
+ DU_LOG("\nERROR --> SCH: LcList doesnt exist");
return;
}
node = lcLL->first;
*
*
*************************************************************************/
-uint32_t calculateEstimateTBSize(uint32_t reqBO, uint16_t mcsIdx,uint8_t numSymbols,\
+uint32_t calculateEstimateTBSize(uint32_t reqBO, uint16_t mcsIdx, uint8_t numSymbols,\
uint16_t maxPRB, uint16_t *estPrb)
{
uint32_t tbs = 0, effecBO = 0;
effecBO = MIN(tbs,reqBO);
return (effecBO);
}
+
+
+/*******************************************************************
+*
+* @brief deleting Page Info node from PageInfo List
+*
+* @details
+*
+* Function : schDeleteFromPageInfoList
+*
+* Functionality: deleting page Info node from Page Info List
+*
+* @params[in] CmLListCp *list, CmLList *node
+*
+* @return void
+*
+* ****************************************************************/
+void schDeleteFromPageInfoList(CmLListCp *list, CmLList *node)
+{
+ SchPageInfo *pageInfo;
+
+ if(node != NULLP)
+ {
+ pageInfo = (SchPageInfo *)node->node;
+ if(deleteNodeFromLList(list, node) == ROK)
+ SCH_FREE(pageInfo, sizeof(SchPageInfo));
+ }
+}
+
+/*******************************************************************
+*
+* @brief searching for Page at a particular SFN
+*
+* @details
+*
+* Function : schPageInfoSearchFromPageList
+*
+* Functionality: searching for Page at a particular SFN
+*
+* @params[in] SlotTimingInfo slotInfo, CmLListCp *storedPageList
+*
+* @return pointer to SchPageInfo
+*
+* ****************************************************************/
+CmLList *schPageInfoSearchFromPageList(SlotTimingInfo slotInfo, CmLListCp *storedPageList)
+{
+ CmLList *node = NULLP;
+ SchPageInfo *pageInfo = NULLP;
+
+ if(storedPageList->count)
+ {
+ CM_LLIST_FIRST_NODE(storedPageList, node);
+ while(node)
+ {
+ pageInfo = (SchPageInfo*)node->node;
+ if(pageInfo == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH: PageInfo empty");
+ }
+ else if(pageInfo->pageTxTime.sfn == slotInfo.sfn &&
+ (pageInfo->pageTxTime.slot == slotInfo.slot))
+ {
+ return node;
+ }
+ node = node->next;
+ }
+ }
+ return NULLP;
+}
+
/*Below function for printing will be used in future so disabling it for now*/
#if 0
/****************************************************************************
if(lcLL == NULLP)
{
- DU_LOG("\nINFO -->SCH: LcList doesnt exist");
+ DU_LOG("\nINFO --> SCH: LcList doesnt exist");
return;
}
node = lcLL->first;
lcNode = (LcInfo *)node->node;
if(lcNode)
{
- DU_LOG("\nINFO --> SCH : LcID:%d, [reqBO, allocBO, allocPRB]:[%d,%d,%d]",\
+ DU_LOG("\nINFO --> SCH : LcID:%d, [reqBO, allocBO, allocPRB]:[%d,%d,%d]",\
lcNode->lcId,lcNode->reqBO, lcNode->allocBO, lcNode->allocPRB);
}
numBitsToShift += 8;
}
}
-
/**********************************************************************
End of file
**********************************************************************/