SlotIndInfo slotIndInfo;
uint8_t slotIndIdx;
+uint16_t sendTxDataReq(CmLteTimingInfo *currTimingInfo, DlAlloc *dlInfo);
+
void lwrMacInit()
{
#ifdef INTEL_WLS
* ****************************************************************/
S16 lwr_mac_handleInvalidEvt(void *msg)
{
- printf("\nLOWER MAC: Error Indication Event[%d] received in state [%d]", clGlobalCp.event, clGlobalCp.phyState);
+ printf("\nLWR_MAC: Error Indication Event[%d] received in state [%d]", clGlobalCp.event, clGlobalCp.phyState);
RETVALUE(ROK);
}
}
else
{
- DU_LOG("\nLOWER MAC: Value Extraction failed" );
+ DU_LOG("\nLWR_MAC: Value Extraction failed" );
return RFAILED;
}
}
if(paramReq != NULLP)
{
fillMsgHeader(¶mReq->header, FAPI_PARAM_REQUEST, msgLen);
- DU_LOG("\nLOWER MAC: Sending Param Request to Phy");
+ DU_LOG("\nLWR_MAC: Sending Param Request to Phy");
LwrMacSendToPhy(paramReq->header.message_type_id, sizeof(fapi_param_req_t), (void *)paramReq);
return ROK;
}
else
{
- DU_LOG("\nLOWER MAC: Failed to allocate memory for Param Request");
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for Param Request");
return RFAILED;
}
#else
ClCellParam *cellParam = NULLP;
paramRsp = (fapi_param_resp_t *)msg;
- DU_LOG("\nLOWER MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
if(paramRsp != NULLP)
{
MAC_ALLOC(cellParam, sizeof(ClCellParam));
if(cellParam != NULLP)
{
- DU_LOG("\n LOWER MAC: Filling TLVS into MAC API");
+ DU_LOG("\n LWR_MAC: Filling TLVS into MAC API");
if(paramRsp->error_code == MSG_OK)
{
for(index = 0; index < paramRsp->number_of_tlvs; index++)
}
else
{
- DU_LOG("\n LOWER MAC: Invalid error code %d", paramRsp->error_code);
+ DU_LOG("\n LWR_MAC: Invalid error code %d", paramRsp->error_code);
return RFAILED;
}
}
else
{
- DU_LOG("\nLOWER MAC: Failed to allocate memory for cell param");
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for cell param");
return RFAILED;
}
}
else
{
- DU_LOG("\nLOWER MAC: Param Response received from PHY is NULL");
+ DU_LOG("\nLWR_MAC: Param Response received from PHY is NULL");
return RFAILED;
}
#else
MacCellCfg macCfgParams;
Inst inst = 0;
- DU_LOG("\nLOWER MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
fapi_config_req_t *configReq;
cellParams = rgCb[inst].cell;
#ifdef FAPI
fapi_config_resp_t *configRsp;
configRsp = (fapi_config_resp_t *)msg;
- DU_LOG("\nLOWER MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
if(configRsp != NULL)
{
if(configRsp->error_code == MSG_OK)
{
- DU_LOG("\nLOWER MAC: PHY has moved to Configured state \n");
+ DU_LOG("\nLWR_MAC: PHY has moved to Configured state \n");
clGlobalCp.phyState = PHY_STATE_CONFIGURED;
/* TODO :
* Store config response into an intermediate struture and send to MAC
else
{
- DU_LOG("\n LOWER MAC: Invalid error code %d", configRsp->error_code);
+ DU_LOG("\n LWR_MAC: Invalid error code %d", configRsp->error_code);
return RFAILED;
}
}
if(startReq != NULL)
{
fillMsgHeader(&startReq->header, FAPI_START_REQUEST, msgLen);
- DU_LOG("\nLOWER MAC: Sending Start Request to PHY");
+ DU_LOG("\nLWR_MAC: Sending Start Request to PHY");
LwrMacSendToPhy(startReq->header.message_type_id, sizeof(fapi_start_req_t), (void *)startReq);
return ROK;
}
else
{
- DU_LOG("\nLOWER MAC: Failed to allocate memory for Start Request");
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for Start Request");
return RFAILED;
}
#else
{
*mibPdu |= (((uint8_t)(slotIndInfo.sfn >> 2)) & MIB_SFN_BITMASK);
*val = (mibPdu[0] << 24 | mibPdu[1] << 16 | mibPdu[2] << 8);
- DU_LOG("\nLOWER MAC: value filled %x", *val);
+ DU_LOG("\nLWR_MAC: MIB PDU %x", *val);
}
#ifdef FAPI
if(numBytes > DCI_PAYLOAD_BYTE_LEN)
{
- DU_LOG("\nLOWER MAC : Total bytes for DCI is more than expected");
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
return;
}
if(numBytes > DCI_PAYLOAD_BYTE_LEN)
{
- DU_LOG("\nLOWER MAC : Total bytes for DCI is more than expected");
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
return;
}
******************************************************************/
void fillPdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, PdschCfg *pdschInfo,
-uint32_t *msgLen)
+uint32_t *msgLen, uint16_t pduIndex)
{
uint8_t idx;
dlTtiReqPdu->pduType = PDSCH_PDU_TYPE;
dlTtiReqPdu->u.pdsch_pdu.pduBitMap = pdschInfo->pduBitmap;
dlTtiReqPdu->u.pdsch_pdu.rnti = pdschInfo->rnti;
- dlTtiReqPdu->u.pdsch_pdu.pduIndex = pdschInfo->pduIndex;
+ dlTtiReqPdu->u.pdsch_pdu.pduIndex = pduIndex;
dlTtiReqPdu->u.pdsch_pdu.bwpSize = pdschInfo->pdschBwpCfg.BWPSize;
dlTtiReqPdu->u.pdsch_pdu.bwpStart = pdschInfo->pdschBwpCfg.BWPStart;
dlTtiReqPdu->u.pdsch_pdu.subCarrierSpacing = pdschInfo->pdschBwpCfg.subcarrierSpacing;
*
* @details
*
- * Function : calculatePduCount
+ * Function : calcDlTtiReqPduCount
*
* Functionality:
* -calculates the total pdu count to be allocated for DL TTI Req
* @return count
*
* ********************************************************************/
-uint8_t calculatePduCount(DlAlloc *dlInfo)
+uint8_t calcDlTtiReqPduCount(DlAlloc *dlInfo)
{
uint8_t count = 0;
uint8_t idx = 0;
return count;
}
+/***********************************************************************
+ *
+ * @brief calculates the total size to be allocated for DL TTI Req
+ *
+ * @details
+ *
+ * Function : calcTxDataReqPduCount
+ *
+ * Functionality:
+ * -calculates the total pdu count to be allocated for DL TTI Req
+ *
+ * @params[in] DlBrdcstAlloc *cellBroadcastInfo
+ * @return count
+ *
+ * ********************************************************************/
+uint8_t calcTxDataReqPduCount(DlAlloc *dlInfo)
+{
+ uint8_t count = 0;
+ if(dlInfo->isBroadcastPres && dlInfo->brdcstAlloc.sib1Trans)
+ {
+ count++;
+ }
+ if(dlInfo->isRarPres)
+ {
+ count++;
+ }
+ return count;
+}
/***********************************************************************
*
* @brief fills the SIB1 TX-DATA request message
* - fills the SIB1 TX-DATA request message
*
* @params[in] fapi_tx_pdu_desc_t *pduDesc
- * @params[in] MacCellCfg *macCellCfg
- * @params[in] uint16_t pduIndex
+ * @params[in] macCellCfg consist of SIB1 pdu
* @params[in] uint32_t *msgLen
+ * @params[in] uint16_t pduIndex
* @return ROK
*
* ********************************************************************/
uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc,MacCellCfg *macCellCfg,
- uint16_t pduIndex, uint32_t *msgLen)
+ uint32_t *msgLen, uint16_t pduIndex)
{
uint32_t pduLen = 0;
uint32_t *sib1TxdataValue = NULLP;
*
* @params[in] fapi_tx_pdu_desc_t *pduDesc
* @params[in] RarInfo *rarInfo
- * @params[in] uint16_t pduIndex
* @params[in] uint32_t *msgLen
+ * @params[in] uint16_t pduIndex
* @return ROK
*
* ********************************************************************/
uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
- uint16_t pduIndex, uint32_t *msgLen)
+ uint32_t *msgLen, uint16_t pduIndex)
{
uint32_t pduLen = 0;
uint32_t *rarTxdataValue = NULLP;
* Function : handleDlTtiReq
*
* Functionality:
- * -Sends FAPI Param req to PHY
+ * -Sends FAPI DL TTI req to PHY
*
- * @params[in] RgDlSf *dlTtiReqSlot
+ * @params[in] timing info
* @return ROK - success
* RFAILED - failure
*
* ****************************************************************/
-uint16_t handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo)
+uint16_t handleDlTtiReq(CmLteTimingInfo *currTimingInfo)
{
#ifdef FAPI
uint8_t idx;
uint8_t nPdu = 0;
uint8_t numPduEncoded = 0;
+ uint16_t pduIndex = 0;
uint32_t msgLen = 0;
fapi_dl_tti_req_t *dlTtiReq = NULLP;
- fapi_tx_data_req_t *txDataReq = NULLP;
RgCellCb *cellCbParams = NULLP;
MacDlSlot *currDlSlot = NULLP;
MacCellCfg macCellCfg;
cellCbParams = rgCb[inst].cell;
macCellCfg = cellCbParams->macCellCfg;
- if(dlTtiReqtimingInfo != NULLP)
+ if(currTimingInfo != NULLP)
{
LWR_MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
if(dlTtiReq != NULLP)
{
- dlTtiReq->sfn = dlTtiReqtimingInfo->sfn;
- dlTtiReq->slot = dlTtiReqtimingInfo->slot;
+ dlTtiReq->sfn = currTimingInfo->sfn;
+ dlTtiReq->slot = currTimingInfo->slot;
currDlSlot = &macCb.macCell->dlSlot[dlTtiReq->slot % MAX_SLOT_SUPPORTED];
- dlTtiReq->nPdus = calculatePduCount(&currDlSlot->dlInfo); /* get total Pdus */
+ dlTtiReq->nPdus = calcDlTtiReqPduCount(&currDlSlot->dlInfo); /* get total Pdus */
nPdu = dlTtiReq->nPdus;
dlTtiReq->nGroup = 0;
if(dlTtiReq->nPdus > 0)
LWR_MAC_ALLOC(dlTtiReq->pdus, (nPdu * sizeof(fapi_dl_tti_req_pdu_t)));
if(!dlTtiReq->pdus)
{
- DU_LOG("\nLOWER MAC: Memory allocation failed");
+ DU_LOG("\nLWR_MAC: Memory allocation failed");
return RFAILED;
}
numPduEncoded++;
}
}
- DU_LOG("\nLOWER MAC: MIB sent..");
+ printf("\033[1;31m");
+ DU_LOG("\nLWR_MAC: MIB sent..");
+ printf("\033[0m");
}
if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans)
{
sib1Alloc.sib1PdcchCfg, &msgLen);
numPduEncoded++;
fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],&currDlSlot->dlInfo.brdcstAlloc.\
- sib1Alloc.sib1PdschCfg, &msgLen);
+ sib1Alloc.sib1PdschCfg, &msgLen, pduIndex);
+ pduIndex++;
numPduEncoded++;
}
- DU_LOG("\nLOWER MAC: SIB1 sent...");
+ printf("\033[1;34m");
+ DU_LOG("\nLWR_MAC: SIB1 sent...");
+ printf("\033[0m");
}
}
if(currDlSlot->dlInfo.isRarPres)
{
/* Filling RAR param */
+ fillRarPdu(&currDlSlot->dlInfo.rarAlloc.rarInfo);
fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &currDlSlot->dlInfo.rarAlloc.rarPdcchCfg, &msgLen);
numPduEncoded++;
- fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &currDlSlot->dlInfo.rarAlloc.rarPdschCfg, &msgLen);
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &currDlSlot->dlInfo.rarAlloc.rarPdschCfg,
+ &msgLen, pduIndex);
numPduEncoded++;
- DU_LOG("\nLOWER MAC: RAR sent...");
+ pduIndex++;
+
+ printf("\033[1;32m");
+ DU_LOG("\nLWR_MAC: RAR sent...");
+ printf("\033[0m");
}
msgLen += sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
/* TODO : Recheck the size / msglen to be sent to WLS_Put*/
LwrMacSendToPhy(dlTtiReq->header.message_type_id, msgLen, (void *)dlTtiReq);
- /* send TX_Data request message */
- if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans)
- {
- msgLen = 0;
- LWR_MAC_ALLOC(txDataReq,sizeof(fapi_tx_data_req_t));
- txDataReq->sfn = dlTtiReqtimingInfo->sfn;
- txDataReq->slot = dlTtiReqtimingInfo->slot;
- txDataReq->numPdus = 1;
- LWR_MAC_ALLOC(txDataReq->pduDesc, (txDataReq->numPdus * \
- sizeof(fapi_tx_pdu_desc_t)));
- fillSib1TxDataReq(
- txDataReq->pduDesc,
- &rgCb[inst].cell->macCellCfg,
- currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg.pduIndex,
- &msgLen);
- msgLen += sizeof(fapi_tx_data_req_t) - sizeof(fapi_msg_t);
- fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
- LwrMacSendToPhy(txDataReq->header.message_type_id, msgLen,(void *)txDataReq);
- }
- if(currDlSlot->dlInfo.isRarPres)
- {
- msgLen = 0;
- /* mux and form RAR pdu */
- fillRarPdu(&currDlSlot->dlInfo.rarAlloc.rarInfo);
- LWR_MAC_ALLOC(txDataReq,sizeof(fapi_tx_data_req_t));
- txDataReq->sfn = dlTtiReqtimingInfo->sfn;
- txDataReq->slot = dlTtiReqtimingInfo->slot;
- txDataReq->numPdus = 1;
- LWR_MAC_ALLOC(txDataReq->pduDesc, (txDataReq->numPdus * \
- sizeof(fapi_tx_pdu_desc_t)));
- fillRarTxDataReq(
- txDataReq->pduDesc,
- &currDlSlot->dlInfo.rarAlloc.rarInfo,
- currDlSlot->dlInfo.rarAlloc.rarPdschCfg.pduIndex,
- &msgLen);
- fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
- LwrMacSendToPhy(txDataReq->header.message_type_id, msgLen,(void *)txDataReq);
- }
+ /* send Tx-DATA req message */
+ sendTxDataReq(currTimingInfo, &currDlSlot->dlInfo);
}
else
{
}
else
{
- DU_LOG("\nLOWER MAC: Failed to allocate memory for DL TTI Request");
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for DL TTI Request");
return RFAILED;
}
}
else
{
- DU_LOG("\nLOWER MAC: Current TTI Info is NULL");
+ DU_LOG("\nLWR_MAC: Current TTI Info is NULL");
return RFAILED;
}
}
else
{
- lwr_mac_handleInvalidEvt(dlTtiReqtimingInfo);
+ lwr_mac_handleInvalidEvt(currTimingInfo);
+ return RFAILED;
}
#endif
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Sends TX data Request to PHY
+ *
+ * @details
+ *
+ * Function : sendTxDataReq
+ *
+ * Functionality:
+ * -Sends FAPI TX data req to PHY
+ *
+ * @params[in] timing info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t sendTxDataReq(CmLteTimingInfo *currTimingInfo, DlAlloc *dlInfo)
+{
+#ifdef FAPI
+ uint8_t nPdu = 0;
+ uint32_t msgLen = 0;
+ uint16_t pduIndex = 0;
+ fapi_tx_data_req_t *txDataReq = NULLP;
+ Inst inst = 0;
+
+ /* send TX_Data request message */
+ nPdu = calcTxDataReqPduCount(dlInfo);
+ if(nPdu > 0)
+ {
+ LWR_MAC_ALLOC(txDataReq,sizeof(fapi_tx_data_req_t));
+ if(txDataReq == NULLP)
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for TX data Request");
+ return RFAILED;
+ }
+ txDataReq->sfn = currTimingInfo->sfn;
+ txDataReq->slot = currTimingInfo->slot;
+ LWR_MAC_ALLOC(txDataReq->pduDesc,nPdu*sizeof(fapi_tx_pdu_desc_t));
+ if(txDataReq->pduDesc == NULLP)
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for pduDesc TX data Request");
+ return RFAILED;
+ }
+
+ if(dlInfo->brdcstAlloc.sib1Trans)
+ {
+ fillSib1TxDataReq(txDataReq->pduDesc,
+ &rgCb[inst].cell->macCellCfg, &msgLen, pduIndex);
+ pduIndex++;
+ txDataReq->numPdus++;
+ }
+ if(dlInfo->isRarPres)
+ {
+ /* mux and form RAR pdu */
+ //fillRarPdu(&dlInfo->rarAlloc.rarInfo);
+ fillRarTxDataReq(txDataReq->pduDesc,
+ &dlInfo->rarAlloc.rarInfo, &msgLen, pduIndex);
+ pduIndex++;
+ txDataReq->numPdus++;
+ }
+
+ msgLen += sizeof(fapi_tx_data_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
+ LwrMacSendToPhy(txDataReq->header.message_type_id, msgLen,(void *)txDataReq);
+ }
+#endif
+ return ROK;
+}
+
/***********************************************************************
*
* @brief calculates the total size to be allocated for UL TTI Req
* RFAILED - failure
*
******************************************************************/
-S16 handleUlTtiReq(CmLteTimingInfo *currTimingInfo)
+uint16_t handleUlTtiReq(CmLteTimingInfo *currTimingInfo)
{
#ifdef FAPI
uint32_t msgLen = 0;
}
msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
- DU_LOG("\nLOWER MAC: Sending UL TTI Request");
+ DU_LOG("\nLWR_MAC: Sending UL TTI Request");
LwrMacSendToPhy(ulTtiReq->header.message_type_id, msgLen, (void *)ulTtiReq);
}
}
{
msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
- DU_LOG("\nLOWER MAC: Sending UL TTI Request");
+ DU_LOG("\nLWR_MAC: Sending UL TTI Request");
LwrMacSendToPhy(ulTtiReq->header.message_type_id, msgLen, (void *)ulTtiReq);
}
return ROK;
}
else
{
- DU_LOG("\nLOWER MAC: Failed to allocate memory for UL TTI Request");
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for UL TTI Request");
return RFAILED;
}
}
else
{
- DU_LOG("\nLOWER MAC: Current TTI Info in UL is NULL");
+ DU_LOG("\nLWR_MAC: Current TTI Info in UL is NULL");
return RFAILED;
}
}
/*******************************************************************
*
- * @brief Sends message to Lower Mac Fsm Event Handler
+ * @brief Sends message to LWR_MAC Fsm Event Handler
*
* @details
*
S16 lwr_mac_handleStartReqEvt(void *msg);
S16 lwr_mac_handleStopReqEvt(void *msg);
void sendToLowerMac(U16, U32, void *);
-uint16_t handleDlTtiReq(CmLteTimingInfo *dlTtiReqtimingInfo);
+uint16_t handleDlTtiReq(CmLteTimingInfo *currTimingInfo);
+uint16_t handleUlTtiReq(CmLteTimingInfo *currTimingInfo);
void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
-S16 handleUlTtiReq(CmLteTimingInfo *currTimingInfo);
typedef S16 (*lwrMacFsmHdlr)(void *);
#endif
{
if(clGlobalCp.phyState == PHY_STATE_CONFIGURED)
{
- DU_LOG("\nLOWER MAC: PHY has moved to running state");
+ DU_LOG("\nLWR_MAC: PHY has moved to running state");
clGlobalCp.phyState = PHY_STATE_RUNNING;
}
typedef struct macDlSlot
{
DlAlloc dlInfo;
-
}MacDlSlot;
typedef struct macUlSlot
/* global variable */
EXTERN MacCb macCb;
void fillMacToSchPst(Pst *pst);
+void fillRarPdu(RarInfo *rarInfo);
#endif
/**********************************************************************
#include "mac.h"
#include "rg.x" /* typedefs for MAC */
+/*******************************************************************
+ *
+ * @brief pack the bits
+ *
+ * @details
+ *
+ * Function : packBytes
+ *
+ * Functionality:
+ * pack the bits in the corresponding byte
+ *
+ * @params[in] buffer pointer, byte and bit position, value and its size
+ * @return void
+ *
+ * ****************************************************************/
void packBytes(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos, uint32_t val, uint8_t valSize)
{
uint32_t temp;
}
}
+/*******************************************************************
+ *
+ * @brief fill the RAR PDU
+ *
+ * @details
+ *
+ * Function : fillRarPdu
+ *
+ * Functionality:
+ * The RAR PDU will be MUXed and formed
+ *
+ * @params[in] RAR info
+ * @return void
+ *
+ * ****************************************************************/
void fillRarPdu(RarInfo *rarInfo)
{
uint8_t *rarPdu = rarInfo->rarPdu;
- uint16_t totalBits;
- uint8_t numBytes;
- uint8_t bytePos;
- uint8_t bitPos;
+ uint16_t totalBits = 0;
+ uint8_t numBytes = 0;
+ uint8_t bytePos= 0;
+ uint8_t bitPos = 0;
/* RAR subheader fields */
- uint8_t EBit;
- uint8_t TBit;
- uint8_t rapId;
+ uint8_t EBit = 0;
+ uint8_t TBit = 0;
+ uint8_t rapId = 0;
/* RAR payload fields */
- uint8_t RBit;
- uint16_t timeAdv;
- uint32_t ulGrant;
- uint16_t tmpCrnti;
+ uint8_t RBit = 0;
+ uint16_t timeAdv = 0;
+ uint32_t ulGrant = 0;
+ uint16_t tmpCrnti = 0;
+ uint8_t paddingLcid = 63;
/* Size(in bits) of RAR subheader files */
uint8_t EBitSize = 1;
uint8_t TBitSize = 1;
uint8_t rapidSize = 6;
+ uint8_t paddingLcidSize = 6;
+ uint8_t paddingSize = 8;
+
/* Size(in bits) of RAR payload fields */
uint8_t RBitSize = 1;
/* Calulating total number of bytes in buffer */
totalBits = EBitSize + TBitSize + rapidSize + RBitSize + timeAdvSize \
+ ulGrantSize + tmpCrntiSize;
+
+ /* add padding size */
+ totalBits += RBitSize*2 + paddingLcidSize + paddingSize;
/* Calulating total number of bytes in buffer */
numBytes = totalBits/8;
packBytes(rarPdu, &bytePos, &bitPos, timeAdv, timeAdvSize);
packBytes(rarPdu, &bytePos, &bitPos, ulGrant, ulGrantSize);
packBytes(rarPdu, &bytePos, &bitPos, tmpCrnti, tmpCrntiSize);
+
+ /* padding of 2 bytes */
+ packBytes(rarPdu, &bytePos, &bitPos, RBit, RBitSize*2);
+ packBytes(rarPdu, &bytePos, &bitPos, paddingLcid, paddingLcidSize);
+ packBytes(rarPdu, &bytePos, &bitPos, 0, paddingSize);
+
}
/**********************************************************************
#include "lrg.x"
#include "du_app_mac_inf.h"
#include "mac.h"
+#include "du_log.h"
+/**
+ * @brief process DL allocation from scheduler
+ *
+ * @details
+ *
+ * Function : MacProcDlAlloc
+ *
+ * This function copied dl sch info in the mac slot info
+ *
+ * @param[in] Pst *pst
+ * @param[in] DL allocation from scheduler
+ * @return S16
+ * -# ROK
+ * -# RFAILED
+ **/
int MacProcDlAlloc(Pst *pst, DlAlloc *dlAlloc)
{
if(dlAlloc != NULLP)
return ROK;
}
+/**
+ * @brief Transmission time interval indication from PHY.
+ *
+ * @details
+ *
+ * Function : fapiMacSlotInd
+ *
+ * This API is invoked by PHY to indicate TTI indication to MAC for a cell.
+ *
+ * @param[in] Pst *pst
+ * @param[in] SuId suId
+ * @param[in] SlotIndInfo *slotInd
+ * @return S16
+ * -# ROK
+ * -# RFAILED
+ **/
+PUBLIC S16 fapiMacSlotInd
+(
+Pst *pst,
+SlotIndInfo *slotInd
+)
+{
+ S16 ret;
+ VOLATILE U32 startTime=0;
+ Inst inst;
+
+ DU_LOG("\nMAC : Slot Indication received");
+
+ inst = pst->dstInst;
+ /*starting Task*/
+ SStartTask(&startTime, PID_MAC_TTI_IND);
+
+ /* send slot indication to scheduler */
+ ret = sendSlotIndMacToSch(slotInd);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC : Sending of slot ind msg from MAC to SCH failed");
+ RETVALUE(ret);
+ }
+
+ ret = macProcessSlotInd(inst,*slotInd);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC : macProcessSlotInd failed");
+ RETVALUE(ret);
+ }
+
+ /* send slot indication to du app */
+ ret = sendSlotIndMacToDuApp(slotInd);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC :Sending of slot ind msg from MAC to DU APP failed");
+ RETVALUE(ret);
+ }
+
+ /*stoping Task*/
+ SStopTask(startTime, PID_MAC_TTI_IND);
+
+ RETVALUE(ret);
+} /* fapiMacSlotInd */
+
/**********************************************************************
End of file
**********************************************************************/
return ret;
}
-/**
- * @brief Transmission time interval indication from PHY.
- *
- * @details
- *
- * Function : fapiMacSlotInd
- *
- * This API is invoked by PHY to indicate TTI indication to MAC for a cell.
- *
- * @param[in] Pst *pst
- * @param[in] SuId suId
- * @param[in] SlotIndInfo *slotInd
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-PUBLIC S16 fapiMacSlotInd
-(
-Pst *pst,
-SlotIndInfo *slotInd
-)
-{
- S16 ret;
- VOLATILE U32 startTime=0;
- Inst inst;
-
- DU_LOG("\nMAC : Slot Indication received");
-
- RG_IS_INST_VALID(pst->dstInst);
- inst = pst->dstInst - RG_INST_START;
- /*starting Task*/
- SStartTask(&startTime, PID_MAC_TTI_IND);
-
- /* send slot indication to scheduler */
- ret = sendSlotIndMacToSch(slotInd);
- if(ret != ROK)
- {
- DU_LOG("\nMAC : Sending of slot ind msg from MAC to SCH failed");
- RETVALUE(ret);
- }
-
- /* Now call the TOM (Tfu ownership module) primitive to process further */
- ret = macProcessSlotInd(inst,*slotInd);
- if(ret != ROK)
- {
- DU_LOG("\nMAC : macProcessSlotInd failed");
- RETVALUE(ret);
- }
-
- /* send slot indication to du app */
- ret = sendSlotIndMacToDuApp(slotInd);
- if(ret != ROK)
- {
- DU_LOG("\nMAC :Sending of slot ind msg from MAC to DU APP failed");
- RETVALUE(ret);
- }
-
- /*stoping Task*/
- SStopTask(startTime, PID_MAC_TTI_IND);
-
- RETVALUE(ret);
-} /* fapiMacSlotInd */
-
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/**
* @brief Transmission of non-rt indication from CL.
schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb;
schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow;
+ /* fill initial DL BWP */
+ schCellCfg.schInitialBwp.bwp.firstPrb = macCellCfg->initialBwp.bwp.firstPrb;
+ schCellCfg.schInitialBwp.bwp.numPrb = macCellCfg->initialBwp.bwp.numPrb;
+ schCellCfg.schInitialBwp.bwp.scs = macCellCfg->initialBwp.bwp.scs;
+ schCellCfg.schInitialBwp.bwp.cyclicPrefix = macCellCfg->initialBwp.bwp.cyclicPrefix;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.searchSpaceId = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.searchSpaceId;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.coresetId = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.coresetId;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.monitoringSlot = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.monitoringSlot;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.duration = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.duration;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.monitoringSymbol = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.monitoringSymbol;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel1;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel2;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel4;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel8;
+ schCellCfg.schInitialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16 = macCellCfg->initialBwp.pdcchCommon.raSearchSpace.candidate.aggLevel16;
cfgPst.srcProcId = pst->dstProcId;
cfgPst.dstProcId = pst->srcProcId;
}
#endif
-/* Trigger for DL TTI REQ */
CmLteTimingInfo timingInfo;
RGADDTOCRNTTIME(cellCb->crntTime, timingInfo, TFU_DELTA);
+
+ /* Trigger for DL TTI REQ */
handleDlTtiReq(&timingInfo);
+
+ /* Trigger for UL TTI REQ */
handleUlTtiReq(&timingInfo);
dlSf = &cellCb->subFrms[(slotInd.slot % RG_NUM_SUB_FRAMES)];
pdsch->codeword[cwCount].mcsIndex = sib1SchCfg->sib1Mcs;
pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
pdsch->codeword[cwCount].rvIndex = 0;
- pdsch->codeword[cwCount].tbSize = 768;
+ pdsch->codeword[cwCount].tbSize = 768/8; /* 38.214: Table 5.1.3.2-1,
+ devided by 8 to get the value in bytes */
}
pdsch->dataScramblingId = pci;
pdsch->numLayers = 1;
#define SCH_MEM_REGION 4
#define SCH_POOL 1
#define SCHED_DELTA 1
-#define SCH_MAX_UE 512
+#define RAR_DELAY 1
+#define SCH_MAX_UE 1
#define SI_RNTI 0xFFFF
-#define P_RNIT 0xFFFE
+#define P_RNTI 0xFFFE
/* allocate and zero out a static buffer */
#define SCH_ALLOC(_datPtr, _size) \
_rspPst.dstInst = 0;\
_rspPst.selector = MAC_SELECTOR_TC;\
}
-extern int schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
+extern uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
/**
* @brief
* Structure holding LTE MAC's General Configuration information.
extern int8_t coresetIdxTable[MAX_CORESET_INDEX][4];
extern int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4];
+/**
+ * @brief calculate ra-rnti function.
+ *
+ * @details
+ *
+ * Function : calculateRaRnti
+ *
+ * This function calculates ra-rnti
+ *
+ * @param[in] symbol index
+ * @param[in] slot index
+ * @param[in] frequency index
+ * @return ra-rnti
+ **/
uint16_t calculateRaRnti(uint8_t symbolIdx, uint8_t slotIdx, uint8_t freqIdx)
{
uint16_t raRnti = 0;
return raRnti;
}
+/**
+ * @brief create raCb function.
+ *
+ * @details
+ *
+ * Function : createSchRaCb
+ *
+ * This function create raCb
+ *
+ * @param[in] tcrnti
+ * @param[in] shed instance
+ * @return void
+ **/
void createSchRaCb(uint16_t tcrnti, Inst schInst)
{
schCb[schInst].cells[schInst]->raCb[0].tcrnti = tcrnti;
}
-int schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
+/**
+ * @brief process rach indication function.
+ *
+ * @details
+ *
+ * Function : schProcessRachInd
+ *
+ * This function process rach indication
+ *
+ * @param[in] rachInd parameters
+ * @param[in] shed instance
+ * @return ROK
+ **/
+uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst)
{
SchCellCb *cell = schCb[schInst].cells[schInst];
+ uint16_t raRnti = 0;
- uint16_t sfn = rachInd->timingInfo.sfn; /* get the current timing info */
- uint16_t slot = rachInd->timingInfo.slot;
- uint16_t sfnSlot = ((sfn * 10) + slot + 1); /* scheduled in the next slot */
- uint8_t rarDelay = 0;
-
- if(sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0)
- {
- /* the next slot has SIB1 occasion, so send it after 2 slot */
- rarDelay = 2;
- }
- else
- {
- /* send RAR in the next slot */
- //rarDelay = 1;
- rarDelay = 2;
- }
-
- if((slot+rarDelay) % SCH_NUM_SLOTS == 0)
- {
- sfn = (sfn+1) % SCH_MAX_SFN;
- }
-
- slot = ((slot + rarDelay) % SCH_NUM_SLOTS);
-
- SchDlAlloc *dlAlloc = cell->dlAlloc[slot]; /* RAR will sent in the next slot */
+ SchDlAlloc *dlAlloc =
+ cell->dlAlloc[(rachInd->timingInfo.slot+SCHED_DELTA+RAR_DELAY)%SCH_NUM_SLOTS]; /* RAR will sent in the next slot */
RarInfo *rarInfo = &(dlAlloc->rarInfo);
/* rar message presense in next slot ind and will be scheduled */
dlAlloc->rarPres = true;
/* calculate the ra-rnti value */
- uint16_t raRnti = 0;
raRnti = calculateRaRnti(rachInd->symbolIdx,rachInd->slotIdx,rachInd->freqIdx);
/* create raCb at SCH */
return ROK;
}
-int schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t offsetPointA)
+/**
+ * @brief fill RAR info function.
+ *
+ * @details
+ *
+ * Function : calculateRaRnti
+ *
+ * This function fills pdcch and pdsch info for RAR
+ *
+ * @param[in] rar Allocation info
+ * @param[in] ra-rnti
+ * @param[in] PCI
+ * @param[in] offset to pointA to determine freq alloc
+ * @return ROK
+ **/
+uint8_t schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t offsetPointA)
{
+ Inst inst = 0;
uint8_t coreset0Idx = 0;
- uint8_t searchSpace0Idx = 0;
- //uint8_t ssbMuxPattern = 0;
uint8_t numRbs = 0;
+ uint8_t firstSymbol = 0;
uint8_t numSymbols = 0;
uint8_t offset = 0;
- //uint8_t oValue = 0;
- //uint8_t numSearchSpacePerSlot = 0;
- //uint8_t mValue = 0;
- uint8_t firstSymbol = 0; /* need to calculate using formula mentioned in 38.213 */
uint8_t FreqDomainResource[6] = {0};
+ SchBwpDlCfg *initialBwp = &schCb[inst].cells[inst]->cellCfg.schInitialBwp;
PdcchCfg *pdcch = &rarAlloc->rarPdcchCfg;
PdschCfg *pdsch = &rarAlloc->rarPdschCfg;
- coreset0Idx = 0;
- searchSpace0Idx = 0;
+ coreset0Idx = initialBwp->pdcchCommon.raSearchSpace.coresetId;
/* derive the sib1 coreset0 params from table 13-1 spec 38.213 */
- //ssbMuxPattern = coresetIdxTable[coreset0Idx][0];
numRbs = coresetIdxTable[coreset0Idx][1];
numSymbols = coresetIdxTable[coreset0Idx][2];
offset = coresetIdxTable[coreset0Idx][3];
- /* derive the search space params from table 13-11 spec 38.213 */
- //oValue = searchSpaceIdxTable[searchSpace0Idx][0];
- //numSearchSpacePerSlot = searchSpaceIdxTable[searchSpace0Idx][1];
- //mValue = searchSpaceIdxTable[searchSpace0Idx][2];
- firstSymbol = searchSpaceIdxTable[searchSpace0Idx][3];
+ /* calculate time domain parameters */
+ // note: since slot value is made sl1, RAR can be sent at all slots
+ uint16_t mask = 0x2000;
+ for(firstSymbol=0; firstSymbol<14;firstSymbol++)
+ {
+ if(initialBwp->pdcchCommon.raSearchSpace.monitoringSymbol & mask)
+ break;
+ else
+ mask = mask>>1;
+ }
/* calculate the PRBs */
freqDomResourceAlloc( ((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource);
/* fill the PDCCH PDU */
- pdcch->pdcchBwpCfg.BWPSize = MAX_NUM_RB; /* whole of BW */
- pdcch->pdcchBwpCfg.BWPStart = 0;
- pdcch->pdcchBwpCfg.subcarrierSpacing = 0; /* 15Khz */
- pdcch->pdcchBwpCfg.cyclicPrefix = 0; /* normal */
+ pdcch->pdcchBwpCfg.BWPSize = initialBwp->bwp.numPrb;
+ pdcch->pdcchBwpCfg.BWPStart = initialBwp->bwp.firstPrb;
+ pdcch->pdcchBwpCfg.subcarrierSpacing = initialBwp->bwp.scs;
+ pdcch->pdcchBwpCfg.cyclicPrefix = initialBwp->bwp.cyclicPrefix;
pdcch->coreset0Cfg.startSymbolIndex = firstSymbol;
pdcch->coreset0Cfg.durationSymbols = numSymbols;
memcpy(pdcch->coreset0Cfg.freqDomainResource,FreqDomainResource,6);
pdcch->dci.rnti = raRnti; /* RA-RNTI */
pdcch->dci.scramblingId = pci;
pdcch->dci.scramblingRnti = 0;
- pdcch->dci.cceIndex = 0;
+ pdcch->dci.cceIndex = 4; /* considering SIB1 is sent at cce 0-1-2-3 */
pdcch->dci.aggregLevel = 4;
pdcch->dci.beamPdcchInfo.numPrgs = 1;
pdcch->dci.beamPdcchInfo.prgSize = 1;
pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
pdsch->rnti = raRnti; /* RA-RNTI */
pdsch->pduIndex = 0;
- pdsch->pdschBwpCfg.BWPSize = MAX_NUM_RB; /* whole of BW */
- pdsch->pdschBwpCfg.BWPStart = 0;
+ pdsch->pdschBwpCfg.BWPSize = initialBwp->bwp.numPrb;
+ pdsch->pdschBwpCfg.BWPStart = initialBwp->bwp.firstPrb;
pdsch->numCodewords = 1;
for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
{
pdsch->codeword[cwCount].targetCodeRate = 308;
pdsch->codeword[cwCount].qamModOrder = 2;
- pdsch->codeword[cwCount].mcsIndex = 4; /* msc configured to 4 */
+ pdsch->codeword[cwCount].mcsIndex = 4; /* mcs configured to 4 */
pdsch->codeword[cwCount].mcsTable = 0; /* notqam256 */
pdsch->codeword[cwCount].rvIndex = 0;
- pdsch->codeword[cwCount].tbSize = 768;
+ pdsch->codeword[cwCount].tbSize = 80/8; /* 38.214: Table 5.1.3.2-1,
+ devided by 8 to get the value in bytes */
}
pdsch->dataScramblingId = pci;
pdsch->numLayers = 1;
#define SIB1_REPETITION_PERIOD 20
#define CORESET_0_INDEX 0
#define SEARCHSPACE_0_INDEX 0
+#define SEARCHSPACE_1_INDEX 1
+#define SS_MONITORING_SLOT_SL1 0 /* all slots */
+#define SS_MONITORING_SYMBOL 0x2000; /* symbol-0, set 14th bit */
#define SIB1_MCS 4
/* Macros for coupling */
uint16_t sib1Mcs;
} Sib1CellCfg;
+typedef struct bwpParams
+{
+ uint16_t firstPrb;
+ uint16_t numPrb;
+ uint8_t scs;
+ uint8_t cyclicPrefix;
+}BwpParams;
+
+typedef struct candidatesInfo
+{
+ uint8_t aggLevel1;
+ uint8_t aggLevel2;
+ uint8_t aggLevel4;
+ uint8_t aggLevel8;
+ uint8_t aggLevel16;
+}CandidatesInfo;
+
+typedef struct searchSpaceCfg
+{
+ uint8_t searchSpaceId;
+ uint8_t coresetId;
+ uint16_t monitoringSlot;
+ uint16_t duration;
+ uint16_t monitoringSymbol;
+ CandidatesInfo candidate;
+}SearchSpaceCfg;
+
+typedef struct pdcchConfigCommon
+{
+ SearchSpaceCfg raSearchSpace;
+}PdcchConfigCommon;
+
+typedef struct bwpDlConfig
+{
+ BwpParams bwp;
+ PdcchConfigCommon pdcchCommon;
+}BwpDlConfig;
+
typedef struct macCellCfg
{
U16 transId;
TDDCfg tddCfg; /* TDD periodicity and slot configuration */
RSSIMeasUnit rssiUnit; /* RSSI measurement unit */
Sib1CellCfg sib1Cfg;
+ BwpDlConfig initialBwp;
}MacCellCfg;
typedef struct macCellCfgCfm
uint8_t raRspWindow; /* RA Response Window */
}SchRachCfg;
+typedef struct schBwpParams
+{
+ uint16_t firstPrb;
+ uint16_t numPrb;
+ uint8_t scs;
+ uint8_t cyclicPrefix;
+}SchBwpParams;
+
+typedef struct schCandidatesInfo
+{
+ uint8_t aggLevel1;
+ uint8_t aggLevel2;
+ uint8_t aggLevel4;
+ uint8_t aggLevel8;
+ uint8_t aggLevel16;
+}SchCandidatesInfo;
+
+typedef struct schSearchSpaceCfg
+{
+ uint8_t searchSpaceId;
+ uint8_t coresetId;
+ uint16_t monitoringSlot;
+ uint16_t duration;
+ uint16_t monitoringSymbol;
+ SchCandidatesInfo candidate;
+}SchSearchSpaceCfg;
+
+typedef struct schPdcchCfgCmn
+{
+ SchSearchSpaceCfg raSearchSpace;
+}SchPdcchCfgCmn;
+
+typedef struct schBwpDlCfg
+{
+ SchBwpParams bwp;
+ SchPdcchCfgCmn pdcchCommon;
+}SchBwpDlCfg;
+
typedef struct schCellCfg
{
uint16_t cellId; /* Cell Id */
SchSsbCfg ssbSchCfg; /* SSB config */
SchSib1Cfg sib1SchCfg; /* SIB1 config */
SchRachCfg schRachCfg; /* PRACH config */
+ SchBwpDlCfg schInitialBwp;
}SchCellCfg;
typedef struct schCellCfgCfm
duCfgParam.macCellCfg.sib1Cfg.searchSpaceZeroIndex = SEARCHSPACE_0_INDEX;
duCfgParam.macCellCfg.sib1Cfg.sib1Mcs = SIB1_MCS;
+
+ /* fill Intial DL BWP */
+ duCfgParam.macCellCfg.initialBwp.bwp.firstPrb = 0;
+ duCfgParam.macCellCfg.initialBwp.bwp.numPrb = TOTAL_PRB_BW; /* configured to total BW */
+ duCfgParam.macCellCfg.initialBwp.bwp.scs = SUBCARRIER_SPACING; /* numerology is 0, 15Khz */
+ duCfgParam.macCellCfg.initialBwp.bwp.cyclicPrefix = NORMAL_CYCLIC_PREFIX;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.searchSpaceId = SEARCHSPACE_1_INDEX;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.coresetId = CORESET_0_INDEX;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.monitoringSlot =
+ SS_MONITORING_SLOT_SL1; /* sl1 - all slots */
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.duration = 0;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.monitoringSymbol =
+ SS_MONITORING_SYMBOL;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ candidate.aggLevel1 = 8;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ candidate.aggLevel2 = 4;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ candidate.aggLevel4 = 2;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ candidate.aggLevel8 = 1;
+ duCfgParam.macCellCfg.initialBwp.pdcchCommon.raSearchSpace.
+ candidate.aggLevel16 = 0;
+
/* This should be calculated based on
(number of mandatory parameters) + (number of otional parameters being filled) */
duCfgParam.macCellCfg.numTlv = 39;
#define FREQ_SHIFT_7P5KHZ FALSE
#define SSB_PBCH_PWR -5
#define BCH_PAYLOAD MAC_GEN_FULL_PBCH_PAYLD
+#define TOTAL_PRB_BW 106
#define SUBCARRIER_SPACING 0
+#define NORMAL_CYCLIC_PREFIX 0
#define SCS_CARRIER_BANDWIDTH 273 /* Subcarrier spacing- carrier bandwidth */
#define OFFSET_TO_POINT_A 24 /* PRB Offset to Point A */
#define BETA_PSS BETA_PSS_0DB
(duCb.actvCellLst[slotInfo->cellId-1]->cellStatus == \
ACTIVATION_IN_PROGRESS))
{
- DU_LOG("\nDU APP : Cell Id %d is ACTIVE", slotInfo->cellId);
+ DU_LOG("\nDU APP : 5G-NR Cell %d is UP", slotInfo->cellId);
duCb.actvCellLst[slotInfo->cellId-1]->cellStatus = ACTIVATED;
}
}
else
{
+ slotIndMsg->sfn = sfnValue;
+ slotIndMsg->slot = slotValue;
+ DU_LOG("\n\nPHY_STUB: SLOT indication [%d:%d]",sfnValue,slotValue);
+
+ /* increment for the next TTI */
slotValue++;
- if(sfnValue > MAX_SFN_VALUE && slotValue > MAX_SLOT_VALUE)
+ if(sfnValue >= MAX_SFN_VALUE && slotValue > MAX_SLOT_VALUE)
{
sfnValue = 0;
slotValue = 0;
sfnValue++;
slotValue = 0;
}
- slotIndMsg->sfn = sfnValue;
- slotIndMsg->slot = slotValue;
fillMsgHeader(&slotIndMsg->header, FAPI_SLOT_INDICATION, sizeof(fapi_slot_ind_t));
- DU_LOG("\n\nPHY_STUB: SLOT indication [%d:%d]",sfnValue,slotValue);
handlePhyMessages(slotIndMsg->header.message_type_id, sizeof(fapi_slot_ind_t), (void*)slotIndMsg);
MAC_FREE(slotIndMsg, sizeof(fapi_slot_ind_t));
}
PUBLIC S16 l1HdlTxDataReq(uint16_t msgLen, void *msg)
{
#ifdef FAPI
- uint8_t pduCount;
+ //uint8_t pduCount;
DU_LOG("\nPHY STUB: Received TX DATA Request");
MAC_FREE(ulTtiReq->pdus, (ulTtiReq->nPdus * sizeof(fapi_ul_tti_req_pdu_t)));
MAC_FREE(ulTtiReq, sizeof(fapi_ul_tti_req_t));
- if(rachIndSent == false && ulTtiReq->slot == 8)
+ if(rachIndSent == false && ulTtiReq->sfn == 2 && ulTtiReq->slot == 6)
{
rachIndSent = true;
l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn);