#ifndef __LWR_MAC_H__
#define __LWR_MAC_H__
-#define MAX_NUM_CELL_SUPP 1
-
-#include "du_app_mac_inf.h"
-
#ifdef INTEL_WLS
#define LWR_MAC_ALLOC(_datPtr, _size) WLS_MEM_ALLOC(_datPtr, _size);
#else
/* Events in Lower Mac */
typedef enum{
- PARAM_REQUEST,
- PARAM_RESPONSE,
- CONFIG_REQUEST,
- CONFIG_RESPONSE,
- START_REQUEST,
- STOP_REQUEST,
- MAX_EVENT
+ PARAM_REQUEST,
+ PARAM_RESPONSE,
+ CONFIG_REQUEST,
+ CONFIG_RESPONSE,
+ START_REQUEST,
+ STOP_REQUEST,
+ MAX_EVENT
}EventState;
-typedef struct clCb
+typedef struct cellCb
+{
+ uint16_t cellId;
+ uint16_t phyCellId;
+ PhyState state;
+}LwrMacCellCb;
+
+typedef struct lwrMacGlobalCb
{
Region region;
Pool pool;
- Bool clCfgDone; /* CL configuration done */
- CmHashListCp cellCbLst; /* List of Cells configured */
- U8 numOfCells; /* Number of Cells configured */
+ bool clCfgDone; /* CL configuration done */
+ LwrMacCellCb cellCb[MAX_NUM_CELL]; /* List of Cells configured */
+ uint8_t numCell; /* Number of Cells configured */
PhyState phyState; /* State of PHY */
EventState event; /* State of Event */
-}ClCb;
-
-typedef struct cellCb
-{
- U16 cellId;
- MacCellCfg cellCfg;
- PhyState phyState;
-}ClCellCb;
+}LwrMacCb;
typedef enum
{
ParamSupport precoderGranularityCoreset;
ParamSupport pdcchMuMimo;
ParamSupport pdcchPrecoderCycling;
- U8 maxPdcchsPerSlot;
+ uint8_t maxPdcchsPerSlot;
Formats pucchFormats;
- U8 maxPucchsPerSlot;
+ uint8_t maxPucchsPerSlot;
MappingType pdschMappingType;
AllocationType pdschAllocationTypes;
VrbToPrbMap pdschVrbToPrbMapping;
DmrsConfigType pdschDmrsConfigTypes;
DmrMaxLen pdschDmrsMaxLength;
DmrsPos pdschDmrsAdditionalPos;
- U8 maxPdschsTBsPerSlot;
- U8 maxNumberMimoLayersPdsch;
+ uint8_t maxPdschsTBsPerSlot;
+ uint8_t maxNumberMimoLayersPdsch;
ModulationOrder supportedMaxModulationOrderDl;
- U8 maxMuMimoUsersDl;
+ uint8_t maxMuMimoUsersDl;
ParamSupport pdschDataInDmrsSymbols;
ParamSupport premptionSupport;
ParamSupport pdschNonSlotSupport;
MappingType puschMappingType;
AllocationType puschAllocationTypes;
VrbToPrbMap puschVrbToPrbMapping;
- U8 puschMaxPtrsPorts;
- U8 maxPduschsTBsPerSlot;
- U8 maxNumberMimoLayersNonCbPusch;
+ uint8_t puschMaxPtrsPorts;
+ uint8_t maxPduschsTBsPerSlot;
+ uint8_t maxNumberMimoLayersNonCbPusch;
ModulationOrder supportedModulationOrderUl;
- U8 maxMuMimoUsersUl;
+ uint8_t maxMuMimoUsersUl;
ParamSupport dftsOfdmSupport;
AggregationFactor puschAggregationFactor;
Formats prachLongFormats;
RssiMeasurement rssiMeasurementSupport;
}ClCellParam;
-EXTERN ClCb clGlobalCp;
-EXTERN ClCellCb * rgClUtlGetCellCb ARGS((U16 cellId));
+EXTERN LwrMacCb lwrMacCb;
+EXTERN LwrMacCellCb * lwrMacGetCellCb ARGS((uint16_t cellId));
EXTERN uint32_t reverseBits(uint32_t num, uint8_t numBits);
EXTERN void fillDlDciPayload(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos,\
- uint32_t val, uint8_t valSize);
+ uint32_t val, uint8_t valSize);
EXTERN void lwrMacInit();
#endif
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* header include files -- defines (.h) */
#include "common_def.h"
-#include "lrg.h" /* Layer manager interface includes*/
-#include "crg.h" /* CRG interface includes*/
-#include "rgu.h" /* RGU interface includes*/
-#include "tfu.h" /* TFU interface includes */
-#include "rg_sch_inf.h" /* SCH interface includes */
-#include "rg_prg.h" /* PRG (MAC-MAC) interface includes*/
-#include "rg_env.h" /* MAC environmental includes*/
-#include "rg.h" /* MAC includes*/
-#include "rg_err.h" /* MAC error includes*/
-#include "du_log.h"
-#include "lwr_mac_fsm.h"
-
-/* header/extern include files (.x) */
-#include "rgu.x" /* RGU types */
-#include "tfu.x" /* RGU types */
-#include "lrg.x" /* layer management typedefs for MAC */
-#include "crg.x" /* CRG interface includes */
-#include "rg_sch_inf.x" /* SCH interface typedefs */
-#include "rg_prg.x" /* PRG (MAC-MAC) Interface typedefs */
+#include "lrg.h"
+#include "lrg.x"
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "rg.x" /* typedefs for MAC */
#include "lwr_mac_phy.h"
+#include "lwr_mac.h"
+#ifdef INTEL_FAPI
+#include "fapi.h"
+#endif
+#include "lwr_mac_fsm.h"
+#include "mac_utils.h"
#define MIB_SFN_BITMASK 0xFC
#define PDCCH_PDU_TYPE 0
#define PDU_PRESENT 1
#define SET_MSG_LEN(x, size) x += size
-extern void fapiMacConfigRsp();
+extern void fapiMacConfigRsp(uint16_t cellId);
extern uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX];
/* Global variables */
#endif
}
- /*******************************************************************
- *
- * @brief Handles Invalid Request Event
- *
- * @details
- *
- * Function : lwr_mac_handleInvalidEvt
- *
- * Functionality:
- * - Displays the PHY state when the invalid event occurs
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-S16 lwr_mac_handleInvalidEvt(void *msg)
+/*******************************************************************
+ *
+ * @brief Handles Invalid Request Event
+ *
+ * @details
+ *
+ * Function : lwr_mac_procInvalidEvt
+ *
+ * Functionality:
+ * - Displays the PHY state when the invalid event occurs
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t lwr_mac_procInvalidEvt(void *msg)
{
- printf("\nLWR_MAC: Error Indication Event[%d] received in state [%d]", clGlobalCp.event, clGlobalCp.phyState);
- RETVALUE(ROK);
+ printf("\nLWR_MAC: Error Indication Event[%d] received in state [%d]", lwrMacCb.event, lwrMacCb.phyState);
+ return ROK;
}
#ifdef INTEL_FAPI
/*******************************************************************
- *
- * @brief Fills FAPI message header
- *
- * @details
- *
- * Function : fillMsgHeader
- *
- * Functionality:
- * -Fills FAPI message header
- *
- * @params[in] Pointer to header
- * Number of messages
- * Messae Type
- * Length of message
- * @return void
- *
- * ****************************************************************/
+ *
+ * @brief Fills FAPI message header
+ *
+ * @details
+ *
+ * Function : fillMsgHeader
+ *
+ * Functionality:
+ * -Fills FAPI message header
+ *
+ * @params[in] Pointer to header
+ * Number of messages
+ * Messae Type
+ * Length of message
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillMsgHeader(fapi_msg_t *hdr, uint16_t msgType, uint16_t msgLen)
{
memset(hdr, 0, sizeof(fapi_msg_t));
}
/*******************************************************************
- *
- * @brief Fills FAPI Config Request message header
- *
- * @details
- *
- * Function : fillTlvs
- *
- * Functionality:
- * -Fills FAPI Config Request message header
- *
- * @params[in] Pointer to TLV
- * Tag
- * Length
- * Value
- * MsgLen
- * @return void
- *
- * ****************************************************************/
+ *
+ * @brief Fills FAPI Config Request message header
+ *
+ * @details
+ *
+ * Function : fillTlvs
+ *
+ * Functionality:
+ * -Fills FAPI Config Request message header
+ *
+ * @params[in] Pointer to TLV
+ * Tag
+ * Length
+ * Value
+ * MsgLen
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillTlvs(fapi_uint32_tlv_t *tlv, uint16_t tag, uint16_t length,
-uint16_t value, uint32_t *msgLen)
+ uint16_t value, uint32_t *msgLen)
{
tlv->tl.tag = tag;
tlv->tl.length = length;
tlv->value = value;
*msgLen = *msgLen + sizeof(tag) + sizeof(length) + length;
}
- /*******************************************************************
- *
- * @brief fills the cyclic prefix by comparing the bitmask
- *
- * @details
- *
- * Function : fillCyclicPrefix
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's cyclic prefix.
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ********************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the cyclic prefix by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillCyclicPrefix
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's cyclic prefix.
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ********************************************************************/
PUBLIC void fillCyclicPrefix(uint8_t value, ClCellParam **cellPtr)
{
if((value & FAPI_NORMAL_CYCLIC_PREFIX_MASK) == FAPI_NORMAL_CYCLIC_PREFIX_MASK)
}
}
- /*******************************************************************
- *
- * @brief fills the subcarrier spacing of Downlink by comparing the bitmask
- *
- * @details
- *
- * Function : fillSubcarrierSpaceDl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's subcarrier spacing in DL
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the subcarrier spacing of Downlink by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillSubcarrierSpaceDl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's subcarrier spacing in DL
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillSubcarrierSpaceDl(uint8_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief fills the downlink bandwidth by comparing the bitmask
- *
- * @details
- *
- * Function : fillBandwidthDl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * -fills the cellPtr's DL Bandwidth
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the downlink bandwidth by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillBandwidthDl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * -fills the cellPtr's DL Bandwidth
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillBandwidthDl(uint16_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief fills the subcarrier spacing of Uplink by comparing the bitmask
- *
- * @details
- *
- * Function : fillSubcarrierSpaceUl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * -fills cellPtr's subcarrier spacing in UL
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the subcarrier spacing of Uplink by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillSubcarrierSpaceUl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * -fills cellPtr's subcarrier spacing in UL
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillSubcarrierSpaceUl(uint8_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief fills the uplink bandwidth by comparing the bitmask
- *
- * @details
- *
- * Function : fillBandwidthUl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's UL Bandwidth
- *
- *
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the uplink bandwidth by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillBandwidthUl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's UL Bandwidth
+ *
+ *
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ *
+ * ****************************************************************/
PUBLIC void fillBandwidthUl(uint16_t value, ClCellParam **cellPtr)
{
(*cellPtr)->supportedBandwidthUl = INVALID_VALUE;
}
}
- /*******************************************************************
- *
- * @brief fills the CCE maping by comparing the bitmask
- *
- * @details
- *
- * Function : fillCCEmaping
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's CCE Mapping Type
- *
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the CCE maping by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillCCEmaping
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's CCE Mapping Type
+ *
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillCCEmaping(uint8_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief fills the PUCCH format by comparing the bitmask
- *
- * @details
- *
- * Function : fillPucchFormat
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's pucch format
- *
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the PUCCH format by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPucchFormat
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's pucch format
+ *
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillPucchFormat(uint8_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief fills the PDSCH Mapping Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPdschMappingType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PDSCH MappingType
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief fills the PDSCH Mapping Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPdschMappingType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PDSCH MappingType
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillPdschMappingType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PDSCH Allocation Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPdschAllocationType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PDSCH AllocationType
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- * ****************************************************************/
+ *
+ * @brief fills the PDSCH Allocation Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPdschAllocationType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PDSCH AllocationType
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC void fillPdschAllocationType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PDSCH PRB Mapping Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPrbMappingType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PRB Mapping Type
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PDSCH PRB Mapping Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPrbMappingType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PRB Mapping Type
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPrbMappingType(uint8_t value, ClCellParam **cellPtr)
{
if((value & FAPI_PDSCH_VRB_TO_PRB_MAP_NON_INTLV_MASK) == FAPI_PDSCH_VRB_TO_PRB_MAP_NON_INTLV_MASK)
}
/*******************************************************************
- *
- * @brief fills the PDSCH DmrsConfig Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPdschDmrsConfigType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's DmrsConfig Type
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PDSCH DmrsConfig Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPdschDmrsConfigType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's DmrsConfig Type
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPdschDmrsConfigType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PDSCH DmrsLength by comparing the bitmask
- *
- * @details
- *
- * Function : fillPdschDmrsLength
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PdschDmrsLength
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PDSCH DmrsLength by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPdschDmrsLength
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PdschDmrsLength
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPdschDmrsLength(uint8_t value, ClCellParam **cellPtr)
{
if(value == FAPI_PDSCH_DMRS_MAX_LENGTH_1)
}
/*******************************************************************
- *
- * @brief fills the PDSCH Dmrs Additional Pos by comparing the bitmask
- *
- * @details
- *
- * Function : fillPdschDmrsAddPos
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's Pdsch DmrsAddPos
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PDSCH Dmrs Additional Pos by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPdschDmrsAddPos
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's Pdsch DmrsAddPos
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPdschDmrsAddPos(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the Modulation Order in DL by comparing the bitmask
- *
- * @details
- *
- * Function : fillModulationOrderDl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's ModulationOrder in DL.
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the Modulation Order in DL by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillModulationOrderDl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's ModulationOrder in DL.
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillModulationOrderDl(uint8_t value, ClCellParam **cellPtr)
{
if(value == 0 )
}
/*******************************************************************
- *
- * @brief fills the PUSCH DmrsConfig Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschDmrsConfigType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH DmrsConfigType
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH DmrsConfig Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschDmrsConfigType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH DmrsConfigType
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschDmrsConfig(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH DmrsLength by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschDmrsLength
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH DmrsLength
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH DmrsLength by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschDmrsLength
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH DmrsLength
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschDmrsLength(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH Dmrs Additional position by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschDmrsAddPos
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH DmrsAddPos
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH Dmrs Additional position by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschDmrsAddPos
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH DmrsAddPos
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschDmrsAddPos(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH Mapping Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschMappingType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH MappingType
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH Mapping Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschMappingType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH MappingType
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschMappingType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH Allocation Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschAllocationType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH AllocationType
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH Allocation Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschAllocationType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH AllocationType
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschAllocationType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH PRB Mapping Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschPrbMappingType
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH PRB MApping Type
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH PRB Mapping Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschPrbMappingType
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH PRB MApping Type
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschPrbMappingType(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the Modulation Order in Ul by comparing the bitmask
- *
- * @details
- *
- * Function : fillModulationOrderUl
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's Modualtsion Order in UL.
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the Modulation Order in Ul by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillModulationOrderUl
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's Modualtsion Order in UL.
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillModulationOrderUl(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PUSCH Aggregation Factor by comparing the bitmask
- *
- * @details
- *
- * Function : fillPuschAggregationFactor
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PUSCH Aggregation Factor
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PUSCH Aggregation Factor by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPuschAggregationFactor
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PUSCH Aggregation Factor
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPuschAggregationFactor(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PRACH Long Format by comparing the bitmask
- *
- * @details
- *
- * Function : fillPrachLongFormat
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PRACH Long Format
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PRACH Long Format by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPrachLongFormat
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PRACH Long Format
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPrachLongFormat(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the PRACH Short Format by comparing the bitmask
- *
- * @details
- *
- * Function : fillPrachShortFormat
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's PRACH ShortFormat
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the PRACH Short Format by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillPrachShortFormat
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's PRACH ShortFormat
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillPrachShortFormat(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the Fd Occasions Type by comparing the bitmask
- *
- * @details
- *
- * Function : fillFdOccasions
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's Fd Occasions
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the Fd Occasions Type by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillFdOccasions
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's Fd Occasions
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillFdOccasions(uint8_t value, ClCellParam **cellPtr)
{
}
/*******************************************************************
- *
- * @brief fills the RSSI Measurement by comparing the bitmask
- *
- * @details
- *
- * Function : fillRssiMeas
- *
- * Functionality:
- * -checks the value with the bitmask and
- * fills the cellPtr's RSSI Measurement report
- *
- * @params[in] Pointer to ClCellParam
- * Value to be compared
- * @return void
- *
- ******************************************************************/
+ *
+ * @brief fills the RSSI Measurement by comparing the bitmask
+ *
+ * @details
+ *
+ * Function : fillRssiMeas
+ *
+ * Functionality:
+ * -checks the value with the bitmask and
+ * fills the cellPtr's RSSI Measurement report
+ *
+ * @params[in] Pointer to ClCellParam
+ * Value to be compared
+ * @return void
+ *
+ ******************************************************************/
PUBLIC void fillRssiMeas(uint8_t value, ClCellParam **cellPtr)
{
}
}
- /*******************************************************************
- *
- * @brief Returns the TLVs value
- *
- * @details
- *
- * Function : getParamValue
- *
- * Functionality:
- * -return TLVs value
- *
- * @params[in]
- * @return ROK - temp
- * RFAILED - failure
- *
- * ****************************************************************/
+/*******************************************************************
+ *
+ * @brief Returns the TLVs value
+ *
+ * @details
+ *
+ * Function : getParamValue
+ *
+ * Functionality:
+ * -return TLVs value
+ *
+ * @params[in]
+ * @return ROK - temp
+ * RFAILED - failure
+ *
+ * ****************************************************************/
uint32_t getParamValue(fapi_uint16_tlv_t *tlv, uint16_t type)
{
}
else
{
- DU_LOG("\nLWR_MAC: Value Extraction failed" );
- return RFAILED;
+ DU_LOG("\nLWR_MAC: Value Extraction failed" );
+ return RFAILED;
}
}
#endif /* FAPI */
- /*******************************************************************
- *
- * @brief Sends FAPI Param req to PHY
- *
- * @details
- *
- * Function : lwr_mac_handleParamReqEvt
- *
- * Functionality:
- * -Sends FAPI Param req to PHY
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 lwr_mac_handleParamReqEvt(void *msg)
+/*******************************************************************
+ *
+ * @brief Sends FAPI Param req to PHY
+ *
+ * @details
+ *
+ * Function : lwr_mac_procParamReqEvt
+ *
+ * Functionality:
+ * -Sends FAPI Param req to PHY
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t lwr_mac_procParamReqEvt(void *msg)
{
#ifdef INTEL_FAPI
/* startGuardTimer(); */
DU_LOG("\nLWR_MAC: Sending Param Request to Phy");
LwrMacSendToPhy(paramReq->header.msg_id, \
- sizeof(fapi_param_req_t), (void *)paramReq);
+ sizeof(fapi_param_req_t), (void *)paramReq);
}
else
{
return ROK;
}
- /*******************************************************************
- *
- * @brief Sends FAPI Param Response to MAC via PHY
- *
- * @details
- *
- * Function : lwr_mac_handleParamRspEvt
- *
- * Functionality:
- * -Sends FAPI Param rsp to MAC via PHY
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 lwr_mac_handleParamRspEvt(void *msg)
+/*******************************************************************
+ *
+ * @brief Sends FAPI Param Response to MAC via PHY
+ *
+ * @details
+ *
+ * Function : lwr_mac_procParamRspEvt
+ *
+ * Functionality:
+ * -Sends FAPI Param rsp to MAC via PHY
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t lwr_mac_procParamRspEvt(void *msg)
{
#ifdef INTEL_FAPI
- /* stopGuardTimer(); */
+ /* stopGuardTimer(); */
uint8_t index;
uint32_t encodedVal;
fapi_param_resp_t *paramRsp;
ClCellParam *cellParam = NULLP;
paramRsp = (fapi_param_resp_t *)msg;
- DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", lwrMacCb.event, lwrMacCb.phyState);
if(paramRsp != NULLP)
{
MAC_ALLOC(cellParam, sizeof(ClCellParam));
if(cellParam != NULLP)
{
- 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++)
- {
- switch(paramRsp->tlvs[index].tl.tag)
- {
- case FAPI_RELEASE_CAPABILITY_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
- if(encodedVal != RFAILED && (encodedVal & RELEASE_15) == RELEASE_15)
- {
- cellParam->releaseCapability = RELEASE_15;
- }
- break;
-
- case FAPI_PHY_STATE_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != clGlobalCp.phyState)
- {
- printf("\n PhyState mismatch [%d][%d]", clGlobalCp.phyState, clGlobalCp.event);
- RETVALUE(RFAILED);
- }
- break;
-
- case FAPI_SKIP_BLANK_DL_CONFIG_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->skipBlankDlConfig = SUPPORTED;
- }
- else
- {
- cellParam->skipBlankDlConfig = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_SKIP_BLANK_UL_CONFIG_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->skipBlankUlConfig = SUPPORTED;
- }
- else
- {
- cellParam->skipBlankUlConfig = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_NUM_CONFIG_TLVS_TO_REPORT_TYPE_TAG:
- cellParam->numTlvsToReport = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
- break;
-
- case FAPI_CYCLIC_PREFIX_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillCyclicPrefix(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_SUPPORTED_SUBCARRIER_SPACING_DL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillSubcarrierSpaceDl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_SUPPORTED_BANDWIDTH_DL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
- if(encodedVal != RFAILED)
- {
- fillBandwidthDl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_SUPPORTED_SUBCARRIER_SPACING_UL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillSubcarrierSpaceUl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_SUPPORTED_BANDWIDTH_UL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
- if(encodedVal != RFAILED)
- {
- fillBandwidthUl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_CCE_MAPPING_TYPE_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillCCEmaping(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->coresetOutsideFirst3OfdmSymsOfSlot = SUPPORTED;
- }
- else
- {
- cellParam->coresetOutsideFirst3OfdmSymsOfSlot = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PRECODER_GRANULARITY_CORESET_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->precoderGranularityCoreset = SUPPORTED;
- }
- else
- {
- cellParam->precoderGranularityCoreset = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PDCCH_MU_MIMO_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->pdcchMuMimo = SUPPORTED;
- }
- else
- {
- cellParam->pdcchMuMimo = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PDCCH_PRECODER_CYCLING_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->pdcchPrecoderCycling = SUPPORTED;
- }
- else
- {
- cellParam->pdcchPrecoderCycling = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_MAX_PDCCHS_PER_SLOT_TAG:
- cellParam->maxPdcchsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_PUCCH_FORMATS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPucchFormat(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_MAX_PUCCHS_PER_SLOT_TAG:
- cellParam->maxPucchsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_PDSCH_MAPPING_TYPE_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPdschMappingType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PDSCH_ALLOCATION_TYPES_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPdschAllocationType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PDSCH_VRB_TO_PRB_MAPPING_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPrbMappingType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PDSCH_CBG_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->pdschCbg = SUPPORTED;
- }
- else
- {
- cellParam->pdschCbg = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PDSCH_DMRS_CONFIG_TYPES_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPdschDmrsConfigType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PDSCH_DMRS_MAX_LENGTH_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPdschDmrsLength(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PDSCH_DMRS_ADDITIONAL_POS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPdschDmrsAddPos(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_MAX_PDSCHS_TBS_PER_SLOT_TAG:
- cellParam->maxPdschsTBsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal < FAPI_MAX_NUMBERMIMO_LAYERS_PDSCH)
- {
- cellParam->maxNumberMimoLayersPdsch = encodedVal;
- }
- break;
-
- case FAPI_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillModulationOrderDl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_MAX_MU_MIMO_USERS_DL_TAG:
- cellParam->maxMuMimoUsersDl = \
- getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->pdschDataInDmrsSymbols = SUPPORTED;
- }
- else
- {
- cellParam->pdschDataInDmrsSymbols = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PREMPTIONSUPPORT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->premptionSupport = SUPPORTED;
- }
- else
- {
- cellParam->premptionSupport = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PDSCH_NON_SLOT_SUPPORT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->pdschNonSlotSupport = SUPPORTED;
- }
- else
- {
- cellParam->pdschNonSlotSupport = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_UCI_MUX_ULSCH_IN_PUSCH_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->uciMuxUlschInPusch = SUPPORTED;
- }
- else
- {
- cellParam->uciMuxUlschInPusch = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_UCI_ONLY_PUSCH_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->uciOnlyPusch = SUPPORTED;
- }
- else
- {
- cellParam->uciOnlyPusch = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PUSCH_FREQUENCY_HOPPING_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->puschFrequencyHopping = SUPPORTED;
- }
- else
- {
- cellParam->puschFrequencyHopping = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PUSCH_DMRS_CONFIG_TYPES_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschDmrsConfig(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_DMRS_MAX_LEN_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschDmrsLength(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_DMRS_ADDITIONAL_POS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschDmrsAddPos(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_CBG_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->puschCbg = SUPPORTED;
- }
- else
- {
- cellParam->puschCbg = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PUSCH_MAPPING_TYPE_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschMappingType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_ALLOCATION_TYPES_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschAllocationType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_VRB_TO_PRB_MAPPING_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschPrbMappingType(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PUSCH_MAX_PTRS_PORTS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal < FAPI_PUSCH_MAX_PTRS_PORTS_UB)
- {
- cellParam->puschMaxPtrsPorts = encodedVal;
- }
- break;
-
- case FAPI_MAX_PDUSCHS_TBS_PER_SLOT_TAG:
- cellParam->maxPduschsTBsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG:
- cellParam->maxNumberMimoLayersNonCbPusch = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_SUPPORTED_MODULATION_ORDER_UL_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillModulationOrderUl(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_MAX_MU_MIMO_USERS_UL_TAG:
- cellParam->maxMuMimoUsersUl = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- break;
-
- case FAPI_DFTS_OFDM_SUPPORT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->dftsOfdmSupport = SUPPORTED;
- }
- else
- {
- cellParam->dftsOfdmSupport = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_PUSCH_AGGREGATION_FACTOR_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPuschAggregationFactor(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PRACH_LONG_FORMATS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPrachLongFormat(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PRACH_SHORT_FORMATS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillPrachShortFormat(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_PRACH_RESTRICTED_SETS_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED && encodedVal != 0)
- {
- cellParam->prachRestrictedSets = SUPPORTED;
- }
- else
- {
- cellParam->prachRestrictedSets = NOT_SUPPORTED;
- }
- break;
-
- case FAPI_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillFdOccasions(encodedVal, &cellParam);
- }
- break;
-
- case FAPI_RSSI_MEASUREMENT_SUPPORT_TAG:
- encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
- if(encodedVal != RFAILED)
- {
- fillRssiMeas(encodedVal, &cellParam);
- }
- break;
- default:
- //printf("\n Invalid value for TLV[%x] at index[%d]", paramRsp->tlvs[index].tl.tag, index);
- break;
- }
- }
- MAC_FREE(cellParam, sizeof(ClCellParam));
- sendToLowerMac(FAPI_CONFIG_REQUEST, 0, (void *)NULL);
- return ROK;
- }
- else
- {
- DU_LOG("\n LWR_MAC: Invalid error code %d", paramRsp->error_code);
- return RFAILED;
- }
- }
- else
- {
- DU_LOG("\nLWR_MAC: Failed to allocate memory for cell param");
- return RFAILED;
- }
+ 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++)
+ {
+ switch(paramRsp->tlvs[index].tl.tag)
+ {
+ case FAPI_RELEASE_CAPABILITY_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
+ if(encodedVal != RFAILED && (encodedVal & RELEASE_15) == RELEASE_15)
+ {
+ cellParam->releaseCapability = RELEASE_15;
+ }
+ break;
+
+ case FAPI_PHY_STATE_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != lwrMacCb.phyState)
+ {
+ printf("\n PhyState mismatch [%d][%d]", lwrMacCb.phyState, lwrMacCb.event);
+ return RFAILED;
+ }
+ break;
+
+ case FAPI_SKIP_BLANK_DL_CONFIG_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->skipBlankDlConfig = SUPPORTED;
+ }
+ else
+ {
+ cellParam->skipBlankDlConfig = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_SKIP_BLANK_UL_CONFIG_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->skipBlankUlConfig = SUPPORTED;
+ }
+ else
+ {
+ cellParam->skipBlankUlConfig = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_NUM_CONFIG_TLVS_TO_REPORT_TYPE_TAG:
+ cellParam->numTlvsToReport = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
+ break;
+
+ case FAPI_CYCLIC_PREFIX_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillCyclicPrefix(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_SUPPORTED_SUBCARRIER_SPACING_DL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillSubcarrierSpaceDl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_SUPPORTED_BANDWIDTH_DL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
+ if(encodedVal != RFAILED)
+ {
+ fillBandwidthDl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_SUPPORTED_SUBCARRIER_SPACING_UL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillSubcarrierSpaceUl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_SUPPORTED_BANDWIDTH_UL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_16);
+ if(encodedVal != RFAILED)
+ {
+ fillBandwidthUl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_CCE_MAPPING_TYPE_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillCCEmaping(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->coresetOutsideFirst3OfdmSymsOfSlot = SUPPORTED;
+ }
+ else
+ {
+ cellParam->coresetOutsideFirst3OfdmSymsOfSlot = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PRECODER_GRANULARITY_CORESET_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->precoderGranularityCoreset = SUPPORTED;
+ }
+ else
+ {
+ cellParam->precoderGranularityCoreset = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PDCCH_MU_MIMO_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->pdcchMuMimo = SUPPORTED;
+ }
+ else
+ {
+ cellParam->pdcchMuMimo = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PDCCH_PRECODER_CYCLING_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->pdcchPrecoderCycling = SUPPORTED;
+ }
+ else
+ {
+ cellParam->pdcchPrecoderCycling = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_MAX_PDCCHS_PER_SLOT_TAG:
+ cellParam->maxPdcchsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_PUCCH_FORMATS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPucchFormat(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_MAX_PUCCHS_PER_SLOT_TAG:
+ cellParam->maxPucchsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_PDSCH_MAPPING_TYPE_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPdschMappingType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PDSCH_ALLOCATION_TYPES_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPdschAllocationType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PDSCH_VRB_TO_PRB_MAPPING_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPrbMappingType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PDSCH_CBG_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->pdschCbg = SUPPORTED;
+ }
+ else
+ {
+ cellParam->pdschCbg = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PDSCH_DMRS_CONFIG_TYPES_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPdschDmrsConfigType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PDSCH_DMRS_MAX_LENGTH_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPdschDmrsLength(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PDSCH_DMRS_ADDITIONAL_POS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPdschDmrsAddPos(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_MAX_PDSCHS_TBS_PER_SLOT_TAG:
+ cellParam->maxPdschsTBsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal < FAPI_MAX_NUMBERMIMO_LAYERS_PDSCH)
+ {
+ cellParam->maxNumberMimoLayersPdsch = encodedVal;
+ }
+ break;
+
+ case FAPI_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillModulationOrderDl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_MAX_MU_MIMO_USERS_DL_TAG:
+ cellParam->maxMuMimoUsersDl = \
+ getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->pdschDataInDmrsSymbols = SUPPORTED;
+ }
+ else
+ {
+ cellParam->pdschDataInDmrsSymbols = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PREMPTIONSUPPORT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->premptionSupport = SUPPORTED;
+ }
+ else
+ {
+ cellParam->premptionSupport = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PDSCH_NON_SLOT_SUPPORT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->pdschNonSlotSupport = SUPPORTED;
+ }
+ else
+ {
+ cellParam->pdschNonSlotSupport = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_UCI_MUX_ULSCH_IN_PUSCH_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->uciMuxUlschInPusch = SUPPORTED;
+ }
+ else
+ {
+ cellParam->uciMuxUlschInPusch = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_UCI_ONLY_PUSCH_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->uciOnlyPusch = SUPPORTED;
+ }
+ else
+ {
+ cellParam->uciOnlyPusch = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PUSCH_FREQUENCY_HOPPING_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->puschFrequencyHopping = SUPPORTED;
+ }
+ else
+ {
+ cellParam->puschFrequencyHopping = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PUSCH_DMRS_CONFIG_TYPES_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschDmrsConfig(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_DMRS_MAX_LEN_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschDmrsLength(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_DMRS_ADDITIONAL_POS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschDmrsAddPos(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_CBG_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->puschCbg = SUPPORTED;
+ }
+ else
+ {
+ cellParam->puschCbg = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PUSCH_MAPPING_TYPE_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschMappingType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_ALLOCATION_TYPES_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschAllocationType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_VRB_TO_PRB_MAPPING_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschPrbMappingType(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PUSCH_MAX_PTRS_PORTS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal < FAPI_PUSCH_MAX_PTRS_PORTS_UB)
+ {
+ cellParam->puschMaxPtrsPorts = encodedVal;
+ }
+ break;
+
+ case FAPI_MAX_PDUSCHS_TBS_PER_SLOT_TAG:
+ cellParam->maxPduschsTBsPerSlot = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG:
+ cellParam->maxNumberMimoLayersNonCbPusch = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_SUPPORTED_MODULATION_ORDER_UL_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillModulationOrderUl(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_MAX_MU_MIMO_USERS_UL_TAG:
+ cellParam->maxMuMimoUsersUl = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ break;
+
+ case FAPI_DFTS_OFDM_SUPPORT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->dftsOfdmSupport = SUPPORTED;
+ }
+ else
+ {
+ cellParam->dftsOfdmSupport = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_PUSCH_AGGREGATION_FACTOR_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPuschAggregationFactor(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PRACH_LONG_FORMATS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPrachLongFormat(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PRACH_SHORT_FORMATS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillPrachShortFormat(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_PRACH_RESTRICTED_SETS_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED && encodedVal != 0)
+ {
+ cellParam->prachRestrictedSets = SUPPORTED;
+ }
+ else
+ {
+ cellParam->prachRestrictedSets = NOT_SUPPORTED;
+ }
+ break;
+
+ case FAPI_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillFdOccasions(encodedVal, &cellParam);
+ }
+ break;
+
+ case FAPI_RSSI_MEASUREMENT_SUPPORT_TAG:
+ encodedVal = getParamValue(¶mRsp->tlvs[index], FAPI_UINT_8);
+ if(encodedVal != RFAILED)
+ {
+ fillRssiMeas(encodedVal, &cellParam);
+ }
+ break;
+ default:
+ //printf("\n Invalid value for TLV[%x] at index[%d]", paramRsp->tlvs[index].tl.tag, index);
+ break;
+ }
+ }
+ MAC_FREE(cellParam, sizeof(ClCellParam));
+ sendToLowerMac(FAPI_CONFIG_REQUEST, 0, (void *)NULL);
+ return ROK;
+ }
+ else
+ {
+ DU_LOG("\n LWR_MAC: Invalid error code %d", paramRsp->error_code);
+ return RFAILED;
+ }
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for cell param");
+ return RFAILED;
+ }
}
else
{
- DU_LOG("\nLWR_MAC: Param Response received from PHY is NULL");
- return RFAILED;
+ DU_LOG("\nLWR_MAC: Param Response received from PHY is NULL");
+ return RFAILED;
}
#else
return ROK;
#endif
}
- /*******************************************************************
- *
- * @brief Sends FAPI Config req to PHY
- *
- * @details
- *
- * Function : lwr_mac_handleConfigReqEvt
- *
- * Functionality:
- * -Sends FAPI Config Req to PHY
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-
-S16 lwr_mac_handleConfigReqEvt(void *msg)
+/*******************************************************************
+ *
+ * @brief Sends FAPI Config req to PHY
+ *
+ * @details
+ *
+ * Function : lwr_mac_procConfigReqEvt
+ *
+ * Functionality:
+ * -Sends FAPI Config Req to PHY
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t lwr_mac_procConfigReqEvt(void *msg)
{
#ifdef INTEL_FAPI
- Inst inst = 0;
uint8_t idx = 0;
uint8_t index = 0;
+ uint16_t *cellId;
+ uint16_t cellIdx;
uint32_t msgLen = 0;
- RgCellCb *cellParams;
MacCellCfg macCfgParams;
fapi_config_req_t *configReq;
- DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, \
- clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", lwrMacCb.event, \
+ lwrMacCb.phyState);
+
+ cellId = (uint16_t *)msg;
+ GET_CELL_IDX(*cellId, cellIdx);
+ macCfgParams = macCb.macCell[cellIdx]->macCellCfg;
- cellParams = rgCb[inst].cell;
- macCfgParams = cellParams->macCellCfg;
+ /* Fill Cell Configuration in lwrMacCb */
+ memset(&lwrMacCb.cellCb[lwrMacCb.numCell], 0, sizeof(LwrMacCellCb));
+ lwrMacCb.cellCb[lwrMacCb.numCell].cellId = macCfgParams.cellId;
+ lwrMacCb.cellCb[lwrMacCb.numCell].phyCellId = macCfgParams.phyCellId;
+ lwrMacCb.numCell++;
+ /* Fill FAPI config req */
LWR_MAC_ALLOC(configReq, sizeof(fapi_config_req_t));
if(configReq != NULL)
{
- memset(configReq, 0, sizeof(fapi_config_req_t));
+ memset(configReq, 0, sizeof(fapi_config_req_t));
msgLen = sizeof(macCfgParams.numTlv);
configReq->number_of_tlvs = macCfgParams.numTlv;
if(macCfgParams.dlCarrCfg.pres)
{
- fillTlvs(&configReq->tlvs[index++], FAPI_DL_BANDWIDTH_TAG, \
- sizeof(uint16_t), macCfgParams.dlCarrCfg.bw, &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_DL_FREQUENCY_TAG, \
- sizeof(uint32_t), macCfgParams.dlCarrCfg.freq, &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_DL_K0_TAG, \
- sizeof(uint16_t), macCfgParams.dlCarrCfg.k0[0], &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_DL_GRIDSIZE_TAG, \
- sizeof(uint16_t), macCfgParams.dlCarrCfg.gridSize[0], &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_NUM_TX_ANT_TAG, \
- sizeof(uint16_t), macCfgParams.dlCarrCfg.numAnt, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_DL_BANDWIDTH_TAG, \
+ sizeof(uint16_t), macCfgParams.dlCarrCfg.bw, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_DL_FREQUENCY_TAG, \
+ sizeof(uint32_t), macCfgParams.dlCarrCfg.freq, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_DL_K0_TAG, \
+ sizeof(uint16_t), macCfgParams.dlCarrCfg.k0[0], &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_DL_GRIDSIZE_TAG, \
+ sizeof(uint16_t), macCfgParams.dlCarrCfg.gridSize[0], &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_NUM_TX_ANT_TAG, \
+ sizeof(uint16_t), macCfgParams.dlCarrCfg.numAnt, &msgLen);
}
if(macCfgParams.ulCarrCfg.pres)
{
- fillTlvs(&configReq->tlvs[index++], FAPI_UPLINK_BANDWIDTH_TAG, \
- sizeof(uint16_t), macCfgParams.ulCarrCfg.bw, &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_UPLINK_FREQUENCY_TAG, \
- sizeof(uint32_t), macCfgParams.ulCarrCfg.freq, &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_UL_K0_TAG, \
- sizeof(uint16_t), macCfgParams.ulCarrCfg.k0[0], &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_UL_GRID_SIZE_TAG, \
- sizeof(uint16_t), macCfgParams.ulCarrCfg.gridSize[0], &msgLen);
- fillTlvs(&configReq->tlvs[index++], FAPI_NUM_RX_ANT_TAG, \
- sizeof(uint16_t), macCfgParams.ulCarrCfg.numAnt, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_UPLINK_BANDWIDTH_TAG, \
+ sizeof(uint16_t), macCfgParams.ulCarrCfg.bw, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_UPLINK_FREQUENCY_TAG, \
+ sizeof(uint32_t), macCfgParams.ulCarrCfg.freq, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_UL_K0_TAG, \
+ sizeof(uint16_t), macCfgParams.ulCarrCfg.k0[0], &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_UL_GRID_SIZE_TAG, \
+ sizeof(uint16_t), macCfgParams.ulCarrCfg.gridSize[0], &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_NUM_RX_ANT_TAG, \
+ sizeof(uint16_t), macCfgParams.ulCarrCfg.numAnt, &msgLen);
}
fillTlvs(&configReq->tlvs[index++], FAPI_FREQUENCY_SHIFT_7P5_KHZ_TAG, \
- sizeof(uint8_t), macCfgParams.freqShft, &msgLen);
+ sizeof(uint8_t), macCfgParams.freqShft, &msgLen);
/* fill cell config */
fillTlvs(&configReq->tlvs[index++], FAPI_PHY_CELL_ID_TAG, \
- sizeof(uint8_t), macCfgParams.phyCellId, &msgLen);
+ sizeof(uint8_t), macCfgParams.phyCellId, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_FRAME_DUPLEX_TYPE_TAG, \
- sizeof(uint8_t), macCfgParams.dupType, &msgLen);
+ sizeof(uint8_t), macCfgParams.dupType, &msgLen);
/* fill SSB configuration */
fillTlvs(&configReq->tlvs[index++], FAPI_SS_PBCH_POWER_TAG, \
- sizeof(uint32_t), macCfgParams.ssbCfg.ssbPbchPwr, &msgLen);
+ sizeof(uint32_t), macCfgParams.ssbCfg.ssbPbchPwr, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_BCH_PAYLOAD_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.bchPayloadFlag, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.bchPayloadFlag, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SCS_COMMON_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.scsCmn, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.scsCmn, &msgLen);
/* fill PRACH configuration */
fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_SEQUENCE_LENGTH_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.prachSeqLen, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.prachSeqLen, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_SUBC_SPACING_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.prachSubcSpacing, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.prachSubcSpacing, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_RESTRICTED_SET_CONFIG_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.prachRstSetCfg, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.prachRstSetCfg, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_NUM_PRACH_FD_OCCASIONS_TAG,
- sizeof(uint8_t), macCfgParams.prachCfg.msg1Fdm, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.msg1Fdm, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_ROOT_SEQUENCE_INDEX_TAG, \
- sizeof(uint16_t), macCfgParams.prachCfg.fdm[0].rootSeqIdx, &msgLen);
+ sizeof(uint16_t), macCfgParams.prachCfg.fdm[0].rootSeqIdx, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_NUM_ROOT_SEQUENCES_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].numRootSeq, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].numRootSeq, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_K1_TAG, \
- sizeof(uint16_t), macCfgParams.prachCfg.fdm[0].k1, &msgLen);
+ sizeof(uint16_t), macCfgParams.prachCfg.fdm[0].k1, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_ZERO_CORR_CONF_TAG , \
- sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].zeroCorrZoneCfg, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].zeroCorrZoneCfg, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_NUM_UNUSED_ROOT_SEQUENCES_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].numUnusedRootSeq, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].numUnusedRootSeq, &msgLen);
if(macCfgParams.prachCfg.fdm[0].numUnusedRootSeq)
{
- for(idx = 0; idx < macCfgParams.prachCfg.fdm[0].numUnusedRootSeq; idx++)
- fillTlvs(&configReq->tlvs[index++], FAPI_UNUSED_ROOT_SEQUENCES_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].unsuedRootSeq[idx], \
- &msgLen);
+ for(idx = 0; idx < macCfgParams.prachCfg.fdm[0].numUnusedRootSeq; idx++)
+ fillTlvs(&configReq->tlvs[index++], FAPI_UNUSED_ROOT_SEQUENCES_TAG, \
+ sizeof(uint8_t), macCfgParams.prachCfg.fdm[0].unsuedRootSeq[idx], \
+ &msgLen);
}
else
{
- macCfgParams.prachCfg.fdm[0].unsuedRootSeq = NULL;
+ macCfgParams.prachCfg.fdm[0].unsuedRootSeq = NULL;
}
fillTlvs(&configReq->tlvs[index++], FAPI_SSB_PER_RACH_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.ssbPerRach, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.ssbPerRach, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, \
- sizeof(uint8_t), macCfgParams.prachCfg.prachMultCarrBand, &msgLen);
+ sizeof(uint8_t), macCfgParams.prachCfg.prachMultCarrBand, &msgLen);
/* fill SSB table */
fillTlvs(&configReq->tlvs[index++], FAPI_SSB_OFFSET_POINT_A_TAG, \
- sizeof(uint16_t), macCfgParams.ssbCfg.ssbOffsetPointA, &msgLen);
+ sizeof(uint16_t), macCfgParams.ssbCfg.ssbOffsetPointA, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_BETA_PSS_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.betaPss, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.betaPss, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SSB_PERIOD_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.ssbPeriod, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.ssbPeriod, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SSB_SUBCARRIER_OFFSET_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.ssbScOffset, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.ssbScOffset, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_MIB_TAG , \
- sizeof(uint32_t), macCfgParams.ssbCfg.mibPdu[0], &msgLen);
+ sizeof(uint32_t), macCfgParams.ssbCfg.mibPdu[0], &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SSB_MASK_TAG, \
- sizeof(uint32_t), macCfgParams.ssbCfg.ssbMask[0], &msgLen);
+ sizeof(uint32_t), macCfgParams.ssbCfg.ssbMask[0], &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_BEAM_ID_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.beamId[0], &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.beamId[0], &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.multCarrBand, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.multCarrBand, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, \
- sizeof(uint8_t), macCfgParams.ssbCfg.multCellCarr, &msgLen);
+ sizeof(uint8_t), macCfgParams.ssbCfg.multCellCarr, &msgLen);
/* fill TDD table */
fillTlvs(&configReq->tlvs[index++], FAPI_TDD_PERIOD_TAG, \
- sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod, &msgLen);
+ sizeof(uint8_t), macCfgParams.tddCfg.tddPeriod, &msgLen);
fillTlvs(&configReq->tlvs[index++], FAPI_SLOT_CONFIG_TAG, \
- sizeof(uint8_t), macCfgParams.tddCfg.slotCfg[0][0], &msgLen);
+ sizeof(uint8_t), macCfgParams.tddCfg.slotCfg[0][0], &msgLen);
/* fill measurement config */
fillTlvs(&configReq->tlvs[index++], FAPI_RSSI_MEASUREMENT_TAG, \
- sizeof(uint8_t), macCfgParams.rssiUnit, &msgLen);
+ sizeof(uint8_t), macCfgParams.rssiUnit, &msgLen);
/* fill DMRS Type A Pos */
- fillTlvs(&configReq->tlvs[index++], FAPI_DMRS_TYPE_A_POS_TAG, \
- sizeof(uint8_t), macCfgParams.dmrsTypeAPos, &msgLen);
+ fillTlvs(&configReq->tlvs[index++], FAPI_DMRS_TYPE_A_POS_TAG, \
+ sizeof(uint8_t), macCfgParams.dmrsTypeAPos, &msgLen);
fillMsgHeader(&configReq->header, FAPI_CONFIG_REQUEST, \
- (sizeof(fapi_config_req_t) - sizeof(fapi_msg_t)));
+ (sizeof(fapi_config_req_t) - sizeof(fapi_msg_t)));
DU_LOG("\nLWR_MAC: Sending Config Request to Phy");
LwrMacSendToPhy(configReq->header.msg_id, sizeof(fapi_config_req_t), (void *)configReq);
*
* @details
*
- * Function : lwr_mac_handleConfigRspEvt
+ * Function : lwr_mac_procConfigRspEvt
*
* Functionality:
* Processes config response from phy
*
* ****************************************************************/
-S16 lwr_mac_handleConfigRspEvt(void *msg)
+uint8_t lwr_mac_procConfigRspEvt(void *msg)
{
#ifdef INTEL_FAPI
fapi_config_resp_t *configRsp;
configRsp = (fapi_config_resp_t *)msg;
- DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", clGlobalCp.event, \
- clGlobalCp.phyState);
+ DU_LOG("\nLWR_MAC: Received EVENT[%d] at STATE[%d]", lwrMacCb.event, \
+ lwrMacCb.phyState);
if(configRsp != NULL)
{
if(configRsp->error_code == MSG_OK)
{
- 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
- * Support LC and LWLC for sending config rsp to MAC
- */
- fapiMacConfigRsp();
+ DU_LOG("\nLWR_MAC: PHY has moved to Configured state \n");
+ lwrMacCb.phyState = PHY_STATE_CONFIGURED;
+ lwrMacCb.cellCb[0].state = PHY_STATE_CONFIGURED;
+ /* TODO :
+ * Store config response into an intermediate struture and send to MAC
+ * Support LC and LWLC for sending config rsp to MAC
+ */
+ fapiMacConfigRsp(lwrMacCb.cellCb[0].cellId);
}
else
{
- DU_LOG("\n LWR_MAC: Invalid error code %d", configRsp->error_code);
- return RFAILED;
+ DU_LOG("\n LWR_MAC: Invalid error code %d", configRsp->error_code);
+ return RFAILED;
}
}
else
#endif
return ROK;
-} /* lwr_mac_handleConfigRspEvt */
+} /* lwr_mac_procConfigRspEvt */
/*******************************************************************
*
*
* @details
*
- * Function : lwr_mac_handleStartReqEvt
+ * Function : lwr_mac_procStartReqEvt
*
* Functionality:
* Build and send start request to phy
* RFAILED - failure
*
* ****************************************************************/
-S16 lwr_mac_handleStartReqEvt(void *msg)
+uint8_t lwr_mac_procStartReqEvt(void *msg)
{
#ifdef INTEL_FAPI
uint32_t msgLen = 0;
LWR_MAC_ALLOC(startReq, sizeof(fapi_start_req_t));
if(startReq != NULL)
{
- memset(startReq, 0, sizeof(fapi_start_req_t));
+ memset(startReq, 0, sizeof(fapi_start_req_t));
fillMsgHeader(&startReq->header, FAPI_START_REQUEST, msgLen);
DU_LOG("\nLWR_MAC: Sending Start Request to PHY");
LwrMacSendToPhy(startReq->header.msg_id, sizeof(fapi_start_req_t),\
- (void *)startReq);
+ (void *)startReq);
}
else
{
}
#endif
return ROK;
-} /* lwr_mac_handleStartReqEvt */
-
- /*******************************************************************
- *
- * @brief Sends FAPI Stop Req to PHY
- *
- * @details
- *
- * Function : lwr_mac_handleStopReqEvt
- *
- * Functionality:
- * -Sends FAPI Stop Req to PHY
- *
- * @params[in]
- * @return ROK - success
- * RFAILED - failure
- *
- ********************************************************************/
-
-S16 lwr_mac_handleStopReqEvt(void *msg)
+} /* lwr_mac_procStartReqEvt */
+
+/*******************************************************************
+ *
+ * @brief Sends FAPI Stop Req to PHY
+ *
+ * @details
+ *
+ * Function : lwr_mac_procStopReqEvt
+ *
+ * Functionality:
+ * -Sends FAPI Stop Req to PHY
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ ********************************************************************/
+
+uint8_t lwr_mac_procStopReqEvt(void *msg)
{
#ifdef INTEL_FAPI
uint32_t msgLen = 0;
LWR_MAC_ALLOC(stopReq, sizeof(fapi_stop_req_t));
if(stopReq != NULLP)
{
- memset(stopReq, 0, sizeof(fapi_stop_req_t));
+ memset(stopReq, 0, sizeof(fapi_stop_req_t));
fillMsgHeader(&stopReq->header, FAPI_STOP_REQUEST, msgLen);
DU_LOG("\nLOWER MAC: Sending Stop Request to PHY");
LwrMacSendToPhy(stopReq->header.msg_id, sizeof(fapi_stop_req_t), (void *)stopReq);
{
*mibPdu |= (((uint8_t)(sfn >> 2)) & MIB_SFN_BITMASK);
*val = (mibPdu[0] << 24 | mibPdu[1] << 16 | mibPdu[2] << 8);
- DU_LOG("\nLWR_MAC: MIB PDU %x", *val);
+ DU_LOG("\nLWR_MAC: MIB PDU %x", *val);
}
#ifdef INTEL_FAPI
*
******************************************************************/
-S16 fillSsbPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, MacCellCfg *macCellCfg,
- MacDlSlot *currDlSlot, uint8_t ssbIdxCount, uint16_t sfn)
+uint8_t fillSsbPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, MacCellCfg *macCellCfg,
+ MacDlSlot *currDlSlot, uint8_t ssbIdxCount, uint16_t sfn)
{
uint32_t mibPayload = 0;
if(dlTtiReqPdu != NULL)
dlTtiReqPdu->pdu.ssb_pdu.preCodingAndBeamforming.digBfInterfaces = 0;
dlTtiReqPdu->pdu.ssb_pdu.preCodingAndBeamforming.pmi_bfi[0].pmIdx = 0;
dlTtiReqPdu->pdu.ssb_pdu.preCodingAndBeamforming. \
- pmi_bfi[0].beamIdx[0].beamidx = macCellCfg->ssbCfg.beamId[0];
+ pmi_bfi[0].beamIdx[0].beamidx = macCellCfg->ssbCfg.beamId[0];
dlTtiReqPdu->pduSize = sizeof(fapi_dl_ssb_pdu_t); /* Size of SSB PDU */
return ROK;
- }
- return RFAILED;
+ }
+ return RFAILED;
}
/*******************************************************************
uint8_t numBytes;
uint8_t bytePos;
uint8_t bitPos;
-
+
uint16_t coreset0Size;
uint16_t rbStart;
uint16_t rbLen;
if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
{
- if((rbLen - 1) <= floor(coreset0Size / 2))
- freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
- else
- freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
- + (coreset0Size - 1 - rbStart);
+ if((rbLen - 1) <= floor(coreset0Size / 2))
+ freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
+ else
+ freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
+ + (coreset0Size - 1 - rbStart);
- freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
+ freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
}
/* Fetching DCI field values */
timeDomResAssign = sib1PdcchInfo->dci.pdschCfg->pdschTimeAlloc.
- rowIndex -1;
+ rowIndex -1;
VRB2PRBMap = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.\
- vrbPrbMapping;
+ vrbPrbMapping;
modNCodScheme = sib1PdcchInfo->dci.pdschCfg->codeword[0].mcsIndex;
redundancyVer = sib1PdcchInfo->dci.pdschCfg->codeword[0].rvIndex;
sysInfoInd = 0; /* 0 for SIB1; 1 for SI messages */
redundancyVer = reverseBits(redundancyVer, redundancyVerSize);
sysInfoInd = reverseBits(sysInfoInd, sysInfoIndSize);
- /* Calulating total number of bytes in buffer */
- dlDciPtr->payloadSizeBits = freqDomResAssignSize + timeDomResAssignSize\
- + VRB2PRBMapSize + modNCodSchemeSize + redundancyVerSize\
- + sysInfoIndSize + reservedSize;
-
- numBytes = dlDciPtr->payloadSizeBits / 8;
- if(dlDciPtr->payloadSizeBits % 8)
- numBytes += 1;
-
- if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
- {
- DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
- return;
- }
-
- /* Initialize buffer */
- for(bytePos = 0; bytePos < numBytes; bytePos++)
- dlDciPtr->payload[bytePos] = 0;
-
- bytePos = numBytes - 1;
- bitPos = 0;
-
- /* Packing DCI format fields */
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- freqDomResAssign, freqDomResAssignSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- timeDomResAssign, timeDomResAssignSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- VRB2PRBMap, VRB2PRBMapSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- modNCodScheme, modNCodSchemeSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- redundancyVer, redundancyVerSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- sysInfoInd, sysInfoIndSize);
- fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- reserved, reservedSize);
+ /* Calulating total number of bytes in buffer */
+ dlDciPtr->payloadSizeBits = freqDomResAssignSize + timeDomResAssignSize\
+ + VRB2PRBMapSize + modNCodSchemeSize + redundancyVerSize\
+ + sysInfoIndSize + reservedSize;
+
+ numBytes = dlDciPtr->payloadSizeBits / 8;
+ if(dlDciPtr->payloadSizeBits % 8)
+ numBytes += 1;
+
+ if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
+ {
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
+ return;
+ }
+
+ /* Initialize buffer */
+ for(bytePos = 0; bytePos < numBytes; bytePos++)
+ dlDciPtr->payload[bytePos] = 0;
+
+ bytePos = numBytes - 1;
+ bitPos = 0;
+
+ /* Packing DCI format fields */
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ freqDomResAssign, freqDomResAssignSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ timeDomResAssign, timeDomResAssignSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ VRB2PRBMap, VRB2PRBMapSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ modNCodScheme, modNCodSchemeSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ redundancyVer, redundancyVerSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ sysInfoInd, sysInfoIndSize);
+ fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
+ reserved, reservedSize);
}
} /* fillSib1DlDciPdu */
if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
{
- if((rbLen - 1) <= floor(coreset0Size / 2))
- freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
- else
- freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
- + (coreset0Size - 1 - rbStart);
+ if((rbLen - 1) <= floor(coreset0Size / 2))
+ freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
+ else
+ freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
+ + (coreset0Size - 1 - rbStart);
- freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
+ freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
}
/* Fetching DCI field values */
/* Calulating total number of bytes in buffer */
dlDciPtr->payloadSizeBits = freqDomResAssignSize + timeDomResAssignSize\
- + VRB2PRBMapSize + modNCodSchemeSize + tbScalingSize + reservedSize;
+ + VRB2PRBMapSize + modNCodSchemeSize + tbScalingSize + reservedSize;
numBytes = dlDciPtr->payloadSizeBits / 8;
if(dlDciPtr->payloadSizeBits % 8)
- numBytes += 1;
+ numBytes += 1;
if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
{
- DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
- return;
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
+ return;
}
/* Initialize buffer */
for(bytePos = 0; bytePos < numBytes; bytePos++)
- dlDciPtr->payload[bytePos] = 0;
+ dlDciPtr->payload[bytePos] = 0;
bytePos = numBytes - 1;
bitPos = 0;
/* Packing DCI format fields */
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- freqDomResAssign, freqDomResAssignSize);
+ freqDomResAssign, freqDomResAssignSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- timeDomResAssign, timeDomResAssignSize);
+ timeDomResAssign, timeDomResAssignSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- VRB2PRBMap, VRB2PRBMapSize);
+ VRB2PRBMap, VRB2PRBMapSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- modNCodScheme, modNCodSchemeSize);
+ modNCodScheme, modNCodSchemeSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- tbScaling, tbScalingSize);
+ tbScaling, tbScalingSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- reserved, reservedSize);
+ reserved, reservedSize);
}
} /* fillRarDlDciPdu */
*
******************************************************************/
void fillMsg4DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *msg4PdcchInfo,\
-Msg4Info *msg4Info)
+ Msg4Info *msg4Info)
{
if(dlDciPtr != NULLP)
{
if((rbLen >=1) && (rbLen <= coreset0Size - rbStart))
{
- if((rbLen - 1) <= floor(coreset0Size / 2))
- freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
- else
- freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
- + (coreset0Size - 1 - rbStart);
+ if((rbLen - 1) <= floor(coreset0Size / 2))
+ freqDomResAssign = (coreset0Size * (rbLen-1)) + rbStart;
+ else
+ freqDomResAssign = (coreset0Size * (coreset0Size - rbLen + 1)) \
+ + (coreset0Size - 1 - rbStart);
- freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
+ freqDomResAssignSize = ceil(log2(coreset0Size * (coreset0Size + 1) / 2));
}
/* Fetching DCI field values */
/* Calulating total number of bytes in buffer */
dlDciPtr->payloadSizeBits = (dciFormatIdSize + freqDomResAssignSize\
- + timeDomResAssignSize + VRB2PRBMapSize + modNCodSchemeSize\
- + ndiSize + redundancyVerSize + harqProcessNumSize + dlAssignmentIdxSize\
- + pucchTpcSize + pucchResoIndSize + harqFeedbackIndSize);
+ + timeDomResAssignSize + VRB2PRBMapSize + modNCodSchemeSize\
+ + ndiSize + redundancyVerSize + harqProcessNumSize + dlAssignmentIdxSize\
+ + pucchTpcSize + pucchResoIndSize + harqFeedbackIndSize);
numBytes = dlDciPtr->payloadSizeBits / 8;
if(dlDciPtr->payloadSizeBits % 8)
- numBytes += 1;
+ numBytes += 1;
if(numBytes > FAPI_DCI_PAYLOAD_BYTE_LEN)
{
- DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
- return;
+ DU_LOG("\nLWR_MAC : Total bytes for DCI is more than expected");
+ return;
}
/* Initialize buffer */
for(bytePos = 0; bytePos < numBytes; bytePos++)
- dlDciPtr->payload[bytePos] = 0;
+ dlDciPtr->payload[bytePos] = 0;
bytePos = numBytes - 1;
bitPos = 0;
/* Packing DCI format fields */
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- dciFormatId, dciFormatIdSize);
+ dciFormatId, dciFormatIdSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- freqDomResAssign, freqDomResAssignSize);
+ freqDomResAssign, freqDomResAssignSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- timeDomResAssign, timeDomResAssignSize);
+ timeDomResAssign, timeDomResAssignSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- VRB2PRBMap, VRB2PRBMapSize);
+ VRB2PRBMap, VRB2PRBMapSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- modNCodScheme, modNCodSchemeSize);
+ modNCodScheme, modNCodSchemeSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- ndi, ndiSize);
+ ndi, ndiSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- redundancyVer, redundancyVerSize);
+ redundancyVer, redundancyVerSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- redundancyVer, redundancyVerSize);
+ redundancyVer, redundancyVerSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- harqProcessNum, harqProcessNumSize);
+ harqProcessNum, harqProcessNumSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- dlAssignmentIdx, dlAssignmentIdxSize);
+ dlAssignmentIdx, dlAssignmentIdxSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- pucchTpc, pucchTpcSize);
+ pucchTpc, pucchTpcSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- pucchResoInd, pucchResoIndSize);
+ pucchResoInd, pucchResoIndSize);
fillDlDciPayload(dlDciPtr->payload, &bytePos, &bitPos,\
- harqFeedbackInd, harqFeedbackIndSize);
+ harqFeedbackInd, harqFeedbackIndSize);
}
} /* fillMsg4DlDciPdu */
*
******************************************************************/
uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, DlSchedInfo *dlInfo, \
- RntiType rntiType, uint8_t coreSetType)
+ RntiType rntiType, uint8_t coreSetType)
{
if(dlTtiReqPdu != NULLP)
{
memset(&dlTtiReqPdu->pdu.pdcch_pdu, 0, sizeof(fapi_dl_pdcch_pdu_t));
if(rntiType == SI_RNTI_TYPE)
{
- pdcchInfo = &dlInfo->brdcstAlloc.sib1Alloc.sib1PdcchCfg;
- bwp = &dlInfo->brdcstAlloc.sib1Alloc.bwp;
- fillSib1DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
+ pdcchInfo = &dlInfo->brdcstAlloc.sib1Alloc.sib1PdcchCfg;
+ bwp = &dlInfo->brdcstAlloc.sib1Alloc.bwp;
+ fillSib1DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
}
else if(rntiType == RA_RNTI_TYPE)
{
- pdcchInfo = &dlInfo->rarAlloc->rarPdcchCfg;
- bwp = &dlInfo->rarAlloc->bwp;
- fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
+ pdcchInfo = &dlInfo->rarAlloc->rarPdcchCfg;
+ bwp = &dlInfo->rarAlloc->bwp;
+ fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo);
}
else if(rntiType == TC_RNTI_TYPE)
{
- pdcchInfo = &dlInfo->msg4Alloc->msg4PdcchCfg;
- bwp = &dlInfo->msg4Alloc->bwp;
- fillMsg4DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
- &dlInfo->msg4Alloc->msg4Info);
+ pdcchInfo = &dlInfo->msg4Alloc->msg4PdcchCfg;
+ bwp = &dlInfo->msg4Alloc->bwp;
+ fillMsg4DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\
+ &dlInfo->msg4Alloc->msg4Info);
}
else
{
- DU_LOG("\nLWR_MAC: Failed filling PDCCH Pdu");
- return RFAILED;;
+ DU_LOG("\nLWR_MAC: Failed filling PDCCH Pdu");
+ return RFAILED;;
}
dlTtiReqPdu->pduType = PDCCH_PDU_TYPE;
dlTtiReqPdu->pdu.pdcch_pdu.bwpSize = bwp->freqAlloc.numPrb;
dlTtiReqPdu->pdu.pdcch_pdu.shiftIndex = pdcchInfo->coreset0Cfg.shiftIndex;
dlTtiReqPdu->pdu.pdcch_pdu.precoderGranularity = pdcchInfo->coreset0Cfg.precoderGranularity;
dlTtiReqPdu->pdu.pdcch_pdu.numDlDci = pdcchInfo->numDlDci;
- dlTtiReqPdu->pdu.pdcch_pdu.coreSetType = coreSetType;
+ dlTtiReqPdu->pdu.pdcch_pdu.coreSetType = coreSetType;
/* Calculating PDU length. Considering only one dl dci pdu for now */
dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t);
- }
+ }
- return ROK;
+ return ROK;
}
/*******************************************************************
******************************************************************/
void fillPdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, PdschCfg *pdschInfo,
- BwpCfg bwp, uint16_t pduIndex)
+ BwpCfg bwp, uint16_t pduIndex)
{
- uint8_t idx;
-
- if(dlTtiReqPdu != NULLP)
- {
- dlTtiReqPdu->pduType = PDSCH_PDU_TYPE;
- memset(&dlTtiReqPdu->pdu.pdsch_pdu, 0, sizeof(fapi_dl_pdsch_pdu_t));
- dlTtiReqPdu->pdu.pdsch_pdu.pduBitMap = pdschInfo->pduBitmap;
- dlTtiReqPdu->pdu.pdsch_pdu.rnti = pdschInfo->rnti;
- dlTtiReqPdu->pdu.pdsch_pdu.pdu_index = pduIndex;
- dlTtiReqPdu->pdu.pdsch_pdu.bwpSize = bwp.freqAlloc.numPrb;
- dlTtiReqPdu->pdu.pdsch_pdu.bwpStart = bwp.freqAlloc.startPrb;
- dlTtiReqPdu->pdu.pdsch_pdu.subCarrierSpacing = bwp.subcarrierSpacing;
- dlTtiReqPdu->pdu.pdsch_pdu.cyclicPrefix = bwp.cyclicPrefix;
- dlTtiReqPdu->pdu.pdsch_pdu.nrOfCodeWords = pdschInfo->numCodewords;
- for(idx = 0; idx < MAX_CODEWORDS ; idx++)
- {
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].targetCodeRate = pdschInfo->codeword[idx].targetCodeRate;
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].qamModOrder = pdschInfo->codeword[idx].qamModOrder;
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsIndex = pdschInfo->codeword[idx].mcsIndex;
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsTable = pdschInfo->codeword[idx].mcsTable;
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].rvIndex = pdschInfo->codeword[idx].rvIndex;
- dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].tbSize = pdschInfo->codeword[idx].tbSize;
- }
- dlTtiReqPdu->pdu.pdsch_pdu.dataScramblingId = pdschInfo->dataScramblingId;
- dlTtiReqPdu->pdu.pdsch_pdu.nrOfLayers = pdschInfo->numLayers;
- dlTtiReqPdu->pdu.pdsch_pdu.transmissionScheme = pdschInfo->transmissionScheme;
- dlTtiReqPdu->pdu.pdsch_pdu.refPoint = pdschInfo->refPoint;
- dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsSymbPos = pdschInfo->dmrs.dlDmrsSymbPos;
- dlTtiReqPdu->pdu.pdsch_pdu.dmrsConfigType = pdschInfo->dmrs.dmrsConfigType;
- dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsScramblingId = pdschInfo->dmrs.dlDmrsScramblingId;
- dlTtiReqPdu->pdu.pdsch_pdu.scid = pdschInfo->dmrs.scid;
- dlTtiReqPdu->pdu.pdsch_pdu.numDmrsCdmGrpsNoData = pdschInfo->dmrs.numDmrsCdmGrpsNoData;
- dlTtiReqPdu->pdu.pdsch_pdu.dmrsPorts = pdschInfo->dmrs.dmrsPorts;
- dlTtiReqPdu->pdu.pdsch_pdu.resourceAlloc = pdschInfo->pdschFreqAlloc.resourceAllocType;
- /* since we are using type-1, hence rbBitmap excluded */
- dlTtiReqPdu->pdu.pdsch_pdu.rbStart = pdschInfo->pdschFreqAlloc.freqAlloc.startPrb;
- dlTtiReqPdu->pdu.pdsch_pdu.rbSize = pdschInfo->pdschFreqAlloc.freqAlloc.numPrb;
- dlTtiReqPdu->pdu.pdsch_pdu.vrbToPrbMapping = pdschInfo->pdschFreqAlloc.vrbPrbMapping;
- dlTtiReqPdu->pdu.pdsch_pdu.startSymbIndex = pdschInfo->pdschTimeAlloc.timeAlloc.startSymb;
- dlTtiReqPdu->pdu.pdsch_pdu.nrOfSymbols = pdschInfo->pdschTimeAlloc.timeAlloc.numSymb;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.numPrgs = pdschInfo->beamPdschInfo.numPrgs;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.prgSize = pdschInfo->beamPdschInfo.prgSize;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.digBfInterfaces = pdschInfo->beamPdschInfo.digBfInterfaces;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0]. \
- pmIdx = pdschInfo->beamPdschInfo.prg[0].pmIdx;
- dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0]. \
- beamIdx[0].beamidx = pdschInfo->beamPdschInfo.prg[0].beamIdx[0];
- dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffset = pdschInfo->txPdschPower.powerControlOffset;
- dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffsetSS = pdschInfo->txPdschPower.powerControlOffsetSS;
- dlTtiReqPdu->pdu.pdsch_pdu.mappingType = pdschInfo->dmrs.mappingType;
- dlTtiReqPdu->pdu.pdsch_pdu.nrOfDmrsSymbols = pdschInfo->dmrs.nrOfDmrsSymbols;
- dlTtiReqPdu->pdu.pdsch_pdu.dmrsAddPos = pdschInfo->dmrs.dmrsAddPos;
-
- dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdsch_pdu_t);
- }
+ uint8_t idx;
+
+ if(dlTtiReqPdu != NULLP)
+ {
+ dlTtiReqPdu->pduType = PDSCH_PDU_TYPE;
+ memset(&dlTtiReqPdu->pdu.pdsch_pdu, 0, sizeof(fapi_dl_pdsch_pdu_t));
+ dlTtiReqPdu->pdu.pdsch_pdu.pduBitMap = pdschInfo->pduBitmap;
+ dlTtiReqPdu->pdu.pdsch_pdu.rnti = pdschInfo->rnti;
+ dlTtiReqPdu->pdu.pdsch_pdu.pdu_index = pduIndex;
+ dlTtiReqPdu->pdu.pdsch_pdu.bwpSize = bwp.freqAlloc.numPrb;
+ dlTtiReqPdu->pdu.pdsch_pdu.bwpStart = bwp.freqAlloc.startPrb;
+ dlTtiReqPdu->pdu.pdsch_pdu.subCarrierSpacing = bwp.subcarrierSpacing;
+ dlTtiReqPdu->pdu.pdsch_pdu.cyclicPrefix = bwp.cyclicPrefix;
+ dlTtiReqPdu->pdu.pdsch_pdu.nrOfCodeWords = pdschInfo->numCodewords;
+ for(idx = 0; idx < MAX_CODEWORDS ; idx++)
+ {
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].targetCodeRate = pdschInfo->codeword[idx].targetCodeRate;
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].qamModOrder = pdschInfo->codeword[idx].qamModOrder;
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsIndex = pdschInfo->codeword[idx].mcsIndex;
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsTable = pdschInfo->codeword[idx].mcsTable;
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].rvIndex = pdschInfo->codeword[idx].rvIndex;
+ dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].tbSize = pdschInfo->codeword[idx].tbSize;
+ }
+ dlTtiReqPdu->pdu.pdsch_pdu.dataScramblingId = pdschInfo->dataScramblingId;
+ dlTtiReqPdu->pdu.pdsch_pdu.nrOfLayers = pdschInfo->numLayers;
+ dlTtiReqPdu->pdu.pdsch_pdu.transmissionScheme = pdschInfo->transmissionScheme;
+ dlTtiReqPdu->pdu.pdsch_pdu.refPoint = pdschInfo->refPoint;
+ dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsSymbPos = pdschInfo->dmrs.dlDmrsSymbPos;
+ dlTtiReqPdu->pdu.pdsch_pdu.dmrsConfigType = pdschInfo->dmrs.dmrsConfigType;
+ dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsScramblingId = pdschInfo->dmrs.dlDmrsScramblingId;
+ dlTtiReqPdu->pdu.pdsch_pdu.scid = pdschInfo->dmrs.scid;
+ dlTtiReqPdu->pdu.pdsch_pdu.numDmrsCdmGrpsNoData = pdschInfo->dmrs.numDmrsCdmGrpsNoData;
+ dlTtiReqPdu->pdu.pdsch_pdu.dmrsPorts = pdschInfo->dmrs.dmrsPorts;
+ dlTtiReqPdu->pdu.pdsch_pdu.resourceAlloc = pdschInfo->pdschFreqAlloc.resourceAllocType;
+ /* since we are using type-1, hence rbBitmap excluded */
+ dlTtiReqPdu->pdu.pdsch_pdu.rbStart = pdschInfo->pdschFreqAlloc.freqAlloc.startPrb;
+ dlTtiReqPdu->pdu.pdsch_pdu.rbSize = pdschInfo->pdschFreqAlloc.freqAlloc.numPrb;
+ dlTtiReqPdu->pdu.pdsch_pdu.vrbToPrbMapping = pdschInfo->pdschFreqAlloc.vrbPrbMapping;
+ dlTtiReqPdu->pdu.pdsch_pdu.startSymbIndex = pdschInfo->pdschTimeAlloc.timeAlloc.startSymb;
+ dlTtiReqPdu->pdu.pdsch_pdu.nrOfSymbols = pdschInfo->pdschTimeAlloc.timeAlloc.numSymb;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.numPrgs = pdschInfo->beamPdschInfo.numPrgs;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.prgSize = pdschInfo->beamPdschInfo.prgSize;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.digBfInterfaces = pdschInfo->beamPdschInfo.digBfInterfaces;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0]. \
+ pmIdx = pdschInfo->beamPdschInfo.prg[0].pmIdx;
+ dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0]. \
+ beamIdx[0].beamidx = pdschInfo->beamPdschInfo.prg[0].beamIdx[0];
+ dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffset = pdschInfo->txPdschPower.powerControlOffset;
+ dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffsetSS = pdschInfo->txPdschPower.powerControlOffsetSS;
+ dlTtiReqPdu->pdu.pdsch_pdu.mappingType = pdschInfo->dmrs.mappingType;
+ dlTtiReqPdu->pdu.pdsch_pdu.nrOfDmrsSymbols = pdschInfo->dmrs.nrOfDmrsSymbols;
+ dlTtiReqPdu->pdu.pdsch_pdu.dmrsAddPos = pdschInfo->dmrs.dmrsAddPos;
+
+ dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdsch_pdu_t);
+ }
}
/***********************************************************************
{
if(dlInfo->brdcstAlloc.ssbTrans)
{
- for(idx = 0; idx < dlInfo->brdcstAlloc.ssbIdxSupported; idx++)
- {
- /* SSB PDU is filled */
- count++;
- }
+ for(idx = 0; idx < dlInfo->brdcstAlloc.ssbIdxSupported; idx++)
+ {
+ /* SSB PDU is filled */
+ count++;
+ }
}
if(dlInfo->brdcstAlloc.sib1Trans)
{
- /* PDCCH and PDSCH PDU is filled */
- count += 2;
+ /* PDCCH and PDSCH PDU is filled */
+ count += 2;
}
}
if(dlInfo->rarAlloc != NULLP)
*
* ********************************************************************/
uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc,MacCellCfg *macCellCfg,
- uint16_t pduIndex)
+ uint16_t pduIndex)
{
uint32_t pduLen = 0;
uint8_t *sib1TxdataValue = NULLP;
return RFAILED;
}
memcpy(sib1TxdataValue,macCellCfg->sib1Cfg.sib1Pdu,
- macCellCfg->sib1Cfg.sib1PduLen);
+ macCellCfg->sib1Cfg.sib1PduLen);
pduDesc[pduIndex].tlvs[0].value = sib1TxdataValue;
/* The total length of the PDU description and PDU data */
*
* ********************************************************************/
uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, RarInfo *rarInfo,
- uint16_t pduIndex)
+ uint16_t pduIndex)
{
uint32_t pduLen = 0;
uint8_t *rarTxdataValue = NULLP;
pduLen += sizeof(fapi_uint8_ptr_tlv_t); /* only 1 TLV is present */
pduDesc[pduIndex].pdu_length = pduLen;
-/* TODO: The pointer value which was stored, needs to be free-ed at PHY *
- * But since we did not implement WLS, this has to be done here
- */
+ /* TODO: The pointer value which was stored, needs to be free-ed at PHY *
+ * But since we did not implement WLS, this has to be done here
+ */
#ifndef INTEL_WLS
MAC_FREE(rarTxdataValue,rarInfo->rarPduLen);
#endif
*
* ********************************************************************/
uint8_t fillMsg4TxDataReq(fapi_tx_pdu_desc_t *pduDesc, Msg4Info *msg4Info,
- uint16_t pduIndex)
+ uint16_t pduIndex)
{
uint32_t pduLen = 0;
uint8_t *msg4TxDataValue = NULLP;
pduDesc[pduIndex].pdu_index = pduIndex;
pduDesc[pduIndex].num_tlvs = 1;
-
+
/* fill the TLV */
/* as of now, memory is allocated from SSI, later WLS memory needs to be taken */
pduDesc[pduIndex].tlvs[0].tl.tag = 1; /* pointer to be sent */
/* TODO: The pointer value which was stored, needs to be free-ed at PHY *
* But since we did not implement WLS, this has to be done here
*/
- #ifndef INTEL_WLS
- MAC_FREE(msg4TxDataValue, msg4Info->msg4PduLen);
- #endif
+#ifndef INTEL_WLS
+ MAC_FREE(msg4TxDataValue, msg4Info->msg4PduLen);
+#endif
return ROK;
}
*
* @details
*
- * Function : handleDlTtiReq
+ * Function : fillDlTtiReq
*
* Functionality:
* -Sends FAPI DL TTI req to PHY
* RFAILED - failure
*
* ****************************************************************/
-uint16_t handleDlTtiReq(SlotIndInfo currTimingInfo)
+uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo)
{
#ifdef INTEL_FAPI
uint8_t idx;
uint8_t nPdu = 0;
uint8_t numPduEncoded = 0;
+ uint16_t cellIdx;
uint16_t pduIndex = 0;
uint32_t msgLen = 0;
fapi_dl_tti_req_t *dlTtiReq = NULLP;
SlotIndInfo dlTtiReqTimingInfo;
- RgCellCb *cellCbParams = NULLP;
MacDlSlot *currDlSlot = NULLP;
MacCellCfg macCellCfg;
memset(&macCellCfg, 0, sizeof(MacCellCfg));
- Inst inst = 0;
RntiType rntiType;
-
- if(clGlobalCp.phyState == PHY_STATE_RUNNING)
+
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
{
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
/* consider phy delay */
ADD_DELTA_TO_TIME(currTimingInfo,dlTtiReqTimingInfo,PHY_DELTA);
- cellCbParams = rgCb[inst].cell;
- macCellCfg = cellCbParams->macCellCfg;
-
- currDlSlot = &macCb.macCell->dlSlot[dlTtiReqTimingInfo.slot];
- nPdu = calcDlTtiReqPduCount(&currDlSlot->dlInfo);
- LWR_MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
- if(dlTtiReq != NULLP)
- {
- memset(dlTtiReq, 0, sizeof(fapi_dl_tti_req_t));
- dlTtiReq->sfn = dlTtiReqTimingInfo.sfn;
- dlTtiReq->slot = dlTtiReqTimingInfo.slot;
- dlTtiReq->nPdus = calcDlTtiReqPduCount(&currDlSlot->dlInfo); /* get total Pdus */
- nPdu = dlTtiReq->nPdus;
- dlTtiReq->nGroup = 0;
-
- if(dlTtiReq->nPdus > 0)
- {
- if(currDlSlot->dlInfo.isBroadcastPres)
- {
- if(currDlSlot->dlInfo.brdcstAlloc.ssbTrans)
- {
- if(dlTtiReq->pdus != NULLP)
- {
- for(idx = 0; idx < currDlSlot->dlInfo.brdcstAlloc.ssbIdxSupported; idx++)
- {
- fillSsbPdu(&dlTtiReq->pdus[numPduEncoded], &macCellCfg,\
- currDlSlot, idx, dlTtiReq->sfn);
- numPduEncoded++;
- }
- }
- printf("\033[1;31m");
- DU_LOG("\nLWR_MAC: MIB sent..");
- printf("\033[0m");
- }
- if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans)
- {
- /* Filling SIB1 param */
- if(numPduEncoded != nPdu)
- {
- rntiType = SI_RNTI_TYPE;
- fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded],&currDlSlot->dlInfo,\
- rntiType, CORESET_TYPE0);
- numPduEncoded++;
- fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
- &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg,
- currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp,
- pduIndex);
- pduIndex++;
- numPduEncoded++;
- }
- printf("\033[1;34m");
- DU_LOG("\nLWR_MAC: SIB1 sent...");
- printf("\033[0m");
- }
- }
- if(currDlSlot->dlInfo.rarAlloc != NULLP)
- {
- /* Filling RAR param */
- rntiType = RA_RNTI_TYPE;
- fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
- &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
- numPduEncoded++;
- fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
- &currDlSlot->dlInfo.rarAlloc->rarPdschCfg,
- currDlSlot->dlInfo.rarAlloc->bwp,
- pduIndex);
- numPduEncoded++;
- pduIndex++;
-
- printf("\033[1;32m");
- DU_LOG("\nLWR_MAC: RAR sent...");
- printf("\033[0m");
- }
- if(currDlSlot->dlInfo.msg4Alloc != NULLP)
- {
- /* Filling Msg4 param */
- rntiType = TC_RNTI_TYPE;
- fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
- &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
- numPduEncoded++;
- fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
- &currDlSlot->dlInfo.msg4Alloc->msg4PdschCfg,
- currDlSlot->dlInfo.msg4Alloc->bwp,
- pduIndex);
- numPduEncoded++;
- pduIndex++;
-
- printf("\033[1;32m");
- DU_LOG("\nLWR_MAC: MSG4 sent...");
- printf("\033[0m");
- }
- msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
- fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
- LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), \
- (void *)dlTtiReq);
-
- /* send Tx-DATA req message */
- sendTxDataReq(currTimingInfo, &currDlSlot->dlInfo);
- }
- else
- {
- msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
- fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
- LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), (void *)dlTtiReq);
- }
- memset(currDlSlot, 0, sizeof(MacDlSlot));
- return ROK;
- }
- else
- {
- DU_LOG("\nLWR_MAC: Failed to allocate memory for DL TTI Request");
- memset(currDlSlot, 0, sizeof(MacDlSlot));
- return RFAILED;
- }
- }
+ macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
+
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[dlTtiReqTimingInfo.slot];
+ nPdu = calcDlTtiReqPduCount(&currDlSlot->dlInfo);
+ LWR_MAC_ALLOC(dlTtiReq, sizeof(fapi_dl_tti_req_t));
+ if(dlTtiReq != NULLP)
+ {
+ memset(dlTtiReq, 0, sizeof(fapi_dl_tti_req_t));
+ dlTtiReq->sfn = dlTtiReqTimingInfo.sfn;
+ dlTtiReq->slot = dlTtiReqTimingInfo.slot;
+ dlTtiReq->nPdus = calcDlTtiReqPduCount(&currDlSlot->dlInfo); /* get total Pdus */
+ nPdu = dlTtiReq->nPdus;
+ dlTtiReq->nGroup = 0;
+
+ if(dlTtiReq->nPdus > 0)
+ {
+ if(currDlSlot->dlInfo.isBroadcastPres)
+ {
+ if(currDlSlot->dlInfo.brdcstAlloc.ssbTrans)
+ {
+ if(dlTtiReq->pdus != NULLP)
+ {
+ for(idx = 0; idx < currDlSlot->dlInfo.brdcstAlloc.ssbIdxSupported; idx++)
+ {
+ fillSsbPdu(&dlTtiReq->pdus[numPduEncoded], &macCellCfg,\
+ currDlSlot, idx, dlTtiReq->sfn);
+ numPduEncoded++;
+ }
+ }
+ printf("\033[1;31m");
+ DU_LOG("\nLWR_MAC: MIB sent..");
+ printf("\033[0m");
+ }
+ if(currDlSlot->dlInfo.brdcstAlloc.sib1Trans)
+ {
+ /* Filling SIB1 param */
+ if(numPduEncoded != nPdu)
+ {
+ rntiType = SI_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded],&currDlSlot->dlInfo,\
+ rntiType, CORESET_TYPE0);
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdschCfg,
+ currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp,
+ pduIndex);
+ pduIndex++;
+ numPduEncoded++;
+ }
+ printf("\033[1;34m");
+ DU_LOG("\nLWR_MAC: SIB1 sent...");
+ printf("\033[0m");
+ }
+ }
+ if(currDlSlot->dlInfo.rarAlloc != NULLP)
+ {
+ /* Filling RAR param */
+ rntiType = RA_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+ &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.rarAlloc->rarPdschCfg,
+ currDlSlot->dlInfo.rarAlloc->bwp,
+ pduIndex);
+ numPduEncoded++;
+ pduIndex++;
+
+ printf("\033[1;32m");
+ DU_LOG("\nLWR_MAC: RAR sent...");
+ printf("\033[0m");
+ }
+ if(currDlSlot->dlInfo.msg4Alloc != NULLP)
+ {
+ /* Filling Msg4 param */
+ rntiType = TC_RNTI_TYPE;
+ fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], \
+ &currDlSlot->dlInfo, rntiType, CORESET_TYPE0);
+ numPduEncoded++;
+ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded],
+ &currDlSlot->dlInfo.msg4Alloc->msg4PdschCfg,
+ currDlSlot->dlInfo.msg4Alloc->bwp,
+ pduIndex);
+ numPduEncoded++;
+ pduIndex++;
+
+ printf("\033[1;32m");
+ DU_LOG("\nLWR_MAC: MSG4 sent...");
+ printf("\033[0m");
+ }
+ msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+ LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), \
+ (void *)dlTtiReq);
+
+ /* send Tx-DATA req message */
+ sendTxDataReq(currTimingInfo, &currDlSlot->dlInfo);
+ }
+ else
+ {
+ msgLen = sizeof(fapi_dl_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&dlTtiReq->header, FAPI_DL_TTI_REQUEST, msgLen);
+ LwrMacSendToPhy(dlTtiReq->header.msg_id, sizeof(fapi_dl_tti_req_t), (void *)dlTtiReq);
+ }
+ memset(currDlSlot, 0, sizeof(MacDlSlot));
+ return ROK;
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for DL TTI Request");
+ memset(currDlSlot, 0, sizeof(MacDlSlot));
+ return RFAILED;
+ }
+ }
else
{
- lwr_mac_handleInvalidEvt(&currTimingInfo);
- return RFAILED;
+ lwr_mac_procInvalidEvt(&currTimingInfo);
+ return RFAILED;
}
#endif
return ROK;
{
#ifdef INTEL_FAPI
uint8_t nPdu = 0;
+ uint16_t cellIdx;
uint32_t msgLen = 0;
uint16_t pduIndex = 0;
- uint32_t txDataReqMsgSize = 0;
+ uint32_t txDataReqMsgSize = 0;
fapi_tx_data_req_t *txDataReq = NULLP;
- Inst inst = 0;
+
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
/* send TX_Data request message */
nPdu = calcTxDataReqPduCount(dlInfo);
txDataReqMsgSize = sizeof(fapi_tx_data_req_t);
if(dlInfo->brdcstAlloc.sib1Trans)
{
- txDataReqMsgSize += rgCb[inst].cell->macCellCfg.sib1Cfg.sib1PduLen;
+ txDataReqMsgSize += macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen;
}
if(dlInfo->rarAlloc != NULLP)
{
- txDataReqMsgSize += dlInfo->rarAlloc->rarInfo.rarPduLen;
+ txDataReqMsgSize += dlInfo->rarAlloc->rarInfo.rarPduLen;
}
if(dlInfo->msg4Alloc != NULLP)
{
- txDataReqMsgSize += dlInfo->msg4Alloc->msg4Info.msg4PduLen;
+ txDataReqMsgSize += dlInfo->msg4Alloc->msg4Info.msg4PduLen;
}
LWR_MAC_ALLOC(txDataReq, txDataReqMsgSize);
if(txDataReq == NULLP)
{
- DU_LOG("\nLWR_MAC: Failed to allocate memory for TX data Request");
- return RFAILED;
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for TX data Request");
+ return RFAILED;
}
memset(txDataReq, 0, txDataReqMsgSize);
- txDataReq->sfn = currTimingInfo.sfn;
- txDataReq->slot = currTimingInfo.slot;
+ txDataReq->sfn = currTimingInfo.sfn;
+ txDataReq->slot = currTimingInfo.slot;
if(dlInfo->brdcstAlloc.sib1Trans)
{
- fillSib1TxDataReq(txDataReq->pdu_desc,
- &rgCb[inst].cell->macCellCfg, pduIndex);
- pduIndex++;
- txDataReq->num_pdus++;
+ fillSib1TxDataReq(txDataReq->pdu_desc,
+ &macCb.macCell[cellIdx]->macCellCfg, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
}
if(dlInfo->rarAlloc != NULLP)
{
- fillRarTxDataReq(txDataReq->pdu_desc, &dlInfo->rarAlloc->rarInfo, pduIndex);
- pduIndex++;
- txDataReq->num_pdus++;
+ fillRarTxDataReq(txDataReq->pdu_desc, &dlInfo->rarAlloc->rarInfo, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
- MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc));
- dlInfo->rarAlloc = NULLP;
+ MAC_FREE(dlInfo->rarAlloc,sizeof(RarAlloc));
+ dlInfo->rarAlloc = NULLP;
}
if(dlInfo->msg4Alloc != NULLP && dlInfo->msg4Alloc->msg4Info.msg4Pdu != NULLP)
{
- fillMsg4TxDataReq(txDataReq->pdu_desc, &dlInfo->msg4Alloc->\
- msg4Info, pduIndex);
- pduIndex++;
- txDataReq->num_pdus++;
-
- MAC_FREE(dlInfo->msg4Alloc->msg4Info.msg4Pdu,\
- dlInfo->msg4Alloc->msg4Info.msg4PduLen);
- dlInfo->msg4Alloc->msg4Info.msg4Pdu = NULLP;
- MAC_FREE(dlInfo->msg4Alloc,sizeof(Msg4Alloc));
- dlInfo->msg4Alloc = NULLP;
+ fillMsg4TxDataReq(txDataReq->pdu_desc, &dlInfo->msg4Alloc->\
+ msg4Info, pduIndex);
+ pduIndex++;
+ txDataReq->num_pdus++;
+
+ MAC_FREE(dlInfo->msg4Alloc->msg4Info.msg4Pdu,\
+ dlInfo->msg4Alloc->msg4Info.msg4PduLen);
+ dlInfo->msg4Alloc->msg4Info.msg4Pdu = NULLP;
+ MAC_FREE(dlInfo->msg4Alloc,sizeof(Msg4Alloc));
+ dlInfo->msg4Alloc = NULLP;
}
msgLen = txDataReqMsgSize - sizeof(fapi_msg_t);
fillMsgHeader(&txDataReq->header, FAPI_TX_DATA_REQUEST, msgLen);
LwrMacSendToPhy(txDataReq->header.msg_id, txDataReqMsgSize, \
- (void *)txDataReq);
+ (void *)txDataReq);
}
#endif
return ROK;
uint8_t pduCount = 0;
if(ulTtiReq && currUlSlot)
- {
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
- {
- pduCount++;
- ulTtiReq->rachPresent++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
- {
- pduCount++;
- ulTtiReq->nUlsch++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
- {
- pduCount++;
- ulTtiReq->nUlsch++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
- {
- pduCount++;
- ulTtiReq->nUlcch++;
- }
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_SRS)
- {
- pduCount++;
- }
- }
+ {
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
+ {
+ pduCount++;
+ ulTtiReq->rachPresent++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ pduCount++;
+ ulTtiReq->nUlsch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH_UCI)
+ {
+ pduCount++;
+ ulTtiReq->nUlsch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ pduCount++;
+ ulTtiReq->nUlcch++;
+ }
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_SRS)
+ {
+ pduCount++;
+ }
+ }
return pduCount;
}
#endif
{
ulTtiReqPdu->pduType = PRACH_PDU_TYPE;
ulTtiReqPdu->pdu.prach_pdu.physCellId = macCellCfg->phyCellId;
- ulTtiReqPdu->pdu.prach_pdu.numPrachOcas = currUlSlot->ulInfo.prachSchInfo.numPrachOcas;
+ ulTtiReqPdu->pdu.prach_pdu.numPrachOcas = \
+ currUlSlot->ulInfo.prachSchInfo.numPrachOcas;
ulTtiReqPdu->pdu.prach_pdu.prachFormat = \
- currUlSlot->ulInfo.prachSchInfo.prachFormat;
+ currUlSlot->ulInfo.prachSchInfo.prachFormat;
ulTtiReqPdu->pdu.prach_pdu.numRa = currUlSlot->ulInfo.prachSchInfo.numRa;
ulTtiReqPdu->pdu.prach_pdu.prachStartSymbol = \
- currUlSlot->ulInfo.prachSchInfo.prachStartSymb;
+ currUlSlot->ulInfo.prachSchInfo.prachStartSymb;
setNumCs(&ulTtiReqPdu->pdu.prach_pdu.numCs, macCellCfg);
ulTtiReqPdu->pdu.prach_pdu.beamforming.numPrgs = 0;
ulTtiReqPdu->pdu.prach_pdu.beamforming.prgSize = 0;
if(ulTtiReqPdu != NULLP)
{
ulTtiReqPdu->pduType = PUSCH_PDU_TYPE;
- memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
+ memset(&ulTtiReqPdu->pdu.pusch_pdu, 0, sizeof(fapi_ul_pusch_pdu_t));
ulTtiReqPdu->pdu.pusch_pdu.pduBitMap = 1;
ulTtiReqPdu->pdu.pusch_pdu.rnti = currUlSlot->ulInfo.crnti;
- /* TODO : Fill handle in raCb when scheduling pusch and access here */
+ /* TODO : Fill handle in raCb when scheduling pusch and access here */
ulTtiReqPdu->pdu.pusch_pdu.handle = 100;
ulTtiReqPdu->pdu.pusch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb;
ulTtiReqPdu->pdu.pusch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb;
ulTtiReqPdu->pdu.pusch_pdu.subCarrierSpacing = \
- macCellCfg->initialUlBwp.bwp.scs;
+ macCellCfg->initialUlBwp.bwp.scs;
ulTtiReqPdu->pdu.pusch_pdu.cyclicPrefix = \
- macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ macCellCfg->initialUlBwp.bwp.cyclicPrefix;
ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = 308;
ulTtiReqPdu->pdu.pusch_pdu.qamModOrder = 2;
ulTtiReqPdu->pdu.pusch_pdu.mcsIndex = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.mcs;
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.mcs;
ulTtiReqPdu->pdu.pusch_pdu.mcsTable = 0;
ulTtiReqPdu->pdu.pusch_pdu.transformPrecoding = 1;
ulTtiReqPdu->pdu.pusch_pdu.dataScramblingId = currUlSlot->ulInfo.cellId;
ulTtiReqPdu->pdu.pusch_pdu.numDmrsCdmGrpsNoData = 1;
ulTtiReqPdu->pdu.pusch_pdu.dmrsPorts = 0;
ulTtiReqPdu->pdu.pusch_pdu.resourceAlloc = \
- currUlSlot->ulInfo.schPuschInfo.resAllocType;
+ currUlSlot->ulInfo.schPuschInfo.resAllocType;
ulTtiReqPdu->pdu.pusch_pdu.rbStart = \
- currUlSlot->ulInfo.schPuschInfo.fdAlloc.startPrb;
+ currUlSlot->ulInfo.schPuschInfo.fdAlloc.startPrb;
ulTtiReqPdu->pdu.pusch_pdu.rbSize = \
- currUlSlot->ulInfo.schPuschInfo.fdAlloc.numPrb;
+ currUlSlot->ulInfo.schPuschInfo.fdAlloc.numPrb;
ulTtiReqPdu->pdu.pusch_pdu.vrbToPrbMapping = 0;
ulTtiReqPdu->pdu.pusch_pdu.frequencyHopping = 0;
ulTtiReqPdu->pdu.pusch_pdu.txDirectCurrentLocation = 0;
ulTtiReqPdu->pdu.pusch_pdu.uplinkFrequencyShift7p5khz = 0;
ulTtiReqPdu->pdu.pusch_pdu.startSymbIndex = \
- currUlSlot->ulInfo.schPuschInfo.tdAlloc.startSymb;
+ currUlSlot->ulInfo.schPuschInfo.tdAlloc.startSymb;
ulTtiReqPdu->pdu.pusch_pdu.nrOfSymbols = \
- currUlSlot->ulInfo.schPuschInfo.tdAlloc.numSymb;
- ulTtiReqPdu->pdu.pusch_pdu.mappingType = \
- currUlSlot->ulInfo.schPuschInfo.dmrsMappingType;
- ulTtiReqPdu->pdu.pusch_pdu.nrOfDmrsSymbols = \
- currUlSlot->ulInfo.schPuschInfo.nrOfDmrsSymbols;
- ulTtiReqPdu->pdu.pusch_pdu.dmrsAddPos = \
- currUlSlot->ulInfo.schPuschInfo.dmrsAddPos;
+ currUlSlot->ulInfo.schPuschInfo.tdAlloc.numSymb;
+ ulTtiReqPdu->pdu.pusch_pdu.mappingType = \
+ currUlSlot->ulInfo.schPuschInfo.dmrsMappingType;
+ ulTtiReqPdu->pdu.pusch_pdu.nrOfDmrsSymbols = \
+ currUlSlot->ulInfo.schPuschInfo.nrOfDmrsSymbols;
+ ulTtiReqPdu->pdu.pusch_pdu.dmrsAddPos = \
+ currUlSlot->ulInfo.schPuschInfo.dmrsAddPos;
ulTtiReqPdu->pdu.pusch_pdu.puschData.rvIndex = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.rv;
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.rv;
ulTtiReqPdu->pdu.pusch_pdu.puschData.harqProcessId = \
- currUlSlot->ulInfo.schPuschInfo.harqProcId;
+ currUlSlot->ulInfo.schPuschInfo.harqProcId;
ulTtiReqPdu->pdu.pusch_pdu.puschData.newDataIndicator = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.ndi;
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.ndi;
ulTtiReqPdu->pdu.pusch_pdu.puschData.tbSize = \
- currUlSlot->ulInfo.schPuschInfo.tbInfo.tbSize;
- /* numCb is 0 for new transmission */
+ currUlSlot->ulInfo.schPuschInfo.tbInfo.tbSize;
+ /* numCb is 0 for new transmission */
ulTtiReqPdu->pdu.pusch_pdu.puschData.numCb = 0;
ulTtiReqPdu->pduSize = sizeof(fapi_ul_pusch_pdu_t);
}
void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, MacCellCfg *macCellCfg,\
- MacUlSlot *currUlSlot)
+ MacUlSlot *currUlSlot)
{
if(ulTtiReqPdu != NULLP)
{
- ulTtiReqPdu->pduType = PUCCH_PDU_TYPE;
- memset(&ulTtiReqPdu->pdu.pucch_pdu, 0, sizeof(fapi_ul_pucch_pdu_t));
- ulTtiReqPdu->pdu.pucch_pdu.rnti = currUlSlot->ulInfo.schPucchInfo.rnti;
- /* TODO : Fill handle in raCb when scheduling pucch and access here */
- ulTtiReqPdu->pdu.pucch_pdu.handle = 100;
- ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb;
- ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb;
- ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->initialUlBwp.bwp.scs;
- ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
- ulTtiReqPdu->pdu.pucch_pdu.formatType = currUlSlot->ulInfo.schPucchInfo.pucchFormat; /* Supporting PUCCH Format 0 */
- ulTtiReqPdu->pdu.pucch_pdu.multiSlotTxIndicator = 0; /* No Multi Slot transmission */
- ulTtiReqPdu->pdu.pucch_pdu.pi2Bpsk = 0; /* Disabled */
- ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.startPrb;
- ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.numPrb;
- ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = currUlSlot->ulInfo.schPucchInfo.tdAlloc.startSymb;
- ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = currUlSlot->ulInfo.schPucchInfo.tdAlloc.numSymb;
- ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = 0; /* Disabled */
- ulTtiReqPdu->pdu.pucch_pdu.secondHopPrb = 0;
- ulTtiReqPdu->pdu.pucch_pdu.groupHopFlag = 0;
- ulTtiReqPdu->pdu.pucch_pdu.sequenceHopFlag = 0;
- ulTtiReqPdu->pdu.pucch_pdu.hoppingId = 0;
- ulTtiReqPdu->pdu.pucch_pdu.initialCyclicShift = 0;
- ulTtiReqPdu->pdu.pucch_pdu.dataScramblingId = 0; /* Valid for Format 2, 3, 4 */
- ulTtiReqPdu->pdu.pucch_pdu.timeDomainOccIdx = 0; /* Valid for Format 1 */
- ulTtiReqPdu->pdu.pucch_pdu.preDftOccIdx = 0; /* Valid for Format 4 */
- ulTtiReqPdu->pdu.pucch_pdu.preDftOccLen = 0; /* Valid for Format 4 */
- ulTtiReqPdu->pdu.pucch_pdu.addDmrsFlag = 0; /* Valid for Format 3, 4 */
- ulTtiReqPdu->pdu.pucch_pdu.dmrsScramblingId = 0; /* Valid for Format 2 */
- ulTtiReqPdu->pdu.pucch_pdu.dmrsCyclicShift = 0; /* Valid for Format 4 */
- ulTtiReqPdu->pdu.pucch_pdu.srFlag = currUlSlot->ulInfo.schPucchInfo.srFlag;
- ulTtiReqPdu->pdu.pucch_pdu.bitLenHarq = currUlSlot->ulInfo.schPucchInfo.numHarqBits;
- ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart1 = 0; /* Valid for Format 2, 3, 4 */
- ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart2 = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pduType = PUCCH_PDU_TYPE;
+ memset(&ulTtiReqPdu->pdu.pucch_pdu, 0, sizeof(fapi_ul_pucch_pdu_t));
+ ulTtiReqPdu->pdu.pucch_pdu.rnti = currUlSlot->ulInfo.schPucchInfo.rnti;
+ /* TODO : Fill handle in raCb when scheduling pucch and access here */
+ ulTtiReqPdu->pdu.pucch_pdu.handle = 100;
+ ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->initialUlBwp.bwp.scs;
+ ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ ulTtiReqPdu->pdu.pucch_pdu.formatType = currUlSlot->ulInfo.schPucchInfo.pucchFormat; /* Supporting PUCCH Format 0 */
+ ulTtiReqPdu->pdu.pucch_pdu.multiSlotTxIndicator = 0; /* No Multi Slot transmission */
+ ulTtiReqPdu->pdu.pucch_pdu.pi2Bpsk = 0; /* Disabled */
+ ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.startPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.numPrb;
+ ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = currUlSlot->ulInfo.schPucchInfo.tdAlloc.startSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = currUlSlot->ulInfo.schPucchInfo.tdAlloc.numSymb;
+ ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = 0; /* Disabled */
+ ulTtiReqPdu->pdu.pucch_pdu.secondHopPrb = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.groupHopFlag = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.sequenceHopFlag = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.hoppingId = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.initialCyclicShift = 0;
+ ulTtiReqPdu->pdu.pucch_pdu.dataScramblingId = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.timeDomainOccIdx = 0; /* Valid for Format 1 */
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccIdx = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.preDftOccLen = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.addDmrsFlag = 0; /* Valid for Format 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.dmrsScramblingId = 0; /* Valid for Format 2 */
+ ulTtiReqPdu->pdu.pucch_pdu.dmrsCyclicShift = 0; /* Valid for Format 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.srFlag = currUlSlot->ulInfo.schPucchInfo.srFlag;
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenHarq = currUlSlot->ulInfo.schPucchInfo.numHarqBits;
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart1 = 0; /* Valid for Format 2, 3, 4 */
+ ulTtiReqPdu->pdu.pucch_pdu.bitLenCsiPart2 = 0; /* Valid for Format 2, 3, 4 */
ulTtiReqPdu->pdu.pucch_pdu.beamforming.numPrgs = 0; /* Not Supported */
ulTtiReqPdu->pdu.pucch_pdu.beamforming.prgSize = 0;
ulTtiReqPdu->pdu.pucch_pdu.beamforming.digBfInterface = 0;
ulTtiReqPdu->pdu.pucch_pdu.beamforming.rx_bfi[0].beamIdx[0].beamidx = 0;
ulTtiReqPdu->pduSize = sizeof(fapi_ul_pucch_pdu_t);
- }
+ }
}
#endif
*
* @details
*
- * Function : handleUlTtiReq
+ * Function : fillUlTtiReq
*
* Functionality:
* -Sends FAPI Param req to PHY
* RFAILED - failure
*
******************************************************************/
-uint16_t handleUlTtiReq(SlotIndInfo currTimingInfo)
+uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo)
{
#ifdef INTEL_FAPI
+ uint16_t cellIdx;
uint8_t pduIdx = -1;
uint32_t msgLen = 0;
uint32_t msgSize = 0;
fapi_ul_tti_req_t *ulTtiReq = NULLP;
SlotIndInfo ulTtiReqTimingInfo;
- RgCellCb *cellCbParams = NULLP;
MacUlSlot *currUlSlot = NULLP;
MacCellCfg macCellCfg;
- Inst inst = 0;
-
- if(clGlobalCp.phyState == PHY_STATE_RUNNING)
- {
- cellCbParams = rgCb[inst].cell;
- macCellCfg = cellCbParams->macCellCfg;
-
- /* add PHY delta */
- ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA);
-
- currUlSlot = &macCb.macCell->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
- msgSize = sizeof(fapi_ul_tti_req_t);
- LWR_MAC_ALLOC(ulTtiReq, msgSize);
-
- if(ulTtiReq != NULLP)
- {
- memset(ulTtiReq, 0, msgSize);
- ulTtiReq->sfn = ulTtiReqTimingInfo.sfn;
- ulTtiReq->slot = ulTtiReqTimingInfo.slot;
- ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
- ulTtiReq->nGroup = 0;
- if(ulTtiReq->nPdus > 0)
- {
- /* Fill Prach Pdu */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
- {
- pduIdx++;
- fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
- }
-
- /* Fill PUSCH PDU */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
- {
- pduIdx++;
- fillPuschPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
- }
- /* Fill PUCCH PDU */
- if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
- {
- pduIdx++;
- fillPucchPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
- }
- }
- msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
- fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
-
- DU_LOG("\nLWR_MAC: Sending UL TTI Request");
- LwrMacSendToPhy(ulTtiReq->header.msg_id, msgSize, (void *)ulTtiReq);
-
- memset(currUlSlot, 0, sizeof(MacUlSlot));
- return ROK;
- }
- else
- {
- DU_LOG("\nLWR_MAC: Failed to allocate memory for UL TTI Request");
- memset(currUlSlot, 0, sizeof(MacUlSlot));
- return RFAILED;
- }
- }
+
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
+ {
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+ macCellCfg = macCb.macCell[cellIdx]->macCellCfg;
+
+ /* add PHY delta */
+ ADD_DELTA_TO_TIME(currTimingInfo,ulTtiReqTimingInfo,PHY_DELTA);
+
+ currUlSlot = &macCb.macCell[cellIdx]->ulSlot[ulTtiReqTimingInfo.slot % MAX_SLOT_SUPPORTED];
+ msgSize = sizeof(fapi_ul_tti_req_t);
+ LWR_MAC_ALLOC(ulTtiReq, msgSize);
+
+ if(ulTtiReq != NULLP)
+ {
+ memset(ulTtiReq, 0, msgSize);
+ ulTtiReq->sfn = ulTtiReqTimingInfo.sfn;
+ ulTtiReq->slot = ulTtiReqTimingInfo.slot;
+ ulTtiReq->nPdus = getnPdus(ulTtiReq, currUlSlot);
+ ulTtiReq->nGroup = 0;
+ if(ulTtiReq->nPdus > 0)
+ {
+ /* Fill Prach Pdu */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PRACH)
+ {
+ pduIdx++;
+ fillPrachPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+
+ /* Fill PUSCH PDU */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_PUSCH)
+ {
+ pduIdx++;
+ fillPuschPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+ /* Fill PUCCH PDU */
+ if(currUlSlot->ulInfo.dataType & SCH_DATATYPE_UCI)
+ {
+ pduIdx++;
+ fillPucchPdu(&ulTtiReq->pdus[pduIdx], &macCellCfg, currUlSlot);
+ }
+ }
+ msgLen = sizeof(fapi_ul_tti_req_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&ulTtiReq->header, FAPI_UL_TTI_REQUEST, msgLen);
+
+ DU_LOG("\nLWR_MAC: Sending UL TTI Request");
+ LwrMacSendToPhy(ulTtiReq->header.msg_id, msgSize, (void *)ulTtiReq);
+
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return ROK;
+ }
+ else
+ {
+ DU_LOG("\nLWR_MAC: Failed to allocate memory for UL TTI Request");
+ memset(currUlSlot, 0, sizeof(MacUlSlot));
+ return RFAILED;
+ }
+ }
else
{
- lwr_mac_handleInvalidEvt(&currTimingInfo);
+ lwr_mac_procInvalidEvt(&currTimingInfo);
}
#endif
return ROK;
{
{
/* PHY_STATE_IDLE */
- lwr_mac_handleParamReqEvt,
- lwr_mac_handleParamRspEvt,
- lwr_mac_handleConfigReqEvt,
- lwr_mac_handleConfigRspEvt,
- lwr_mac_handleInvalidEvt,
- lwr_mac_handleInvalidEvt,
+ lwr_mac_procParamReqEvt,
+ lwr_mac_procParamRspEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procInvalidEvt,
},
{
- /* PHY_STATE_CONFIGURED */
- lwr_mac_handleParamReqEvt,
- lwr_mac_handleParamRspEvt,
- lwr_mac_handleConfigReqEvt,
- lwr_mac_handleConfigRspEvt,
- lwr_mac_handleStartReqEvt,
- lwr_mac_handleInvalidEvt,
+ /* PHY_STATE_CONFIGURED */
+ lwr_mac_procParamReqEvt,
+ lwr_mac_procParamRspEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procStartReqEvt,
+ lwr_mac_procInvalidEvt,
},
{
- /* PHY_STATE_RUNNING */
- lwr_mac_handleInvalidEvt,
- lwr_mac_handleInvalidEvt,
- lwr_mac_handleConfigReqEvt,
- lwr_mac_handleConfigRspEvt,
- lwr_mac_handleInvalidEvt,
- lwr_mac_handleStopReqEvt,
+ /* PHY_STATE_RUNNING */
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procConfigReqEvt,
+ lwr_mac_procConfigRspEvt,
+ lwr_mac_procInvalidEvt,
+ lwr_mac_procStopReqEvt,
}
};
*
* @return void
*
-******************************************************************/
+ ******************************************************************/
void sendToLowerMac(uint16_t msgType, uint32_t msgLen, void *msg)
{
- clGlobalCp.event = msgType;
- fapiEvtHdlr[clGlobalCp.phyState][clGlobalCp.event](msg);
+ lwrMacCb.event = msgType;
+ fapiEvtHdlr[lwrMacCb.phyState][lwrMacCb.event](msg);
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#define CORESET_TYPE2 2
#define CORESET_TYPE3 3
-
-#include "lwr_mac.h"
-
-#ifdef INTEL_FAPI
-#include "fapi.h"
-#endif
-
typedef enum{
SI_RNTI_TYPE,
RA_RNTI_TYPE,
TC_RNTI_TYPE
}RntiType;
-S16 lwr_mac_handleInvalidEvt(void *msg);
-S16 lwr_mac_handleParamReqEvt(void *msg);
-S16 lwr_mac_handleParamRspEvt(void *msg);
-S16 lwr_mac_handleConfigReqEvt(void *msg);
-S16 lwr_mac_handleConfigRspEvt(void *msg);
-S16 lwr_mac_handleStartReqEvt(void *msg);
-S16 lwr_mac_handleStopReqEvt(void *msg);
-void sendToLowerMac(U16, U32, void *);
-void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
-
-typedef S16 (*lwrMacFsmHdlr)(void *);
+uint8_t lwr_mac_procInvalidEvt(void *msg);
+uint8_t lwr_mac_procParamReqEvt(void *msg);
+uint8_t lwr_mac_procParamRspEvt(void *msg);
+uint8_t lwr_mac_procConfigReqEvt(void *msg);
+uint8_t lwr_mac_procConfigRspEvt(void *msg);
+uint8_t lwr_mac_procStartReqEvt(void *msg);
+uint8_t lwr_mac_procStopReqEvt(void *msg);
+void sendToLowerMac(uint16_t, uint32_t, void *);
+void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
+
+typedef uint8_t (*lwrMacFsmHdlr)(void *);
#endif
/**********************************************************************
/* header include files (.h) */
#include "common_def.h"
-#include "tfu.h" /* RGU Interface defines */
+#include "lrg.h"
#ifdef INTEL_FAPI
#include "fapi.h"
#endif
/* header/extern include files (.x) */
-#include "tfu.x" /* RGU Interface includes */
-#include "du_log.h"
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac.h"
#include "lwr_mac_fsm.h"
#include "lwr_mac_phy.h"
#include "lwr_mac_upr_inf.h"
-#include "rg.h"
+#include "mac.h"
+#include "mac_utils.h"
#ifdef INTEL_FAPI
/* Function pointer for slot indication from lower mac to mac */
fapiMacRxDataInd,
packRxDataInd
};
-
+
/* Function pointer for stop indication from lower mac to mac */
packStopIndMsg sendStopIndOpts[] =
{
*
* @details
*
- * Function : handleSlotInd
+ * Function : procSlotInd
*
* Functionality:
* Processes Slot Indication from PHY and sends to MAC
* RFAILED - failure
*
* ****************************************************************/
-U16 handleSlotInd(fapi_slot_ind_t *fapiSlotInd)
+uint8_t procSlotInd(fapi_slot_ind_t *fapiSlotInd)
{
/* fill Pst structure to send to lwr_mac to MAC */
Pst pst;
fillLwrMacToMacPst(&pst);
pst.event = EVENT_SLOT_IND_TO_MAC;
+ slotInd.cellId = lwrMacCb.cellCb[0].cellId;
slotInd.sfn = fapiSlotInd->sfn;
slotInd.slot = fapiSlotInd->slot;
*
* @details
*
- * Function : handleStopInd
+ * Function : procStopInd
*
* Functionality:
* Handles Stop Indication received from PHY
* RFAILED - failure
*
* ****************************************************************/
-uint8_t handleStopInd()
+uint8_t procStopInd()
{
uint8_t ret;
Pst pst;
- clGlobalCp.phyState = PHY_STATE_CONFIGURED;
+ lwrMacCb.phyState = PHY_STATE_CONFIGURED;
+ lwrMacCb.cellCb[0].state = PHY_STATE_CONFIGURED;
DU_LOG("\nLWR_MAC: PHY has moved to configured state");
fillLwrMacToMacPst(&pst);
pst.event = EVENT_STOP_IND_TO_MAC;
- ret = (*sendStopIndOpts[pst.selector])(&pst);
+ ret = (*sendStopIndOpts[pst.selector])(&pst, \
+ lwrMacCb.cellCb[0].cellId);
return ret;
}
/*******************************************************************
*
* @details
*
- * Function : handleRachInd
+ * Function : procRachInd
*
* Functionality:
* Processes Rach Indication from PHY and sends to MAC
* RFAILED - failure
*
* ****************************************************************/
-uint8_t handleRachInd(fapi_rach_indication_t *fapiRachInd)
+uint8_t procRachInd(fapi_rach_indication_t *fapiRachInd)
{
Pst pst;
uint8_t pduIdx;
RachPduInfo *rachPdu;
RachInd rachInd;
+ rachInd.cellId = lwrMacCb.cellCb[0].cellId;
rachInd.timingInfo.sfn = fapiRachInd->sfn;
rachInd.timingInfo.slot = fapiRachInd->slot;
rachInd.numPdu = fapiRachInd->numPdus;
rachPdu->numPream = fapiRachInd->rachPdu[pduIdx].numPreamble;
for(prmbleIdx=0; prmbleIdx<rachPdu->numPream; prmbleIdx++)
{
- rachPdu->preamInfo[prmbleIdx].preamIdx = \
- fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].preambleIndex;
- rachPdu->preamInfo[prmbleIdx].timingAdv = \
- fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].timingAdvance;
+ rachPdu->preamInfo[prmbleIdx].preamIdx = \
+ fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].preambleIndex;
+ rachPdu->preamInfo[prmbleIdx].timingAdv = \
+ fapiRachInd->rachPdu[pduIdx].preambleInfo[prmbleIdx].timingAdvance;
}
}
fillLwrMacToMacPst(&pst);
pst.event = EVENT_RACH_IND_TO_MAC;
(*sendRachIndOpts[pst.selector])(&pst, &rachInd);
- return ROK;
+ return ROK;
}/* handleRachInd */
*
* @details
*
- * Function : handleCrcInd
+ * Function : procCrcInd
*
* Functionality:
* Handles CRC indication from PHY and sends to MAC
*
* ****************************************************************/
-uint8_t handleCrcInd(fapi_crc_ind_t *fapiCrcInd)
+uint8_t procCrcInd(fapi_crc_ind_t *fapiCrcInd)
{
Pst pst;
uint8_t crcInfoIdx;
CrcInfo *crcIndInfo;
CrcInd crcInd;
+ crcInd.cellId = lwrMacCb.cellCb[0].cellId;
crcInd.timingInfo.sfn = fapiCrcInd->sfn;
crcInd.timingInfo.slot = fapiCrcInd->slot;
crcInd.numCrc = fapiCrcInd->numCrcs;
crcIndInfo->numCb = fapiCrcInd->crc[crcInfoIdx].numCb;
for(crcStatusIdx = 0; crcStatusIdx < crcIndInfo->numCb; crcStatusIdx++)
{
- crcIndInfo->cbCrcStatus[crcStatusIdx] = \
- fapiCrcInd->crc[crcInfoIdx].cbCrcStatus[crcStatusIdx];
+ crcIndInfo->cbCrcStatus[crcStatusIdx] = \
+ fapiCrcInd->crc[crcInfoIdx].cbCrcStatus[crcStatusIdx];
}
crcIndInfo->ul_cqi = fapiCrcInd->crc[crcInfoIdx].ul_cqi;
crcIndInfo->timingAdvance = fapiCrcInd->crc[crcInfoIdx].timingAdvance;
fillLwrMacToMacPst(&pst);
pst.event = EVENT_CRC_IND_TO_MAC;
-
+
(*sendCrcIndOpts[pst.selector])(&pst, &crcInd);
return ROK;
*
* @details
*
- * Function : handleRxDataInd
+ * Function : procRxDataInd
*
* Functionality:
* Handles Rx Data indication from PHY and sends to MAC
* RFAILED - failure
*
* ****************************************************************/
-
-uint8_t handleRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd)
+
+uint8_t procRxDataInd(fapi_rx_data_indication_t *fapiRxDataInd)
{
Pst pst;
uint8_t pduIdx;
RxDataInd rxDataInd;
RxDataIndPdu *pdu;
+ rxDataInd.cellId = lwrMacCb.cellCb[0].cellId;
rxDataInd.timingInfo.sfn = fapiRxDataInd->sfn;
rxDataInd.timingInfo.slot = fapiRxDataInd->slot;
rxDataInd.numPdus = fapiRxDataInd->numPdus;
fillLwrMacToMacPst(&pst);
pst.event = EVENT_RX_DATA_IND_TO_MAC;
-
+
(*sendRxDataIndOpts[pst.selector])(&pst, &rxDataInd);
return ROK;
}
#endif /* FAPI */
-void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)
+void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)
{
#ifdef INTEL_FAPI
/* extract the header */
{
case FAPI_PARAM_RESPONSE:
case FAPI_CONFIG_RESPONSE:
- {
- sendToLowerMac(msgType, msgSize, msg);
- break;
- }
+ {
+ sendToLowerMac(msgType, msgSize, msg);
+ break;
+ }
case FAPI_SLOT_INDICATION:
- {
- if(clGlobalCp.phyState == PHY_STATE_CONFIGURED)
- {
- DU_LOG("\nLWR_MAC: PHY has moved to running state");
- clGlobalCp.phyState = PHY_STATE_RUNNING;
- }
-
- fapi_slot_ind_t *slotInd;
- slotInd = (fapi_slot_ind_t *)msg;
- handleSlotInd(slotInd);
- break;
- }
+ {
+ if(lwrMacCb.phyState == PHY_STATE_CONFIGURED)
+ {
+ DU_LOG("\nLWR_MAC: PHY has moved to running state");
+ lwrMacCb.phyState = PHY_STATE_RUNNING;
+ lwrMacCb.cellCb[0].state = PHY_STATE_RUNNING;
+ }
+
+ fapi_slot_ind_t *slotInd;
+ slotInd = (fapi_slot_ind_t *)msg;
+ procSlotInd(slotInd);
+ break;
+ }
case FAPI_ERROR_INDICATION:
- {
- break;
- }
+ {
+ break;
+ }
case FAPI_RX_DATA_INDICATION:
- {
- fapi_rx_data_indication_t *rxDataInd;
- rxDataInd = (fapi_rx_data_indication_t *)msg;
- handleRxDataInd(rxDataInd);
- break;
- }
+ {
+ fapi_rx_data_indication_t *rxDataInd;
+ rxDataInd = (fapi_rx_data_indication_t *)msg;
+ procRxDataInd(rxDataInd);
+ break;
+ }
case FAPI_CRC_INDICATION:
- {
- fapi_crc_ind_t *crcInd;
- crcInd = (fapi_crc_ind_t *)msg;
- handleCrcInd(crcInd);
- break;
- }
+ {
+ fapi_crc_ind_t *crcInd;
+ crcInd = (fapi_crc_ind_t *)msg;
+ procCrcInd(crcInd);
+ break;
+ }
case FAPI_UCI_INDICATION:
- {
- break;
- }
+ {
+ break;
+ }
case FAPI_SRS_INDICATION:
- {
- break;
- }
+ {
+ break;
+ }
case FAPI_RACH_INDICATION:
- {
- fapi_rach_indication_t *rachInd;
- rachInd = (fapi_rach_indication_t *)msg;
- handleRachInd(rachInd);
- break;
- }
+ {
+ fapi_rach_indication_t *rachInd;
+ rachInd = (fapi_rach_indication_t *)msg;
+ procRachInd(rachInd);
+ break;
+ }
case FAPI_STOP_INDICATION:
- {
- DU_LOG("\nLWR_MAC: Handling Stop Indication");
- handleStopInd();
- break;
- }
+ {
+ DU_LOG("\nLWR_MAC: Handling Stop Indication");
+ procStopInd();
+ break;
+ }
}
#ifdef INTEL_WLS
WLS_MEM_FREE(msg, LWR_MAC_WLS_BUF_SIZE);
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* This file contains APIs to send/receive messages from PHY */
#include "common_def.h"
-#include "rg.h"
+#include "lrg.h"
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
+#include "mac.h"
#include "lwr_mac_phy.h"
#include "lwr_mac_fsm.h"
+#include "mac_utils.h"
#ifdef INTEL_WLS
#include "wls_lib.h"
#endif
-EXTERN S16 rgClHndlCfgReq ARGS((void *msg));
+EXTERN uint8_t rgClHndlCfgReq ARGS((void *msg));
EXTERN void l1ProcessFapiRequest ARGS((uint8_t msgType, uint32_t msgLen, void *msg));
#ifdef INTEL_WLS
void *wlsHdlr;
WLS_MEM_ALLOC(memPtr, LWR_MAC_WLS_BUF_SIZE);
-
+
if(memPtr)
{
wlsHdlr = mtGetWlsHdl();
-
+
/* allocate blocks for UL transmittion */
while(WLS_EnqueueBlock(wlsHdlr, WLS_VA2PA(wlsHdlr, memPtr)))
{
- WLS_MEM_ALLOC(memPtr, LWR_MAC_WLS_BUF_SIZE);
- if(!memPtr)
- break;
+ WLS_MEM_ALLOC(memPtr, LWR_MAC_WLS_BUF_SIZE);
+ if(!memPtr)
+ break;
}
-
+
// free not enqueued block
if(memPtr)
{
- WLS_MEM_FREE(memPtr, LWR_MAC_WLS_BUF_SIZE);
+ WLS_MEM_FREE(memPtr, LWR_MAC_WLS_BUF_SIZE);
}
}
}/* LwrMacEnqueueWlsBlock */
{
void *memPtr;
void *wlsHdlr; /* WLS handler */
-
+
wlsHdlr = mtGetWlsHdl();
while(numBlocks)
{
WLS_MEM_ALLOC(memPtr, LWR_MAC_WLS_BUF_SIZE);
if(memPtr)
{
- WLS_EnqueueBlock(wlsHdlr, WLS_VA2PA(wlsHdlr, memPtr));
+ WLS_EnqueueBlock(wlsHdlr, WLS_VA2PA(wlsHdlr, memPtr));
}
}
- RETVALUE(ROK);
+ return ROK;
}/* enqueueNBlocks */
/*******************************************************************
MAC_ALLOC(node, sizeof(CmLList));
if(node)
{
- block->ptr = msg;
- block->size = msgLen;
+ block->ptr = msg;
+ block->size = msgLen;
- node->node = (PTR)block;
- cmLListAdd2Tail(&wlsBlockToFreeList[idx], node);
+ node->node = (PTR)block;
+ cmLListAdd2Tail(&wlsBlockToFreeList[idx], node);
}
}
}/* addWlsBlockToFree */
CM_LLIST_FIRST_NODE(&wlsBlockToFreeList[idx], node);
while(node)
{
- block = (WlsBlockToFree *)node->node;
- cmLListDelFrm(&wlsBlockToFreeList[idx], node);
- WLS_MEM_FREE(block->ptr, block->size);
- MAC_FREE(block, sizeof(WlsBlockToFree));
- MAC_FREE(node, sizeof(CmLList));
- node = NULL;
- CM_LLIST_FIRST_NODE(&wlsBlockToFreeList[idx], node);
+ block = (WlsBlockToFree *)node->node;
+ cmLListDelFrm(&wlsBlockToFreeList[idx], node);
+ WLS_MEM_FREE(block->ptr, block->size);
+ MAC_FREE(block, sizeof(WlsBlockToFree));
+ MAC_FREE(node, sizeof(CmLList));
+ node = NULL;
+ CM_LLIST_FIRST_NODE(&wlsBlockToFreeList[idx], node);
}
}
}
if(WLS_Ready(wlsHdlr))
{
numToGet = WLS_Wait(wlsHdlr);
-
+
numL1Msg = numToGet;
while(numToGet)
{
- l1Msg = (uint64_t) NULL;
- l1Msg = WLS_Get(wlsHdlr, &msgSize, &msgType, &flag);
- if(l1Msg)
- {
- l1MsgPtr = WLS_PA2VA(wlsHdlr, l1Msg);
- handlePhyMessages(msgType, msgSize, l1MsgPtr);
- }
- numToGet--;
+ l1Msg = (uint64_t) NULL;
+ l1Msg = WLS_Get(wlsHdlr, &msgSize, &msgType, &flag);
+ if(l1Msg)
+ {
+ l1MsgPtr = WLS_PA2VA(wlsHdlr, l1Msg);
+ handlePhyMessages(msgType, msgSize, l1MsgPtr);
+ }
+ numToGet--;
}
-
+
if(numL1Msg)
{
- enqueueNBlocks(numL1Msg);
+ enqueueNBlocks(numL1Msg);
}
}
#ifdef INTEL_WLS
int ret;
unsigned long long pMsg;
-
+
pMsg = WLS_VA2PA(mtGetWlsHdl(), msg);
ret = WLS_Put(mtGetWlsHdl(), pMsg, msgLen, msgType, 0);
if(ret != 0)
{
printf("\nFailure in sending message to PHY");
- WLS_MEM_FREE(msg, msgLen);
+ WLS_MEM_FREE(msg, msgLen);
return RFAILED;
}
else
} /* LwrMacSendToPhy */
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#endif
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packCrcInd(Pst *pst, CrcInd *crcInd)
+uint8_t packCrcInd(Pst *pst, CrcInd *crcInd)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd)
+uint8_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
return ROK;
}
- else
- {
- return RFAILED;
- }
+ return RFAILED;
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packRachInd(Pst *pst, RachInd *rachInd)
+uint8_t packRachInd(Pst *pst, RachInd *rachInd)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
}
return RFAILED;
}
-
+
/*******************************************************************
*
* @brief Loose coupled packing of slot indication
* RFAILED - failure
*
* ****************************************************************/
-S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd)
+uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd)
{
Buffer *mBuf = NULLP;
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
-
+
/* pack SFN and slot value */
CMCHKPK(SPkU16,slotInd->sfn, mBuf);
CMCHKPK(SPkU16,slotInd->slot, mBuf);
-
- RETVALUE(SPstTsk(pst,mBuf));
+
+ return SPstTsk(pst,mBuf);
}
-
+
/*******************************************************************
*
* @brief Light weight loose coupled packing of slot indication
* RFAILED - failure
*
* ****************************************************************/
-S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd)
+uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd)
{
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packStopInd(Pst *pst)
+uint8_t packStopInd(Pst *pst, uint16_t cellId)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#ifndef __LWR_MAC_UPR_INF_H__
#define __LWR_MAC_UPR_INF_H__
-#include "tfu.h"
-
-/* header/extern include files (.x) */
-#include "tfu.x"
+
+#define MAX_PREAMBLE_PER_SLOT 1 /* Max number of preamble per slot */
+#define MAX_RACH_PDU_PER_SLOT 1 /* Max number of rach pdu per slot */
+#define MAX_CRCS_PER_SLOT 1
+#define MAX_CB_PER_TTI_IN_BYTES 1
+#define MAX_ULSCH_PDUS_PER_TTI 1
/* events */
-#define EVENT_RACH_IND_TO_MAC 0
-#define EVENT_CRC_IND_TO_MAC 1
+#define EVENT_RACH_IND_TO_MAC 0
+#define EVENT_CRC_IND_TO_MAC 1
#define EVENT_RX_DATA_IND_TO_MAC 2
-#define EVENT_STOP_IND_TO_MAC 3
+#define EVENT_STOP_IND_TO_MAC 3
+#define EVENT_SLOT_IND_TO_MAC 4
+
+typedef struct rachPreamInfo
+{
+ uint8_t preamIdx;
+ uint16_t timingAdv;
+}RachPreamInfo;
+
+typedef struct rachPduInfo
+{
+ uint16_t pci;
+ uint8_t symbolIdx;
+ uint8_t slotIdx;
+ uint8_t freqIdx;
+ uint8_t numPream;
+ RachPreamInfo preamInfo[MAX_PREAMBLE_PER_SLOT];
+}RachPduInfo;
+
+typedef struct rachInd
+{
+ uint16_t cellId;
+ SlotIndInfo timingInfo;
+ uint8_t numPdu;
+ RachPduInfo rachPdu[MAX_RACH_PDU_PER_SLOT];
+}RachInd;
+
+typedef struct crcInfo
+{
+ uint32_t handle;
+ uint16_t rnti;
+ uint8_t harqId;
+ uint8_t tbCrcStatus;
+ uint16_t numCb;
+ uint8_t cbCrcStatus[MAX_CB_PER_TTI_IN_BYTES];
+ uint8_t ul_cqi;
+ uint16_t timingAdvance;
+ uint16_t rssi;
+}CrcInfo;
+
+typedef struct crcInd
+{
+ uint16_t cellId;
+ SlotIndInfo timingInfo;
+ uint16_t numCrc;
+ CrcInfo crcInfo[MAX_CRCS_PER_SLOT];
+}CrcInd;
+
+typedef struct
+{
+ uint32_t handle;
+ uint16_t rnti;
+ uint8_t harqId;
+ uint16_t pduLength;
+ uint8_t ul_cqi;
+ uint16_t timingAdvance;
+ uint16_t rssi;
+ uint8_t *pduData;
+}RxDataIndPdu;
+
+typedef struct
+{
+ uint16_t cellId;
+ SlotIndInfo timingInfo;
+ uint16_t numPdus;
+ RxDataIndPdu pdus[MAX_ULSCH_PDUS_PER_TTI];
+}RxDataInd;
+
+typedef uint8_t (*packSlotIndMsg)(Pst *pst, SlotIndInfo *slotInd);
+uint8_t packLcSlotInd (Pst *pst, SlotIndInfo *slotInd);
+uint8_t packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd);
-typedef S16 (*packSlotIndMsg)(Pst *pst, SlotIndInfo *slotInd);
-S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd);
-S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd);
+uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd);
-typedef uint16_t (*packRachIndMsg)(Pst *pst, RachInd *rachInd);
-uint16_t packRachInd(Pst *pst, RachInd *rachInd);
-uint16_t fapiMacRachInd(Pst *pst, RachInd *rachInd);
+typedef uint8_t (*packRachIndMsg)(Pst *pst, RachInd *rachInd);
+uint8_t packRachInd(Pst *pst, RachInd *rachInd);
+uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd);
-typedef uint16_t (*packCrcIndMsg)(Pst *pst, CrcInd *crcInd);
-uint16_t packCrcInd(Pst *pst, CrcInd *crcInd);
-uint16_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd);
+typedef uint8_t (*packCrcIndMsg)(Pst *pst, CrcInd *crcInd);
+uint8_t packCrcInd(Pst *pst, CrcInd *crcInd);
+uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd);
-typedef uint16_t (*packRxDataIndMsg)(Pst *pst, RxDataInd *rxDataInd);
-uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd);
-uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd);
+typedef uint8_t (*packRxDataIndMsg)(Pst *pst, RxDataInd *rxDataInd);
+uint8_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd);
+uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd);
-typedef uint16_t (*packStopIndMsg)(Pst *pst);
-uint16_t packStopInd(Pst *pst);
-uint16_t fapiMacStopInd(Pst *pst);
+typedef uint8_t (*packStopIndMsg)(Pst *pst, uint16_t cellId);
+uint8_t packStopInd(Pst *pst, uint16_t cellId);
+uint8_t fapiMacStopInd(Pst *pst, uint16_t cellId);
#endif
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
* NULLP - failure
*
* ****************************************************************/
-PUBLIC ClCellCb * rgClUtlGetCellCb
+PUBLIC LwrMacCellCb * lwrMacGetCellCb
(
- U16 cellId
+ uint16_t cellId
)
{
- ClCellCb *cellCb;
+ LwrMacCellCb *cellCb;
- if(cellId >= MAX_NUM_CELL_SUPP)
+ if(cellId >= MAX_NUM_CELL)
{
printf("\n Invalid Cell Id [%d]. rgClUtlGetCellCb failed.", cellId);
- RETVALUE(NULLP);
+ return NULLP;
}
-
- cmHashListFind((CmHashListCp *)&clGlobalCp.cellCbLst, (U8 *)&cellId, sizeof(U16), 0, (PTR *)&cellCb);
- RETVALUE(cellCb);
+ cellCb = &lwrMacCb.cellCb[cellId -1];
+
+ return cellCb;
}
/*******************************************************************
for (i = 0; i < numBits; i++)
{
if((num & (1 << i)))
- reverse_num |= 1 << ((numBits - 1) - i);
+ reverse_num |= 1 << ((numBits - 1) - i);
}
return reverse_num;
}
* ****************************************************************/
void fillDlDciPayload(uint8_t *buf, uint8_t *bytePos, uint8_t *bitPos,\
- uint32_t val, uint8_t valSize)
+ uint32_t val, uint8_t valSize)
{
uint8_t temp;
uint8_t bytePart1;
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#ifndef _MAC_H_
#define _MAC_H_
-#include <stdio.h>
-
-/* header include files (.h) */
-#include "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-#include "gen.h" /* general */
-#include "ssi.h" /* system services */
-#include "cm_tkns.h" /* Common Token Defines */
-#include "cm_llist.h" /* Common Link List Defines */
-#include "cm_hash.h" /* Common Hash List Defines */
-#include "cm_lte.h" /* Common LTE Defines */
-#include "cm_mblk.h" /* Common LTE Defines */
-#include "rgu.h" /* RGU interface includes*/
-#include "tfu.h" /* TFU Interface defines */
-#include "lrg.h"
-#include "du_app_mac_inf.h"
-#include "mac_sch_interface.h"
-#include "rg.h"
-
-/* header/extern include files (.x) */
-#include "gen.x" /* general */
-#include "ssi.x" /* system services */
-#include "cm_tkns.x" /* Common Token Definitions */
-#include "cm_llist.x" /* Common Link List Definitions */
-#include "cm_lib.x" /* Common Library Definitions */
-#include "cm_hash.x" /* Common Hash List Definitions */
-#include "cm_lte.x" /* Common LTE Defines */
-#include "cm_mblk.x" /* Common LTE Defines */
-#include "rgu.x"
-#include "tfu.x" /* RGU Interface includes */
-#include "lrg.x"
-
-#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */
-#define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
-#define SI_RNTI 0xFFFF
-#define P_RNTI 0xFFFE
+/* MAX values */
#define MAX_MAC_CE 6
-#define MAX_UE 1
#define MAX_CRI_SIZE 6
#define MAX_MAC_DL_PDU 10
#define MAX_NUM_HARQ_PROC 16
+#define MAX_SLOT_SUPPORTED 10 /* numerology 0 15Khz */
+#define MAX_ZERO_CORR_CFG_IDX 16 /* max zero correlation config index */
+
+#define DEFAULT_CELLS 1
+#define SI_RNTI 0xFFFF
+#define P_RNTI 0xFFFE
#define PERIODIC_BSR_TMR_1MS 1
#define PERIODIC_BSR_TMR_5MS 5
struct macCellCb
{
uint16_t cellId;
- MacRaCbInfo macRaCb[MAX_UE];
+ MacRaCbInfo macRaCb[MAX_NUM_UE];
MacDlSlot dlSlot[MAX_SLOT_SUPPORTED];
MacUlSlot ulSlot[MAX_SLOT_SUPPORTED];
uint16_t numActvUe;
- MacUeCb ueCb[MAX_UE];
+ MacUeCb ueCb[MAX_NUM_UE];
+ MacCellCfg macCellCfg;
+ SlotIndInfo currTime;
};
typedef struct macCb
{
Inst macInst;
ProcId procId;
- MacCellCb *macCell;
+ MacCellCb *macCell[MAX_NUM_CELL];
}MacCb;
/* global variable */
MacCb macCb;
-void fillMacToSchPst(Pst *pst);
void fillRarPdu(RarInfo *rarInfo);
void createMacRaCb(uint16_t cellId, uint16_t crnti);
-void fillMsg4DlData(MacDlData *dlData, uint8_t *msg4Pdu);
+void fillMsg4DlData(uint16_t cellId, MacDlData *dlData, uint8_t *msg4Pdu);
void fillMacCe(MacCeInfo *macCeData, uint8_t *msg3Pdu);
void macMuxPdu(MacDlData *dlData, MacCeInfo *macCeData, uint8_t *msg4TxPdu, uint16_t tbSize);
-int unpackRxData(RxDataIndPdu *rxDataIndPdu);
-uint16_t macSendUlCcchInd(uint8_t *rrcContainer, uint16_t cellId, uint16_t crnti);
+uint8_t unpackRxData(uint16_t cellId, RxDataIndPdu *rxDataIndPdu);
+uint8_t macSendUlCcchInd(uint8_t *rrcContainer, uint16_t cellId, uint16_t crnti);
void fillMg4Pdu(Msg4Alloc *msg4Alloc);
void buildAndSendMuxPdu(SlotIndInfo currTimingInfo);
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2017-2019] [Radisys] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+/* This file stores handler for MAC and SCH configuration requests */
+/* header include files (.h) */
+#include "common_def.h"
+#include "lrg.h"
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
+#include "mac.h"
+#include "mac_upr_inf_api.h"
+#include "lwr_mac.h"
+#include "lwr_mac_fsm.h"
+#include "mac_utils.h"
+
+uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
+
+packMacCellCfgConfirm packMacCellCfmOpts[] =
+{
+ packMacCellCfgCfm, /* packing for loosely coupled */
+ duHandleMacCellCfgCfm, /* packing for tightly coupled */
+ packMacCellCfgCfm, /* packing for light weight loosly coupled */
+};
+
+SchCellCfgFunc SchCellCfgOpts[] =
+{
+ packSchCellCfg, /* packing for loosely coupled */
+ SchHdlCellCfgReq, /* packing for tightly coupled */
+ packSchCellCfg /* packing for light weight loosly coupled */
+};
+
+
+/**
+ * @brief Layer Manager Configuration request handler for Scheduler
+ *
+ * @details
+ *
+ * Function : MacSchGenCfgReq
+ *
+ * This function receives general configurations for Scheduler
+ * from DU APP and forwards to Scheduler.
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] RgMngmt *cfg, the configuration parameter's structure
+ * @return
+ * -# ROK
+ **/
+PUBLIC int MacSchGenCfgReq(Pst *pst, RgMngmt *cfg)
+{
+ printf("\nReceived Scheduler gen config at MAC");
+ pst->dstInst = DEFAULT_CELLS + 1;
+ SchProcGenCfgReq(pst, cfg);
+
+ return ROK;
+}
+
+/**
+ * @brief Layer Manager Configuration response from Scheduler
+ *
+ * @details
+ *
+ * Function : SchSendCfgCfm
+ *
+ * This function sends general configurations response from
+ * Scheduler to DU APP.
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] RgMngmt *cfm, the configuration confirm structure
+ * @return
+ * -# ROK
+ **/
+PUBLIC uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm)
+{
+ printf("\nSending Scheduler config confirm to DU APP");
+ pst->dstEnt = ENTDUAPP;
+ pst->dstInst = 0;
+ pst->srcInst = 0;
+ pst->selector = ODU_SELECTOR_LC;
+ RgMiLrgSchCfgCfm(pst, cfm);
+
+ return ROK;
+}
+
+/**
+ * @brief Layer Manager Configuration request handler.
+ *
+ * @details
+ *
+ * Function : MacProcCellCfgReq
+ *
+ * This function handles the gNB and cell configuration
+ * request received from DU APP.
+ * This API unapcks and forwards the config towards SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] MacCellCfg *macCellCfg
+ * @return
+ * -# ROK
+ **/
+uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
+{
+ Pst cfmPst;
+ uint16_t cellIdx;
+ uint16_t ret = ROK;
+ MacCellCb *macCellCb;
+
+ cmMemset((uint8_t *)&cfmPst, 0, sizeof(Pst));
+
+ MAC_ALLOC(macCellCb, sizeof(MacCellCb));
+ if(macCellCb == NULLP)
+ {
+ DU_LOG("\nMAC : macCellCb is NULL at handling of macCellCfg\n");
+ return RFAILED;
+ }
+ memset(macCellCb, 0, sizeof(MacCellCb));
+
+ GET_CELL_IDX(macCellCfg->cellId, cellIdx);
+ macCb.macCell[cellIdx] = macCellCb;
+ macCb.macCell[cellIdx]->cellId = macCellCfg->cellId;
+ memcpy(&macCb.macCell[cellIdx]->macCellCfg, macCellCfg, sizeof(MacCellCfg));
+
+ MAC_ALLOC(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, \
+ macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
+ if(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu == NULLP)
+ {
+ DU_LOG("\nMAC : macCellCb is NULL at handling of sib1Pdu of macCellCfg\n");
+ return RFAILED;
+ }
+ memcpy(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1Pdu, \
+ macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
+
+ /* Send cell cfg to scheduler */
+ ret = MacSchCellCfgReq(pst, macCellCfg);
+ if(ret != ROK)
+ {
+ MacCellCfgCfm macCellCfgCfm;
+ macCellCfgCfm.rsp = RSP_NOK;
+ macCellCfgCfm.cellId = macCellCfg->cellId;
+ /* Fill Pst */
+ FILL_PST_MAC_TO_DUAPP(cfmPst, EVENT_MAC_CELL_CONFIG_CFM);
+ cfmPst.selector = ODU_SELECTOR_LC;
+
+ ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
+ }
+ else
+ {
+ if(macCellCfg->prachCfg.fdm[0].numUnusedRootSeq != 0)
+ {
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->prachCfg.fdm[0].unsuedRootSeq,
+ macCellCfg->prachCfg.fdm[0].numUnusedRootSeq* sizeof(uint8_t));
+ }
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg ,sizeof(MacCellCfg));
+ }
+#ifdef INTEL_WLS
+ LwrMacEnqueueWlsBlock();
+#endif
+ return ret;
+} /* end of MacProcCellCfgReq */
+
+/**
+ * @brief Layer Manager Configuration request handler.
+ *
+ * @details
+ *
+ * Function : MacSchCellCfgReq
+ *
+ * This function sends cell configuration to SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] MacCellCfg *macCellCfg
+ * @return
+ * -# ROK
+ **/
+uint8_t MacSchCellCfgReq(Pst *pst, MacCellCfg *macCellCfg)
+{
+ SchCellCfg schCellCfg;
+ Pst cfgPst;
+ int ret;
+
+ cmMemset((uint8_t *)&cfgPst, 0, sizeof(Pst));
+ schCellCfg.cellId = macCellCfg->cellId;
+ schCellCfg.phyCellId = macCellCfg->phyCellId;
+ schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
+ schCellCfg.dupMode = macCellCfg->dupType;
+
+ /* fill ssb scheduler parameters */
+ schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
+ schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
+ schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
+ schCellCfg.ssbSchCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod;
+ schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
+ for(uint8_t idx=0; idx<SSB_MASK_SIZE; idx++)
+ {
+ schCellCfg.ssbSchCfg.nSSBMask[idx] = macCellCfg->ssbCfg.ssbMask[idx];
+ }
+
+ /* fill SIB1 scheduler parameters */
+ schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen;
+ schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod;
+ schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod;
+ schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex;
+ schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex;
+ schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs;
+
+ /* fill RACH config params */
+ schCellCfg.schRachCfg.prachCfgIdx = macCellCfg->prachCfg.prachCfgIdx;
+ schCellCfg.schRachCfg.prachSubcSpacing = \
+ macCellCfg->prachCfg.prachSubcSpacing;
+ schCellCfg.schRachCfg.msg1FreqStart = macCellCfg->prachCfg.msg1FreqStart;
+ schCellCfg.schRachCfg.msg1Fdm = macCellCfg->prachCfg.msg1Fdm;
+ schCellCfg.schRachCfg.rootSeqLen = macCellCfg->prachCfg.rootSeqLen;
+ schCellCfg.schRachCfg.rootSeqIdx = macCellCfg->prachCfg.fdm[0].rootSeqIdx;
+ schCellCfg.schRachCfg.numRootSeq = macCellCfg->prachCfg.fdm[0].numRootSeq;
+ schCellCfg.schRachCfg.k1 = macCellCfg->prachCfg.fdm[0].k1;
+ schCellCfg.schRachCfg.ssbPerRach = macCellCfg->prachCfg.ssbPerRach;
+ schCellCfg.schRachCfg.prachMultCarrBand = \
+ macCellCfg->prachCfg.prachMultCarrBand;
+ schCellCfg.schRachCfg.raContResTmr = macCellCfg->prachCfg.raContResTmr;
+ schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb;
+ schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow;
+
+ /* fill initial DL BWP */
+ schCellCfg.schInitialDlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialDlBwp.bwp.firstPrb;
+ schCellCfg.schInitialDlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialDlBwp.bwp.numPrb;
+ schCellCfg.schInitialDlBwp.bwp.scs = macCellCfg->initialDlBwp.bwp.scs;
+ schCellCfg.schInitialDlBwp.bwp.cyclicPrefix = macCellCfg->initialDlBwp.bwp.cyclicPrefix;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.coresetId =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.coresetId;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.duration =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.duration;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1 =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2 =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4 =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8 =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8;
+ schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16 =
+ macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16;
+ schCellCfg.schInitialDlBwp.pdschCommon.k0 = macCellCfg->initialDlBwp.pdschCommon.k0;
+ schCellCfg.schInitialDlBwp.pdschCommon.mappingType =
+ macCellCfg->initialDlBwp.pdschCommon.mappingType;
+ schCellCfg.schInitialDlBwp.pdschCommon.startSymbol =
+ macCellCfg->initialDlBwp.pdschCommon.startSymbol;
+ schCellCfg.schInitialDlBwp.pdschCommon.lengthSymbol =
+ macCellCfg->initialDlBwp.pdschCommon.lengthSymbol;
+
+ /* fill initial UL BWP */
+ schCellCfg.schInitialUlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialUlBwp.bwp.firstPrb;
+ schCellCfg.schInitialUlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialUlBwp.bwp.numPrb;
+ schCellCfg.schInitialUlBwp.bwp.scs = macCellCfg->initialUlBwp.bwp.scs;
+ schCellCfg.schInitialUlBwp.bwp.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
+ schCellCfg.schInitialUlBwp.puschCommon.k2 = macCellCfg->initialUlBwp.puschCommon.k2;
+ schCellCfg.schInitialUlBwp.puschCommon.mappingType =
+ macCellCfg->initialUlBwp.puschCommon.mappingType;
+ schCellCfg.schInitialUlBwp.puschCommon.startSymbol =
+ macCellCfg->initialUlBwp.puschCommon.startSymbol;
+ schCellCfg.schInitialUlBwp.puschCommon.lengthSymbol =
+ macCellCfg->initialUlBwp.puschCommon.lengthSymbol;
+
+ FILL_PST_MAC_TO_SCH(cfgPst, EVENT_SCH_CELL_CFG);
+
+ ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg);
+ return ret;
+} /* end of MacSchCellCfgReq */
+
+
+/*******************************************************************
+ *
+ * @brief Sends Cell config confirm to DU APP
+ *
+ * @details
+ *
+ * Function : MacSendCellCfgCfm
+ *
+ * Functionality:
+ * Sends Cell config confirm to DU APP
+ *
+ * @params[in] Response status
+ * @return void
+ *
+ * ****************************************************************/
+void MacSendCellCfgCfm(uint16_t cellId, uint8_t response)
+{
+ Pst pst;
+ uint16_t cellIdx;
+ MacCellCfgCfm macCellCfgCfm;
+
+ cmMemset((uint8_t *)&pst, 0, sizeof(Pst));
+
+ GET_CELL_IDX(cellId, cellIdx);
+ macCellCfgCfm.cellId = macCb.macCell[cellIdx]->macCellCfg.cellId;
+ macCellCfgCfm.rsp = response;
+
+ /* Fill Pst */
+ FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_CELL_CONFIG_CFM);
+ pst.selector = ODU_SELECTOR_LC;
+
+ (*packMacCellCfmOpts[pst.selector])(&pst,&macCellCfgCfm);
+}
+
+
+/**
+ * @brief Layer Manager Configuration response handler.
+ *
+ * @details
+ *
+ * Function : MacProcSchCellCfgCfm
+ *
+ * This function processes cell configuration to SCH
+ *
+ * @param[in] Pst *pst
+ * @param[in] SchCellCfgCfm *schCellCfgCfm
+ * @return int
+ * -# ROK
+ **/
+uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
+{
+ uint16_t *cellId = NULLP;
+
+ if(schCellCfgCfm->rsp == RSP_OK)
+ {
+ cellId = &schCellCfgCfm->cellId;
+ sendToLowerMac(CONFIG_REQUEST, 0, (void *)cellId);
+ }
+ else
+ {
+ MacSendCellCfgCfm(schCellCfgCfm->cellId, RSP_NOK);
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief MAC handler for config response from PHY
+ *
+ * @details
+ *
+ * Function : fapiMacConfigRsp
+ *
+ * Functionality:
+ * Processes config response from PHY and sends cell config
+ * confirm to DU APP
+ *
+ * @params[in]
+ * @return void
+ *
+ * ****************************************************************/
+void fapiMacConfigRsp(uint16_t cellId)
+{
+ /* TODO : Processing of config response from PHY */
+
+ /* Send cell config cfm to DU APP */
+ MacSendCellCfgCfm(cellId, RSP_OK);
+}
+
+/**********************************************************************
+ End of file
+ **********************************************************************/
/* header include files -- defines (.h) */
#include "common_def.h"
-#include "du_log.h"
-#include "du_app_mac_inf.h"
#include "lrg.h" /* Layer manager interface includes*/
-#include "crg.h" /* CRG interface includes*/
-#include "tfu.h" /* TFU interface includes */
-#include "rgu.h" /* RGU interface includes*/
-#include "rg_sch_inf.h" /* SCH interface includes */
-#include "rg_env.h" /* MAC environmental includes*/
-#include "rg.h" /* MAC includes*/
-#include "rg_err.h" /* MAC error includes*/
-
-/* header/extern include files (.x) */
-#include "tfu.x" /* RGU types */
#include "lrg.x" /* layer management typedefs for MAC */
-#include "crg.x" /* CRG interface includes */
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "rgu.x" /* RGU types */
-#include "rg_sch_inf.x" /* SCH interface typedefs */
-#include "rg_prg.x" /* PRG (MAC-MAC) Interface typedefs */
-#include "rg.x" /* typedefs for MAC */
+#include "mac_utils.h"
+
/*******************************************************************
*
* @brief De-mux of MAC-Sub PDUs from Rx Data Ind Pdu
* RFAILED
*
* ****************************************************************/
-int unpackRxData(RxDataIndPdu *rxDataIndPdu)
+uint8_t unpackRxData(uint16_t cellId, RxDataIndPdu *rxDataIndPdu)
{
uint8_t lcId;
uint8_t idx = 0;
uint8_t *pdu;
uint16_t pduLen;
uint8_t *rxDataPdu;
+ uint16_t cellIdx;
+ GET_CELL_IDX(cellId, cellIdx);
pduLen = rxDataIndPdu->pduLength;
rxDataPdu = rxDataIndPdu->pduData;
switch(lcId)
{
- 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);
-
- /* Send UL-CCCH Indication to DU APP */
- macSendUlCcchInd(pdu, macCb.macCell->cellId, rxDataIndPdu->rnti);
- 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("\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[cellIdx]->macRaCb[0].msg3Pdu, pdu, length);
+
+ /* Send UL-CCCH Indication to DU APP */
+ macSendUlCcchInd(pdu, macCb.macCell[cellIdx]->cellId, rxDataIndPdu->rnti);
+ 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;
+ }
} /* End of switch */
- if(lcId == MAC_LCID_PADDING)
- break;
+ if(lcId == MAC_LCID_PADDING)
+ break;
} /* End of While */
} /* End of unpackRxData */
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* header include files -- defines (.h) */
#include "common_def.h"
-#include "rgu.h"
-#include "tfu.h"
-#include "rg_sch_inf.h"
-#include "rg_env.h"
#include "lrg.h"
-#include "crg.h"
-#include "rg.h"
-#include "du_log.h"
-#include "lwr_mac.h"
-
-/* header/extern include files (.x) */
-#include "rgu.x"
-#include "tfu.x"
-#include "rg_sch_inf.x"
+#include "rgu.h"
#include "lrg.x"
-#include "crg.x"
-#include "rg_prg.x"
+#include "rgu.x"
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
#include "mac_upr_inf_api.h"
-#include "rg.x"
+#include "lwr_mac.h"
+#ifdef INTEL_FAPI
+#include "fapi_interface.h"
+#endif
#include "lwr_mac_fsm.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
+#include "mac_utils.h"
/* This file contains message handling functionality for MAC */
* RFAILED - failure
*
****************************************************************/
-int sendDlRlcBoInfoMacToSch(DlRlcBOInfo *dlBoInfo)
+uint8_t sendDlRlcBoInfoMacToSch(DlRlcBOInfo *dlBoInfo)
{
Pst pst;
- fillMacToSchPst(&pst);
- pst.event = EVENT_DL_RLC_BO_INFO_TO_SCH;
-
+ FILL_PST_MAC_TO_SCH(pst, EVENT_DL_RLC_BO_INFO_TO_SCH);
return(*macSchDlRlcBoInfoOpts[pst.selector])(&pst, dlBoInfo);
}
* RFAILED - failure
*
****************************************************************/
-int sendCrcIndMacToSch(CrcIndInfo *crcInd)
+uint8_t sendCrcIndMacToSch(CrcIndInfo *crcInd)
{
Pst pst;
- fillMacToSchPst(&pst);
- pst.event = EVENT_CRC_IND_TO_SCH;
-
+ FILL_PST_MAC_TO_SCH(pst, EVENT_CRC_IND_TO_SCH);
return(*macSchCrcIndOpts[pst.selector])(&pst, crcInd);
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd)
+uint8_t fapiMacCrcInd(Pst *pst, CrcInd *crcInd)
{
+ uint16_t cellIdx;
CrcIndInfo crcIndInfo;
DU_LOG("\nMAC : Received CRC indication");
+ GET_CELL_IDX(crcInd->cellId, cellIdx);
/* Considering one pdu and one preamble */
- crcIndInfo.cellId = macCb.macCell->cellId;;
+ crcIndInfo.cellId = macCb.macCell[cellIdx]->cellId;;
crcIndInfo.crnti = crcInd->crcInfo[0].rnti;
crcIndInfo.timingInfo.sfn = crcInd->timingInfo.sfn;
crcIndInfo.timingInfo.slot = crcInd->timingInfo.slot;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
+uint8_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd)
{
uint16_t pduIdx;
for(pduIdx = 0; pduIdx < rxDataInd->numPdus; pduIdx++)
{
- unpackRxData(&rxDataInd->pdus[pduIdx]);
+ unpackRxData(rxDataInd->cellId, &rxDataInd->pdus[pduIdx]);
}
return ROK;
}
*
* @details
*
- * Function : MacHdlCellStartReq
+ * Function : MacProcCellStartReq
*
* Functionality:
* Handles cell start reuqest from DU APP
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
+uint8_t MacProcCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
{
DU_LOG("\nMAC : Handling cell start request");
sendToLowerMac(START_REQUEST, 0, cellStartInfo);
*
* @details
*
- * Function : MacHdlCellStartReq
+ * Function : MacProcCellStartReq
*
* Functionality:
* Handles cell stop request from DU APP
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
+uint8_t MacProcCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
{
#ifdef INTEL_FAPI
DU_LOG("\nMAC : Sending cell stop request to Lower Mac");
*
* @details
*
- * Function : MacHdlDlCcchInd
+ * Function : MacProcDlCcchInd
*
* Functionality:
* Handles DL CCCH Ind from DU APP
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacHdlDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
+uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
{
+ uint16_t cellIdx;
uint16_t idx;
DlRlcBOInfo dlBoInfo;
memset(&dlBoInfo, 0, sizeof(DlRlcBOInfo));
DU_LOG("\nMAC : Handling DL CCCH IND");
- /* TODO : Fill DL RLC Buffer status info */
+ GET_CELL_IDX(dlCcchIndInfo->cellId, cellIdx);
+
dlBoInfo.cellId = dlCcchIndInfo->cellId;
dlBoInfo.crnti = dlCcchIndInfo->crnti;
dlBoInfo.numLc = 0;
dlBoInfo.numLc++;
/* storing Msg4 Pdu in raCb */
- if(macCb.macCell->macRaCb[0].crnti == dlCcchIndInfo->crnti)
+ if(macCb.macCell[cellIdx]->macRaCb[0].crnti == dlCcchIndInfo->crnti)
{
- macCb.macCell->macRaCb[0].msg4PduLen = dlCcchIndInfo->dlCcchMsgLen;
- MAC_ALLOC(macCb.macCell->macRaCb[0].msg4Pdu, \
- macCb.macCell->macRaCb[0].msg4PduLen);
- if(macCb.macCell->macRaCb[0].msg4Pdu)
+ macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen = dlCcchIndInfo->dlCcchMsgLen;
+ MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu, \
+ macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
+ if(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu)
{
for(idx = 0; idx < dlCcchIndInfo->dlCcchMsgLen; idx++)
{
- macCb.macCell->macRaCb[0].msg4Pdu[idx] =\
+ macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu[idx] =\
dlCcchIndInfo->dlCcchMsg[idx];
}
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t macSendUlCcchInd(uint8_t *rrcContainer, uint16_t cellId, uint16_t crnti)
+uint8_t macSendUlCcchInd(uint8_t *rrcContainer, uint16_t cellId, uint16_t crnti)
{
Pst pst;
uint8_t ret = ROK;
ulCcchIndInfo->ulCcchMsg = rrcContainer;
/* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTRG;
- pst.dstEnt = ENTDUAPP;
- pst.dstInst = 0;
- pst.srcInst = macCb.macInst;
- pst.dstProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.srcProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.region = MAC_MEM_REGION;
- pst.pool = MAC_POOL;
- pst.event = EVENT_MAC_UL_CCCH_IND;
- pst.route = 0;
- pst.prior = 0;
- pst.intfVer = 0;
+ FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_UL_CCCH_IND);
if(MacDuAppUlCcchInd(&pst, ulCcchIndInfo) != ROK)
{
/* header include files -- defines (.h) */
#include "common_def.h"
#include "lrg.h" /* Layer manager interface includes*/
-#include "crg.h" /* CRG interface includes*/
-#include "rgu.h" /* RGU interface includes*/
-#include "tfu.h" /* TFU interface includes */
-#include "rg_sch_inf.h" /* SCH interface includes */
-#include "rg_prg.h" /* PRG (MAC-MAC) interface includes*/
-#include "rg_env.h" /* MAC environmental includes*/
-#include "rg.h" /* MAC includes*/
-#include "rg_err.h" /* MAC error includes*/
-#include "du_log.h"
-
-/* header/extern include files (.x) */
-#include "rgu.x" /* RGU types */
-#include "tfu.x" /* RGU types */
#include "lrg.x" /* layer management typedefs for MAC */
-#include "crg.x" /* CRG interface includes */
-#include "rg_sch_inf.x" /* SCH interface typedefs */
-#include "rg_prg.x" /* PRG (MAC-MAC) Interface typedefs */
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "rg.x" /* typedefs for MAC */
/*******************************************************************
*
uint32_t bytePart2;
uint8_t bytePart1Size;
uint32_t bytePart2Size;
-
+
if(*bitPos - valSize + 1 >= 0)
{
bytePart1 = (uint8_t)val;
buf[*bytePos] |= bytePart1;
if(*bitPos - valSize < 0)
{
- *bitPos = 7;
- (*bytePos)++;
+ *bitPos = 7;
+ (*bytePos)++;
}
else
- *bitPos -= valSize;
+ *bitPos -= valSize;
}
else
{
bytePart1 = (val >> bytePart2Size) << (*bitPos -bytePart1Size +1);
bytePart2 = (~((~temp) << bytePart2Size)) & val;
-
+
buf[*bytePos] |= bytePart1;
(*bytePos)++;
*bitPos = 7;
uint16_t timeAdv = 0;
uint32_t ulGrant = 0;
uint16_t tmpCrnti = 0;
- uint8_t paddingLcid = 63;
+ 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;
+ uint8_t paddingLcidSize = 6;
+ uint8_t paddingSize = 8;
/* Size(in bits) of RAR payload fields */
EBit = 0;
TBit = 1;
rapId = rarInfo->RAPID;
-
+
RBit = 0;
timeAdv = rarInfo->ta;
ulGrant = 0; /* this will be done when implementing msg3 */
/* Calulating total number of bytes in buffer */
totalBits = EBitSize + TBitSize + rapidSize + RBitSize + timeAdvSize \
- + ulGrantSize + tmpCrntiSize;
+ + ulGrantSize + tmpCrntiSize;
/* add padding size */
- totalBits += RBitSize*2 + paddingLcidSize + paddingSize;
-
+ totalBits += RBitSize*2 + paddingLcidSize + paddingSize;
+
/* Calulating total number of bytes in buffer */
numBytes = totalBits/8;
if(totalBits % 8)
numBytes += 1;
-
- rarInfo->rarPduLen = numBytes;
+
+ rarInfo->rarPduLen = numBytes;
/* Initialize buffer */
for(bytePos = 0; bytePos < numBytes; bytePos++)
rarPdu[bytePos] = 0;
-
+
bytePos = 0;
bitPos = 7;
packBytes(rarPdu, &bytePos, &bitPos, ulGrant, ulGrantSize);
packBytes(rarPdu, &bytePos, &bitPos, tmpCrnti, tmpCrntiSize);
- /* padding of 2 bytes */
+ /* padding of 2 bytes */
packBytes(rarPdu, &bytePos, &bitPos, RBit, RBitSize*2);
packBytes(rarPdu, &bytePos, &bitPos, paddingLcid, paddingLcidSize);
packBytes(rarPdu, &bytePos, &bitPos, 0, paddingSize);
-
+
}
/*******************************************************************
void createMacRaCb(uint16_t cellId, uint16_t crnti)
{
uint8_t idx = 0; /* supporting 1 UE */
- macCb.macCell->macRaCb[idx].cellId = cellId;
- macCb.macCell->macRaCb[idx].crnti = crnti;
+ uint16_t cellIdx;
+
+ GET_CELL_IDX(cellId, cellIdx);
+
+ macCb.macCell[cellIdx]->macRaCb[idx].cellId = cellId;
+ macCb.macCell[cellIdx]->macRaCb[idx].crnti = crnti;
}
/*************************************************
* msg4Pdu pointer
************************************************/
-void fillMsg4DlData(MacDlData *dlData, uint8_t *msg4Pdu)
+void fillMsg4DlData(uint16_t cellId, MacDlData *dlData, uint8_t *msg4Pdu)
{
uint8_t idx = 0;
uint16_t idx2;
+ uint16_t cellIdx;
+
+ GET_CELL_IDX(cellId, cellIdx);
+
dlData->numPdu = 1;
dlData->pduInfo[idx].lcId = MAC_LCID_CCCH;
- dlData->pduInfo[idx].pduLen = macCb.macCell->macRaCb[idx].msg4PduLen;
+ dlData->pduInfo[idx].pduLen = macCb.macCell[cellIdx]->macRaCb[idx].msg4PduLen;
for(idx2 = 0; idx2 < dlData->pduInfo[idx].pduLen; idx2++)
- {
+ {
dlData->pduInfo[idx].dlPdu[idx2] = msg4Pdu[idx2];
- }
+ }
}
/*************************************************
{
macCeInfo->macCe[idx].macCeLcid = MAC_LCID_CRI;
memcpy(macCeInfo->macCe[idx].macCeValue, \
- msg3Pdu, MAX_CRI_SIZE);
+ msg3Pdu, MAX_CRI_SIZE);
}
}
lcid = macCeData->macCe[idx].macCeLcid;
switch(lcid)
{
- case MAC_LCID_CRI:
- {
- /* Packing fields into MAC PDU R/R/LCID */
- packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
- packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
- memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
- MAX_CRI_SIZE);
- bytePos += MAX_CRI_SIZE;
- break;
- }
- default:
- DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
- break;
+ case MAC_LCID_CRI:
+ {
+ /* Packing fields into MAC PDU R/R/LCID */
+ packBytes(macPdu, &bytePos, &bitPos, RBit, (RBitSize * 2));
+ packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+ memcpy(&macPdu[bytePos], macCeData->macCe[idx].macCeValue,\
+ MAX_CRI_SIZE);
+ bytePos += MAX_CRI_SIZE;
+ break;
+ }
+ default:
+ DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
+ break;
}
}
lcid = dlData->pduInfo[idx].lcId;
switch(lcid)
{
- case MAC_LCID_CCCH:
- {
- lenField = dlData->pduInfo[idx].pduLen;
- if(dlData->pduInfo[idx].pduLen > 255)
- {
- FBit = 1;
- lenFieldSize = 16;
-
- }
- else
- {
- FBit = 0;
- lenFieldSize = 8;
- }
- /* Packing fields into MAC PDU R/F/LCID/L */
- packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
- packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
- packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
- packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
- memcpy(&macPdu[bytePos], dlData->pduInfo[idx].dlPdu, lenField);
- bytePos += lenField;
- break;
- }
-
- default:
- DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
- break;
+ case MAC_LCID_CCCH:
+ {
+ lenField = dlData->pduInfo[idx].pduLen;
+ if(dlData->pduInfo[idx].pduLen > 255)
+ {
+ FBit = 1;
+ lenFieldSize = 16;
+
+ }
+ else
+ {
+ FBit = 0;
+ lenFieldSize = 8;
+ }
+ /* Packing fields into MAC PDU R/F/LCID/L */
+ packBytes(macPdu, &bytePos, &bitPos, RBit, RBitSize);
+ packBytes(macPdu, &bytePos, &bitPos, FBit, FBitSize);
+ packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
+ packBytes(macPdu, &bytePos, &bitPos, lenField, lenFieldSize);
+ memcpy(&macPdu[bytePos], dlData->pduInfo[idx].dlPdu, lenField);
+ bytePos += lenField;
+ break;
+ }
+
+ default:
+ DU_LOG("\n MAC: Invalid LCID %d in mac pdu",lcid);
+ break;
}
}
packBytes(macPdu, &bytePos, &bitPos, lcid, lcidSize);
}
- /*Storing the muxed pdu in macRaCb */
+ /*Storing the muxed pdu in macRaCb */
if(msg4TxPdu != NULLP)
{
- memcpy(msg4TxPdu, macPdu, tbSize);
+ memcpy(msg4TxPdu, macPdu, tbSize);
}
}
*******************************************************************************/
/* header include files (.h) */
#include "common_def.h"
-#include "tfu.h" /* RGU Interface includes */
#include "lrg.h"
-
-#include "tfu.x" /* RGU Interface includes */
#include "lrg.x"
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "du_log.h"
+#include "mac_utils.h"
/* Function pointer for sending rach ind from MAC to SCH */
MacSchRachIndFunc macSchRachIndOpts[]=
* RFAILED - failure
*
* ****************************************************************/
-int sendRachIndMacToSch(RachIndInfo *rachInd)
+uint8_t sendRachIndMacToSch(RachIndInfo *rachInd)
{
Pst pst;
-
- fillMacToSchPst(&pst);
- pst.event = EVENT_RACH_IND_TO_SCH;
-
+
+ FILL_PST_MAC_TO_SCH(pst, EVENT_RACH_IND_TO_SCH);
return(*macSchRachIndOpts[pst.selector])(&pst, rachInd);
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t fapiMacRachInd(Pst *pst, RachInd *rachInd)
+uint8_t fapiMacRachInd(Pst *pst, RachInd *rachInd)
{
uint8_t pduIdx;
uint8_t preambleIdx;
rachIndInfo.symbolIdx = rachInd->rachPdu[pduIdx].symbolIdx;
rachIndInfo.freqIdx = rachInd->rachPdu[pduIdx].freqIdx;
rachIndInfo.preambleIdx = \
- rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].preamIdx;
+ rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].preamIdx;
rachIndInfo.timingAdv = \
- rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].timingAdv;
+ rachInd->rachPdu[pduIdx].preamInfo[preambleIdx].timingAdv;
/* storing the value in macRaCb */
createMacRaCb(rachIndInfo.cellId, rachIndInfo.crnti);
uint8_t UnrestrictedSetNcsTable[MAX_ZERO_CORR_CFG_IDX] =
{0, 2, 4, 6, 8, 10, 12, 13, 15, 17, 19, 23, 27, 34, 46, 69};
-int MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
+/*******************************************************************
+ *
+ * @brief Processes UL scheduling info from SCH
+ *
+ * @details
+ *
+ * Function : MacProcUlSchInfo
+ *
+ * Functionality: Processes UL scheduling info from SCH
+ *
+ * @params[in] Post structure
+ * UL scheduling info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
{
+ uint16_t cellIdx;
+
+ GET_CELL_IDX(ulSchedInfo->cellId, cellIdx);
if(ulSchedInfo != NULLP)
- {
+ {
MacUlSlot *currUlSlot =
- &macCb.macCell->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED];
+ &macCb.macCell[cellIdx]->ulSlot[ulSchedInfo->slotIndInfo.slot % MAX_SLOT_SUPPORTED];
memcpy(&currUlSlot->ulInfo, ulSchedInfo, sizeof(UlSchedInfo));
}
return ROK;
*******************************************************************************/
/* header include files (.h) */
#include "common_def.h"
-#include "rgu.h"
-#include "tfu.h" /* RGU Interface includes */
#include "lrg.h"
-#include "crg.h" /* layer management defines for LTE-MAC */
-#include "rg_sch_inf.h" /* layer management defines for LTE-MAC */
-#include "rg_env.h"
-#include "rg.h"
-
-#include "rgu.x"
-#include "tfu.x" /* RGU Interface includes */
#include "lrg.x"
-#include "crg.x" /* layer management typedefs for MAC */
-#include "rg_sch_inf.x" /* SCH interface typedefs */
-#include "rg_prg.x"
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "du_log.h"
-#include "rg.x"
#include "mac_upr_inf_api.h"
+#include "lwr_mac_fsm.h"
+#include "mac_utils.h"
+
+/* Function declarations */
+extern uint16_t fillUlTtiReq(SlotIndInfo currTimingInfo);
+extern uint16_t fillDlTtiReq(SlotIndInfo currTimingInfo);
/* function pointers for packing slot ind from mac to sch */
MacSchSlotIndFunc macSchSlotIndOpts[] =
*
* @param[in] Pst *pst
* @param[in] DL allocation from scheduler
- * @return S16
+ * @return
* -# ROK
* -# RFAILED
**/
-int MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
+uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
{
+ uint16_t cellIdx;
MacDlSlot *currDlSlot = NULLP;
if(dlSchedInfo != NULLP)
{
- if(dlSchedInfo->isBroadcastPres)
- {
- currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
- currDlSlot->dlInfo.isBroadcastPres = true;
- memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
- }
-
- if(dlSchedInfo->rarAlloc != NULLP)
- {
- currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
- currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
-
- /* MUXing of RAR */
- fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
- }
-
- if(dlSchedInfo->msg4Alloc != NULLP)
+ GET_CELL_IDX(dlSchedInfo->cellId, cellIdx);
+ if(dlSchedInfo->isBroadcastPres)
{
- Msg4Alloc *msg4Alloc = NULLP;
- currDlSlot = &macCb.macCell->dlSlot[dlSchedInfo->schSlotValue.msg4Time.slot];
- currDlSlot->dlInfo.msg4Alloc = dlSchedInfo->msg4Alloc; /* copy msg4 alloc pointer in MAC slot info */
- msg4Alloc = dlSchedInfo->msg4Alloc;
- macCb.macCell->macRaCb[0].msg4TbSize = msg4Alloc->msg4PdschCfg.codeword[0].tbSize;
+ currDlSlot = &macCb.macCell[cellIdx]->\
+ dlSlot[dlSchedInfo->schSlotValue.broadcastTime.slot];
+ currDlSlot->dlInfo.isBroadcastPres = true;
+ memcpy(&currDlSlot->dlInfo.brdcstAlloc, &dlSchedInfo->brdcstAlloc, sizeof(DlBrdcstAlloc));
+ }
+
+ if(dlSchedInfo->rarAlloc != NULLP)
+ {
+ currDlSlot = &macCb.macCell[cellIdx]->\
+ dlSlot[dlSchedInfo->schSlotValue.rarTime.slot];
+ currDlSlot->dlInfo.rarAlloc = dlSchedInfo->rarAlloc;
+
+ /* MUXing of RAR */
+ fillRarPdu(&currDlSlot->dlInfo.rarAlloc->rarInfo);
+ }
+
+ if(dlSchedInfo->msg4Alloc != NULLP)
+ {
+ Msg4Alloc *msg4Alloc = NULLP;
+ currDlSlot = &macCb.macCell[cellIdx]->\
+ dlSlot[dlSchedInfo->schSlotValue.msg4Time.slot];
+ currDlSlot->dlInfo.msg4Alloc = dlSchedInfo->msg4Alloc; /* copy msg4 alloc pointer in MAC slot info */
+ msg4Alloc = dlSchedInfo->msg4Alloc;
+ macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize = msg4Alloc->msg4PdschCfg.codeword[0].tbSize;
}
}
return ROK;
* @param[in] Msg4Alloc *msg4Alloc
* @return void
**/
-void fillMsg4Pdu(Msg4Alloc *msg4Alloc)
+void fillMsg4Pdu(uint16_t cellId, Msg4Alloc *msg4Alloc)
{
+ uint16_t cellIdx;
MacDlData msg4DlData;
MacCeInfo macCeData;
+ GET_CELL_IDX(cellId, cellIdx);
+
memset(&msg4DlData, 0, sizeof(MacDlData));
memset(&macCeData, 0, sizeof(MacCeInfo));
-
- if(macCb.macCell->macRaCb[0].msg4Pdu != NULLP)
+
+ if(macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu != NULLP)
{
MAC_ALLOC(msg4DlData.pduInfo[0].dlPdu, \
- macCb.macCell->macRaCb[0].msg4PduLen);
+ macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
if(msg4DlData.pduInfo[0].dlPdu != NULLP)
{
- fillMsg4DlData(&msg4DlData, macCb.macCell->macRaCb[0].msg4Pdu);
- fillMacCe(&macCeData, macCb.macCell->macRaCb[0].msg3Pdu);
- /* Forming Mux Pdu */
- macCb.macCell->macRaCb[0].msg4TxPdu = NULLP;
- MAC_ALLOC(macCb.macCell->macRaCb[0].msg4TxPdu, macCb.macCell->macRaCb[0].msg4TbSize);
- if(macCb.macCell->macRaCb[0].msg4TxPdu != NULLP)
- {
- memset(macCb.macCell->macRaCb[0].msg4TxPdu, 0, macCb.macCell->macRaCb[0].msg4TbSize);
- macMuxPdu(&msg4DlData, &macCeData, macCb.macCell->macRaCb[0].msg4TxPdu,\
- macCb.macCell->macRaCb[0].msg4TbSize);
-
- }
- else
- {
- DU_LOG("\nMAC: Failed allocating memory for msg4TxPdu");
- }
- /* Free memory allocated */
- MAC_FREE(msg4DlData.pduInfo[0].dlPdu, macCb.macCell->macRaCb[0].msg4PduLen);
+ fillMsg4DlData(cellId, &msg4DlData, macCb.macCell[cellIdx]->macRaCb[0].msg4Pdu);
+ fillMacCe(&macCeData, macCb.macCell[cellIdx]->macRaCb[0].msg3Pdu);
+ /* Forming Mux Pdu */
+ macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu = NULLP;
+ MAC_ALLOC(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, \
+ macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
+ if(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu != NULLP)
+ {
+ memset(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, 0, \
+ macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
+ macMuxPdu(&msg4DlData, &macCeData, macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu,\
+ macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize);
+
+ }
+ else
+ {
+ DU_LOG("\nMAC: Failed allocating memory for msg4TxPdu");
+ }
+ /* Free memory allocated */
+ MAC_FREE(msg4DlData.pduInfo[0].dlPdu, macCb.macCell[cellIdx]->macRaCb[0].msg4PduLen);
}
}
-
+
/* storing msg4 Pdu in macDlSlot */
- if(macCb.macCell->macRaCb[0].msg4TxPdu)
+ if(macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu)
{
- msg4Alloc->msg4Info.msg4PduLen = macCb.macCell->macRaCb[0].msg4TbSize;
+ msg4Alloc->msg4Info.msg4PduLen = macCb.macCell[cellIdx]->macRaCb[0].msg4TbSize;
MAC_ALLOC(msg4Alloc->msg4Info.msg4Pdu, msg4Alloc->msg4Info.msg4PduLen);
- if(msg4Alloc->msg4Info.msg4Pdu != NULLP)
- {
- memcpy(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell->macRaCb[0].msg4TxPdu, \
- msg4Alloc->msg4Info.msg4PduLen);
- }
- }
- else
- {
+ if(msg4Alloc->msg4Info.msg4Pdu != NULLP)
+ {
+ memcpy(msg4Alloc->msg4Info.msg4Pdu, macCb.macCell[cellIdx]->macRaCb[0].msg4TxPdu, \
+ msg4Alloc->msg4Info.msg4PduLen);
+ }
+ }
+ else
+ {
DU_LOG("\nMAC: Failed at macMuxPdu()");
- }
+ }
/* TODO: Free all allocated memory, after the usage */
/* MAC_FREE(macCb.macCell->macRaCb[0].msg4TxPdu, \
- macCb.macCell->macRaCb[0].msg4TbSize); // TODO: To be freed after re-transmission is successful.
+ macCb.macCell->macRaCb[0].msg4TbSize); // TODO: To be freed after re-transmission is successful.
MAC_FREE(macCb.macCell->macRaCb[0].msg4Pdu, macCb.macCell->macRaCb[0].msg4PduLen); */
}
void buildAndSendMuxPdu(SlotIndInfo currTimingInfo)
{
+ uint16_t cellIdx;
MacDlSlot *currDlSlot = NULLP;
SlotIndInfo muxTimingInfo;
memset(&muxTimingInfo, 0, sizeof(SlotIndInfo));
-
- ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA);
- currDlSlot = &macCb.macCell->dlSlot[muxTimingInfo.slot];
+
+ GET_CELL_IDX(currTimingInfo.cellId, cellIdx);
+
+ ADD_DELTA_TO_TIME(currTimingInfo, muxTimingInfo, PHY_DELTA);
+ currDlSlot = &macCb.macCell[cellIdx]->dlSlot[muxTimingInfo.slot];
if(currDlSlot->dlInfo.msg4Alloc)
- {
- fillMsg4Pdu(currDlSlot->dlInfo.msg4Alloc);
- currDlSlot = NULLP;
+ {
+ fillMsg4Pdu(currTimingInfo.cellId, currDlSlot->dlInfo.msg4Alloc);
+ currDlSlot = NULLP;
}
}
* This API is invoked by MAC to send slot ind to scheduler.
*
* @param[in] SlotIndInfo *slotInd
- * @return S16
+ * @return
* -# ROK
* -# RFAILED
**/
/* fill Pst structure to send to lwr_mac to MAC */
Pst pst;
- fillMacToSchPst(&pst);
- pst.event = EVENT_SLOT_IND_TO_SCH;
-
+ FILL_PST_MAC_TO_SCH(pst, EVENT_SLOT_IND_TO_SCH);
return(*macSchSlotIndOpts[pst.selector])(&pst,slotInd);
}
{
Pst pst;
uint16_t ret;
- SlotInfo *slotInfo;
-
+ SlotIndInfo *slotInfo;
+
/* Allocate sharable memory */
- MAC_ALLOC_SHRABL_BUF(slotInfo, sizeof(SlotInfo));
+ MAC_ALLOC_SHRABL_BUF(slotInfo, sizeof(SlotIndInfo));
if(!slotInfo)
{
DU_LOG("\nMAC : Slot Indication memory allocation failed");
return RFAILED;
- }
-
- slotInfo->cellId = macCb.macCell->cellId;
- slotInfo->sfn = slotInd->sfn;
- slotInfo->slot = slotInd->slot;
-
- /* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTRG;
- pst.dstEnt = ENTDUAPP;
- pst.dstInst = 0;
- pst.srcInst = macCb.macInst;
- pst.dstProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.srcProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.region = MAC_MEM_REGION;
- pst.pool = MAC_POOL;
- pst.event = EVENT_MAC_SLOT_IND;
- pst.route = 0;
- pst.prior = 0;
- pst.intfVer = 0;
-
- ret = MacDuAppSlotInd(&pst, slotInfo);
- if(ret != ROK)
- {
- DU_LOG("\nMAC: Failed to send slot indication to DU APP");
- MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, slotInfo, sizeof(SlotInfo));
- }
-
- return ret;
+ }
+
+ slotInfo->cellId = slotInd->cellId;
+ slotInfo->sfn = slotInd->sfn;
+ slotInfo->slot = slotInd->slot;
+
+ /* Fill Pst */
+ FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_SLOT_IND);
+
+ ret = MacDuAppSlotInd(&pst, slotInfo);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC: Failed to send slot indication to DU APP");
+ MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, slotInfo, sizeof(SlotIndInfo));
+ }
+
+ return ret;
} /* sendSlotIndMacToDuApp */
+/*******************************************************************
+ *
+ * @brief Process slot indication at MAC
+ *
+ * @details
+ *
+ * Function : macProcSlotInd
+ *
+ * Functionality: Process slot indication at MAC
+ *
+ * @params[in] Slot indication info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t macProcSlotInd(SlotIndInfo slotInd)
+{
+ uint16_t cellIdx;
+
+ GET_CELL_IDX(slotInd.cellId, cellIdx);
+
+ /* Store current time info */
+ macCb.macCell[cellIdx]->currTime.cellId = slotInd.cellId;
+ macCb.macCell[cellIdx]->currTime.slot = slotInd.slot;
+ macCb.macCell[cellIdx]->currTime.sfn = slotInd.sfn;
+
+ /* Mux Pdu for Msg4 */
+ buildAndSendMuxPdu(slotInd);
+
+ /* Trigger for DL TTI REQ */
+ fillDlTtiReq(slotInd);
+
+ /* Trigger for UL TTI REQ */
+ fillUlTtiReq(slotInd);
+
+ return ROK;
+} /* macProcSlotInd */
/**
* @brief Transmission time interval indication from PHY.
* @param[in] Pst *pst
* @param[in] SuId suId
* @param[in] SlotIndInfo *slotInd
- * @return S16
+ * @return
* -# ROK
* -# RFAILED
**/
-PUBLIC S16 fapiMacSlotInd
-(
-Pst *pst,
-SlotIndInfo *slotInd
-)
+uint8_t fapiMacSlotInd(Pst *pst, SlotIndInfo *slotInd)
{
- S16 ret;
- VOLATILE U32 startTime=0;
- Inst inst;
+ uint8_t ret;
+ VOLATILE uint32_t startTime=0;
DU_LOG("\nMAC : Slot Indication received");
-
- inst = pst->dstInst;
+
/*starting Task*/
SStartTask(&startTime, PID_MAC_TTI_IND);
if(ret != ROK)
{
DU_LOG("\nMAC : Sending of slot ind msg from MAC to SCH failed");
- RETVALUE(ret);
+ return ret;
}
- ret = macProcessSlotInd(inst,*slotInd);
+ ret = macProcSlotInd(*slotInd);
if(ret != ROK)
{
- DU_LOG("\nMAC : macProcessSlotInd failed");
- RETVALUE(ret);
+ DU_LOG("\nMAC : macProcSlotInd failed");
+ return ret;
}
/* send slot indication to du app */
if(ret != ROK)
{
DU_LOG("\nMAC :Sending of slot ind msg from MAC to DU APP failed");
- RETVALUE(ret);
+ return ret;
}
/*stoping Task*/
SStopTask(startTime, PID_MAC_TTI_IND);
- RETVALUE(ret);
+ return ret;
} /* fapiMacSlotInd */
/**********************************************************************
*******************************************************************************/
/* header include files (.h) */
#include "common_def.h"
-#include "tfu.h" /* RGU Interface includes */
#include "lrg.h"
-#include "tfu.x" /* RGU Interface includes */
#include "lrg.x"
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "du_log.h"
+#include "mac_upr_inf_api.h"
+#include "mac_utils.h"
+
+/*******************************************************************
+ *
+ * @brief Send stop indication to DU APP
+ *
+ * @details
+ *
+ * Function : sendStopIndToDuApp
+ *
+ * Functionality:
+ * Send stop indication to DU APP
+ *
+ * @params[in] Pst info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t sendStopIndToDuApp(uint16_t cellId)
+{
+ Pst pst;
+ uint8_t ret = ROK;
+ MacCellStopInfo *cellStopInd;
+
+ /* Allocate sharable memory */
+ MAC_ALLOC_SHRABL_BUF(cellStopInd, sizeof(MacCellStopInfo));
+ if(!cellStopInd)
+ {
+ DU_LOG("\nMAC : Stop Indication memory allocation failed");
+ return RFAILED;
+ }
+ cellStopInd->cellId = cellId;
+
+ /* Fill Pst */
+ FILL_PST_MAC_TO_DUAPP(pst, EVENT_MAC_STOP_IND);
+
+ ret = MacDuAppStopInd(&pst, cellStopInd);
+ if(ret != ROK)
+ {
+ DU_LOG("\nMAC: Failed to send stop indication to DU APP");
+ MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, cellStopInd, sizeof(MacCellStopInfo));
+ }
+ return ROK;
+}
/*******************************************************************
* @brief process Stop indication to MAC
* Function : fapiMacStopInd
*
* @param[in] Pst *pst
- * @return S16
+ * @return
* -# ROK
* -# RFAILED
******************************************************************/
-PUBLIC S16 fapiMacStopInd(Pst *pst)
+uint8_t fapiMacStopInd(Pst *pst, uint16_t cellId)
{
uint8_t ret = ROK;
- ret = sendStopIndMacToDuApp();
+ ret = sendStopIndToDuApp(cellId);
return ret;
}
+
+/**********************************************************************
+ End of file
+ ***********************************************************************/
/* header include files (.h) */
#include "common_def.h"
-#include "tfu.h"
#include "lrg.h"
-
-#include "tfu.x"
#include "lrg.x"
-
#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
-#include "du_log.h"
+#include "mac_utils.h"
/* function pointers for packing slot ind from mac to sch */
MacSchUeCreateReqFunc macSchUeCreateReqOpts[] =
}
}
- fillMacToSchPst(&pst);
- pst.event = EVENT_UE_CREATE_REQ_TO_SCH;
-
+ /* Fill event and send UE create request to SCH */
+ FILL_PST_MAC_TO_SCH(pst, EVENT_UE_CREATE_REQ_TO_SCH);
return(*macSchUeCreateReqOpts[pst.selector])(&pst, &schUeCfg);
}
* ****************************************************************/
uint8_t createUeCb(MacUeCfg *ueCfg)
{
- uint16_t ueIdx, lcIdx;
+ uint16_t ueIdx, lcIdx, cellIdx;
MacUeCb *ueCb;
+ GET_CELL_IDX(ueCfg->cellId, cellIdx);
+
/* Validate cell id */
- if(macCb.macCell->cellId != ueCfg->cellId)
+ if(macCb.macCell[cellIdx]->cellId != ueCfg->cellId)
{
DU_LOG("\nMAC : Cell Id %d not configured", ueCfg->cellId);
return RFAILED;
}
/* Check if max number of UE configured */
- if(macCb.macCell->numActvUe > MAX_UE)
+ if(macCb.macCell[cellIdx]->numActvUe > MAX_NUM_UE)
{
- DU_LOG("MAC : Max number of UE [%d] already configured", MAX_UE);
+ DU_LOG("MAC : Max number of UE [%d] already configured", MAX_NUM_UE);
return RFAILED;
}
/* Check if UE already configured */
- ueCb = &macCb.macCell->ueCb[ueCfg->ueIdx];
+ ueCb = &macCb.macCell[cellIdx]->ueCb[ueCfg->ueIdx];
if(ueCb)
{
if((ueCb->ueIdx == ueCfg->ueIdx) && (ueCb->crnti == ueCfg->crnti) &&\
memset(ueCb, 0, sizeof(MacUeCb));
ueCb->crnti = ueCfg->crnti;
- ueCb->cellCb = macCb.macCell;
+ ueCb->cellCb = macCb.macCell[cellIdx];
ueCb->dlInfo.dlHarqEnt.numHarqProcs = \
ueCfg->spCellCfg.servCellCfg.pdschServCellCfg.numHarqProcForPdsch;
ueCb->state = UE_STATE_ACTIVE;
}
/* Copy RA Cb */
- for(ueIdx = 0; ueIdx < MAX_UE; ueIdx++)
+ for(ueIdx = 0; ueIdx < MAX_NUM_UE; ueIdx++)
{
- if(macCb.macCell->macRaCb[ueIdx].crnti == ueCb->crnti)
+ if(macCb.macCell[cellIdx]->macRaCb[ueIdx].crnti == ueCb->crnti)
{
- ueCb->raCb = &macCb.macCell->macRaCb[ueIdx];
+ ueCb->raCb = &macCb.macCell[cellIdx]->macRaCb[ueIdx];
break;
}
}
- macCb.macCell->numActvUe++;
+ macCb.macCell[cellIdx]->numActvUe++;
return ROK;
}
*
* @details
*
- * Function : MacHdlUeCreateReq
+ * Function : MacProcUeCreateReq
*
* Functionality: Handles UE create requst from DU APP
*
* RFAILED - failure
*
* ****************************************************************/
-uint8_t MacHdlUeCreateReq(Pst *pst, MacUeCfg *ueCfg)
+uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg)
{
uint8_t ret;
return ret;
}
+/*******************************************************************
+ *
+ * @brief Fill and Send UE create response from MAC to DU APP
+ *
+ * @details
+ *
+ * Function : MacSendUeCreateRsp
+ *
+ * Functionality: Fill and Send UE create response from MAC to DUAPP
+ *
+ * @params[in] MAC UE create result
+ * SCH UE create response
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
uint8_t MacSendUeCreateRsp(MacRsp result, SchUeCfgRsp *schCfgRsp)
{
MacUeCfgRsp *cfgRsp;
cfgRsp->ueIdx = schCfgRsp->ueIdx;
cfgRsp->result = result;
- /* Filling Post structure */
+ /* Fill Post structure and send UE Create response*/
memset(&rspPst, 0, sizeof(Pst));
- rspPst.selector = ODU_SELECTOR_LWLC;
- rspPst.srcEnt = ENTRG;
- rspPst.dstEnt = ENTDUAPP;
- rspPst.dstInst = 0;
- rspPst.srcInst = macCb.macInst;
- rspPst.dstProcId = macCb.procId;
- rspPst.srcProcId = macCb.procId;
- rspPst.region = MAC_MEM_REGION;
- rspPst.pool = MAC_POOL;
- rspPst.event = EVENT_MAC_UE_CREATE_RSP;
-
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_CREATE_RSP);
return DuMacUeCreateRspOpts[rspPst.selector](&rspPst, cfgRsp);
}
{
uint8_t result = MAC_DU_APP_RSP_NOK;
uint8_t ret = ROK;
+ uint16_t cellIdx;
+
+ GET_CELL_IDX(schCfgRsp->cellId, cellIdx);
if(schCfgRsp->rsp == RSP_NOK)
{
DU_LOG("\nMAC : SCH UE Create Response : FAILURE [CRNTI %d]", schCfgRsp->crnti);
- memset(&macCb.macCell->ueCb[schCfgRsp->ueIdx], 0, sizeof(MacUeCb));
- macCb.macCell->numActvUe--;
+ memset(&macCb.macCell[cellIdx]->ueCb[schCfgRsp->ueIdx], 0, sizeof(MacUeCb));
+ macCb.macCell[cellIdx]->numActvUe--;
result = MAC_DU_APP_RSP_NOK;
}
else
/* This file contains the definitions for Upper Interface APIs that are
* invoked from MAC */
#include "common_def.h"
+#include "du_app_mac_inf.h"
#include "mac_upr_inf_api.h"
/* Funtion pointer options for slot indication */
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacDuAppSlotInd(Pst *pst, SlotInfo *slotInfo)
+uint8_t MacDuAppSlotInd(Pst *pst, SlotIndInfo *slotInfo)
{
return (*packMacSlotIndOpts[pst->selector])(pst, slotInfo);
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+uint8_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId)
{
return (*packMacStopIndOpts[pst->selector])(pst, cellStopId);
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
+uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
{
return (*packMacUlCcchIndOpts[pst->selector])(pst, ulCcchIndInfo);
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* This file contains the definitions for Upper Interface APIs that are
* invoked from MAC */
-#include "du_app_mac_inf.h"
-
-
-uint16_t MacDuAppSlotInd(Pst *pst, SlotInfo *slotInfo);
-uint16_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId);
-uint16_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
+uint8_t MacDuAppSlotInd(Pst *pst, SlotIndInfo *slotInfo);
+uint8_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId);
+uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
/**********************************************************************
End of file
**********************************************************************/
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2017-2019] [Radisys] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* Contains common utility definitions to be used at MAC */
+
+#define MAC_MEM_REGION 4
+#define MAC_POOL 1
+
+/* allocate and zero out a MAC static buffer */
+#define MAC_ALLOC(_datPtr, _size) \
+{ \
+ uint8_t _ret; \
+ _ret = SGetSBuf(MAC_MEM_REGION, MAC_POOL, \
+ (Data **)&_datPtr, _size); \
+ if(_ret == ROK) \
+ { \
+ cmMemset((uint8_t *)_datPtr, 0, _size); \
+ } \
+ else \
+ { \
+ _datPtr = NULLP; \
+ } \
+}
+
+/* free a static buffer */
+#define MAC_FREE(_datPtr, _size) \
+{ \
+ if(_datPtr) \
+ { \
+ SPutSBuf(MAC_MEM_REGION, MAC_POOL, \
+ (Data *)_datPtr, _size); \
+ } \
+}
+
+/* Allocate shared memory to be used for LWLC
+ * during inter-layer communication */
+#define MAC_ALLOC_SHRABL_BUF(_buf, _size) \
+{ \
+ if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \
+ (Data **)&_buf, (Size) _size, 0) == ROK) \
+ { \
+ cmMemset((uint8_t *)(_buf), 0, _size); \
+ } \
+ else \
+ { \
+ (_buf) = NULLP; \
+ } \
+}
+
+/* Free shared memory, received through LWLC */
+#define MAC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
+{ \
+ if (_buf != NULLP) \
+ { \
+ (Void) SPutStaticBuffer(_region, _pool, \
+ (Data *) _buf, (Size) _size, 0); \
+ _buf = NULLP; \
+ } \
+}
+
+/* Fill Pst structure for sending msg from MAC to DU APP */
+#define FILL_PST_MAC_TO_DUAPP(_pst, _event) \
+{ \
+ _pst.selector = ODU_SELECTOR_LWLC; \
+ _pst.srcEnt = ENTRG; \
+ _pst.dstEnt = ENTDUAPP; \
+ _pst.dstInst = 0; \
+ _pst.srcInst = macCb.macInst; \
+ _pst.dstProcId = macCb.procId; \
+ _pst.srcProcId = macCb.procId; \
+ _pst.region = MAC_MEM_REGION; \
+ _pst.pool = MAC_POOL; \
+ _pst.event = _event; \
+ _pst.route = 0; \
+ _pst.prior = 0; \
+ _pst.intfVer = 0; \
+}
+
+/* Fill Pst structure for sending msg from MAC to SCH */
+#define FILL_PST_MAC_TO_SCH(_pst, _event) \
+{ \
+ _pst.selector = ODU_SELECTOR_TC; \
+ _pst.srcEnt = ENTRG; \
+ _pst.dstEnt = ENTRG; \
+ _pst.dstInst = 1; \
+ _pst.srcInst = macCb.macInst; \
+ _pst.dstProcId = macCb.procId; \
+ _pst.srcProcId = macCb.procId; \
+ _pst.region = MAC_MEM_REGION; \
+ _pst.pool = MAC_POOL; \
+ _pst.event = _event; \
+ _pst.route = 0; \
+ _pst.prior = 0; \
+ _pst.intfVer = 0; \
+}
+
+/**********************************************************************
+ End of file
+**********************************************************************/
#define RG_MAX_DL_HARQ_NUM 8
#endif
-#define MAC_MEM_REGION 4
-#define MAC_POOL 1
-/* allocate and zero out a MAC static buffer */
-#define MAC_ALLOC(_datPtr, _size) \
-{ \
- S16 _ret; \
- _ret = SGetSBuf(MAC_MEM_REGION, MAC_POOL, \
- (Data **)&_datPtr, _size); \
- if(_ret == ROK) \
- cmMemset((U8*)_datPtr, 0, _size); \
- else \
- _datPtr = NULLP; \
-}
-
-/* free a static buffer */
-#define MAC_FREE(_datPtr, _size) \
- if(_datPtr) \
- SPutSBuf(MAC_MEM_REGION, MAC_POOL, \
- (Data *)_datPtr, _size);
-
-/* Allocate shared memory to be used for LWLC
- * during inter-layer communication */
-#define MAC_ALLOC_SHRABL_BUF(_buf, _size) \
-{ \
- if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \
- (Data **)&_buf, (Size) _size, 0) == ROK) \
- { \
- cmMemset((U8 *)(_buf), 0, _size); \
- } \
- else \
- { \
- (_buf) = NULLP; \
- } \
-}
-
-/* Free shared memory, received through LWLC */
-#define MAC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
-{ \
- if (_buf != NULLP) \
- { \
- (Void) SPutStaticBuffer(_region, _pool, \
- (Data *) _buf, (Size) _size, 0); \
- _buf = NULLP; \
- } \
-}
-
/* Free shared memory, received through LWLC */
#define MAC_FREE_MEM(_region, _pool, _datPtr, _size) \
if(_datPtr) \
{ \
}
#endif
-#define DEFAULT_CELLS 1
#endif /* __RGH__ */
\f
/**********************************************************************
#ifdef EMTC_ENABLE
U8 emtcEnable;
#endif
- /* 5GNR changes */
- MacCellCfg macCellCfg; /* MAC cell config paramters */
};
/**
Inst inst,
TfuDatIndInfo *datInd));
-EXTERN S16 macProcessSlotInd ARGS((
- Inst inst,
- SlotIndInfo slotInd));
EXTERN Void rgTOMRlsSf ARGS((Inst inst,RgDlSf *dlSf));
EXTERN S16 rgSchMacSfAllocReq ARGS((Pst *pst, RgInfSfAlloc *sfInfo));
/* Data not received but ta needs to be sent. */
/* MUX TA and send it */
bldPdu.datReq = NULLP;
- bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
+ //bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
bldPdu.schdTbSz = hqP->tbInfo[i].tbSz;
bldPdu.ta = hqP->tbInfo[i].schdTa;
#ifdef LTE_ADV
#ifdef LTEMAC_RGU_PAD
/* Data not received from RLC. Padding at MAC */
bldPdu.datReq = NULLP;
- bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
+ //bldPdu.reqType = EVENT_SLOT_IND_TO_MAC;
bldPdu.schdTbSz = hqP->tbInfo[i].tbSz;
bldPdu.ta = hqP->tbInfo[i].schdTa;
#ifdef LTE_ADV
#include "rg_prg.x" /*PRG interface includes*/
#include "du_app_mac_inf.h"
#include "rg.x" /* typedefs for MAC */
-int unpackDuMacCellCfg(DuMacCellCfgReq func,Pst *pst,Buffer *mBuf);
/**
* @brief Task Activation callback function Entity SM.
#endif /* LCRGMILRG */
case EVENT_MAC_CELL_CONFIG_REQ:
/* Process MAC cell config */
- unpackDuMacCellCfg(MacHdlCellCfgReq, pst, mBuf);
+ unpackDuMacCellCfg(MacProcCellCfgReq, pst, mBuf);
break;
case EVENT_MAC_CELL_START_REQ:
/* Process MAC cell start request */
- unpackMacCellStartReq(MacHdlCellStartReq, pst, mBuf);
+ unpackMacCellStartReq(MacProcCellStartReq, pst, mBuf);
break;
case EVENT_MAC_CELL_STOP_REQ:
/* Process MAC cell stop request */
- unpackMacCellStopReq(MacHdlCellStopReq, pst, mBuf);
+ unpackMacCellStopReq(MacProcCellStopReq, pst, mBuf);
break;
case EVENT_MAC_DL_CCCH_IND:
/* Process DL CCCH Ind */
- unpackMacDlCcchInd(MacHdlDlCcchInd, pst, mBuf);
+ unpackMacDlCcchInd(MacProcDlCcchInd, pst, mBuf);
break;
case EVENT_MAC_UE_CREATE_REQ:
/* Process Ue Create Request */
- unpackMacUeCreateReq(MacHdlUeCreateReq, pst, mBuf);
+ unpackMacUeCreateReq(MacProcUeCreateReq, pst, mBuf);
break;
default:
RG_FREE_MSG(mBuf);
case EVTTFUDATIND:
cmUnpkTfuDatInd(RgLiTfuDatInd, pst, mBuf);
break;
- case EVENT_SLOT_IND_TO_MAC:
- cmUnpackSlotInd(fapiMacSlotInd, pst, mBuf);
- break;
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
case EVTTFUNONRTIND:
cmUnpkTfuNonRtInd(RgLiTfuNonRtInd, pst, mBuf);
#include "rg_sch_inf.h" /* layer management defines for LTE-MAC */
#include "rg_env.h" /* customisable defines and macros for MAC */
#include "rg.h" /* defines and macros for MAC */
-#include "du_log.h"
/* header/extern include files (.x) */
#include "rgu.x" /* RGU types */
#include "crg.x" /* layer management typedefs for MAC */
#include "rg_sch_inf.x" /* SCH interface typedefs */
#include "rg_prg.x" /* PRG interface typedefs */
-#include "du_app_mac_inf.h"
#include "rg.x" /* typedefs for MAC */
-#include "mac_upr_inf_api.h"
-#include "mac.h"
-
/* local externs */
#ifdef UNUSED_FUNC
PRIVATE S16 rgLIMValidateSap ARGS((Inst inst,SuId suId));
} /* rgLIMTfuDatReq*/
#endif /*L2_OPTMZ */
-/*******************************************************************
- *
- * @brief Fills post structure
- *
- * @details
- *
- * Function : fillMacToSchPst
- *
- * Functionality:
- * Fills post structure to be used when sending msg from
- * MAC to SCH
- *
- * @params[in] Post structure pointer
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-void fillMacToSchPst(Pst *pst)
-{
- pst->srcProcId = 0;
- pst->dstProcId = 0;
- pst->srcEnt = ENTRG;
- pst->dstEnt = ENTRG;
- pst->srcInst = 0;
- pst->dstInst = 1;
- pst->region = 0;
- pst->pool = 0;
- pst->selector = ODU_SELECTOR_TC;
-}
-
-/*******************************************************************
- *
- * @brief MAC handler for config response from PHY
- *
- * @details
- *
- * Function : fapiMacConfigRsp
- *
- * Functionality:
- * Processes config response from PHY and sends cell config
- * confirm to DU APP
- *
- * @params[in]
- * @return void
- *
- * ****************************************************************/
-void fapiMacConfigRsp()
-{
- /* TODO : Processing of config response from PHY */
-
- /* Send cell config cfm to DU APP */
- MacSendCellCfgCfm(RSP_OK);
-}
-
-/*******************************************************************
- *
- * @brief Send stop indication to DU APP
- *
- * @details
- *
- * Function : sendStopIndMacToDuApp
- *
- * Functionality:
- * Send stop indication to DU APP
- *
- * @params[in] Pst info
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-uint8_t sendStopIndMacToDuApp()
-{
- Pst pst;
- uint8_t ret = ROK;
-
- MacCellStopInfo *cellStopId;
-
- /* Allocate sharable memory */
- MAC_ALLOC_SHRABL_BUF(cellStopId, sizeof(MacCellStopInfo));
- if(!cellStopId)
- {
- DU_LOG("\nMAC : Stop Indication memory allocation failed");
- return RFAILED;
- }
- cellStopId->cellId = macCb.macCell->cellId;
-
- /* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTRG;
- pst.dstEnt = ENTDUAPP;
- pst.dstInst = 0;
- pst.srcInst = macCb.macInst;
- pst.dstProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.srcProcId = rgCb[pst.srcInst].rgInit.procId;
- pst.region = MAC_MEM_REGION;
- pst.pool = MAC_POOL;
- pst.event = EVENT_MAC_STOP_IND;
- pst.route = 0;
- pst.prior = 0;
- pst.intfVer = 0;
-
- ret = MacDuAppStopInd(&pst, cellStopId);
- if(ret != ROK)
- {
- DU_LOG("\nMAC: Failed to send stop indication to DU APP");
- MAC_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, cellStopId, sizeof(MacCellStopInfo));
- }
- return ROK;
-}
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/**
* @brief Transmission of non-rt indication from CL.
#include "rgr.h" /* LRG Interface defines */
#include "rg.h" /* MAC defines */
#include "rg_err.h" /* MAC error defines */
-#include "du_log.h"
/* header/extern include files (.x) */
#include "crg.x" /* CRG Interface includes */
#include "ss_rbuf.h"
#include "ss_rbuf.x"
#include "lwr_mac.h" /* MAC CL defines */
+#include "mac_sch_interface.h"
+#include "lwr_mac_upr_inf.h"
#include "mac.h"
#include "lwr_mac_phy.h"
#include "lwr_mac_fsm.h"
#endif /* __cplusplus */
/* Public variable declaration */
-ClCb clGlobalCp;
+LwrMacCb lwrMacCb;
extern MacCb macCb;
-int MacSchCellCfgReq(Pst *pst,MacCellCfg *macCellCfg);
-
/* forward references */
PRIVATE U16 rgLMMGenCfg ARGS((
Inst inst,
Pst *cfmPst
));
-extern int packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
-
-packMacCellCfgConfirm packMacCellCfmOpts[] =
-{
- packMacCellCfgCfm, /* packing for loosely coupled */
- duHandleMacCellCfgCfm, /* packing for tightly coupled */
- packMacCellCfgCfm, /* packing for light weight loosly coupled */
-};
-
-SchCellCfgFunc SchCellCfgOpts[] =
-{
- packSchCellCfg, /* packing for loosely coupled */
- SchHdlCellCfgReq, /* packing for tightly coupled */
- packSchCellCfg /* packing for light weight loosly coupled */
-};
-
\f
/**
* @brief Task Initiation callback function.
#endif
/* Initializing CL control block */
- clGlobalCp.region = region;
- clGlobalCp.pool = 0;
- clGlobalCp.clCfgDone = FALSE;
- clGlobalCp.numOfCells = 0;
- clGlobalCp.phyState = PHY_STATE_IDLE;
-
- if( cmHashListInit(&clGlobalCp.cellCbLst, MAX_NUM_CELL_SUPP, 0x0, FALSE,
- CM_HASH_KEYTYPE_DEF, clGlobalCp.region, clGlobalCp.pool ) != ROK )
- {
- printf("\n Cellcb hash list initialization failed for MAC CL");
- RETVALUE(RFAILED);
- }
+ memset(&lwrMacCb, 0, sizeof(LwrMacCb));
+ lwrMacCb.region = region;
+ lwrMacCb.pool = 0;
+ lwrMacCb.clCfgDone = TRUE;
+ lwrMacCb.numCell = 0;
+ lwrMacCb.phyState = PHY_STATE_IDLE;
/* Initialize Scheduler as well */
schActvInit(ENTRG, (DEFAULT_CELLS + SCH_INST_START), DFLT_REGION, PWR_UP);
rgCb[inst].genCfg.tmrRes = cfg->s.genCfg.tmrRes;
macCb.macInst = rgCb[inst].rgInit.inst;
+ macCb.procId = rgCb[inst].rgInit.procId;
/* Initialize SAP States */
rgCb[inst].crgSap.sapSta.sapState = LRG_NOT_CFG;
} /* end of rgActvTmr */
-/**
- * @brief Layer Manager Configuration request handler for Scheduler
- *
- * @details
- *
- * Function : MacSchGenCfgReq
- *
- * This function receives general configurations for Scheduler
- * from DU APP and forwards to Scheduler.
- *
- * @param[in] Pst *pst, the post structure
- * @param[in] RgMngmt *cfg, the configuration parameter's structure
- * @return S16
- * -# ROK
- **/
-#ifdef ANSI
-PUBLIC int MacSchGenCfgReq
-(
-Pst *pst, /* post structure */
-RgMngmt *cfg /* config structure */
-)
-#else
-PUBLIC int MacSchGenCfgReq(pst, cfg)
-Pst *pst; /* post structure */
-RgMngmt *cfg; /* config structure */
-#endif
-{
- printf("\nReceived Scheduler gen config at MAC");
- pst->dstInst = DEFAULT_CELLS + 1;
- HandleSchGenCfgReq(pst, cfg);
-
- return ROK;
-}
-
-/**
- * @brief Layer Manager Configuration response from Scheduler
- *
- * @details
- *
- * Function : SchSendCfgCfm
- *
- * This function sends general configurations response from
- * Scheduler to DU APP.
- *
- * @param[in] Pst *pst, the post structure
- * @param[in] RgMngmt *cfm, the configuration confirm structure
- * @return S16
- * -# ROK
- **/
-#ifdef ANSI
-PUBLIC S16 SchSendCfgCfm
-(
-Pst *pst, /* post structure */
-RgMngmt *cfm /* config confirm structure */
-)
-#else
-PUBLIC S16 SchSendCfgCfm(pst, cfm)
-Pst *pst; /* post structure */
-RgMngmt *cfm; /* config confirm structure */
-#endif
-{
- printf("\nSending Scheduler config confirm to DU APP");
- pst->dstEnt = ENTDUAPP;
- pst->dstInst = 0;
- pst->srcInst = 0;
- pst->selector = ODU_SELECTOR_LC;
- RgMiLrgSchCfgCfm(pst, cfm);
-
- RETVALUE(ROK);
-}
-
-\f
-/***********************************************************
- *
- * Func : macCellCfgFillCfmPst
- *
- *
- * Desc : Fills the Confirmation Post Structure cfmPst
- *
- * Ret : Void
- *
- * Notes:
- *
- * File : rg_lmm.c
- *
- **********************************************************/
-Void macCellCfgFillCfmPst
-(
-Pst *reqPst,
-Pst *cfmPst
-)
-{
- Inst inst;
- inst = reqPst->dstInst;
-
- cfmPst->srcEnt = rgCb[inst].rgInit.ent;
- cfmPst->srcInst = rgCb[inst].rgInit.inst;
- cfmPst->srcProcId = rgCb[inst].rgInit.procId;
-
- cfmPst->dstEnt = ENTDUAPP;
- cfmPst->dstInst = 0;
- cfmPst->dstProcId = cfmPst->srcProcId;
-
- cfmPst->selector = ODU_SELECTOR_LC;
- cfmPst->prior = reqPst->prior;
- cfmPst->route = reqPst->route;
- cfmPst->region = reqPst->region;
- cfmPst->pool = reqPst->pool;
- cfmPst->event = EVENT_MAC_CELL_CONFIG_CFM;
-
- RETVOID;
-}
-
-/**
- * @brief Layer Manager Configuration request handler.
- *
- * @details
- *
- * Function : MacHdlCellCfgReq
- *
- * This function handles the gNB and cell configuration
- * request received from DU APP.
- * This API unapcks and forwards the config towards SCH
- *
- * @param[in] Pst *pst
- * @param[in] MacCellCfg *macCellCfg
- * @return S16
- * -# ROK
- **/
-int MacHdlCellCfgReq
-(
- Pst *pst,
- MacCellCfg *macCellCfg
-)
-{
- Pst cfmPst;
- uint16_t ret = ROK;
- RgCellCb *cellCb;
- MacCellCb *macCellCb = NULLP;
- Inst inst = pst->dstInst;
-
- cmMemset((U8 *)&cfmPst, 0, sizeof(Pst));
- MAC_ALLOC(cellCb,sizeof(RgCellCb));
-
- if(cellCb == NULLP)
- {
- DU_LOG("\nMAC : cellCb is NULL at handling of macCellCfg\n");
- return RFAILED;
- }
-
- memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg));
- rgCb[inst].cell = cellCb;
-
- MAC_ALLOC(macCellCb,sizeof(MacCellCb));
- if(macCellCb == NULLP)
- {
- DU_LOG("\nMAC : macCellCb is NULL at handling of macCellCfg\n");
- return RFAILED;
- }
- memset(macCellCb, 0, sizeof(MacCellCb));
- macCb.macCell = macCellCb;
- macCb.macCell->cellId = macCellCfg->cellId;
-
- MAC_ALLOC(cellCb->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
- if(cellCb->macCellCfg.sib1Cfg.sib1Pdu == NULLP)
- {
- DU_LOG("\nMAC : macCellCb is NULL at handling of sib1Pdu of macCellCfg\n");
- return RFAILED;
- }
- memcpy(cellCb->macCellCfg.sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
-
- /* Send cell cfg to scheduler */
- ret = MacSchCellCfgReq(pst, macCellCfg);
- if(ret != ROK)
- {
- MacCellCfgCfm macCellCfgCfm;
- macCellCfgCfm.rsp = RSP_NOK;
- macCellCfgCfm.cellId = macCellCfg->cellId;
- macCellCfgFillCfmPst(pst,&cfmPst);
- ret = (*packMacCellCfmOpts[cfmPst.selector])(&cfmPst,&macCellCfgCfm);
- }
- else
- {
- if(macCellCfg->prachCfg.fdm[0].numUnusedRootSeq != 0)
- {
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->prachCfg.fdm[0].unsuedRootSeq,
- macCellCfg->prachCfg.fdm[0].numUnusedRootSeq* sizeof(uint8_t));
- }
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg->sib1Cfg.sib1Pdu, macCellCfg->sib1Cfg.sib1PduLen);
- MAC_FREE_SHRABL_BUF(pst->region, pst->pool, macCellCfg ,sizeof(MacCellCfg));
- }
-
-#ifdef INTEL_WLS
- LwrMacEnqueueWlsBlock();
-#endif
- return ret;
-} /* end of MacHdlCellCfgReq */
-
-/**
- * @brief Layer Manager Configuration request handler.
- *
- * @details
- *
- * Function : MacSchCellCfgReq
- *
- * This function sends cell configuration to SCH
- *
- * @param[in] Pst *pst
- * @param[in] MacCellCfg *macCellCfg
- * @return S16
- * -# ROK
- **/
-int MacSchCellCfgReq
-(
- Pst *pst,
- MacCellCfg *macCellCfg
-)
-{
- SchCellCfg schCellCfg;
- Pst cfgPst;
- int ret;
-
- cmMemset((U8 *)&cfgPst, 0, sizeof(Pst));
- schCellCfg.cellId = macCellCfg->cellId;
- schCellCfg.phyCellId = macCellCfg->phyCellId;
- schCellCfg.bandwidth = macCellCfg->dlCarrCfg.bw;
- schCellCfg.dupMode = macCellCfg->dupType;
-
- /* fill ssb scheduler parameters */
- schCellCfg.ssbSchCfg.ssbPbchPwr = macCellCfg->ssbCfg.ssbPbchPwr;
- schCellCfg.ssbSchCfg.scsCommon = macCellCfg->ssbCfg.scsCmn;
- schCellCfg.ssbSchCfg.ssbOffsetPointA = macCellCfg->ssbCfg.ssbOffsetPointA;
- schCellCfg.ssbSchCfg.ssbPeriod = macCellCfg->ssbCfg.ssbPeriod;
- schCellCfg.ssbSchCfg.ssbSubcOffset = macCellCfg->ssbCfg.ssbScOffset;
- for(uint8_t idx=0; idx<SSB_MASK_SIZE; idx++)
- {
- schCellCfg.ssbSchCfg.nSSBMask[idx] = macCellCfg->ssbCfg.ssbMask[idx];
- }
-
- /* fill SIB1 scheduler parameters */
- schCellCfg.sib1SchCfg.sib1PduLen = macCellCfg->sib1Cfg.sib1PduLen;
- schCellCfg.sib1SchCfg.sib1NewTxPeriod = macCellCfg->sib1Cfg.sib1NewTxPeriod;
- schCellCfg.sib1SchCfg.sib1RepetitionPeriod = macCellCfg->sib1Cfg.sib1RepetitionPeriod;
- schCellCfg.sib1SchCfg.coresetZeroIndex = macCellCfg->sib1Cfg.coresetZeroIndex;
- schCellCfg.sib1SchCfg.searchSpaceZeroIndex = macCellCfg->sib1Cfg.searchSpaceZeroIndex;
- schCellCfg.sib1SchCfg.sib1Mcs = macCellCfg->sib1Cfg.sib1Mcs;
-
- /* fill RACH config params */
- schCellCfg.schRachCfg.prachCfgIdx = macCellCfg->prachCfg.prachCfgIdx;
- schCellCfg.schRachCfg.prachSubcSpacing = \
- macCellCfg->prachCfg.prachSubcSpacing;
- schCellCfg.schRachCfg.msg1FreqStart = macCellCfg->prachCfg.msg1FreqStart;
- schCellCfg.schRachCfg.msg1Fdm = macCellCfg->prachCfg.msg1Fdm;
- schCellCfg.schRachCfg.rootSeqLen = macCellCfg->prachCfg.rootSeqLen;
- schCellCfg.schRachCfg.rootSeqIdx = macCellCfg->prachCfg.fdm[0].rootSeqIdx;
- schCellCfg.schRachCfg.numRootSeq = macCellCfg->prachCfg.fdm[0].numRootSeq;
- schCellCfg.schRachCfg.k1 = macCellCfg->prachCfg.fdm[0].k1;
- schCellCfg.schRachCfg.ssbPerRach = macCellCfg->prachCfg.ssbPerRach;
- schCellCfg.schRachCfg.prachMultCarrBand = \
- macCellCfg->prachCfg.prachMultCarrBand;
- schCellCfg.schRachCfg.raContResTmr = macCellCfg->prachCfg.raContResTmr;
- schCellCfg.schRachCfg.rsrpThreshSsb = macCellCfg->prachCfg.rsrpThreshSsb;
- schCellCfg.schRachCfg.raRspWindow = macCellCfg->prachCfg.raRspWindow;
-
- /* fill initial DL BWP */
- schCellCfg.schInitialDlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialDlBwp.bwp.firstPrb;
- schCellCfg.schInitialDlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialDlBwp.bwp.numPrb;
- schCellCfg.schInitialDlBwp.bwp.scs = macCellCfg->initialDlBwp.bwp.scs;
- schCellCfg.schInitialDlBwp.bwp.cyclicPrefix = macCellCfg->initialDlBwp.bwp.cyclicPrefix;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.searchSpaceId;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.coresetId =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.coresetId;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSlot;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.duration =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.duration;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.monitoringSymbol;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1 =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel1;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2 =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel2;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4 =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel4;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8 =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel8;
- schCellCfg.schInitialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16 =
- macCellCfg->initialDlBwp.pdcchCommon.commonSearchSpace.candidate.aggLevel16;
- schCellCfg.schInitialDlBwp.pdschCommon.k0 = macCellCfg->initialDlBwp.pdschCommon.k0;
- schCellCfg.schInitialDlBwp.pdschCommon.mappingType =
- macCellCfg->initialDlBwp.pdschCommon.mappingType;
- schCellCfg.schInitialDlBwp.pdschCommon.startSymbol =
- macCellCfg->initialDlBwp.pdschCommon.startSymbol;
- schCellCfg.schInitialDlBwp.pdschCommon.lengthSymbol =
- macCellCfg->initialDlBwp.pdschCommon.lengthSymbol;
-
- /* fill initial UL BWP */
- schCellCfg.schInitialUlBwp.bwp.freqAlloc.startPrb = macCellCfg->initialUlBwp.bwp.firstPrb;
- schCellCfg.schInitialUlBwp.bwp.freqAlloc.numPrb = macCellCfg->initialUlBwp.bwp.numPrb;
- schCellCfg.schInitialUlBwp.bwp.scs = macCellCfg->initialUlBwp.bwp.scs;
- schCellCfg.schInitialUlBwp.bwp.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix;
- schCellCfg.schInitialUlBwp.puschCommon.k2 = macCellCfg->initialUlBwp.puschCommon.k2;
- schCellCfg.schInitialUlBwp.puschCommon.mappingType =
- macCellCfg->initialUlBwp.puschCommon.mappingType;
- schCellCfg.schInitialUlBwp.puschCommon.startSymbol =
- macCellCfg->initialUlBwp.puschCommon.startSymbol;
- schCellCfg.schInitialUlBwp.puschCommon.lengthSymbol =
- macCellCfg->initialUlBwp.puschCommon.lengthSymbol;
-
-
- cfgPst.srcProcId = pst->dstProcId;
- cfgPst.dstProcId = pst->srcProcId;
- cfgPst.srcEnt = ENTRG;
- cfgPst.srcInst = 0;
- cfgPst.dstEnt = ENTRG;
- cfgPst.dstInst = 1;
- cfgPst.selector = ODU_SELECTOR_TC;
- cfgPst.event = EVENT_SCH_CELL_CFG;
-
- ret = (*SchCellCfgOpts[cfgPst.selector])(&cfgPst, &schCellCfg);
- return ret;
-} /* end of MacSchCellCfgReq */
-
-
-/*******************************************************************
- *
- * @brief Sends Cell config confirm to DU APP
- *
- * @details
- *
- * Function : MacSendCellCfgCfm
- *
- * Functionality:
- * Sends Cell config confirm to DU APP
- *
- * @params[in] Response status
- * @return void
- *
- * ****************************************************************/
-void MacSendCellCfgCfm(uint8_t response)
-{
- Pst pst;
- RgCellCb *cellCb;
- MacCellCfgCfm macCellCfgCfm;
-
- cmMemset((U8 *)&pst, 0, sizeof(Pst));
- cellCb = rgCb[macCb.macInst].cell;
-
- macCellCfgCfm.cellId = cellCb->macCellCfg.cellId;
- macCellCfgCfm.rsp = response;
-
- memcpy((void *)&pst, (void *)&rgCb[macCb.macInst].rgInit.lmPst, sizeof(Pst));
- pst.event = EVENT_MAC_CELL_CONFIG_CFM;
- (*packMacCellCfmOpts[pst.selector])(&pst,&macCellCfgCfm);
-}
-
-
-/**
- * @brief Layer Manager Configuration response handler.
- *
- * @details
- *
- * Function : MacProcSchCellCfgCfm
- *
- * This function processes cell configuration to SCH
- *
- * @param[in] Pst *pst
- * @param[in] SchCellCfgCfm *schCellCfgCfm
- * @return int
- * -# ROK
- **/
-int MacProcSchCellCfgCfm
-(
- Pst *pst,
- SchCellCfgCfm *schCellCfgCfm
-)
-{
- if(schCellCfgCfm->rsp == RSP_OK)
- {
- sendToLowerMac(CONFIG_REQUEST, 0, (void *)NULL);
- }
- else
- {
- MacSendCellCfgCfm(RSP_NOK);
- }
- return ROK;
-}
-
/**********************************************************************
End of file
}
break;
- case EVENT_SLOT_IND_TO_MAC:
- break;
default:
break;
} /* End of switch(reqType) */
*/
/* header include files -- defines (.h) */
#include "common_def.h"
-#include "du_app_mac_inf.h"
#include "rgu.h" /* RGU defines */
#include "tfu.h" /* RGU defines */
#include "lrg.h" /* layer management defines for LTE-MAC */
#include "rg_prg.x" /* PRG interface typedefs */
#include "rgm.x" /* layer management typedefs for MAC */
#include "rg.x" /* typedefs for MAC */
-#include "mac.h"
-#include "lwr_mac_fsm.h"
#ifdef MAC_RLC_UL_RBUF
#include "ss_rbuf.h"
#include "ss_rbuf.x"
#endif
-uint16_t handleDlTtiReq(SlotIndInfo currTimingInfo);
-uint16_t handleUlTtiReq(SlotIndInfo currTimingInfo);
-
/* ADD Changes for Downlink UE Timing Optimization */
#ifndef LTEMAC_DLUE_TMGOPTMZ
PRIVATE S16 rgTOMUtlProcDlSf ARGS(( RgDlSf *dlSf, RgCellCb *cellCb,
U32 rgMacGT;
-/**
- * @brief Handler for processing TTI indication recieved from
- * PHY for a cell.
- *
- * @details
- *
- * Function: macProcessSlotInd
- *
- * Handler for processing slot indication recieved from PHY
- * for a cell.
- *
- * Invoked by: macProcessSlotInd
- *
- * Processing Steps:
- * - Get cell and update the cell's current time with the timing value given
- * by PHY
- * - Invoke the cmPrcTmr to process the timing queue.
- * - Append the PHICH information to the downlink subframe that needs to go
- * out to PHY in this subframe.
- * - Invoke DHM to release the downlink subframe that occured earlier
- * rgDHMRlsDlsfHqProc.
- * - Invoke the TTI handler of scheduler.
- * - Invoke the TTI handler of RAM module.
- * - Get the downlink subframe that has to go out to PHY in this subframe
- * rgSCHSubFrmGet.
- * - Invoke rgTOMUtlProcTA to perform and timing advance processing.
- * - Invoke rgTOMUtlProcDlSf to do further processing on the downlink
- * subframe.
- * - Get the downlink subframe that would occur after RG_DL_DELTA and
- * invoke rgTOMUtlProcDlSfStaInd to send status indications to the higher
- * layer.
- * - Invoke GOM's TTI handler rgGOMTtiHndlr
- * - Invoke COM's TTI handler rgCOMTtiHndlr
- *
- * @param[in] Inst inst
- * @param[in] SlotIndInfo slotInd
- * @return S16
- * -# ROK
- * -# RFAILED
- **/
-#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
-pthread_t gMacTId = 0;
-#endif
-PUBLIC S16 macProcessSlotInd
-(
-Inst inst,
-SlotIndInfo slotInd
-)
-{
- RgCellCb *cellCb;
- RgErrInfo err;
- RgDlSf *dlSf;
-/* ADD Changes for Downlink UE Timing Optimization */
-#ifdef LTEMAC_DLUE_TMGOPTMZ
- RgDlSf *prevDlSf;
- CmLteTimingInfo prevTmInfo;
-#endif
- //SlotIndInfo *slotInd = &ttiInfo->cells[0];
-
- TRC2(macProcessSlotInd);
-
-#ifdef MAC_FREE_RING_BUF
- gMacTId = pthread_self();
-#endif
-
- cellCb = rgCb[inst].cell;
- if (cellCb == NULLP)
- {
- err.errType = RGERR_TOM_TTIIND;
- err.errCause = RGERR_TOM_INV_CELL_ID;
- RETVALUE(RFAILED);
- }
-
- RGCPYTIMEINFO(slotInd, cellCb->crntTime);
-
- rgMacGT = (slotInd.sfn * RG_NUM_SUB_FRAMES_5G) + slotInd.slot;
-#ifdef LTE_L2_MEAS
- rgL2Meas(cellCb);
- /*Included to track the number of 10240 cycles completed */
-
- if((cellCb->crntTime.sfn == 0) && (cellCb->crntTime.slot==0))
- {
- cellCb->ttiCycle += 1;
- }
-
-#endif
-
- /*Check if we have transmitted the previous DL SF, it could be the
- case that we haven't received all the DATA from RLC as yet
- and thus we would not have transmitted previous DL SF yet.*/
-/* ADD Changes for Downlink UE Timing Optimization */
-#ifdef LTEMAC_DLUE_TMGOPTMZ
- RGSUBFRMCRNTTIME(slotInd, prevTmInfo, 1);
- prevDlSf = &cellCb->subFrms[(prevTmInfo.slot % RG_NUM_SUB_FRAMES)];
- if(FALSE == prevDlSf->txDone)
- {
- if (ROK != rgTOMUtlProcDlSf (prevDlSf, cellCb, &err))
- {
- RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to process "
- "previous downlink subframe for cell");
- err.errType = RGERR_TOM_TTIIND;
- }
-
- /* Mark this frame as sent */
- prevDlSf->txDone = TRUE;
-
- if(prevDlSf->remDatReqCnt)
- {
- /*We have not received 1 or more data requests from RLC, this is
- error scenario. MAC & SCH need to discard the allocations for
- which data request hasn't been received as yet. And MAC
- needs to inform SCH about the list of UEs for which
- allocation need to be discarded. */
- prevDlSf->remDatReqCnt = 0;
- }
- }
-#endif
-
- /* Mux Pdu for Msg4 */
- buildAndSendMuxPdu(slotInd);
-
- /* Trigger for DL TTI REQ */
- handleDlTtiReq(slotInd);
-
- /* Trigger for UL TTI REQ */
- handleUlTtiReq(slotInd);
-
- dlSf = &cellCb->subFrms[(slotInd.slot % RG_NUM_SUB_FRAMES)];
-
- if((dlSf->txDone == TRUE) ||
- (!RG_TIMEINFO_SAME(slotInd,dlSf->schdTime)))
- {
- /* MS_WORKAROUND */
-#ifndef LTEMAC_DLUE_TMGOPTMZ
- TfuDatReqInfo *datInfo;
- CmLteTimingInfo timingInfo;
-#ifdef TFU_DL_DELTA_CHANGE
- RGADDTOCRNTTIME(cellCb->crntTime, timingInfo, TFU_DLDATA_DLDELTA);
-#else
- RGADDTOCRNTTIME(cellCb->crntTime, timingInfo, TFU_DELTA);
-#endif
- /* Fill Data Request from MAC for BCH */
- if ((timingInfo.sfn % 4 == 0) && (timingInfo.slot == 0))
- {
- if (ROK != rgAllocEventMem(inst,(Ptr *)&datInfo,
- sizeof(TfuDatReqInfo)))
- {
- RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,
- "rgTOMUtlProcDlSf() Unable to Allocate TfuDatReqInfo for cell");
- RETVALUE(RFAILED);
- }
- else
- {
- cmLListInit(&datInfo->pdus);
- datInfo->cellId = cellCb->cellId;
- datInfo->bchDat.pres = NOTPRSNT;
- datInfo->timingInfo = timingInfo;
-
-
- /* sending the dummy data req to Phy */
- if (rgLIMTfuDatReq(inst,datInfo) != ROK)
- {
- RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,
- "rgTOMUtlProcDlSf() Unable to send data info for cell");
- }
-
- }
- }
-#endif
- /* Freeing as the part of CL Non RT Indication */
- /* TDOD : Generalize for all SOCs */
-#if !(defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
- rgDHMFreeTbBufs(inst);
-#endif
- RETVALUE(ROK);
- }
-
- /*Return if there is still some data to be received
- from RLC for this DL SF. */
-/* ADD Changes for Downlink UE Timing Optimization */
-#ifdef LTEMAC_DLUE_TMGOPTMZ
- if(0 != dlSf->remDatReqCnt)
- {
- /* Freeing as the part of CL Non RT Indication */
- /* TODO : Generalize for all SOCs and remove this flag */
-#if !(defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
- rgDHMFreeTbBufs(inst);
-#endif
- RETVALUE(ROK);
- }
-#endif
-
-#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((slotInd.slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_BR_PRC);
-#endif
-
- if (ROK != rgTOMUtlProcDlSf (dlSf, cellCb, &err))
- {
- //RLOG_ARG0(L_ERROR,DBG_CELLID,slotInd->cellId,
- // "Unable to process downlink subframe for cell");
- err.errType = RGERR_TOM_TTIIND;
- }
-#ifdef XEON_SPECIFIC_CHANGES
- CM_MEAS_TIME((slotInd->slot % RG_NUM_SUB_FRAMES), CM_DBG_MAC_TTI_IND, CM_DBG_MAC_DL_AFTER_PRC);
-#endif
-
- /* Mark this frame as sent */
- dlSf->txDone = TRUE;
-
- /* Freeing as the part of CL Non RT Indication */
- /* TODO : Generalize for all SOCs and remove this flag */
-#if !(defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
- rgDHMFreeTbBufs(inst);
-#endif
- RETVALUE(ROK);
-} /* macProcessSlotInd */
-
/** @brief This function allocates the RgMacPdu that will be populated by DEMUX
* with the SubHeaders list and the values of the Control elements.
*
U32 ueCount
));
-EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
+EXTERN uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
#ifdef __cplusplus
}
#endif /* __cplusplus */
static int RLOG_MODULE_ID=4096;
/* header include files -- defines (.h) */
-#include "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-#include "gen.h" /* general layer */
-#include "ssi.h" /* system service interface */
-#include "cm5.h" /* common timers */
-#include "cm_hash.h" /* common hash list */
-#include "cm_mblk.h" /* common memory link list library */
-#include "cm_llist.h" /* common linked list library */
-#include "cm_err.h" /* common error */
-#include "cm_lte.h" /* common LTE */
+#include "common_def.h"
#include "lrg.h"
#include "rgr.h"
#include "rgm.h"
#include "rl_common.h"
/* header/extern include files (.x) */
-#include "gen.x" /* general layer */
-#include "ssi.x" /* system service interface */
-#include "cm5.x" /* common timers */
-#include "cm_lib.x" /* common library */
-#include "cm_hash.x" /* common hash list */
-#include "cm_llist.x" /* common linked list library */
-#include "cm_mblk.x" /* memory management */
-#include "cm_tkns.x" /* common tokens */
-#include "cm_lte.x" /* common LTE */
#include "lrg.x"
#include "rgr.x"
#include "rgm.x"
#include "rgm.x" /* layer management typedefs for MAC */
#include "rg_sch_inf.x" /* typedefs for Scheduler */
#include "rg_sch.x" /* typedefs for Scheduler */
-
+#include "mac_sch_interface.h"
\f
#ifdef LCRGMILRG
case EVTMACSCHGENCFGREQ:
/* Process a config. request */
- cmUnpkLrgSchCfgReq(HandleSchGenCfgReq, pst, mBuf);
+ cmUnpkLrgSchCfgReq(SchProcGenCfgReq, pst, mBuf);
break;
case EVTLRGSCHCNTRLREQ:
/* Process a control request */
#endif
#endif
case EVENT_SLOT_IND_TO_SCH:
- cmUnpackMacSchSlotInd(macSchSlotInd, pst, mBuf);
+ unpackMacSchSlotInd(macSchSlotInd, pst, mBuf);
break;
default:
RGSCH_FREE_MSG(mBuf);
*
* Function : rgSCHLmmSapCfg
*
- * This function in called by HandleSchGenCfgReq(). It handles the
+ * This function in called by SchProcGenCfgReq(). It handles the
* interface SAP configuration of the scheduler instance. It
* initializes the sapState to LRG_UNBND. Returns
* reason for success/failure of this function.
/* local defines */
SchCellCfgCfmFunc SchCellCfgCfmOpts[] =
{
- packSchCellCfgCfm, /* LC */
- MacProcSchCellCfgCfm, /* TC */
- packSchCellCfgCfm /* LWLC */
+ packSchCellCfgCfm, /* LC */
+ MacProcSchCellCfgCfm, /* TC */
+ packSchCellCfgCfm /* LWLC */
};
* @return int
* -# ROK
**/
-int schActvInit
-(
-Ent entity, /* entity */
-Inst instId, /* instance */
-Region region, /* region */
-Reason reason /* reason */
-)
+uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason)
{
Inst inst = (instId - SCH_INST_START);
schCb[inst].schInit.trc = FALSE;
schCb[inst].schInit.procId = SFndProcId();
- RETVALUE(ROK);
+ return ROK;
} /* schActvInit */
/**
*
* Function : SchInstCfg
*
- * This function in called by HandleSchGenCfgReq(). It handles the
+ * This function in called by SchProcGenCfgReq(). It handles the
* general configurations of the scheduler instance. Returns
* reason for success/failure of this function.
*
* -# LCM_REASON_INVALID_MSGTYPE
* -# LCM_REASON_MEM_NOAVAIL
**/
-PUBLIC U16 SchInstCfg
-(
-RgCfg *cfg, /* Configuaration information */
-Inst dInst
-)
+PUBLIC U16 SchInstCfg(RgCfg *cfg, Inst dInst)
{
uint16_t ret = LCM_REASON_NOT_APPL;
Inst inst = (dInst - SCH_INST_START);
/* Check if Instance Configuration is done already */
if (schCb[inst].schInit.cfgDone == TRUE)
{
- RETVALUE(LCM_REASON_INVALID_MSGTYPE);
+ return LCM_REASON_INVALID_MSGTYPE;
}
/* Update the Pst structure for LM interface */
cmMemcpy((U8 *)&schCb[inst].schInit.lmPst,
- (U8 *)&cfg->s.schInstCfg.genCfg.lmPst,
- sizeof(Pst));
-
+ (U8 *)&cfg->s.schInstCfg.genCfg.lmPst,
+ sizeof(Pst));
+
schCb[inst].schInit.inst = inst;
schCb[inst].schInit.lmPst.srcProcId = schCb[inst].schInit.procId;
schCb[inst].schInit.lmPst.srcEnt = schCb[inst].schInit.ent;
schCb[inst].schInit.lmPst.srcInst = schCb[inst].schInit.inst +
- SCH_INST_START;
+ SCH_INST_START;
schCb[inst].schInit.lmPst.event = EVTNONE;
schCb[inst].schInit.region = cfg->s.schInstCfg.genCfg.mem.region;
/* SS_MT_TMR needs to be enabled as schActvTmr needs instance information */
/* Timer Registration request to SSI */
if (SRegTmrMt(schCb[inst].schInit.ent, dInst,
- (S16)schCb[inst].genCfg.tmrRes, schActvTmr) != ROK)
+ (S16)schCb[inst].genCfg.tmrRes, schActvTmr) != ROK)
{
RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "SchInstCfg(): Failed to "
- "register timer.");
+ "register timer.");
RETVALUE(LCM_REASON_MEM_NOAVAIL);
}
#endif
/* Set Config done in TskInit */
schCb[inst].schInit.cfgDone = TRUE;
printf("\nScheduler gen config done");
-
- RETVALUE(ret);
+
+ return ret;
}
/**
*
* @details
*
- * Function : HandleSchGenCfgReq
+ * Function : SchProcGenCfgReq
*
* This function handles the configuration
* request received at scheduler instance from the Layer Manager.
* @return S16
* -# ROK
**/
-int HandleSchGenCfgReq
-(
-Pst *pst, /* post structure */
-RgMngmt *cfg /* config structure */
-)
+int SchProcGenCfgReq(Pst *pst, RgMngmt *cfg)
{
uint16_t ret = LCM_PRIM_OK;
uint16_t reason = LCM_REASON_NOT_APPL;
if(pst->dstInst < SCH_INST_START)
{
DU_LOG("\nInvalid inst ID");
- DU_LOG("\nHandleSchGenCfgReq(): "
- "pst->dstInst=%d SCH_INST_START=%d", pst->dstInst,SCH_INST_START);
- RETVALUE(ROK);
+ DU_LOG("\nSchProcGenCfgReq(): "
+ "pst->dstInst=%d SCH_INST_START=%d", pst->dstInst,SCH_INST_START);
+ return ROK;
}
printf("\nReceived scheduler gen config");
/* Fill the post structure for sending the confirmation */
- memset(&cfmPst, 0 , sizeof(Pst));
+ memset(&cfmPst, 0 , sizeof(Pst));
SchFillCfmPst(pst, &cfmPst, cfg);
cmMemset((U8 *)&cfm, 0, sizeof(RgMngmt));
switch(cfg->hdr.elmId.elmnt)
{
case STSCHINST:
- reason = SchInstCfg(&cfg->t.cfg,pst->dstInst );
- break;
+ reason = SchInstCfg(&cfg->t.cfg,pst->dstInst );
+ break;
default:
- ret = LCM_PRIM_NOK;
- reason = LCM_REASON_INVALID_ELMNT;
- DU_LOG("\nInvalid Elmnt=%d", cfg->hdr.elmId.elmnt);
- break;
+ ret = LCM_PRIM_NOK;
+ reason = LCM_REASON_INVALID_ELMNT;
+ DU_LOG("\nInvalid Elmnt=%d", cfg->hdr.elmId.elmnt);
+ break;
}
if (reason != LCM_REASON_NOT_APPL)
SchSendCfgCfm(&cfmPst, &cfm);
/* SPutSBuf(pst->region, pst->pool, (Data *)cfg, sizeof(RgMngmt)); */
-
- RETVALUE(ROK);
-}/*-- HandleSchGenCfgReq --*/
+
+ return ROK;
+}/*-- SchProcGenCfgReq --*/
/**
* @brief slot indication from MAC to SCH.
* -# ROK
* -# RFAILED
**/
-int macSchSlotInd
-(
-Pst *pst,
-SlotIndInfo *slotInd
-)
+uint8_t macSchSlotInd(Pst *pst, SlotIndInfo *slotInd)
{
Inst inst = pst->dstInst-SCH_INST_START;
/* Now call the TOM (Tfu ownership module) primitive to process further */
schProcessSlotInd(slotInd, inst);
- RETVALUE(ROK);
+ return ROK;
} /* macSchSlotInd */
/*******************************************************************
* RFAILED - failure
*
* ****************************************************************/
-int macSchRachInd(Pst *pst, RachIndInfo *rachInd)
+uint8_t macSchRachInd(Pst *pst, RachIndInfo *rachInd)
{
Inst inst = pst->dstInst-SCH_INST_START;
DU_LOG("\nSCH : Received Rach indication");
* RFAILED - failure
*
* ****************************************************************/
-int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
+uint8_t macSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
{
switch(crcInd->crcInd[0])
- {
+ {
case CRC_FAILED:
- DU_LOG("\nSCH : Received CRC indication. CRC Status [FAILURE]");
- break;
+ DU_LOG("\nSCH : Received CRC indication. CRC Status [FAILURE]");
+ break;
case CRC_PASSED:
- DU_LOG("\nSCH : Received CRC indication. CRC Status [PASS]");
- break;
- default:
- DU_LOG("\nSCH : Invalid CRC state %d", crcInd->crcInd[0]);
- return RFAILED;
- }
+ DU_LOG("\nSCH : Received CRC indication. CRC Status [PASS]");
+ break;
+ default:
+ DU_LOG("\nSCH : Invalid CRC state %d", crcInd->crcInd[0]);
+ return RFAILED;
+ }
return ROK;
}
{
SchCellCb *cell;
SCH_ALLOC(cell, sizeof(SchCellCb));
- if(!cell)
- {
+ if(!cell)
+ {
DU_LOG("\nMemory allocation failed in InitSchCellCb");
- return RFAILED;
- }
-
- cell->cellId = schCellCfg->cellId;
- cell->instIdx = inst;
- switch(schCellCfg->ssbSchCfg.scsCommon)
- {
- case SCH_SCS_15KHZ:
- {
- cell->numSlots = SCH_NUM_SLOTS;
- }
- break;
- default:
- DU_LOG("\nSCS %d not supported", schCellCfg->ssbSchCfg.scsCommon);
- }
-
+ return RFAILED;
+ }
+
+ cell->cellId = schCellCfg->cellId;
+ cell->instIdx = inst;
+ switch(schCellCfg->ssbSchCfg.scsCommon)
+ {
+ case SCH_SCS_15KHZ:
+ {
+ cell->numSlots = SCH_NUM_SLOTS;
+ }
+ break;
+ default:
+ DU_LOG("\nSCS %d not supported", schCellCfg->ssbSchCfg.scsCommon);
+ }
+
for(uint8_t idx=0; idx<SCH_NUM_SLOTS; idx++)
- {
- SchDlSlotInfo *schDlSlotInfo;
- SchUlSlotInfo *schUlSlotInfo;
+ {
+ SchDlSlotInfo *schDlSlotInfo;
+ SchUlSlotInfo *schUlSlotInfo;
/* DL Alloc */
- SCH_ALLOC(schDlSlotInfo, sizeof(SchDlSlotInfo));
- if(!schDlSlotInfo)
- {
- DU_LOG("\nMemory allocation failed in InitSchCellCb");
- return RFAILED;
- }
+ SCH_ALLOC(schDlSlotInfo, sizeof(SchDlSlotInfo));
+ if(!schDlSlotInfo)
+ {
+ DU_LOG("\nMemory allocation failed in InitSchCellCb");
+ return RFAILED;
+ }
/* UL Alloc */
- SCH_ALLOC(schUlSlotInfo, sizeof(SchUlSlotInfo));
- if(!schUlSlotInfo)
- {
- DU_LOG("\nMemory allocation failed in InitSchCellCb");
- return RFAILED;
- }
+ SCH_ALLOC(schUlSlotInfo, sizeof(SchUlSlotInfo));
+ if(!schUlSlotInfo)
+ {
+ DU_LOG("\nMemory allocation failed in InitSchCellCb");
+ return RFAILED;
+ }
memset(schDlSlotInfo, 0, sizeof(SchDlSlotInfo));
- memset(schUlSlotInfo, 0, sizeof(SchUlSlotInfo));
+ memset(schUlSlotInfo, 0, sizeof(SchUlSlotInfo));
schDlSlotInfo->totalPrb = schUlSlotInfo->totalPrb = MAX_NUM_RB;
- for(uint8_t itr=0; itr<SCH_SYMBOL_PER_SLOT; itr++)
- {
- schDlSlotInfo->assignedPrb[itr] = 0;
- schUlSlotInfo->assignedPrb[itr] = 0;
- }
- schUlSlotInfo->schPuschInfo = NULLP;
+ for(uint8_t itr=0; itr<SCH_SYMBOL_PER_SLOT; itr++)
+ {
+ schDlSlotInfo->assignedPrb[itr] = 0;
+ schUlSlotInfo->assignedPrb[itr] = 0;
+ }
+ schUlSlotInfo->schPuschInfo = NULLP;
- for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
- {
- memset(&schDlSlotInfo->ssbInfo[itr], 0, sizeof(SsbInfo));
- }
+ for(uint8_t itr=0; itr<MAX_SSB_IDX; itr++)
+ {
+ memset(&schDlSlotInfo->ssbInfo[itr], 0, sizeof(SsbInfo));
+ }
- cell->schDlSlotInfo[idx] = schDlSlotInfo;
- cell->schUlSlotInfo[idx] = schUlSlotInfo;
+ cell->schDlSlotInfo[idx] = schDlSlotInfo;
+ cell->schUlSlotInfo[idx] = schUlSlotInfo;
- }
- schCb[inst].cells[inst] = cell;
+ }
+ schCb[inst].cells[inst] = cell;
DU_LOG("\nCell init completed for cellId:%d", cell->cellId);
return ROK;
}
-void fillSchSib1Cfg(
-Inst schInst,
-SchSib1Cfg *sib1SchCfg,
-uint16_t pci,
-uint8_t offsetPointA
-)
+/**
+ * @brief Fill SIB1 configuration
+ *
+ * @details
+ *
+ * Function : fillSchSib1Cfg
+ *
+ * Fill SIB1 configuration
+ *
+ * @param[in] Inst schInst : scheduler instance
+ * SchSib1Cfg *sib1SchCfg : cfg to be filled
+ * uint16_t pci : physical cell Id
+ * uint8_t offsetPointA : offset
+ * @return void
+ **/
+void fillSchSib1Cfg(Inst schInst, SchSib1Cfg *sib1SchCfg, uint16_t pci, \
+ uint8_t offsetPointA)
{
uint8_t coreset0Idx = 0;
uint8_t searchSpace0Idx = 0;
uint8_t slotIndex = 0;
uint8_t FreqDomainResource[6] = {0};
uint16_t tbSize = 0;
- uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
+ uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
PdcchCfg *pdcch = &(sib1SchCfg->sib1PdcchCfg);
PdschCfg *pdsch = &(sib1SchCfg->sib1PdschCfg);
* Also, from this configuration, coreset0 is only on even subframe */
slotIndex = ((oValue * 1) + (0 * mValue)) % 10;
sib1SchCfg->n0 = slotIndex;
-
+
/* calculate the PRBs */
schAllocFreqDomRscType0(((offsetPointA-offset)/6), (numRbs/6), FreqDomainResource);
pdcch->dci.beamPdcchInfo.prg[0].beamIdx[0] = 0;
pdcch->dci.txPdcchPower.powerValue = 0;
pdcch->dci.txPdcchPower.powerControlOffsetSS = 0;
- /* Storing pdschCfg pointer here. Required to access pdsch config while
- fillig up pdcch pdu */
+ /* Storing pdschCfg pointer here. Required to access pdsch config while
+ fillig up pdcch pdu */
pdcch->dci.pdschCfg = pdsch;
/* fill the PDSCH PDU */
- uint8_t cwCount = 0;
+ uint8_t cwCount = 0;
pdsch->pduBitmap = 0; /* PTRS and CBG params are excluded */
pdsch->rnti = 0xFFFF; /* SI-RNTI */
pdsch->pduIndex = 0;
pdsch->numCodewords = 1;
- for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
- {
+ for(cwCount = 0; cwCount < pdsch->numCodewords; cwCount++)
+ {
pdsch->codeword[cwCount].targetCodeRate = 308;
pdsch->codeword[cwCount].qamModOrder = 2;
pdsch->codeword[cwCount].mcsIndex = sib1SchCfg->sib1Mcs;
pdsch->dmrs.scid = 0;
pdsch->dmrs.numDmrsCdmGrpsNoData = 1;
pdsch->dmrs.dmrsPorts = 0;
- pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Type-A */
- pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
- pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
+ pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Type-A */
+ pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
+ pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
- pdsch->pdschFreqAlloc.freqAlloc.startPrb = offset + SCH_SSB_NUM_PRB; /* the RB numbering starts from coreset0,
- and PDSCH is always above SSB */
+ pdsch->pdschFreqAlloc.freqAlloc.startPrb = offset + SCH_SSB_NUM_PRB; /* the RB numbering starts from coreset0,
+ and PDSCH is always above SSB */
pdsch->pdschFreqAlloc.freqAlloc.numPrb = schCalcNumPrb(tbSize,sib1SchCfg->sib1Mcs,numPdschSymbols);
pdsch->pdschFreqAlloc.vrbPrbMapping = 0; /* non-interleaved */
pdsch->pdschTimeAlloc.rowIndex = 1;
**/
void fillSsbStartSymb(SchCellCb *cellCb)
{
- uint8_t cnt, scs;
+ uint8_t cnt, scs;
- scs = cellCb->cellCfg.ssbSchCfg.scsCommon;
- uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM];
+ scs = cellCb->cellCfg.ssbSchCfg.scsCommon;
+ uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM];
memset(ssbStartSymbArr, 0, sizeof(SCH_MAX_SSB_BEAM));
- /* Determine value of "n" based on Section 4.1 of 3GPP TS 38.213 */
- switch(scs)
- {
- case SCH_SCS_15KHZ:
- {
- uint8_t symbIdx=0;
- cnt = 2;/* n = 0, 1 for SCS = 15KHz */
- for(uint8_t idx=0; idx<cnt; idx++)
- {
- /* start symbol determined using {2, 8} + 14n */
- ssbStartSymbArr[symbIdx++] = 2 + SCH_SYMBOL_PER_SLOT*idx;
- ssbStartSymbArr[symbIdx++] = 8 + SCH_SYMBOL_PER_SLOT*idx;
- }
- }
- break;
- default:
- DU_LOG("\nSCS %d is currently not supported", scs);
- }
+ /* Determine value of "n" based on Section 4.1 of 3GPP TS 38.213 */
+ switch(scs)
+ {
+ case SCH_SCS_15KHZ:
+ {
+ uint8_t symbIdx=0;
+ cnt = 2;/* n = 0, 1 for SCS = 15KHz */
+ for(uint8_t idx=0; idx<cnt; idx++)
+ {
+ /* start symbol determined using {2, 8} + 14n */
+ ssbStartSymbArr[symbIdx++] = 2 + SCH_SYMBOL_PER_SLOT*idx;
+ ssbStartSymbArr[symbIdx++] = 8 + SCH_SYMBOL_PER_SLOT*idx;
+ }
+ }
+ break;
+ default:
+ DU_LOG("\nSCS %d is currently not supported", scs);
+ }
memset(cellCb->ssbStartSymbArr, 0, sizeof(SCH_MAX_SSB_BEAM));
memcpy(cellCb->ssbStartSymbArr, ssbStartSymbArr, SCH_MAX_SSB_BEAM);
* -# ROK
* -# RFAILED
**/
-int SchHdlCellCfgReq
-(
-Pst *pst,
-SchCellCfg *schCellCfg
-)
+uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg)
{
- int ret = ROK;
+ uint8_t ret = ROK;
SchCellCb *cellCb;
- SchCellCfgCfm schCellCfgCfm;
- Pst rspPst;
- Inst inst = pst->dstInst-1;
+ SchCellCfgCfm schCellCfgCfm;
+ Pst rspPst;
+ Inst inst = pst->dstInst-1;
- InitSchCellCb(inst, schCellCfg);
- cellCb = schCb[inst].cells[inst]; //cells is of MAX_CELLS, why inst
+ InitSchCellCb(inst, schCellCfg);
+ cellCb = schCb[inst].cells[inst]; //cells is of MAX_CELLS, why inst
cellCb->macInst = pst->srcInst;
/* derive the SIB1 config parameters */
- fillSchSib1Cfg(
- inst,
- &(schCellCfg->sib1SchCfg),
- schCellCfg->phyCellId,
- schCellCfg->ssbSchCfg.ssbOffsetPointA);
+ fillSchSib1Cfg(
+ inst,
+ &(schCellCfg->sib1SchCfg),
+ schCellCfg->phyCellId,
+ schCellCfg->ssbSchCfg.ssbOffsetPointA);
memcpy(&cellCb->cellCfg, schCellCfg, sizeof(SchCellCfg));
+ /* Fill and send Cell config confirm */
memset(&rspPst, 0, sizeof(Pst));
- SCH_FILL_RSP_PST(rspPst, inst);
- rspPst.event = EVENT_SCH_CELL_CFG_CFM;
- schCellCfgCfm.rsp = RSP_OK;
-
+ FILL_PST_SCH_TO_MAC(rspPst, pst->dstInst);
+ rspPst.event = EVENT_SCH_CELL_CFG_CFM;
+
+ schCellCfgCfm.cellId = schCellCfg->cellId;
+ schCellCfgCfm.rsp = RSP_OK;
+
ret = (*SchCellCfgCfmOpts[rspPst.selector])(&rspPst, &schCellCfgCfm);
return ret;
SchCellCb *cell = schCb[inst].cells[inst];
SchDlSlotInfo *schDlSlotInfo = \
- cell->schDlSlotInfo[(cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + MSG4_DELAY) % SCH_NUM_SLOTS];
-
+ cell->schDlSlotInfo[(cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + MSG4_DELAY) % SCH_NUM_SLOTS];
+
for(lcIdx = 0; lcIdx < dlBoInfo->numLc; lcIdx++)
- {
- if(dlBoInfo->boInfo[lcIdx].lcId == CCCH_LCID)
- {
- SCH_ALLOC(schDlSlotInfo->msg4Info, sizeof(Msg4Info));
- if(!schDlSlotInfo->msg4Info)
- {
- DU_LOG("\nSCH : Memory allocation failed for msg4Info");
- schDlSlotInfo = NULL;
- return RFAILED;
- }
- schDlSlotInfo->msg4Info->crnti = dlBoInfo->crnti;
- schDlSlotInfo->msg4Info->ndi = 1;
- schDlSlotInfo->msg4Info->harqProcNum = 0;
- schDlSlotInfo->msg4Info->dlAssignIdx = 0;
- schDlSlotInfo->msg4Info->pucchTpc = 0;
- schDlSlotInfo->msg4Info->pucchResInd = 0;
- schDlSlotInfo->msg4Info->harqFeedbackInd = 0;
- schDlSlotInfo->msg4Info->dciFormatId = 1;
- }
- }
+ {
+ if(dlBoInfo->boInfo[lcIdx].lcId == CCCH_LCID)
+ {
+ SCH_ALLOC(schDlSlotInfo->msg4Info, sizeof(Msg4Info));
+ if(!schDlSlotInfo->msg4Info)
+ {
+ DU_LOG("\nSCH : Memory allocation failed for msg4Info");
+ schDlSlotInfo = NULL;
+ return RFAILED;
+ }
+ schDlSlotInfo->msg4Info->crnti = dlBoInfo->crnti;
+ schDlSlotInfo->msg4Info->ndi = 1;
+ schDlSlotInfo->msg4Info->harqProcNum = 0;
+ schDlSlotInfo->msg4Info->dlAssignIdx = 0;
+ schDlSlotInfo->msg4Info->pucchTpc = 0;
+ schDlSlotInfo->msg4Info->pucchResInd = 0;
+ schDlSlotInfo->msg4Info->harqFeedbackInd = 0;
+ schDlSlotInfo->msg4Info->dciFormatId = 1;
+ }
+ }
return ROK;
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* macros */
#define SCH_INST_START 1
-#define SCH_MAX_CELLS 1
#define SCH_MAX_INST 1
#define SCH_NUM_SLOTS 10 /*forcing this to 10 */
#define SCH_MAX_SFN 1024
#define SCH_SYMBOL_PER_SLOT 14
#define SCH_SSB_NUM_SYMB 4
#define SCH_SSB_NUM_PRB 20
-#define SCH_MEM_REGION 4
-#define SCH_POOL 1
#define SCHED_DELTA 1
#define BO_DELTA 1
#define RAR_DELAY 2
#define MSG4_DELAY 1
-#define SCH_MAX_UE 1
#define PUSCH_START_RB 15
#define PUCCH_NUM_PRB_FORMAT_0 1 /* number of PRBs in freq domain, spec 38.213 - 9.2.1 */
#define SI_RNTI 0xFFFF
#define CRC_FAILED 0
#define CRC_PASSED 1
-/* allocate and zero out a static buffer */
-#define SCH_ALLOC(_datPtr, _size) \
-{ \
- S16 _ret; \
- _ret = SGetSBuf(SCH_MEM_REGION, SCH_POOL, \
- (Data **)&_datPtr, _size); \
- if(_ret == ROK) \
- { \
- cmMemset((U8*)_datPtr, 0, _size); \
- } \
- else \
- { \
- _datPtr = NULLP; \
- } \
-}
-
-/* free a static buffer */
-#define SCH_FREE(_datPtr, _size) \
-{ \
- if(_datPtr) \
- { \
- SPutSBuf(SCH_MEM_REGION, SCH_POOL, \
- (Data *)_datPtr, _size); \
- } \
-}
-
-#define SCH_FILL_RSP_PST(_rspPst, _inst)\
-{ \
- _rspPst.srcProcId = SFndProcId(); \
- _rspPst.dstProcId = SFndProcId();\
- _rspPst.srcEnt = ENTRG;\
- _rspPst.dstEnt = ENTRG;\
- _rspPst.srcInst = 1;\
- _rspPst.dstInst = 0;\
- _rspPst.selector = ODU_SELECTOR_TC;\
-}
extern uint8_t schProcessRachInd(RachIndInfo *rachInd, Inst schInst);
typedef enum
SchUlSlotInfo *schUlSlotInfo[SCH_NUM_SLOTS]; /*!< SCH resource allocations in UL */
SchCellCfg cellCfg; /*!< Cell ocnfiguration */
uint8_t ssbStartSymbArr[SCH_MAX_SSB_BEAM]; /*!<start symbol per SSB beam */
- SchRaCb raCb[SCH_MAX_UE]; /*!< Rach Cb */
+ SchRaCb raCb[MAX_NUM_UE]; /*!< Rach Cb */
uint16_t numActvUe;
- SchUeCb ueCb[SCH_MAX_UE];
+ SchUeCb ueCb[MAX_NUM_UE];
}SchCellCb;
/**
{
TskInit schInit; /*!< Task Init info */
SchGenCb genCfg; /*!< General Config info */
- SchCellCb *cells[SCH_MAX_CELLS]; /* Array to store cellCb ptr */
+ SchCellCb *cells[MAX_NUM_CELL]; /* Array to store cellCb ptr */
}SchCb;
/* Declaration for scheduler control blocks */
SchMacUlSchInfoFunc schMacUlSchInfoOpts[] =
{
- packSchMacUlSchInfo,
- MacProcUlSchInfo,
- packSchMacUlSchInfo
+ packSchMacUlSchInfo,
+ MacProcUlSchInfo,
+ packSchMacUlSchInfo
};
/**
* @return void
**/
uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,
- uint16_t slot)
+ uint16_t slot)
{
- /* schedule SSB */
- uint8_t ssbStartPrb, ssbStartSymb, idx;
- SchDlSlotInfo *schDlSlotInfo;
- SsbInfo ssbInfo;
-
- schDlSlotInfo = cell->schDlSlotInfo[slot];
- if(dlBrdcstAlloc->ssbTrans)
- {
- ssbStartPrb = cell->cellCfg.ssbSchCfg.ssbOffsetPointA;
+ /* schedule SSB */
+ uint8_t ssbStartPrb, ssbStartSymb, idx;
+ SchDlSlotInfo *schDlSlotInfo;
+ SsbInfo ssbInfo;
+
+ schDlSlotInfo = cell->schDlSlotInfo[slot];
+ if(dlBrdcstAlloc->ssbTrans)
+ {
+ ssbStartPrb = cell->cellCfg.ssbSchCfg.ssbOffsetPointA;
ssbStartSymb = cell->ssbStartSymbArr[dlBrdcstAlloc->ssbIdxSupported-1]; /*since we are
- supporting only 1 ssb beam */
-
- /* Assign interface structure */
- for(idx=0; idx<dlBrdcstAlloc->ssbIdxSupported; idx++)
- {
- ssbInfo.ssbIdx = idx;
- ssbInfo.fdAlloc.startPrb = ssbStartPrb;
- ssbInfo.fdAlloc.numPrb = SCH_SSB_NUM_PRB;
- ssbInfo.tdAlloc.startSymb = ssbStartSymb;
- ssbInfo.tdAlloc.numSymb = SCH_SSB_NUM_SYMB;
- dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
- schDlSlotInfo->ssbInfo[idx] = ssbInfo;
- }
-
- schDlSlotInfo->ssbPres = true;
- schDlSlotInfo->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported;
- for(idx=ssbStartSymb; idx<ssbStartSymb+SCH_SSB_NUM_SYMB; idx++)
- {
- schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */
- }
- }
-
- /* SIB1 allocation */
- if(dlBrdcstAlloc->sib1Trans)
- {
- schDlSlotInfo->sib1Pres = true;
- for(idx=0; idx<SCH_SYMBOL_PER_SLOT; idx++)
- {
- schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + 10; /* 10 PRBs for sib1 */
- }
- memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->cellCfg.sib1SchCfg.bwp, sizeof(BwpCfg));
- memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg));
- memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdschCfg, &cell->cellCfg.sib1SchCfg.sib1PdschCfg, sizeof(PdschCfg));
- }
- return ROK;
+ supporting only 1 ssb beam */
+
+ /* Assign interface structure */
+ for(idx=0; idx<dlBrdcstAlloc->ssbIdxSupported; idx++)
+ {
+ ssbInfo.ssbIdx = idx;
+ ssbInfo.fdAlloc.startPrb = ssbStartPrb;
+ ssbInfo.fdAlloc.numPrb = SCH_SSB_NUM_PRB;
+ ssbInfo.tdAlloc.startSymb = ssbStartSymb;
+ ssbInfo.tdAlloc.numSymb = SCH_SSB_NUM_SYMB;
+ dlBrdcstAlloc->ssbInfo[idx] = ssbInfo;
+ schDlSlotInfo->ssbInfo[idx] = ssbInfo;
+ }
+
+ schDlSlotInfo->ssbPres = true;
+ schDlSlotInfo->ssbIdxSupported = dlBrdcstAlloc->ssbIdxSupported;
+ for(idx=ssbStartSymb; idx<ssbStartSymb+SCH_SSB_NUM_SYMB; idx++)
+ {
+ schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1; /* +1 for kSsb */
+ }
+ }
+
+ /* SIB1 allocation */
+ if(dlBrdcstAlloc->sib1Trans)
+ {
+ schDlSlotInfo->sib1Pres = true;
+ for(idx=0; idx<SCH_SYMBOL_PER_SLOT; idx++)
+ {
+ schDlSlotInfo->assignedPrb[idx] = ssbStartPrb + SCH_SSB_NUM_PRB + 1 + 10; /* 10 PRBs for sib1 */
+ }
+ memcpy(&dlBrdcstAlloc->sib1Alloc.bwp, &cell->cellCfg.sib1SchCfg.bwp, sizeof(BwpCfg));
+ memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdcchCfg, &cell->cellCfg.sib1SchCfg.sib1PdcchCfg, sizeof(PdcchCfg));
+ memcpy(&dlBrdcstAlloc->sib1Alloc.sib1PdschCfg, &cell->cellCfg.sib1SchCfg.sib1PdschCfg, sizeof(PdschCfg));
+ }
+ return ROK;
}
/*******************************************************************
* ****************************************************************/
int sendUlSchInfoToMac(UlSchedInfo *ulSchedInfo, Inst inst)
{
- Pst pst;
+ Pst pst;
memset(&pst, 0, sizeof(Pst));
- SCH_FILL_RSP_PST(pst, inst);
- pst.event = EVENT_UL_SCH_INFO;
+ FILL_PST_SCH_TO_MAC(pst, inst);
+ pst.event = EVENT_UL_SCH_INFO;
- return(*schMacUlSchInfoOpts[pst.selector])(&pst, ulSchedInfo);
+ return(*schMacUlSchInfoOpts[pst.selector])(&pst, ulSchedInfo);
}
/**
* @brief resource allocation for PRACH
{
uint8_t puschScs;
uint8_t numPrachRb = 0;
- uint8_t numRa = 0;
- uint8_t freqStart = 0;
- uint8_t prachCfgIdx = 0;
- uint8_t prachFormat = 0;
- uint8_t x = 0;
- uint8_t y = 0;
- uint16_t prachSubframe = 0;
- uint8_t prachStartSymbol = 0;
- uint8_t prachOcas = 0;
- uint8_t dataType = 0;
- uint8_t idx = 0;
- SchUlSlotInfo *schUlSlotInfo = NULLP;
+ uint8_t numRa = 0;
+ uint8_t freqStart = 0;
+ uint8_t prachCfgIdx = 0;
+ uint8_t prachFormat = 0;
+ uint8_t x = 0;
+ uint8_t y = 0;
+ uint16_t prachSubframe = 0;
+ uint8_t prachStartSymbol = 0;
+ uint8_t prachOcas = 0;
+ uint8_t dataType = 0;
+ uint8_t idx = 0;
+ SchUlSlotInfo *schUlSlotInfo = NULLP;
puschScs = cell->cellCfg.schInitialUlBwp.bwp.scs;
- schUlSlotInfo = cell->schUlSlotInfo[prachOccasionTimingInfo.slot];
- prachCfgIdx = cell->cellCfg.schRachCfg.prachCfgIdx;
-
- /* derive the prachCfgIdx table paramters */
- x = prachCfgIdxTable[prachCfgIdx][1];
- y = prachCfgIdxTable[prachCfgIdx][2];
- prachSubframe = prachCfgIdxTable[prachCfgIdx][3];
-
- if((prachOccasionTimingInfo.sfn%x) == y)
- {
- /* check for subFrame number */
- if ((1 << prachOccasionTimingInfo.slot) & prachSubframe)
- {
- /* prach ocassion present in this subframe */
-
- prachFormat = prachCfgIdxTable[prachCfgIdx][0];
- prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4];
- prachOcas = prachCfgIdxTable[prachCfgIdx][6];
-
- /* freq domain resource determination for RACH*/
- freqStart = cell->cellCfg.schRachCfg.msg1FreqStart;
- /* numRa determined as 𝑛 belonging {0,1,.., M − 1},
- * where M is given by msg1Fdm */
- numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1);
- for(idx=0; idx<MAX_RACH_NUM_RB_IDX; idx++)
- {
- if(numRbForPrachTable[idx][0] == cell->cellCfg.schRachCfg.rootSeqLen)
- {
- if(numRbForPrachTable[idx][1] == cell->cellCfg.schRachCfg.prachSubcSpacing)
- {
- if(numRbForPrachTable[idx][2] == puschScs)
- {
- break;
- }
- }
- }
- }
- numPrachRb = numRbForPrachTable[idx][3];
- dataType |= SCH_DATATYPE_PRACH;
- /* Considering first slot in the frame for PRACH */
- idx = 0;
- schUlSlotInfo->assignedPrb[idx] = freqStart+numPrachRb;
- }
- ulSchedInfo->dataType = dataType;
- /* prach info */
- ulSchedInfo->prachSchInfo.numPrachOcas = prachOcas;
- ulSchedInfo->prachSchInfo.prachFormat = prachFormat;
- ulSchedInfo->prachSchInfo.numRa = numRa;
- ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol;
- }
+ schUlSlotInfo = cell->schUlSlotInfo[prachOccasionTimingInfo.slot];
+ prachCfgIdx = cell->cellCfg.schRachCfg.prachCfgIdx;
+
+ /* derive the prachCfgIdx table paramters */
+ x = prachCfgIdxTable[prachCfgIdx][1];
+ y = prachCfgIdxTable[prachCfgIdx][2];
+ prachSubframe = prachCfgIdxTable[prachCfgIdx][3];
+
+ if((prachOccasionTimingInfo.sfn%x) == y)
+ {
+ /* check for subFrame number */
+ if ((1 << prachOccasionTimingInfo.slot) & prachSubframe)
+ {
+ /* prach ocassion present in this subframe */
+
+ prachFormat = prachCfgIdxTable[prachCfgIdx][0];
+ prachStartSymbol = prachCfgIdxTable[prachCfgIdx][4];
+ prachOcas = prachCfgIdxTable[prachCfgIdx][6];
+
+ /* freq domain resource determination for RACH*/
+ freqStart = cell->cellCfg.schRachCfg.msg1FreqStart;
+ /* numRa determined as 𝑛 belonging {0,1,.., M − 1},
+ * where M is given by msg1Fdm */
+ numRa = (cell->cellCfg.schRachCfg.msg1Fdm - 1);
+ for(idx=0; idx<MAX_RACH_NUM_RB_IDX; idx++)
+ {
+ if(numRbForPrachTable[idx][0] == cell->cellCfg.schRachCfg.rootSeqLen)
+ {
+ if(numRbForPrachTable[idx][1] == cell->cellCfg.schRachCfg.prachSubcSpacing)
+ {
+ if(numRbForPrachTable[idx][2] == puschScs)
+ {
+ break;
+ }
+ }
+ }
+ }
+ numPrachRb = numRbForPrachTable[idx][3];
+ dataType |= SCH_DATATYPE_PRACH;
+ /* Considering first slot in the frame for PRACH */
+ idx = 0;
+ schUlSlotInfo->assignedPrb[idx] = freqStart+numPrachRb;
+ }
+ ulSchedInfo->dataType = dataType;
+ /* prach info */
+ ulSchedInfo->prachSchInfo.numPrachOcas = prachOcas;
+ ulSchedInfo->prachSchInfo.prachFormat = prachFormat;
+ ulSchedInfo->prachSchInfo.numRa = numRa;
+ ulSchedInfo->prachSchInfo.prachStartSymb = prachStartSymbol;
+ }
}
uint16_t fillPucchResourceInfo(SchPucchInfo *schPucchInfo, Inst inst)
/* derive pucchResourceSet from schCellCfg */
SchCellCb *cell = schCb[inst].cells[inst];
SchPucchCfgCmn *pucchCfg = &cell->cellCfg.schInitialUlBwp.pucchCommon;
- uint8_t pucchIdx = pucchCfg->pucchResourceCommon;
- SchBwpParams *ulBwp = &cell->cellCfg.schInitialUlBwp.bwp;
+ uint8_t pucchIdx = pucchCfg->pucchResourceCommon;
+ SchBwpParams *ulBwp = &cell->cellCfg.schInitialUlBwp.bwp;
schPucchInfo->fdAlloc.startPrb = ulBwp->freqAlloc.startPrb + pucchResourceSet[pucchIdx][3];
schPucchInfo->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0;
schPucchInfo->tdAlloc.startSymb = pucchResourceSet[pucchIdx][1];
schPucchInfo->tdAlloc.numSymb = pucchResourceSet[pucchIdx][2];
- schPucchInfo->pucchFormat = pucchResourceSet[pucchIdx][0];
+ schPucchInfo->pucchFormat = pucchResourceSet[pucchIdx][0];
/* set HARQ flag to true */
schPucchInfo->harqFlag = true;
uint8_t schUlResAlloc(SchCellCb *cell, Inst schInst)
{
int ret = ROK;
- UlSchedInfo ulSchedInfo;
+ UlSchedInfo ulSchedInfo;
SchUlSlotInfo *schUlSlotInfo = NULLP;
SlotIndInfo ulTimingInfo;
- memset(&ulSchedInfo, 0, sizeof(UlSchedInfo));
+ memset(&ulSchedInfo, 0, sizeof(UlSchedInfo));
/* add PHY delta */
ADD_DELTA_TO_TIME(cell->slotInfo,ulTimingInfo,PHY_DELTA+SCHED_DELTA);
- ulSchedInfo.cellId = cell->cellId;
- ulSchedInfo.slotIndInfo.sfn = ulTimingInfo.sfn;
+ ulSchedInfo.cellId = cell->cellId;
+ ulSchedInfo.slotIndInfo.cellId = ulSchedInfo.cellId;
+ ulSchedInfo.slotIndInfo.sfn = ulTimingInfo.sfn;
ulSchedInfo.slotIndInfo.slot = ulTimingInfo.slot;
/* Schedule resources for PRACH */
- schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
+ schPrachResAlloc(cell, &ulSchedInfo, ulTimingInfo);
- schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot];
- if(schUlSlotInfo->schPuschInfo)
- {
+ schUlSlotInfo = cell->schUlSlotInfo[ulTimingInfo.slot];
+ if(schUlSlotInfo->schPuschInfo)
+ {
ulSchedInfo.crnti = cell->raCb[0].tcrnti;
- ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
- memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
- sizeof(SchPuschInfo));
- SCH_FREE(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
- schUlSlotInfo->schPuschInfo = NULL;
- }
-
- if(schUlSlotInfo->pucchPres)
- {
- ulSchedInfo.dataType |= SCH_DATATYPE_UCI;
- fillPucchResourceInfo(&schUlSlotInfo->schPucchInfo, schInst);
- memcpy(&ulSchedInfo.schPucchInfo, &schUlSlotInfo->schPucchInfo,
- sizeof(SchPucchInfo));
- memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
- }
-
- //send msg to MAC
+ ulSchedInfo.dataType |= SCH_DATATYPE_PUSCH;
+ memcpy(&ulSchedInfo.schPuschInfo, schUlSlotInfo->schPuschInfo,
+ sizeof(SchPuschInfo));
+ SCH_FREE(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
+ schUlSlotInfo->schPuschInfo = NULL;
+ }
+
+ if(schUlSlotInfo->pucchPres)
+ {
+ ulSchedInfo.dataType |= SCH_DATATYPE_UCI;
+ fillPucchResourceInfo(&schUlSlotInfo->schPucchInfo, schInst);
+ memcpy(&ulSchedInfo.schPucchInfo, &schUlSlotInfo->schPucchInfo,
+ sizeof(SchPucchInfo));
+ memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
+ }
+
+ //send msg to MAC
ret = sendUlSchInfoToMac(&ulSchedInfo, schInst);
if(ret != ROK)
{
DU_LOG("\nSending UL Sch info from SCH to MAC failed");
}
- memset(cell->schUlSlotInfo[ulTimingInfo.slot], 0, sizeof(SchUlSlotInfo));
+ memset(cell->schUlSlotInfo[ulTimingInfo.slot], 0, sizeof(SchUlSlotInfo));
- return ret;
+ return ret;
}
/*******************************************************************
uint8_t offsetPointA;
uint8_t FreqDomainResource[6] = {0};
uint16_t tbSize = 0;
- uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
+ uint8_t numPdschSymbols = 12; /* considering pdsch region from 2 to 13 */
uint8_t mcs = 4; /* MCS fixed to 4 */
SchBwpDlCfg *initialBwp;
for(firstSymbol=0; firstSymbol<14;firstSymbol++)
{
if(initialBwp->pdcchCommon.commonSearchSpace.monitoringSymbol & mask)
- break;
+ break;
else
- mask = mask>>1;
+ mask = mask>>1;
}
/* calculate the PRBs */
pdsch->codeword[cwCount].rvIndex = 0;
/* 38.214: Table 5.1.3.2-1, divided by 8 to get the value in bytes */
/* TODO : Calculate tbSize based of DL CCCH msg size */
- tbSize = schCalcTbSize(2664/8); /* send this value to the func in bytes when considering msg4 size */
+ tbSize = schCalcTbSize(2664/8); /* send this value to the func in bytes when considering msg4 size */
pdsch->codeword[cwCount].tbSize = tbSize;
}
pdsch->dataScramblingId = cell->cellCfg.phyCellId;
pdsch->dmrs.scid = 0;
pdsch->dmrs.numDmrsCdmGrpsNoData = 1;
pdsch->dmrs.dmrsPorts = 0;
- pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Setting to Type-A */
- pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
- pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
+ pdsch->dmrs.mappingType = DMRS_MAP_TYPE_A; /* Setting to Type-A */
+ pdsch->dmrs.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
+ pdsch->dmrs.dmrsAddPos = DMRS_ADDITIONAL_POS;
pdsch->pdschFreqAlloc.resourceAllocType = 1; /* RAT type-1 RIV format */
/* the RB numbering starts from coreset0, and PDSCH is always above SSB */
pdsch->pdschFreqAlloc.freqAlloc.startPrb = offset + SCH_SSB_NUM_PRB;
pdsch->beamPdschInfo.prg[0].beamIdx[0] = 0;
pdsch->txPdschPower.powerControlOffset = 0;
pdsch->txPdschPower.powerControlOffsetSS = 0;
-
+
pdcch->dci.pdschCfg = pdsch;
return ROK;
}
{
uint8_t k1 = 1; /* dl-DataToUL-ACK RRC parameter will received from DU-APP msg4-pucch config */
uint16_t pucchSlot = (slot + k1) % SCH_NUM_SLOTS;
- SchUlSlotInfo *schUlSlotInfo = NULLP;
-
- schUlSlotInfo = cell->schUlSlotInfo[pucchSlot];
- memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
+ SchUlSlotInfo *schUlSlotInfo = NULLP;
+
+ schUlSlotInfo = cell->schUlSlotInfo[pucchSlot];
+ memset(&schUlSlotInfo->schPucchInfo, 0, sizeof(SchPucchInfo));
- schUlSlotInfo->pucchPres = true;
- schUlSlotInfo->schPucchInfo.rnti = crnti;
+ schUlSlotInfo->pucchPres = true;
+ schUlSlotInfo->schPucchInfo.rnti = crnti;
return ROK;
}
SchMacDlAllocFunc schMacDlAllocOpts[] =
{
- packSchMacDlAlloc,
- MacProcDlAlloc,
- packSchMacDlAlloc
+ packSchMacDlAlloc,
+ MacProcDlAlloc,
+ packSchMacDlAlloc
};
extern SchCb schCb[SCH_MAX_INST];
extern int schFillRar(RarAlloc *rarAlloc, uint16_t raRnti, uint16_t pci, uint8_t
-offsetPointA);
+ offsetPointA);
/*******************************************************************
*
* ****************************************************************/
int sendDlAllocToMac(DlSchedInfo *dlSchedInfo, Inst inst)
{
- Pst pst;
+ Pst pst;
memset(&pst, 0, sizeof(Pst));
- SCH_FILL_RSP_PST(pst, inst);
- pst.event = EVENT_DL_ALLOC;
+ FILL_PST_SCH_TO_MAC(pst, inst);
+ pst.event = EVENT_DL_ALLOC;
- return(*schMacDlAllocOpts[pst.selector])(&pst, dlSchedInfo);
+ return(*schMacDlAllocOpts[pst.selector])(&pst, dlSchedInfo);
}
uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst schInst)
{
int ret = ROK;
- uint8_t ssb_rep;
- uint16_t slot, sfnSlot = 0;
- DlSchedInfo dlSchedInfo;
- memset(&dlSchedInfo,0,sizeof(DlSchedInfo));
+ uint8_t ssb_rep;
+ uint16_t slot, sfnSlot = 0;
+ DlSchedInfo dlSchedInfo;
+ memset(&dlSchedInfo,0,sizeof(DlSchedInfo));
DlBrdcstAlloc *dlBrdcstAlloc = &dlSchedInfo.brdcstAlloc;
- RarAlloc *rarAlloc;
+ RarAlloc *rarAlloc;
Msg4Alloc *msg4Alloc;
- dlBrdcstAlloc->ssbTrans = NO_SSB;
+ dlBrdcstAlloc->ssbTrans = NO_SSB;
dlBrdcstAlloc->sib1Trans = NO_SIB1;
-
- SchCellCb *cell = schCb[schInst].cells[schInst];
+
+ SchCellCb *cell = schCb[schInst].cells[schInst];
schCalcSlotValues(*slotInd, &dlSchedInfo.schSlotValue);
- ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
- memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
- dlBrdcstAlloc->ssbIdxSupported = 1;
+ ssb_rep = cell->cellCfg.ssbSchCfg.ssbPeriod;
+ memcpy(&cell->slotInfo, slotInd, sizeof(SlotIndInfo));
+ dlBrdcstAlloc->ssbIdxSupported = 1;
sfnSlot = ((dlSchedInfo.schSlotValue.broadcastTime.sfn * 10) +
- dlSchedInfo.schSlotValue.broadcastTime.slot);
-
- slot = dlSchedInfo.schSlotValue.currentTime.slot;
-
- dlSchedInfo.cellId = cell->cellId;
-
- /* Identify SSB ocassion*/
- if (sfnSlot % SCH_MIB_TRANS == 0)
- {
- dlBrdcstAlloc->ssbTrans = SSB_TRANSMISSION;
- }
- else if (sfnSlot % ssb_rep == 0)
- {
- dlBrdcstAlloc->ssbTrans = SSB_REPEAT;
- }
- else
- {
- /* not SSB occassion */
- }
+ dlSchedInfo.schSlotValue.broadcastTime.slot);
+
+ slot = dlSchedInfo.schSlotValue.currentTime.slot;
+
+ dlSchedInfo.cellId = cell->cellId;
+
+ /* Identify SSB ocassion*/
+ if (sfnSlot % SCH_MIB_TRANS == 0)
+ {
+ dlBrdcstAlloc->ssbTrans = SSB_TRANSMISSION;
+ }
+ else if (sfnSlot % ssb_rep == 0)
+ {
+ dlBrdcstAlloc->ssbTrans = SSB_REPEAT;
+ }
+ else
+ {
+ /* not SSB occassion */
+ }
/* Identify SIB1 occasions */
if(sfnSlot % cell->cellCfg.sib1SchCfg.sib1NewTxPeriod == 0)
- {
- dlBrdcstAlloc->sib1Trans = SIB1_TRANSMISSION;
- }
- else if (sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0)
- {
- dlBrdcstAlloc->sib1Trans = SIB1_REPITITION;
- }
- else
- {
- /* not SIB1 occassion */
- }
-
- if(dlBrdcstAlloc->ssbTrans || dlBrdcstAlloc->sib1Trans)
- {
- dlSchedInfo.isBroadcastPres = true;
- slot = dlSchedInfo.schSlotValue.broadcastTime.slot;
- ret = schBroadcastAlloc(cell,dlBrdcstAlloc,slot);
+ {
+ dlBrdcstAlloc->sib1Trans = SIB1_TRANSMISSION;
+ }
+ else if (sfnSlot % cell->cellCfg.sib1SchCfg.sib1RepetitionPeriod == 0)
+ {
+ dlBrdcstAlloc->sib1Trans = SIB1_REPITITION;
+ }
+ else
+ {
+ /* not SIB1 occassion */
+ }
+
+ if(dlBrdcstAlloc->ssbTrans || dlBrdcstAlloc->sib1Trans)
+ {
+ dlSchedInfo.isBroadcastPres = true;
+ slot = dlSchedInfo.schSlotValue.broadcastTime.slot;
+ ret = schBroadcastAlloc(cell,dlBrdcstAlloc,slot);
if(ret != ROK)
{
- DU_LOG("\nschBroadcastAlloc failed");
- RETVALUE(ret);
+ DU_LOG("\nschBroadcastAlloc failed");
+ RETVALUE(ret);
}
}
/* check for RAR */
- if(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.rarTime.slot]->rarInfo != NULLP)
- {
- slot = dlSchedInfo.schSlotValue.rarTime.slot;
+ if(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.rarTime.slot]->rarInfo != NULLP)
+ {
+ slot = dlSchedInfo.schSlotValue.rarTime.slot;
SCH_ALLOC(rarAlloc, sizeof(RarAlloc));
if(!rarAlloc)
{
- DU_LOG("\nMAC: Memory Allocation failed for RAR alloc");
- return RFAILED;
+ DU_LOG("\nMAC: Memory Allocation failed for RAR alloc");
+ return RFAILED;
}
-
+
dlSchedInfo.rarAlloc = rarAlloc;
- /* RAR info is copied, this was earlier filled in schProcessRachInd */
+ /* RAR info is copied, this was earlier filled in schProcessRachInd */
memcpy(&rarAlloc->rarInfo,cell->schDlSlotInfo[slot]->rarInfo, sizeof(RarInfo));
- /* pdcch and pdsch data is filled */
- schFillRar(rarAlloc,
- cell->schDlSlotInfo[slot]->rarInfo->raRnti,
- cell->cellCfg.phyCellId,
- cell->cellCfg.ssbSchCfg.ssbOffsetPointA);
+ /* pdcch and pdsch data is filled */
+ schFillRar(rarAlloc,
+ cell->schDlSlotInfo[slot]->rarInfo->raRnti,
+ cell->cellCfg.phyCellId,
+ cell->cellCfg.ssbSchCfg.ssbOffsetPointA);
SCH_FREE(cell->schDlSlotInfo[slot]->rarInfo,sizeof(RarAlloc));
- cell->schDlSlotInfo[slot]->rarInfo = NULLP;
+ cell->schDlSlotInfo[slot]->rarInfo = NULLP;
}
/* check for MSG4 */
if(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info != NULLP)
{
- slot = dlSchedInfo.schSlotValue.msg4Time.slot;
- SCH_ALLOC(msg4Alloc, sizeof(Msg4Alloc));
- if(!msg4Alloc)
- {
- DU_LOG("\nMAC: Memory Allocation failed for msg4 alloc");
- return RFAILED;
- }
-
- dlSchedInfo.msg4Alloc = msg4Alloc;
-
- /* Msg4 info is copied, this was earlier filled in macSchDlRlcBoInfo */
- memcpy(&msg4Alloc->msg4Info, cell->schDlSlotInfo[slot]->msg4Info, \
- sizeof(Msg4Info));
-
- /* pdcch and pdsch data is filled */
- schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.msg4Time.slot);
-
- /* PUCCH resource */
- schAllocPucchResource(cell, msg4Alloc->msg4Info.crnti, dlSchedInfo.schSlotValue.msg4Time.slot);
-
- SCH_FREE(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info, sizeof(Msg4Info));
- cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info = NULL;
+ slot = dlSchedInfo.schSlotValue.msg4Time.slot;
+ SCH_ALLOC(msg4Alloc, sizeof(Msg4Alloc));
+ if(!msg4Alloc)
+ {
+ DU_LOG("\nMAC: Memory Allocation failed for msg4 alloc");
+ return RFAILED;
+ }
+
+ dlSchedInfo.msg4Alloc = msg4Alloc;
+
+ /* Msg4 info is copied, this was earlier filled in macSchDlRlcBoInfo */
+ memcpy(&msg4Alloc->msg4Info, cell->schDlSlotInfo[slot]->msg4Info, \
+ sizeof(Msg4Info));
+
+ /* pdcch and pdsch data is filled */
+ schDlRsrcAllocMsg4(msg4Alloc, cell, dlSchedInfo.schSlotValue.msg4Time.slot);
+
+ /* PUCCH resource */
+ schAllocPucchResource(cell, msg4Alloc->msg4Info.crnti, dlSchedInfo.schSlotValue.msg4Time.slot);
+
+ SCH_FREE(cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info, sizeof(Msg4Info));
+ cell->schDlSlotInfo[dlSchedInfo.schSlotValue.msg4Time.slot]->msg4Info = NULL;
}
- /* send msg to MAC */
+ /* send msg to MAC */
ret = sendDlAllocToMac(&dlSchedInfo, schInst);
if(ret != ROK)
{
DU_LOG("\nSending DL Broadcast allocation from SCH to MAC failed");
RETVALUE(ret);
}
-
- schUlResAlloc(cell, schInst);
- memset(cell->schDlSlotInfo[slot], 0, sizeof(SchDlSlotInfo));
+ schUlResAlloc(cell, schInst);
+
+ memset(cell->schDlSlotInfo[slot], 0, sizeof(SchDlSlotInfo));
- return ret;
+ return ret;
}
/**********************************************************************
#include "du_app_mac_inf.h"
#include "mac_sch_interface.h"
#include "sch.h"
+#include "sch_utils.h"
/* local defines */
SchUeCfgRspFunc SchUeCfgRspOpts[] =
/* Filling response post */
memset(&rspPst, 0, sizeof(Pst));
- SCH_FILL_RSP_PST(rspPst, inst);
+ FILL_PST_SCH_TO_MAC(rspPst, inst);
rspPst.event = EVENT_UE_CREATE_RSP_TO_MAC;
SchUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp);
}
/* Search of cell cb */
- for(idx = 0; idx < SCH_MAX_CELLS; idx++)
+ for(idx = 0; idx < MAX_NUM_CELL; idx++)
{
cellCb = schCb[inst].cells[idx];
if(cellCb->cellId == ueCfg->cellId)
break;
}
- if(idx == SCH_MAX_CELLS)
+ if(idx == MAX_NUM_CELL)
{
DU_LOG("\nSCH : Ue create request failed. Invalid cell id %d", ueCfg->cellId);
SchSendUeCfgRspToMac(ueCfg, inst, RSP_NOK, &cfgRsp);
}
/* Check if max number of UE configured */
- if(cellCb->numActvUe > SCH_MAX_UE)
+ if(cellCb->numActvUe > MAX_NUM_UE)
{
- DU_LOG("SCH : Max number of UE [%d] already configured", SCH_MAX_UE);
+ DU_LOG("SCH : Max number of UE [%d] already configured", MAX_NUM_UE);
SchSendUeCfgRspToMac(ueCfg, inst, RSP_NOK, &cfgRsp);
return ROK;
}
#include <stdint.h>
#include <math.h>
+/* Memory info */
+#define SCH_MEM_REGION 4
+#define SCH_POOL 1
+
/* macros */
#define MAX_CORESET_INDEX 16
#define MAX_SEARCH_SPACE_INDEX 16
#define MAX_PRACH_CONFIG_IDX 256
#define MAX_MU_PUSCH 4
#define TOTAL_TBSIZE_VALUES 93
+
#define SET_BITS_MSB(_startBit, _numBits, _byte) \
{ \
_byte = (~((0xFF) >> _numBits)); \
- _byte >>= _startBit; \
+ _byte >>= _startBit; \
}
#define SET_BITS_LSB(_startBit, _numBits, _byte) \
{ \
_byte = (~((0xFF) << _numBits)); \
- _byte <<= _startBit; \
+ _byte <<= _startBit; \
+}
+
+/* allocate and zero out a static buffer */
+#define SCH_ALLOC(_datPtr, _size) \
+{ \
+ int _ret; \
+ _ret = SGetSBuf(SCH_MEM_REGION, SCH_POOL, \
+ (Data **)&_datPtr, _size); \
+ if(_ret == ROK) \
+ { \
+ cmMemset((U8*)_datPtr, 0, _size); \
+ } \
+ else \
+ { \
+ _datPtr = NULLP; \
+ } \
+}
+
+/* free a static buffer */
+#define SCH_FREE(_datPtr, _size) \
+{ \
+ if(_datPtr) \
+ { \
+ SPutSBuf(SCH_MEM_REGION, SCH_POOL, \
+ (Data *)_datPtr, _size); \
+ } \
+}
+
+/* Fill post structure for msg from SCH to MAC */
+#define FILL_PST_SCH_TO_MAC(_pst, _inst) \
+{ \
+ _pst.srcProcId = SFndProcId(); \
+ _pst.dstProcId = SFndProcId(); \
+ _pst.srcEnt = ENTRG; \
+ _pst.dstEnt = ENTRG; \
+ _pst.srcInst = 1; \
+ _pst.dstInst = 0; \
+ _pst.selector = ODU_SELECTOR_TC; \
}
/* functions declarations */
extern int8_t searchSpaceIdxTable[MAX_SEARCH_SPACE_INDEX][4];
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#include "cm_hash.x"
#include "cm_lte.x"
#include "cm_lib.x"
+#include "du_log.h"
+
+/* MAX values */
+#define MAX_NUM_CELL 1
+#define MAX_NUM_UE 1
/* 5G ORAN phy delay */
#define PHY_DELTA 2
#define ODU_SELECTOR_TC 1
#define ODU_SELECTOR_LWLC 2
-#define CRNTI_START_RANGE 100
-#define CRNTI_END_RANGE 500
+#define ODU_START_CRNTI 100
+#define ODU_END_CRNTI 500
+
+#define GET_UE_IDX( _crnti,_ueIdx) \
+{ \
+ _ueIdx = _crnti - ODU_START_CRNTI + 1; \
+}
-#define GET_UE_IDX( _crnti,_ueIdx) \
-{ \
- _ueIdx = _crnti - CRNTI_START_RANGE; \
+#define GET_CRNTI( _crnti,_ueIdx) \
+{ \
+ _crnti = _ueIdx + ODU_START_CRTNI - 1; \
}
-#define GET_CRNTI( _crnti,_ueIdx) \
-{ \
- _crnti = _ueIdx + CRNTI_START_RANGE; \
+/* Calculates cellIdx from cellId */
+#define GET_CELL_IDX(_cellId, _cellIdx) \
+{ \
+ _cellIdx = _cellId - 1; \
}
+typedef struct slotIndInfo
+{
+ uint16_t cellId;
+ uint16_t sfn;
+ uint16_t slot;
+}SlotIndInfo;
+
+typedef struct PlmnIdentity
+{
+ uint8_t mcc[3];
+ uint8_t mnc[3];
+}Plmn;
+
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+***********************************************************************/
*******************************************************************************/
#include "common_def.h"
-#include "ss_queue.h"
-#include "ss_task.h"
-#include "ss_msg.h"
-#include "du_cfg.h"
#include "du_app_mac_inf.h"
/**************************************************************************
* RFAILED - failure
*
***************************************************************************/
-int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
+uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg)
{
if(pst->selector == ODU_SELECTOR_LC)
{
* RFAILED - failure
*
***************************************************************************/
-int unpackDuMacCellCfg(
- DuMacCellCfgReq func,
- Pst *pst,
- Buffer *mBuf)
+uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf)
{
U16 ret = ROK;
MacCellCfg *macCellCfg;
* RFAILED - failure
*
***************************************************************************/
-int packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
{
if(pst->selector == ODU_SELECTOR_LC)
{
* RFAILED - failure
*
***************************************************************************/
-int unpackMacCellCfgCfm(
- DuMacCellCfgCfm func,
- Pst *pst,
- Buffer *mBuf)
+uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf)
{
MacCellCfgCfm macCellCfgCfm;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
+uint8_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo)
{
Buffer *mBuf = NULLP;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf)
{
MacCellStartInfo *cellStartInfo;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
+uint8_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
{
if(pst->selector == ODU_SELECTOR_LC)
{
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf)
{
MacCellStopInfo *cellStopInfo;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo )
+uint8_t packMacSlotInd(Pst *pst, SlotIndInfo *slotInfo )
{
Buffer *mBuf = NULLP;
CMCHKPK(SPkU16, slotInfo->sfn, mBuf);
CMCHKPK(SPkU16, slotInfo->slot, mBuf);
- CM_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotInfo));
+ CM_FREE_SHRABL_BUF(pst->region, pst->pool, slotInfo, sizeof(SlotIndInfo));
slotInfo = NULL;
}
else if(pst->selector == ODU_SELECTOR_LWLC)
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf)
{
if(pst->selector == ODU_SELECTOR_LWLC)
{
- SlotInfo *slotInfo;
+ SlotIndInfo *slotInfo;
/* unpack the address of the structure */
CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf);
}
else if(pst->selector == ODU_SELECTOR_LC)
{
- SlotInfo slotInfo;
+ SlotIndInfo slotInfo;
CMCHKUNPK(SUnpkU16, &(slotInfo.slot), mBuf);
CMCHKUNPK(SUnpkU16, &(slotInfo.sfn), mBuf);
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+uint8_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId)
{
Buffer *mBuf = NULLP;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
{
if(pst->selector == ODU_SELECTOR_LWLC)
{
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
+uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
{
Buffer *mBuf = NULLP;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf)
{
if(pst->selector == ODU_SELECTOR_LWLC)
{
* RFAILED - failure
*
* ****************************************************************/
-uint16_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
+uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo)
{
Buffer *mBuf = NULLP;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf)
+uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf)
{
if(pst->selector == ODU_SELECTOR_LWLC)
{
#ifndef __MACINT_H__
#define __MACINT_H__
-#include <stdbool.h>
-
#define NUM_NUMEROLOGY 5 /* Number of numerology */
#define MAXIMUM_TDD_PERIODICITY 5
#define MAX_SYMB_PER_SLOT 14
uint8_t rsp;
}MacCellCfgCfm;
-typedef struct slotInfo
-{
- uint16_t cellId;
- uint16_t sfn;
- uint16_t slot;
-}SlotInfo;
-
typedef struct macCellStartInfo
{
uint16_t cellId;
LcCfg lcCfgList[MAX_NUM_LOGICAL_CHANNELS];
}MacUeCfg;
-typedef struct plmnId
-{
- uint8_t mcc[3];
- uint8_t mnc[3];
-}PlmnIdentity;
-
typedef struct nrcgi
{
- PlmnIdentity plmn;
+ Plmn plmn;
uint16_t cellId;
}Nrcgi;
}MacUeCfgRsp;
/* Functions for slot Ind from MAC to DU APP*/
-typedef uint16_t (*DuMacSlotInd) ARGS((
- Pst *pst,
- SlotInfo *slotInfo ));
+typedef uint8_t (*DuMacSlotInd) ARGS((
+ Pst *pst,
+ SlotIndInfo *slotInfo ));
/* Functions for stop Ind from MAC to DU APP*/
-typedef uint16_t (*DuMacStopInd) ARGS((
- Pst *pst,
- MacCellStopInfo *cellId ));
+typedef uint8_t (*DuMacStopInd) ARGS((
+ Pst *pst,
+ MacCellStopInfo *cellId ));
/* Functions for mac cell start req */
-typedef uint16_t (*DuMacCellStartReq) ARGS((
- Pst *pst,
- MacCellStartInfo *cellStartInfo ));
+typedef uint8_t (*DuMacCellStartReq) ARGS((
+ Pst *pst,
+ MacCellStartInfo *cellStartInfo ));
/* Functions for mac cell stop request */
-typedef uint16_t (*DuMacCellStopReq) ARGS((
- Pst *pst,
- MacCellStopInfo *cellStopInfo ));
+typedef uint8_t (*DuMacCellStopReq) ARGS((
+ Pst *pst,
+ MacCellStopInfo *cellStopInfo ));
/* Function pointers for packing macCellCfg Request and Confirm */
-typedef int (*packMacCellCfgReq) ARGS((
- Pst *pst,
- MacCellCfg *macCellCfg ));
+typedef uint8_t (*packMacCellCfgReq) ARGS((
+ Pst *pst,
+ MacCellCfg *macCellCfg ));
-typedef int (*packMacCellCfgConfirm) ARGS((
- Pst *pst,
- MacCellCfgCfm *macCellCfgCfm ));
+typedef uint8_t (*packMacCellCfgConfirm) ARGS((
+ Pst *pst,
+ MacCellCfgCfm *macCellCfgCfm ));
-typedef int (*DuMacCellCfgReq) ARGS((
- Pst *pst,
- MacCellCfg *macCellCfg));
+typedef uint8_t (*DuMacCellCfgReq) ARGS((
+ Pst *pst,
+ MacCellCfg *macCellCfg));
-typedef int (*DuMacCellCfgCfm) ARGS((
- Pst *pst,
- MacCellCfgCfm *macCellCfgCfm ));
+typedef uint8_t (*DuMacCellCfgCfm) ARGS((
+ Pst *pst,
+ MacCellCfgCfm *macCellCfgCfm ));
/* Functions for UL CCCH Ind from MAC to DU APP*/
-typedef uint16_t (*DuMacUlCcchInd) ARGS((
- Pst *pst,
- UlCcchIndInfo *ulCcchIndInfo ));
+typedef uint8_t (*DuMacUlCcchInd) ARGS((
+ Pst *pst,
+ UlCcchIndInfo *ulCcchIndInfo ));
/* Functions for DL CCCH Ind from DU APP to MAC*/
-typedef uint16_t (*DuMacDlCcchInd) ARGS((
- Pst *pst,
- DlCcchIndInfo *dlCcchIndInfo ));
+typedef uint8_t (*DuMacDlCcchInd) ARGS((
+ Pst *pst,
+ DlCcchIndInfo *dlCcchIndInfo ));
/* UE create Request from DU APP to MAC*/
typedef uint8_t (*DuMacUeCreateReq) ARGS((
- Pst *pst,
- MacUeCfg *ueCfg ));
+ Pst *pst,
+ MacUeCfg *ueCfg ));
/* UE create Response from MAC to DU APP */
typedef uint8_t (*DuMacUeCreateRspFunc) ARGS((
- Pst *pst,
- MacUeCfgRsp *cfgRsp));
-
-extern uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo );
-extern uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
-extern uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo);
-extern uint16_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
-extern uint16_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf);
-extern uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
-extern uint16_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
-extern uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf);
-extern uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
-extern int packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
-extern int MacHdlCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
-extern void cmUnpackLwLcMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
-extern int unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
-extern int duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
-extern uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellId);
-extern uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
-extern uint16_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellId);
-extern uint16_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
-extern uint16_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
-extern uint16_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
-extern uint16_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
-extern uint16_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
-extern uint16_t MacHdlDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
-extern uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
-extern uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
-extern uint8_t MacHdlUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
-uint8_t sendStopIndMacToDuApp();
-extern uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
-extern uint8_t unpackDuMacUeCreateRsp(DuMacUeCreateRspFunc func, Pst *pst, Buffer *mBuf);
-extern uint8_t duHandleMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
+ Pst *pst,
+ MacUeCfgRsp *cfgRsp));
+
+uint8_t packMacSlotInd(Pst *pst, SlotIndInfo *slotInfo );
+uint8_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
+uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo);
+uint8_t packMacCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
+uint8_t unpackMacCellStartReq(DuMacCellStartReq func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcCellStartReq(Pst *pst, MacCellStartInfo *cellStartInfo);
+uint8_t packMacCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
+uint8_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo);
+uint8_t packMacCellCfg(Pst *pst, MacCellCfg *macCellCfg);
+uint8_t unpackDuMacCellCfg(DuMacCellCfgReq func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcCellCfgReq(Pst *pst, MacCellCfg *macCellCfg);
+uint8_t packMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
+uint8_t unpackMacCellCfgCfm(DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf);
+uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm);
+uint8_t packMacStopInd(Pst *pst, MacCellStopInfo *cellId);
+uint8_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf);
+uint8_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellId);
+uint8_t packMacUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
+uint8_t unpackMacUlCcchInd(DuMacUlCcchInd func, Pst *pst, Buffer *mBuf);
+uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo);
+uint8_t packMacDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
+uint8_t unpackMacDlCcchInd(DuMacDlCcchInd func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcDlCcchInd(Pst *pst, DlCcchIndInfo *dlCcchIndInfo);
+uint8_t packDuMacUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t unpackMacUeCreateReq(DuMacUeCreateReq func, Pst *pst, Buffer *mBuf);
+uint8_t MacProcUeCreateReq(Pst *pst, MacUeCfg *ueCfg);
+uint8_t packDuMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
+uint8_t unpackDuMacUeCreateRsp(DuMacUeCreateRspFunc func, Pst *pst, Buffer *mBuf);
+uint8_t duHandleMacUeCreateRsp(Pst *pst, MacUeCfgRsp *cfgRsp);
+uint8_t sendStopIndMacToDuApp(uint16_t cellId);
#endif
/**********************************************************************
/* This file contains DU APP and EGTP interface functions */
#include "common_def.h"
-#include "lrg.h"
#include "legtp.h"
-#include "lkw.x"
-#include "lrg.x"
-#include "du_cfg.h"
-#include "du_egtp.h"
/*******************************************************************
*
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nEGTP : Failed to allocate memory");
RETVALUE(RFAILED);
{
Buffer *mBuf;
- if(SGetMsg(DFLT_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(DFLT_REGION, pst->pool, &mBuf) != ROK)
{
printf("\nDU_APP : Failed to allocate memory");
RETVALUE(RFAILED);
* @param cfg pointer to RgMngmt
* @return ROK/RFAILED
*/
-EXTERN int HandleSchGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
+EXTERN int SchProcGenCfgReq ARGS((Pst *pst, RgMngmt *cfg));
/** @brief This primitive carries the Confirmation for a Configuration Request
* sent from the layer manager to Scheduler.
/* This file contains DU APP and SCTP interface functions */
#include "common_def.h"
-#include "lrg.h"
-#include "legtp.h"
-#include "du_cfg.h"
-#include "lkw.x"
-#include "lrg.x"
-#include "du_mgr.h"
-#include "du_sctp.h"
-
+#include "lsctp.h"
/*******************************************************************
*
{
Buffer *mBuf;
- if(SGetMsg(DU_APP_MEM_REGION, DU_POOL, &mBuf) != ROK)
+ if(SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
printf("\nSCTP : Failed to allocate memory");
RETVALUE(RFAILED);
#ifndef __LSCTP_H___
#define __LSCTP_H___
+typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy));
extern S16 cmPkSctpNtfy(Pst *pst, CmInetSctpNotification *ntfy);
extern S16 cmUnpkSctpNtfy(SctpNtfy func, Pst *pst, Buffer *mBuf);
/* header include files (.h) */
#include "common_def.h"
-#include "tfu.h" /* RGU Interface defines */
#include "lrg.h"
/* header/extern include files (.x) */
-#include "tfu.x" /* RGU Interface includes */
#include "lrg.x"
-#include "du_app_mac_inf.h"
#include "mac_sch_interface.h"
/**
* @return S16
* -# ROK
**/
-int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd)
+uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd)
{
Buffer *mBuf = NULLP;
if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
{
- RETVALUE(RFAILED);
+ return RFAILED;
}
/* pack SFN and slot value */
CMCHKPK(SPkU16,slotInd->sfn, mBuf);
CMCHKPK(SPkU16,slotInd->slot, mBuf);
- RETVALUE(SPstTsk(pst,mBuf));
+ return SPstTsk(pst,mBuf);
}
+/**
+ * @brief function to unpack Slot ind message from MAC
+ * to scheduler with loose coupling
+ *
+ * @details
+ *
+ * Function : unpackMacSchSlotInd
+ *
+ *
+ * @param[in] Pst *pst, the post structure
+ * @param[in] Buffer *mBuf, the message buffer
+ * @return S16
+ * -# ROK
+ **/
+uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf)
+{
+ /* TODO */
+ return ROK;
+}
+
+
/*******************************************************************
*
* @brief Pack and Send Rach Ind from MAC to SCH
* RFAILED - failure
*
* ****************************************************************/
-int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
+uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
* RFAILED - failure
*
* ****************************************************************/
-int packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
+uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd)
{
if((pst->selector == ODU_SELECTOR_LC) || (pst->selector == ODU_SELECTOR_LWLC))
{
* @return S16
* -# ROK
**/
-int packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
+uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo)
{
return ROK;
}
* @return S16
* -# ROK
**/
-int packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
+uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo)
{
return ROK;
}
* @return S16
* -# ROK
**/
-int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg)
+uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg)
{
return ROK;
}
* @return S16
* -# ROK
**/
-int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
+uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm)
{
return ROK;
}
#define EVENT_DL_RLC_BO_INFO_TO_SCH 7
#define EVENT_UE_CREATE_REQ_TO_SCH 8
#define EVENT_UE_CREATE_RSP_TO_MAC 9
-
+#define EVENT_SLOT_IND_TO_SCH 10
/*macros*/
#define NO_SSB 0
#define SSB_TRANSMISSION 1
#define SSB_REPEAT 2
#define MAX_SSB_IDX 1 /* forcing it as 1 for now. Right value is 64 */
+#define SCH_SSB_MASK_SIZE 1
#define NO_SIB1 0
#define SIB1_TRANSMISSION 1
DYNAMIC_BUNDLING_TYPE
}SchBundlingType;
+typedef enum
+{
+ DUPLEX_MODE_FDD,
+ DUPLEX_MODE_TDD
+}SchDuplexMode;
+
+typedef enum
+{
+ SSB_PRDCTY_MS5,
+ SSB_PRDCTY_MS10,
+ SSB_PRDCTY_MS20,
+ SSB_PRDCTY_MS40,
+ SSB_PRDCTY_MS80,
+ SSB_PRDCTY_MS160
+}SchSSBPeriod;
+
typedef enum
{
RSP_OK,
uint32_t ssbPbchPwr; /* SSB block power */
uint8_t scsCommon; /* subcarrier spacing for common [0-3]*/
uint8_t ssbOffsetPointA; /* SSB sub carrier offset from point A */
- SSBPeriod ssbPeriod; /* SSB Periodicity in msec */
+ SchSSBPeriod ssbPeriod; /* SSB Periodicity in msec */
uint8_t ssbSubcOffset; /* Subcarrier Offset(Kssb) */
- uint32_t nSSBMask[SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
+ uint32_t nSSBMask[SCH_SSB_MASK_SIZE]; /* Bitmap for actually transmitted SSB. */
}SchSsbCfg;
typedef struct bwpCfg
uint16_t cellId; /* Cell Id */
uint16_t phyCellId; /* Physical cell id */
uint8_t bandwidth; /* Supported B/W */
- DuplexMode dupMode; /* Duplex type: TDD/FDD */
+ SchDuplexMode dupMode; /* Duplex type: TDD/FDD */
SchSsbCfg ssbSchCfg; /* SSB config */
SchSib1Cfg sib1SchCfg; /* SIB1 config */
SchRachCfg schRachCfg; /* PRACH config */
/* Info of Scheduling Request to Add/Modify */
typedef struct schSchedReqInfo
{
- uint8_t schedReqId;
- SrProhibitTimer srProhibitTmr;
- SrTransMax srTransMax;
+ uint8_t schedReqId;
+ SchSrProhibitTimer srProhibitTmr;
+ SchSrTransMax srTransMax;
}SchSchedReqInfo;
/* Scheduling Request Configuration */
/* function pointers */
-typedef int (*SchCellCfgCfmFunc) ARGS((
+typedef uint8_t (*SchCellCfgCfmFunc) ARGS((
Pst *pst, /* Post Structure */
SchCellCfgCfm *schCellCfgCfm /* Cell Cfg Cfm */
));
-typedef int (*SchCellCfgFunc) ARGS((
+typedef uint8_t (*SchCellCfgFunc) ARGS((
Pst *pst, /* Post Structure */
SchCellCfg *schCellCfg /* Cell Cfg */
));
-typedef int (*SchMacDlAllocFunc) ARGS((
+typedef uint8_t (*SchMacDlAllocFunc) ARGS((
Pst *pst, /* Post Structure */
DlSchedInfo *dlSchedInfo /* dl allocation Info */
));
-typedef int (*SchMacUlSchInfoFunc) ARGS((
+typedef uint8_t (*SchMacUlSchInfoFunc) ARGS((
Pst *pst, /* Post Structure */
UlSchedInfo *ulSchedInfo /* UL Alloc Sch Info */
));
-typedef int (*MacSchRachIndFunc) ARGS((
+typedef uint8_t (*MacSchRachIndFunc) ARGS((
Pst *pst, /* Post structure */
RachIndInfo *rachInd)); /* Rach Indication Info */
-typedef int (*MacSchCrcIndFunc) ARGS((
+typedef uint8_t (*MacSchCrcIndFunc) ARGS((
Pst *pst, /* Post structure */
CrcIndInfo *crcInd)); /* CRC Info */
Pst *pst, /* Post structure */
SchUeCfgRsp *cfgRsp)); /* Scheduler UE Cfg response */
+typedef uint8_t (*MacSchSlotIndFunc) ARGS((
+ Pst *pst, /* Post structure */
+ SlotIndInfo *slotInd)); /* Slot Info */
+
/* function declarations */
-int packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
-int packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
-int packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
-EXTERN int packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
-EXTERN int packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
-
-EXTERN int MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
-EXTERN int MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
-EXTERN int MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
-EXTERN int SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
-EXTERN int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
-EXTERN S16 SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
-EXTERN int MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
-int packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
-int macSchRachInd(Pst *pst, RachIndInfo *rachInd);
-int packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
-int macSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
+uint8_t packMacSchSlotInd(Pst *pst, SlotIndInfo *slotInd);
+uint8_t packSchMacDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
+uint8_t packSchMacUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
+uint8_t packSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
+uint8_t packSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
+uint8_t MacProcDlAlloc(Pst *pst, DlSchedInfo *dlSchedInfo);
+uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg *schCellCfg);
+uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm *schCellCfgCfm);
+uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
+uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
+uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
+uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
+uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
+uint8_t macSchRachInd(Pst *pst, RachIndInfo *rachInd);
+uint8_t packMacSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
+uint8_t macSchCrcInd(Pst *pst, CrcIndInfo *crcInd);
uint8_t packMacSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
uint8_t macSchDlRlcBoInfo(Pst *pst, DlRlcBOInfo *dlBoInfo);
uint8_t packMacSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
uint8_t macSchUeCreateReq(Pst *pst, SchUeCfg *ueCfgToSch);
uint8_t packSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
uint8_t MacProcSchUeCfgRsp(Pst *pst, SchUeCfgRsp *cfgRsp);
-
+uint8_t macSchSlotInd ARGS((Pst * pst, SlotIndInfo * slotInd));
+uint8_t packMacSchSlotInd(Pst * pst, SlotIndInfo * slotInd);
+uint8_t unpackMacSchSlotInd(MacSchSlotIndFunc func, Pst *pst, Buffer *mBuf);
/**********************************************************************
End of file
}
}
- pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
+ //pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
RETVALUE(SPstTsk(pst,mBuf));
}
-\f
-/***********************************************************
-*
-* Func : cmUnpackSlotInd
-*
-*
-* Desc : This API is the TTI indication from PHY to MAC .
- * @details This primitive provides the timing information (SFN and subframe)
- * which is currently running on the physical layer.
- * @param pst Pointer to the post structure.
- * @param suId SAP ID of the service user.
- * @param ttiInd Pointer to the TfuTtiIndInfo.
- * @return ROK/RFAILED
-*
-*
-* Ret : S16
-*
-* Notes:
-*
-* File :
-*
-**********************************************************/
-PUBLIC S16 cmUnpackSlotInd
-(
-TfuTtiInd func,
-Pst *pst,
-Buffer *mBuf
-)
-{
- SuId suId;
- SlotIndInfo *slotInd;
-
- TRC3(cmUnpackSlotInd)
-
- if (SUnpkS16(&suId, mBuf) != ROK) {
- TFU_FREE_MSG(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
-#endif
- RETVALUE(RFAILED);
- }
- if (pst->selector != ODU_SELECTOR_LWLC) {
- if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
-#endif
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
-
- if (pst->selector == ODU_SELECTOR_LC)
- {
- if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
- SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
- TFU_FREE_MSG(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
-#endif
- RETVALUE(RFAILED);
- }
- }
- else if(pst->selector == ODU_SELECTOR_LWLC)
- {
- if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
- TFU_FREE_MSG(mBuf);
-
- RETVALUE((*func)(pst, slotInd));
-}
-
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/***********************************************************
*
#endif
-/***********************************************************
-*
-* Func : cmUnpackMacSchSlotInd
-*
-*
-* Desc : This API is the TTI indication from PHY to scheduler.
- * @details This primitive provides the timing information (SFN and subframe)
- * which is currently running on the physical layer.
- * @param pst Pointer to the post structure.
- * @param suId SAP ID of the service user.
- * @param ttiInd Pointer to the TfuTtiIndInfo.
- * @return ROK/RFAILED
-*
-*
-* Ret : S16
-*
-* Notes:
-*
-* File :
-*
-**********************************************************/
-PUBLIC S16 cmUnpackMacSchSlotInd
-(
-MacSchSlotIndFunc func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-#if 0
- SuId suId;
- SlotIndInfo *slotInd;
-
- TRC3(cmUnpackMacSchSlotInd)
-
- if (SUnpkS16(&suId, mBuf) != ROK) {
- TFU_FREE_MSG(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU116, (ErrVal)0, "Packing failed");
-#endif
- RETVALUE(RFAILED);
- }
- if (pst->selector != ODU_SELECTOR_LWLC) {
- if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU117, (ErrVal)0, "Packing failed");
-#endif
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
-
- if (pst->selector == ODU_SELECTOR_LC)
- {
- if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
- SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
- TFU_FREE_MSG(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFU118, (ErrVal)0, "Packing failed");
-#endif
- RETVALUE(RFAILED);
- }
- }
- else if(pst->selector == ODU_SELECTOR_LWLC)
- {
- if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
- {
-#if (ERRCLASS & ERRCLS_ADD_RES)
- SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
- __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
- (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
-#endif
- SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
- TFU_FREE_MSG(mBuf);
- RETVALUE(RFAILED);
- }
- }
- TFU_FREE_MSG(mBuf);
- /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
-// (*func)(pst, suId, slotInd);
- (*func)(pst, slotInd);
- SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
-#endif
- return ROK;
-}
-
\f
/***********************************************************
*
/* CA dev End */
\f
-/***********************************************************
-*
-* Func : cmUnpackSlotIndInfo
-*
-*
-* Desc : This structure contains information that is passed as a part of the Slot
- * indication sent from PHY to MAC.
-*
-*
-* Ret : S16
-*
-* Notes:
-*
-* File :
-*
-**********************************************************/
-PUBLIC S16 cmUnpackSlotIndInfo
-(
-SlotIndInfo *param,
-Buffer *mBuf
-)
-{
- CMCHKUNPK(SUnpkU16, ¶m->sfn, mBuf);
- CMCHKUNPK(SUnpkU16, ¶m->slot, mBuf);
-
- RETVALUE(ROK);
-}
-
-
-\f
/***********************************************************
*
* Func : cmPkTfuRaReqInfo
#define EVTTFUCRCIND 14 /*!< CRC indication. */
#define EVTTFUTIMINGADVIND 15 /*!< Timing advance indication.*/
#define EVTTFUDATREQ 16 /*!< Data Request.*/
-#define EVENT_SLOT_IND_TO_MAC 17 /*!< TTI indication.*/
-#define EVENT_SLOT_IND_TO_SCH 18 /*!< TTI indication for scheduler.*/
#define EVTTFUCNTRLREQ 19 /*!< Control Request.*/
#define EVTTFUPUCCHDELPWR 20 /*!< PUCCH Delta power. */
#define EVTTFUDOAIND 21 /*!< PUCCH Delta power. */
#define EVTTFUERRIND 25 /*!< TFU Error Indication */
/** @} */
-#define MAX_PREAM_PER_SLOT 1 /* Max number of preamble per slot */
-#define MAX_RACH_PDU_PER_SLOT 1 /* Max number of rach pdu per slot */
-#define MAX_CRCS_PER_SLOT 1
-#define MAX_CB_PER_TTI_IN_BYTES 1
-#define MAX_ULSCH_PDUS_PER_TTI 1
-
/* selector(coupling) values */
#define TFU_MAX_ALLOC_BYTES 4
/* pack unpack error code */
} TfuDelDatReqInfo;
#endif
-typedef struct slotIndInfo
-{
- U16 sfn;
- U16 slot;
-}SlotIndInfo;
-
-typedef struct rachPreamInfo
-{
- uint8_t preamIdx;
- uint16_t timingAdv;
-}RachPreamInfo;
-
-typedef struct rachPduInfo
-{
- uint16_t pci;
- uint8_t symbolIdx;
- uint8_t slotIdx;
- uint8_t freqIdx;
- uint8_t numPream;
- RachPreamInfo preamInfo[MAX_PREAM_PER_SLOT];
-}RachPduInfo;
-
-typedef struct rachInd
-{
- SlotIndInfo timingInfo;
- uint8_t numPdu;
- RachPduInfo rachPdu[MAX_RACH_PDU_PER_SLOT];
-}RachInd;
-
-typedef struct crcInfo
-{
- uint32_t handle;
- uint16_t rnti;
- uint8_t harqId;
- uint8_t tbCrcStatus;
- uint16_t numCb;
- uint8_t cbCrcStatus[MAX_CB_PER_TTI_IN_BYTES];
- uint8_t ul_cqi;
- uint16_t timingAdvance;
- uint16_t rssi;
-}CrcInfo;
-
-typedef struct crcInd
-{
- SlotIndInfo timingInfo;
- uint16_t numCrc;
- CrcInfo crcInfo[MAX_CRCS_PER_SLOT];
-}CrcInd;
-
-typedef struct
-{
- uint32_t handle;
- uint16_t rnti;
- uint8_t harqId;
- uint16_t pduLength;
- uint8_t ul_cqi;
- uint16_t timingAdvance;
- uint16_t rssi;
- uint8_t *pduData;
-}RxDataIndPdu;
-
-typedef struct
-{
- SlotIndInfo timingInfo;
- uint16_t numPdus;
- RxDataIndPdu pdus[MAX_ULSCH_PDUS_PER_TTI];
-}RxDataInd;
-
-
typedef S16 (*TfuBndReq) ARGS((
Pst* pst,
SuId suId,
TfuDatIndInfo * datInd
));
-EXTERN S16 fapiMacSlotInd
-(
-Pst *pst,
-SlotIndInfo *slotInd
-);
-
EXTERN S16 RgLiTfuCrcInd ARGS((
Pst * pst,
SuId suId,
TfuTtiIndInfo * ttiInd
));
-EXTERN int macSchSlotInd ARGS((
- Pst * pst,
- SlotIndInfo * slotInd
-));
-
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
EXTERN S16 RgLiTfuNonRtInd ARGS((
Pst * pst,
Buffer *mBuf
));
-typedef int (*MacSchSlotIndFunc) ARGS((
- Pst *pst, /* Post Structure */
- SlotIndInfo *slotInd /* slot ind Info */
-));
-
#if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
/** @brief This API is the non-rt indication from PHY to MAC.
*/
SuId suId,
TfuTtiIndInfo * ttiInd
));
-/** @brief This API is the TTI indication from PHY to SCH.
- */
-EXTERN S16 cmUnpackMacSchSlotInd ARGS((
- MacSchSlotIndFunc func,
- Pst * pst,
- Buffer *mBuf
-));
-
/** @brief This API is used to convey the PUCCH delta power from PHY to SCH.
*/
EXTERN S16 cmPkTfuPucchDeltaPwrInd ARGS((
+#include "common_def.h"
+#include "OCTET_STRING.h"
+#include "BIT_STRING.h"
+#include "asn_codecs.h"
#include "odu_common_codec.h"
/*******************************************************************
RETVALUE(ROK);
}
+/*******************************************************************
+ *
+ * @brief Converts bit strings to integer
+ *
+ * @details
+ *
+ * Function : bitStringToInt
+ *
+ * Functionality:
+ * - Converts ASN bit string format IEs to integer type
+ *
+ * @params[in] void
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val)
+{
+ U16 idx;
+ if(bitString->buf == NULL || bitString->size <= 0)
+ {
+ DU_LOG("\nDU_APP : Bit string is empty");
+ return RFAILED;
+ }
+
+ for(idx=0; idx< bitString->size-1; idx++)
+ {
+ *val |= bitString->buf[idx];
+ *val <<= 8;
+ }
+ *val |= bitString->buf[idx];
+ *val >>= bitString->bits_unused;
+
+ return ROK;
+}
+
+
/**********************************************************************
End of file
#ifndef __ODU_COMMON_CODEC_H__
#define __ODU_COMMON_CODEC_H__
-#include "envopt.h" /* Environment options */
-#include "envdep.h" /* Environment dependent */
-#include "envind.h" /* Environment independent */
-
-#include "gen.h" /* General */
-#include "gen.x" /* General */
-#include "ssi.h"
-#include "OCTET_STRING.h"
-#include "BIT_STRING.h"
-#include "asn_codecs.h"
-
#define ENC_BUF_MAX_LEN 400
#define ENCODE_FAIL -1
-typedef struct PlmnIdentity
-{
- uint8_t mcc[3];
- uint8_t mnc[3];
-}Plmn;
+char encBuf[ENC_BUF_MAX_LEN];
+int encBufSize;
int PrepFinalEncBuf(const void *buffer, size_t size, void *encodedBuf);
S16 buildPlmnId(Plmn plmn, OCTET_STRING_t *octe);
S16 fillBitString(BIT_STRING_t *id, U8 unusedBits, U8 byteSize, U8 val);
-
-char encBuf[ENC_BUF_MAX_LEN];
-int encBufSize;
+S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val);
#endif
/* This file contains F1AP message handler functions */
#include "common_def.h"
+#include "OCTET_STRING.h"
+#include "BIT_STRING.h"
#include "odu_common_codec.h"
#include "cu_stub_sctp.h"
#include "cu_f1ap_msg_hdl.h"
/* This functions contains main() for cu_app */
#include "common_def.h"
-#include "odu_common_codec.h"
#include "cu_stub.h"
#include "cu_stub_sctp.h"
#include "cu_stub_egtp.h"
/* This file contains all EGTP related functionality */
#include "common_def.h"
-#include "odu_common_codec.h"
#include "cu_stub_egtp.h"
#include "du_log.h"
/* This file contains all SCTP related functionality */
#include "common_def.h"
-#include "odu_common_codec.h"
#include "cu_f1ap_msg_hdl.h"
#include "cu_stub_sctp.h"
#include "cu_stub_egtp.h"
#include "legtp.h"
#include "lrg.x"
#include "lkw.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "E2AP-PDU.h"
#include<ProtocolIE-Field.h>
#include "F1AP-PDU.h"
#include "du_cell_mgr.h"
+#include "odu_common_codec.h"
extern DuCfgParams duCfgParam;
extern S16 duBuildAndSendMacCellCfg();
value.choice.Cells_to_be_Activated_List_Item;
bitStringToInt(&cell.nRCGI.nRCellIdentity, &nci);
- if(nci <= 0 || nci > DU_MAX_CELLS)
+ if(nci <= 0 || nci > MAX_NUM_CELL)
{
DU_LOG("\nDU APP : Invalid NCI %d", nci);
return RFAILED;
#include "lrg.h"
#include "lkw.x"
#include "lrg.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_mgr.h"
+#include "du_utils.h"
+#include "OCTET_STRING.h"
+#include "BIT_STRING.h"
+#include "odu_common_codec.h"
#include "du_sys_info_hdl.h"
#include "MIB.h"
#include "SearchSpace.h"
#include "SI-SchedulingInfo.h"
#include "ConnEstFailureControl.h"
#include "PLMN-IdentityInfo.h"
-#include "odu_common_codec.h"
#include "PDSCH-TimeDomainResourceAllocation.h"
#include "BCCH-Config.h"
#include "PagingCycle.h"
return ROK;
}
-/*******************************************************************
- *
- * @brief Converts bit strings to integer
- *
- * @details
- *
- * Function : bitStringToInt
- *
- * Functionality:
- * - Converts ASN bit string format IEs to integer type
- *
- * @params[in] void
- * @return ROK - success
- * RFAILED - failure
- *
- * ****************************************************************/
-S16 bitStringToInt(BIT_STRING_t *bitString, U16 *val)
-{
- U16 idx;
- if(bitString->buf == NULL || bitString->size <= 0)
- {
- DU_LOG("\nDU_APP : Bit string is empty");
- return RFAILED;
- }
-
- for(idx=0; idx< bitString->size-1; idx++)
- {
- *val |= bitString->buf[idx];
- *val <<= 8;
- }
-
- *val |= bitString->buf[idx];
- *val >>= bitString->bits_unused;
-
- return ROK;
-}
-
-
/**********************************************************************
End of file
**********************************************************************/
#ifndef __DU_CONFIG_H_
#define __DU_CONFIG_H__
-#include "stdbool.h"
-#include "du_app_mac_inf.h"
-#include "du_log.h"
-#include "odu_common_codec.h"
-
/* MACROS */
#define DU_INST 0
#define DU_ID 1
/* Macro definitions for F1 procedures */
#define CU_DU_NAME_LEN_MAX 30 /* Max length of CU/DU name string */
#define MAX_F1_CONNECTIONS 65536 /* Max num of F1 connections */
-#define DU_MAX_CELLS 1 /* Max num of cells served by gNB-DU */
-#define DU_MAX_UE 1 /* Maximum number of UE Ids */
#define MAX_PLMN 6 /* Max num of broadcast PLMN ids */
#define MAXNRARFCN 3279165 /* Maximum values of NRAFCN */
#define MAXNRCELLBANDS 2 /* Maximum number of frequency bands */
uint32_t transId; /* Uniquely identify transaction */
uint32_t duId; /* DU ID */
char duName[CU_DU_NAME_LEN_MAX]; /* DU name */
- F1DuSrvdCellInfo srvdCellLst[DU_MAX_CELLS]; /* Serving cell list */
+ F1DuSrvdCellInfo srvdCellLst[MAX_NUM_CELL]; /* Serving cell list */
F1RrcVersion rrcVersion; /* RRC version */
}F1SetupReq;
typedef struct f1GnbDuCfgUpd
{
uint32_t transId; /* Uniquely identify transaction */
- F1DuSrvdCellInfo srvdCellLstAdd[DU_MAX_CELLS]; /* Served cell list to be added */
- F1DuSrvdCellToDel srvdCellLstMod[DU_MAX_CELLS]; /* Served cell list to be modified */
- NrEcgi srvdCellLstDel[DU_MAX_CELLS]; /* Served cell list to be deleted */
- F1CellStatus cellStatus[DU_MAX_CELLS]; /* Cell status */
- F1DedSIDelUE ueLst[DU_MAX_UE]; /* Ue list that requires dedicated SI delivery */
+ F1DuSrvdCellInfo srvdCellLstAdd[MAX_NUM_CELL]; /* Served cell list to be added */
+ F1DuSrvdCellToDel srvdCellLstMod[MAX_NUM_CELL]; /* Served cell list to be modified */
+ NrEcgi srvdCellLstDel[MAX_NUM_CELL]; /* Served cell list to be deleted */
+ F1CellStatus cellStatus[MAX_NUM_CELL]; /* Cell status */
+ F1DedSIDelUE ueLst[MAX_NUM_UE]; /* Ue list that requires dedicated SI delivery */
uint32_t gnbDuId;
F1TnlAssocToRmv gnbDuTnlAssocRmv[MAX_TNL_ASSOC]; /* TNL Assoc list to remove */
}F1GnbDuCfgUpd;
typedef struct f1GnbDuCfgUpdAck
{
uint32_t transId; /* Uniquely identify transaction */
- F1CuActCellInfo cellLstAct[DU_MAX_CELLS]; /* List of cells to be activated */
+ F1CuActCellInfo cellLstAct[MAX_NUM_CELL]; /* List of cells to be activated */
F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
- NrEcgi cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
+ NrEcgi cellLstDeact[MAX_NUM_CELL]; /* List of cells to be deactivated */
}F1GnbDuCfgUpdAck;
typedef struct f1GnbDuCfgUpdFail
typedef struct f1GnbCuCfgUpd
{
uint32_t transId; /* Uniquely identifies transaction */
- F1CuActCellInfo cellLstAct[DU_MAX_CELLS]; /* List of cells to be activated */
- NrEcgi cellLstDeact[DU_MAX_CELLS]; /* List of cells to be deactivated */
+ F1CuActCellInfo cellLstAct[MAX_NUM_CELL]; /* List of cells to be activated */
+ NrEcgi cellLstDeact[MAX_NUM_CELL]; /* List of cells to be deactivated */
F1TnlAssoc assocLstAdd[MAX_TNL_ASSOC]; /* List of TNL assocs to be added */
F1TnlAssoc assocLstUpd[MAX_TNL_ASSOC]; /* List of TNL assocs to be updated */
F1TnlAssocToRmv assocLstRmv[MAX_TNL_ASSOC]; /* List of TNL assocs to be removed */
- F1CellBarred cellToBarList[DU_MAX_CELLS]; /* List of Cells to be barred */
+ F1CellBarred cellToBarList[MAX_NUM_CELL]; /* List of Cells to be barred */
F1ProtectEUTRARsrc protectEutraRsrcList[MAXCELLINENB]; /* List of Protected EUTRA resources */
}F1GnbCuCfgUpd;
typedef struct f1GnbCuCfgUpdAck
{
uint32_t transId; /* Uniquely identify transaction */
- F1ActCellFail actCellFailList[DU_MAX_CELLS]; /* Cells failed to be activated list */
+ F1ActCellFail actCellFailList[MAX_NUM_CELL]; /* Cells failed to be activated list */
F1CritDiagnostic critDiagnostic; /* Critical diagnostics */
F1TnlAssocAddr assocSetupList[MAX_TNL_ASSOC]; /* TNL Assoc Setup list */
F1TnlAssocSetupFail assocSetupFailList[MAX_TNL_ASSOC]; /* TNL Assoc Setup fail list */
uint32_t duId;
uint8_t duName[CU_DU_NAME_LEN_MAX];
SchedulerCfg schedCfg;
- F1DuSrvdCellInfo srvdCellLst[DU_MAX_CELLS]; /* Serving cell list *///TODO: this must be removed eventually
+ F1DuSrvdCellInfo srvdCellLst[MAX_NUM_CELL]; /* Serving cell list *///TODO: this must be removed eventually
F1RrcVersion rrcVersion; /* RRC version */
MacCellCfg macCellCfg; /* MAC cell configuration */
MibParams mibParams; /* MIB Params */
S16 readClCfg();
S16 readCfg();
S16 duReadCfg();
-S16 bitStringToInt(BIT_STRING_t *bitString, uint16_t *val);
uint16_t calcSliv(uint8_t startSymbol, uint8_t lengthSymbol);
#endif /* __DU_CONFIG_H__ */
#include "lkw.x"
#include "lrg.x"
#include "legtp.h"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_mgr_main.h"
+#include "du_utils.h"
#include "GlobalE2node-gNB-ID.h"
-#include "odu_common_codec.h"
#include<ProtocolIE-FieldE2.h>
#include "E2AP-PDU.h"
#include "du_e2ap_msg_hdl.h"
+#include "odu_common_codec.h"
/* Global variable */
DuCfgParams duCfgParam;
{
E2AP_PDU_t *e2apMsg = NULLP;
RICindication_t *ricIndicationMsg=NULLP;
- uint8_t elementCnt=0;
asn_enc_rval_t encRetVal; /* Encoder return value */
uint8_t ret = RFAILED;
uint8_t FillRicIndicationret = ROK;
#include "lkw.x"
#include "lrg.x"
#include "legtp.h"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_egtp.h"
#include "du_ue_mgr.h"
+#include "du_utils.h"
/* Global variable declaration */
EgtpGlobalCb egtpCb;
DU_LOG("\nEGTP : Tunnel addition : LocalTeid[%d] Remote Teid[%d]", tnlEvt.lclTeid, tnlEvt.remTeid);
- ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, (Data **)&teidCb, (Size)sizeof(EgtpTeIdCb));
- if(ret != ROK)
+ DU_ALLOC(teidCb, sizeof(EgtpTeIdCb));
+ if(teidCb == NULLP)
{
DU_LOG("\nEGTP : Memory allocation failed");
return LCM_REASON_MEM_NOAVAIL;
if(ret != ROK)
{
DU_LOG("\nEGTP : Failed to insert in hash list");
- SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)sizeof(EgtpTeIdCb));
+ DU_FREE(teidCb, sizeof(EgtpTeIdCb));
return LCM_REASON_HASHING_FAILED;
}
egtpCb.dstCb.numTunn++;
}
cmHashListDelete(&(egtpCb.dstCb.teIdLst), (PTR)teidCb);
- SPutSBuf(DU_APP_MEM_REGION, DU_POOL, (Data *)teidCb, (Size)sizeof(EgtpTeIdCb));
+ DU_FREE(teidCb, sizeof(EgtpTeIdCb));
egtpCb.dstCb.numTunn--;
return ROK;
#include "legtp.h"
#include "lkw.x"
#include "lrg.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "E2AP-PDU.h"
#include "du_mgr.h"
#include "du_mgr_main.h"
#include "du_f1ap_msg_hdl.h"
+#include "du_utils.h"
#include "GNB-DU-System-Information.h"
#include "CellGroupConfigRrc.h"
#include "MAC-CellGroupConfig.h"
#include "ProtocolExtensionField.h"
#include "F1AP-PDU.h"
#include "du_cell_mgr.h"
+#include "odu_common_codec.h"
S16 procGNBDUCfgUpdAck(F1AP_PDU_t *f1apMsg);
uint8_t procDlRrcMsgTrans(F1AP_PDU_t *f1apMsg);
#define __DU_MGR_H__
#define DU_PROC 0
-/* Memory related configs */
-#define DU_APP_MEM_REGION 0
-#define RLC_UL_MEM_REGION 1
-#define RLC_DL_MEM_REGION 4
-#define MAC_MEM_REGION 4
-
-#define DU_POOL 1
-#define RLC_POOL 1
-#define RG_POOL 1
-
/* Events */
#define EVTCFG 0
#define EVTSCTPSTRT 1
#define DU_SET_ZERO(_buf, _size) \
cmMemset((U8 *)(_buf), 0, _size);
-/* allocate and zero out a static buffer */
-#define DU_ALLOC(_datPtr, _size) \
-{ \
- S16 _ret; \
- _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \
- (Data **)&_datPtr, _size); \
- if(_ret == ROK) \
- cmMemset((U8*)_datPtr, 0, _size); \
- else \
- _datPtr = NULLP; \
-}
-
-/* free a static buffer */
-#define DU_FREE(_datPtr, _size) \
- if(_datPtr) \
- SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \
- (Data *)_datPtr, _size);
-
-/* Allocate shared memory to be used for LWLC
- * during inter-layer communication */
-#define DU_ALLOC_SHRABL_BUF(_buf, _size) \
-{ \
- if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \
- (Data **)&_buf, (Size) _size, 0) == ROK) \
- { \
- cmMemset((U8 *)(_buf), 0, _size); \
- } \
- else \
- { \
- (_buf) = NULLP; \
- } \
-}
-
-/* Free shared memory, received through LWLC */
-#define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
-{ \
- if (_buf != NULLP) \
- { \
- (Void) SPutStaticBuffer(_region, _pool, \
- (Data *) _buf, (Size) _size, 0); \
- _buf = NULLP; \
- } \
-}
-
-
typedef enum
{
CELL_OUT_OF_SERVICE,
typedef enum
{
UE_INACTIVE,
- UE_ACTIVE
+ UE_ACTIVE
}UeState;
typedef struct cellCfgParams
Bool firstSlotIndRcvd;
CellStatus cellStatus; /* Cell status */
uint32_t numActvUes; /* Total Active UEs */
- DuUeCb ueCb[DU_MAX_UE]; /* UE CONTEXT */
+ DuUeCb ueCb[MAX_NUM_UE]; /* UE CONTEXT */
}DuCellCb;
typedef struct duLSapCb
Bool f1Status; /* Status of F1 connection */
Bool e2Status; /* Status of E2 connection */
uint8_t numCfgCells;
- DuCellCb* cfgCellLst[DU_MAX_CELLS]; /* List of cells at DU APP of type DuCellCb */
+ DuCellCb* cfgCellLst[MAX_NUM_CELL]; /* List of cells at DU APP of type DuCellCb */
uint8_t numActvCells;
- DuCellCb* actvCellLst[DU_MAX_CELLS]; /* List of cells activated/to be activated of type DuCellCb */
+ DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */
/* pointer to store the address of macCellCfg params used to send du-app to MAC */
MacCellCfg *duMacCellCfg; /* pointer to store params while sending DU-APP to MAC */
uint32_t numUe; /* current number of UEs */
- UeCcchCtxt ueCcchCtxt[DU_MAX_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
+ UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
}DuCb;
S16 duSendEgtpTestData();
S16 duSendEgtpDatInd(Buffer *mBuf);
S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
-uint16_t duBuildAndSendMacCellStartReq();
-uint16_t duBuildAndSendMacCellStopReq();
+uint8_t duBuildAndSendMacCellStartReq();
+uint8_t duBuildAndSendMacCellStopReq();
#endif
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
#include "lkw.h"
#include "lrg.x"
#include "lkw.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "E2AP-PDU.h"
#include "du_sctp.h"
duCb.f1Status = FALSE;
duCb.e2Status = FALSE;
- for(id = 0; id < DU_MAX_CELLS; id ++)
+ for(id = 0; id < MAX_NUM_CELL; id ++)
{
duCb.cfgCellLst[id] = NULL;
duCb.actvCellLst[id] = NULL;
}
duCb.numUe = 0;
- memset(duCb.ueCcchCtxt, 0, DU_MAX_UE * sizeof(UeCcchCtxt));
+ memset(duCb.ueCcchCtxt, 0, MAX_NUM_UE * sizeof(UeCcchCtxt));
duCb.numCfgCells = 0;
duCb.numActvCells = 0;
+
SSetProcId(DU_PROC);
return ROK;
case EVENT_MAC_UE_CREATE_RSP:
{
ret = unpackDuMacUeCreateRsp(duHandleMacUeCreateRsp, pst, mBuf);
+ break;
}
default:
#include "legtp.h"
#include "lrg.x"
#include "lkw.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_mgr_main.h"
#include "du_sctp.h"
#include "du_egtp.h"
-
extern S16 kwUlActvTsk (Pst *, Buffer *);
extern S16 kwUlActvInit (Ent, Inst, Region, Reason);
extern S16 kwDlActvTsk (Pst *, Buffer *);
#include "lkw.h"
#include "lrg.x"
#include "lkw.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_mgr.h"
#include "du_sctp.h"
#include "lsctp.h"
#include "legtp.h"
#include "lphy_stub.h"
+#include "du_utils.h"
U8 rlcDlCfg = 0;
U8 numRlcDlSaps = 0;
packMacCellCfgReq packMacCellCfgOpts[] =
{
packMacCellCfg, /* packing for loosely coupled */
- MacHdlCellCfgReq, /* packing for tightly coupled */
+ MacProcCellCfgReq, /* packing for tightly coupled */
packMacCellCfg, /* packing for light weight loosly coupled */
};
DuMacCellStartReq packMacCellStartReqOpts[] =
{
packMacCellStartReq, /* Loose coupling */
- MacHdlCellStartReq, /* TIght coupling */
+ MacProcCellStartReq, /* TIght coupling */
packMacCellStartReq /* Light weight-loose coupling */
};
DuMacCellStopReq packMacCellStopReqOpts[] =
{
packMacCellStopReq, /* Loose coupling */
- MacHdlCellStopReq, /* TIght coupling */
+ MacProcCellStopReq, /* TIght coupling */
packMacCellStopReq /* Light weight-loose coupling */
};
genCfg->lmPst.pool = RLC_POOL;
genCfg->lmPst.selector = ODU_SELECTOR_LC;
- /* Fill Header */
+ /* Fill Header */
kwMngmt.hdr.msgType = TCFG;
kwMngmt.hdr.msgLen = 0;
kwMngmt.hdr.entId.ent = ENTKW;
lSap->procId = DU_PROC;
lSap->ent = ENTKW;
lSap->inst = (inst == RLC_UL_INST) ?
- RLC_DL_INST : RLC_UL_INST;
+ RLC_DL_INST : RLC_UL_INST;
lSap->sapId = 0;
lSap->selector = ODU_SELECTOR_LC;
kwMngmt.hdr.elmId.elmnt = STUDXSAP;
{
DuCellCb *cell = NULLP;
DU_ALLOC(cell, sizeof(DuCellCb))
- if(cell == NULLP)
- {
- DU_LOG("\nDU_APP : Memory Allocation failed in duProcCfgComplete");
- ret = RFAILED;
- }
- else
- {
- U32 nci;
- U8 idx1;
- memset(cell, 0, sizeof(DuCellCb));
- cell->cellId = ++cellId;
- cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
- cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
- cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
- cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
- cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
- cell->cellInfo.nrEcgi.plmn.mnc[2] = PLMN_MNC2;
- cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
- cell->cellInfo.nrPci = NR_PCI;
- cell->cellInfo.fiveGsTac = DU_TAC;
- for(idx1=0; idx1<MAX_PLMN; idx1++)
- {
- cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
- cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
- cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
- cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
- cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
- cell->cellInfo.plmn[idx1].mnc[2] = PLMN_MNC2;
+ if(cell == NULLP)
+ {
+ DU_LOG("\nDU_APP : Memory Allocation failed in duProcCfgComplete");
+ ret = RFAILED;
+ }
+ else
+ {
+ U32 nci;
+ U8 idx1;
+ memset(cell, 0, sizeof(DuCellCb));
+ cell->cellId = ++cellId;
+ cell->cellInfo.nrEcgi.plmn.mcc[0] = PLMN_MCC0;
+ cell->cellInfo.nrEcgi.plmn.mcc[1] = PLMN_MCC1;
+ cell->cellInfo.nrEcgi.plmn.mcc[2] = PLMN_MCC2;
+ cell->cellInfo.nrEcgi.plmn.mnc[0] = PLMN_MNC0;
+ cell->cellInfo.nrEcgi.plmn.mnc[1] = PLMN_MNC1;
+ cell->cellInfo.nrEcgi.plmn.mnc[2] = PLMN_MNC2;
+ cell->cellInfo.nrEcgi.cellId = NR_CELL_ID;
+ cell->cellInfo.nrPci = NR_PCI;
+ cell->cellInfo.fiveGsTac = DU_TAC;
+ for(idx1=0; idx1<MAX_PLMN; idx1++)
+ {
+ cell->cellInfo.plmn[idx1].mcc[0] = PLMN_MCC0;
+ cell->cellInfo.plmn[idx1].mcc[1] = PLMN_MCC1;
+ cell->cellInfo.plmn[idx1].mcc[2] = PLMN_MCC2;
+ cell->cellInfo.plmn[idx1].mnc[0] = PLMN_MNC0;
+ cell->cellInfo.plmn[idx1].mnc[1] = PLMN_MNC1;
+ cell->cellInfo.plmn[idx1].mnc[2] = PLMN_MNC2;
+ }
+ cell->cellInfo.maxUe = duCfgParam.maxUe;
+ cell->cellStatus = CELL_OUT_OF_SERVICE;
+ nci = (U16)cell->cellInfo.nrEcgi.cellId;
+
+ duCb.cfgCellLst[nci-1] = cell;
+ duCb.numCfgCells++;
}
- cell->cellInfo.maxUe = duCfgParam.maxUe;
- cell->cellStatus = CELL_OUT_OF_SERVICE;
- nci = (U16)cell->cellInfo.nrEcgi.cellId;
-
- duCb.cfgCellLst[nci-1] = cell;
- duCb.numCfgCells++;
}
- }
if(ret != RFAILED)
{
//Start layer configs
duBuildRlcLsapCfg(ENTRG, (Inst)RLC_UL_INST, cellIdx);
}
duBuildRlcLsapCfg(ENTKW, (Inst)RLC_UL_INST, 0);
-
+
return ROK;
}
{
duBuildRlcLsapCfg(ENTRG, (Inst)RLC_DL_INST, cellIdx);
}
-
+
return ROK;
}
/**************************************************************************
{
switch (cntrl->hdr.elmId.elmnt)
{
- case STRGUSAP:
- {
- if (pst->srcInst == RLC_DL_INST)
- {
- DU_LOG("\nDU_APP : BIND OF RLC DL TO MAC (RGU) SAP SUCCESSFUL");
- macCfgInst++;
- if(macCfgInst < DEFAULT_CELLS)
- {
- macCfgInst = 0;
- duBindUnbindRlcToMacSap((Inst) RLC_DL_INST, ABND);
- }
- else
- {
- duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
- }
- }
- else
- {
- DU_LOG("\nDU_APP : BIND OF RLC UL TO MAC (RGU) SAP SUCCESSFUL");
- macCfgInst++;
- if(macCfgInst < DEFAULT_CELLS)
- {
- duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
- }
- else
- {
- duSendSchCfg();
- }
- break;
- }
- }
+ case STRGUSAP:
+ {
+ if (pst->srcInst == RLC_DL_INST)
+ {
+ DU_LOG("\nDU_APP : BIND OF RLC DL TO MAC (RGU) SAP SUCCESSFUL");
+ macCfgInst++;
+ if(macCfgInst < DEFAULT_CELLS)
+ {
+ macCfgInst = 0;
+ duBindUnbindRlcToMacSap((Inst) RLC_DL_INST, ABND);
+ }
+ else
+ {
+ duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
+ }
+ }
+ else
+ {
+ DU_LOG("\nDU_APP : BIND OF RLC UL TO MAC (RGU) SAP SUCCESSFUL");
+ macCfgInst++;
+ if(macCfgInst < DEFAULT_CELLS)
+ {
+ duBindUnbindRlcToMacSap((Inst) RLC_UL_INST, ABND);
+ }
+ else
+ {
+ duSendSchCfg();
+ }
+ break;
+ }
+ }
}
}
{
switch(cfm->hdr.elmId.elmnt)
{
- case STGEN:
- {
- rlcUlCfg |= RLC_GEN_CFG;
- break;
- }
- case STRGUSAP:
- {
- numRlcMacSaps++;
- if(numRlcMacSaps == DEFAULT_CELLS)
- {
- rlcUlCfg |= RLC_MAC_SAP_CFG;
- numRlcMacSaps = 0;
- }
- break;
- }
- case STUDXSAP:
- {
- rlcUlCfg |= RLC_UDX_SAP_CFG;
- break;
-
- }
- default:
- break;
+ case STGEN:
+ {
+ rlcUlCfg |= RLC_GEN_CFG;
+ break;
+ }
+ case STRGUSAP:
+ {
+ numRlcMacSaps++;
+ if(numRlcMacSaps == DEFAULT_CELLS)
+ {
+ rlcUlCfg |= RLC_MAC_SAP_CFG;
+ numRlcMacSaps = 0;
+ }
+ break;
+ }
+ case STUDXSAP:
+ {
+ rlcUlCfg |= RLC_UDX_SAP_CFG;
+ break;
+
+ }
+ default:
+ break;
}
DU_LOG("\nDU_APP : RLC UL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
if(rlcUlCfg == DU_RLC_UL_CONFIGURED)
{
- rlcUlCfg = 0;
- numRlcMacSaps = 0;
- //Start configuration of RLC DL
- duSendRlcDlCfg();
+ rlcUlCfg = 0;
+ numRlcMacSaps = 0;
+ //Start configuration of RLC DL
+ duSendRlcDlCfg();
}
}
{
switch(cfm->hdr.elmId.elmnt)
{
- case STGEN:
- {
- rlcDlCfg |= RLC_GEN_CFG;
- break;
- }
- case STRGUSAP:
- {
- numRlcMacSaps++;
- if(numRlcMacSaps == DEFAULT_CELLS)
- {
- rlcDlCfg |= RLC_MAC_SAP_CFG;
- numRlcMacSaps = 0;
- }
- break;
- }
- case STUDXSAP:
- {
- rlcDlCfg |= RLC_UDX_SAP_CFG;
- break;
-
- }
- default:
- break;
+ case STGEN:
+ {
+ rlcDlCfg |= RLC_GEN_CFG;
+ break;
+ }
+ case STRGUSAP:
+ {
+ numRlcMacSaps++;
+ if(numRlcMacSaps == DEFAULT_CELLS)
+ {
+ rlcDlCfg |= RLC_MAC_SAP_CFG;
+ numRlcMacSaps = 0;
+ }
+ break;
+ }
+ case STUDXSAP:
+ {
+ rlcDlCfg |= RLC_UDX_SAP_CFG;
+ break;
+
+ }
+ default:
+ break;
}
DU_LOG("\nDU_APP : RLC DL Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
if(rlcDlCfg == DU_RLC_DL_CONFIGURED)
{
- rlcDlCfg = 0;
- //Start configuration of MAC
- duSendMacCfg();
+ rlcDlCfg = 0;
+ //Start configuration of MAC
+ duSendMacCfg();
}
}
DU_SET_ZERO(&rgMngmt, sizeof(RgMngmt));
genCfg = &(rgMngmt.t.cfg.s.genCfg);
-
+
/*----------- Fill General Configuration Parameters ---------*/
genCfg->mem.region = MAC_MEM_REGION;
- genCfg->mem.pool = RG_POOL;
+ genCfg->mem.pool = MAC_POOL;
genCfg->tmrRes = 10;
genCfg->numRguSaps = 2;
genCfg->lmPst.prior = PRIOR0;
genCfg->lmPst.route = RTESPEC;
genCfg->lmPst.region = MAC_MEM_REGION;
- genCfg->lmPst.pool = RG_POOL;
+ genCfg->lmPst.pool = MAC_POOL;
genCfg->lmPst.selector = ODU_SELECTOR_LC;
- /* Fill Header */
+ /* Fill Header */
rgMngmt.hdr.msgType = TCFG;
rgMngmt.hdr.msgLen = 0;
rgMngmt.hdr.entId.ent = ENTRG;
rgMngmt.hdr.response.prior = PRIOR0;
rgMngmt.hdr.response.route = RTESPEC;
rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
- rgMngmt.hdr.response.mem.pool = RG_POOL;
+ rgMngmt.hdr.response.mem.pool = MAC_POOL;
rgMngmt.hdr.response.selector = ODU_SELECTOR_LC;
/* Fill Pst */
uSap = &(rgMngmt.t.cfg.s.rguSap);
uSap->mem.region = MAC_MEM_REGION;
- uSap->mem.pool = RG_POOL;
+ uSap->mem.pool = MAC_POOL;
uSap->suId = 0;
uSap->spId = sapId;
uSap->procId = DU_PROC;
rgMngmt.hdr.entId.inst = (Inst)0;
rgMngmt.hdr.elmId.elmnt = STRGUSAP;
rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
- rgMngmt.hdr.response.mem.pool = RG_POOL;
-
+ rgMngmt.hdr.response.mem.pool = MAC_POOL;
+
/* fill pst */
pst.selector = ODU_SELECTOR_LC;
pst.srcEnt = ENTDUAPP;
{
switch (cfm->hdr.elmId.elmnt)
{
- case STGEN:
- {
- macCfg |= MAC_GEN_CFG;
- break;
- }
- case STRGUSAP:
- {
- macCfg |= MAC_SAP_CFG;
- numRlcMacSaps++;
- break;
- }
- default:
- break;
+ case STGEN:
+ {
+ macCfg |= MAC_GEN_CFG;
+ break;
+ }
+ case STRGUSAP:
+ {
+ macCfg |= MAC_SAP_CFG;
+ numRlcMacSaps++;
+ break;
+ }
+ default:
+ break;
}
DU_LOG("\nDU_APP : MAC Cfg Cfm received for the element %d ",cfm->hdr.elmId.elmnt);
if(macCfg == MAC_CONFIGURED && numRlcMacSaps == MAX_MAC_SAP)
{
- macCfg = 0;
- DU_LOG("\nDU_APP : Completed sending Configs");
- macCfgInst = 0;
- duBindUnbindRlcToMacSap(RLC_DL_INST, ABND);
+ macCfg = 0;
+ DU_LOG("\nDU_APP : Completed sending Configs");
+ macCfgInst = 0;
+ duBindUnbindRlcToMacSap(RLC_DL_INST, ABND);
}
}
TRC2(smBindKwToRguSap)
- DU_SET_ZERO(&kwMngmt, sizeof(KwMngmt));
+ DU_SET_ZERO(&kwMngmt, sizeof(KwMngmt));
DU_SET_ZERO(&pst, sizeof(Pst));
if (action == ABND)
{
if(BuildAndSendF1SetupReq() != ROK)
{
- return RFAILED;
+ return RFAILED;
}
}
else if(ricParams.assocId == ntfy->u.assocChange.assocId)
{
if(BuildAndSendE2SetupReq() != ROK)
{
- return RFAILED;
+ return RFAILED;
}
}
else
- {
+ {
DU_LOG("\nDU_APP : Invalid assocId %d received", ntfy->u.assocChange.assocId);
- return RFAILED;
- }
+ return RFAILED;
+ }
return ROK;
}
pst->event = event;
pst->selector = ODU_SELECTOR_LC;
pst->pool= DU_POOL;
-
+
RETVALUE(ROK);
}
S16 duBuildEgtpCfgReq()
{
- Pst pst;
- EgtpConfig egtpCfg;
-
- DU_LOG("\nDU_APP : Sending EGTP config request");
-
- cmMemset((U8 *)&egtpCfg, 0, sizeof(EgtpConfig));
- cmMemcpy((U8 *)&egtpCfg, (U8 *)&duCfgParam.egtpParams, (PTR)sizeof(EgtpConfig));
-
- duFillEgtpPst(&pst, EVTCFGREQ);
- packEgtpCfgReq(&pst, egtpCfg);
-
- RETVALUE(ROK);
+ Pst pst;
+ EgtpConfig egtpCfg;
+
+ DU_LOG("\nDU_APP : Sending EGTP config request");
+
+ cmMemset((U8 *)&egtpCfg, 0, sizeof(EgtpConfig));
+ cmMemcpy((U8 *)&egtpCfg, (U8 *)&duCfgParam.egtpParams, (PTR)sizeof(EgtpConfig));
+
+ duFillEgtpPst(&pst, EVTCFGREQ);
+ packEgtpCfgReq(&pst, egtpCfg);
+
+ RETVALUE(ROK);
}
/*******************************************************************
* RFAILED - failure
*
* ****************************************************************/
-
+
S16 duSendEgtpSrvOpenReq()
{
Pst pst;
S16 duHdlEgtpSrvOpenComplete(CmStatus cfm)
{
- S16 ret = ROK;
-
- if(cfm.status == LCM_PRIM_OK)
- {
- DU_LOG("\nDU_APP : EGTP server opened successfully");
+ S16 ret = ROK;
+
+ if(cfm.status == LCM_PRIM_OK)
+ {
+ DU_LOG("\nDU_APP : EGTP server opened successfully");
#ifdef EGTP_TEST
- duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, EGTP_LCL_TEID, EGTP_REM_TEID);
+ duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, EGTP_LCL_TEID, EGTP_REM_TEID);
#endif
- }
- else
- {
- DU_LOG("\nDU_APP : EGTP server opening failed");
- ret = RFAILED;
- }
-
- RETVALUE(ret);
+ }
+ else
+ {
+ DU_LOG("\nDU_APP : EGTP server opening failed");
+ ret = RFAILED;
+ }
+
+ RETVALUE(ret);
}
/*******************************************************************
tnlEvt.action = action;
tnlEvt.lclTeid = lclTeid;
tnlEvt.remTeid = remTeid;
-
+
DU_LOG("\nDU_APP : Sending EGTP tunnel management request");
-
+
duFillEgtpPst(&pst, EVTTNLMGMTREQ);
packEgtpTnlMgmtReq(&pst, tnlEvt);
-
+
RETVALUE(ROK);
}
egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
egtpMsg.msgHdr.teId = 1;
egtpMsg.msg = mBuf;
-
+
egtpHdlDatInd(egtpMsg);
return ROK;
{
if(SAddPstMsgMult((Data *)data, datSize, mBuf) != ROK)
{
- DU_LOG("\nDU_APP : SAddPstMsgMult failed");
- SPutMsg(mBuf);
- RETVALUE(RFAILED);
+ DU_LOG("\nDU_APP : SAddPstMsgMult failed");
+ SPutMsg(mBuf);
+ RETVALUE(RFAILED);
}
}
else
S16 ret, cnt, idx;
Data revPkArray[CM_IPV4_HDRLEN];
Data pkArray[CM_IPV4_HDRLEN];
-
+
/* initialize locals */
cnt = 0;
cmMemset(revPkArray, 0, CM_IPV4_HDRLEN);
/* this function automatically reverses revPkArray */
ret = SAddPreMsgMult(revPkArray, (MsgLen)cnt, mBuf);
-
+
duSendEgtpDatInd(mBuf);
-
+
RETVALUE(ROK);
}
#endif /* EGTP_TEST */
cfg->instId = DEFAULT_CELLS + 1;
/* Filling of Gen config */
cfg->genCfg.mem.region = MAC_MEM_REGION;
- cfg->genCfg.mem.pool = RG_POOL;
+ cfg->genCfg.mem.pool = MAC_POOL;
cfg->genCfg.tmrRes = 10;
#ifdef LTE_ADV
cfg->genCfg.lmPst.prior = PRIOR0;
cfg->genCfg.lmPst.route = RTESPEC;
cfg->genCfg.lmPst.region = MAC_MEM_REGION;
- cfg->genCfg.lmPst.pool = RG_POOL;
+ cfg->genCfg.lmPst.pool = MAC_POOL;
cfg->genCfg.lmPst.selector = ODU_SELECTOR_LC;
/* Fill Header */
rgMngmt.hdr.entId.inst = DU_INST;
rgMngmt.hdr.elmId.elmnt = STSCHINST;
rgMngmt.hdr.response.mem.region = MAC_MEM_REGION;
- rgMngmt.hdr.response.mem.pool = RG_POOL;
+ rgMngmt.hdr.response.mem.pool = MAC_POOL;
/* Fill Pst */
pst.selector = ODU_SELECTOR_LC;
{
switch (cfm->hdr.elmId.elmnt)
{
- case STSCHINST:
- {
- DU_LOG("\nDU_APP : Received SCH CFG CFM at DU APP");
- break;
- }
- default:
- break;
+ case STSCHINST:
+ {
+ DU_LOG("\nDU_APP : Received SCH CFG CFM at DU APP");
+ break;
+ }
+ default:
+ break;
}
}
duLayerConfigComplete();
duFillEgtpPst(&pst, EVTSLOTIND);
packEgtpSlotInd(&pst);
-
+
RETVALUE(ROK);
-
+
}
/**************************************************************************
memcpy(duMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg));
/* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTDUAPP;
- pst.dstEnt = ENTRG;
- pst.dstInst = 0;
- pst.srcInst = 0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = DU_APP_MEM_REGION;
- pst.pool = DU_POOL;
- pst.event = EVENT_MAC_CELL_CONFIG_REQ;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_CONFIG_REQ);
/* Send MAC cell config to MAC */
return (*packMacCellCfgOpts[pst.selector])(&pst, duMacCellCfg);
* RFAILED - failure
*
***************************************************************************/
-int duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
+uint8_t duHandleMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm)
{
uint8_t actvCellIdx = 0;
- S16 ret = ROK;
+ uint8_t ret = ROK;
if(macCellCfgCfm->rsp == ROK)
{
* RFAILED - failure
*
* ****************************************************************/
-uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo)
+uint8_t duHandleSlotInd(Pst *pst, SlotIndInfo *slotInfo)
{
-
+
DU_LOG("\nDU APP : Slot Indication received");
- if(slotInfo->cellId <=0 || slotInfo->cellId > DU_MAX_CELLS)
+ if(slotInfo->cellId <=0 || slotInfo->cellId > MAX_NUM_CELL)
{
DU_LOG("\nDU APP : Invalid Cell Id %d", slotInfo->cellId);
}
{
duCb.actvCellLst[slotInfo->cellId-1]->firstSlotIndRcvd = true;
if((duCb.actvCellLst[slotInfo->cellId-1] != NULL) && \
- (duCb.actvCellLst[slotInfo->cellId-1]->cellStatus == \
- ACTIVATION_IN_PROGRESS))
+ (duCb.actvCellLst[slotInfo->cellId-1]->cellStatus == \
+ ACTIVATION_IN_PROGRESS))
{
- DU_LOG("\nDU APP : 5G-NR Cell %d is UP", slotInfo->cellId);
- duCb.actvCellLst[slotInfo->cellId-1]->cellStatus = ACTIVATED;
+ DU_LOG("\nDU APP : 5G-NR Cell %d is UP", slotInfo->cellId);
+ duCb.actvCellLst[slotInfo->cellId-1]->cellStatus = ACTIVATED;
}
-
+
}
/* TODO : Slot Indication to be moved out of EGTP_TEST when
#endif
if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
- DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotInfo));
+ DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, slotInfo, sizeof(SlotIndInfo));
return ROK;
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t duBuildAndSendMacCellStartReq()
+uint8_t duBuildAndSendMacCellStartReq()
{
Pst pst;
MacCellStartInfo *cellStartInfo = NULL;
return RFAILED;
}
- for(uint8_t id = 0; id < DU_MAX_CELLS; id++)
+ for(uint8_t id = 0; id < MAX_NUM_CELL; id++)
{
if(duCb.actvCellLst[id])
{
- duCb.actvCellLst[id]->firstSlotIndRcvd = FALSE;
- cellStartInfo->cellId = duCb.actvCellLst[id]->cellInfo.nrEcgi.cellId;
-
- /* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTDUAPP;
- pst.dstEnt = ENTRG;
- pst.dstInst = 0;
- pst.srcInst = 0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = DU_APP_MEM_REGION;
- pst.pool = DU_POOL;
- pst.event = EVENT_MAC_CELL_START_REQ;
-
- return (*packMacCellStartReqOpts[pst.selector])(&pst, cellStartInfo);
+ duCb.actvCellLst[id]->firstSlotIndRcvd = FALSE;
+ cellStartInfo->cellId = duCb.actvCellLst[id]->cellInfo.nrEcgi.cellId;
+
+ /* Fill Pst */
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_START_REQ);
+
+ return (*packMacCellStartReqOpts[pst.selector])(&pst, cellStartInfo);
}
}
return ROK;
* RFAILED - failure
*
* ****************************************************************/
-uint16_t duBuildAndSendMacCellStopReq()
+uint8_t duBuildAndSendMacCellStopReq()
{
Pst pst;
MacCellStopInfo *cellStopInfo = NULL;
-
+
DU_LOG("\nDU APP : Building and Sending cell stop request to MAC");
/* Send Cell Stop Request to MAC */
return RFAILED;
}
cellStopInfo->cellId = duCb.actvCellLst[0]->cellId;
-
+
/* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTDUAPP;
- pst.dstEnt = ENTRG;
- pst.dstInst = 0;
- pst.srcInst = 0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = DU_APP_MEM_REGION;
- pst.pool = DU_POOL;
- pst.event = EVENT_MAC_CELL_STOP_REQ;
-
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_CELL_STOP_REQ);
+
return (*packMacCellStopReqOpts[pst.selector])(&pst, cellStopInfo);
}
* RFAILED - failure
*
* ****************************************************************/
-uint16_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+uint8_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId)
{
- if(cellStopId->cellId <=0 || cellStopId->cellId > DU_MAX_CELLS)
+ if(cellStopId->cellId <=0 || cellStopId->cellId > MAX_NUM_CELL)
{
DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId);
}
- if(duCb.actvCellLst[cellStopId->cellId-1] != NULL)
- {
+ if(duCb.actvCellLst[cellStopId->cellId-1] != NULL)
+ {
if(duCb.actvCellLst[cellStopId->cellId-1]->firstSlotIndRcvd)
{
- duCb.actvCellLst[cellStopId->cellId-1]->firstSlotIndRcvd = false;
- if((duCb.actvCellLst[cellStopId->cellId-1]->cellStatus == \
- ACTIVATED))
- {
- DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellStopId->cellId);
- duCb.actvCellLst[cellStopId->cellId-1]->cellStatus = DELETION_IN_PROGRESS;
- }
+ duCb.actvCellLst[cellStopId->cellId-1]->firstSlotIndRcvd = false;
+ if((duCb.actvCellLst[cellStopId->cellId-1]->cellStatus == \
+ ACTIVATED))
+ {
+ DU_LOG("\nDU APP : 5G-NR Cell %d is DOWN", cellStopId->cellId);
+ duCb.actvCellLst[cellStopId->cellId-1]->cellStatus = DELETION_IN_PROGRESS;
+ }
}
- }
+ }
if((pst->selector == ODU_SELECTOR_LWLC) || (pst->selector == ODU_SELECTOR_TC))
DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellStopId, sizeof(MacCellStopInfo));
* RFAILED - failure
*
* ****************************************************************/
-uint16_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
+uint8_t duHandleUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
{
-
+
DU_LOG("\nDU APP : UL CCCH Indication received");
return (duProcUlCcchInd(ulCcchIndInfo));
#include "legtp.h"
#include "lrg.x"
#include "lkw.x"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_sctp.h"
#include "lsctp.h"
-
+#include "du_utils.h"
/**************************************************************************
* @brief Task Initiation callback function.
CmStatus cfm;
DuSctpDestCb *paramPtr = NULLP;
- if(SGetSBuf(DU_APP_MEM_REGION, DU_POOL, (Data **)¶mPtr, (Size)sizeof(DuSctpDestCb)) != ROK)
+ DU_ALLOC(paramPtr, sizeof(DuSctpDestCb));
+ if(paramPtr == NULLP)
{
printf("\nDU_APP : Failed to allocate memory");
RETVALUE(RFAILED);
pst.event = EVENT_SCTP_NTFY;
pst.selector = ODU_SELECTOR_LC;
pst.pool= DU_POOL;
- pst.region = DFLT_REGION;
+ pst.region = DU_APP_MEM_REGION;
if(cmPkSctpNtfy(&pst, ntfy) != ROK)
{
void sctpAssocReq();
void sendToDuApp(Buffer *mBuf, Event event);
S16 sctpSend(Buffer *mBuf, U8 itfType);
-typedef S16 (*SctpNtfy) ARGS((Buffer *mBuf, CmInetSctpNotification *ntfy));
S16 duSctpCfgReq(SctpParams sctpCfg);
S16 fillAddrLst(CmInetNetAddrLst *addrLstPtr, F1IpAddr *ipAddr);
S16 fillDestNetAddr(CmInetNetAddr *destAddrPtr, F1IpAddr *dstIpPtr);
#include "lkw.x"
#include "lrg.x"
#include "legtp.h"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_mgr.h"
-#include "du_log.h"
+#include "du_utils.h"
#include "BCCH-BCH-Message.h"
#include "MIB.h"
#include "PLMN-IdentityInfo.h"
#include "ServingCellConfigCommonSIB.h"
#include "MCC.h"
#include "SIB1.h"
+#include "odu_common_codec.h"
#include "du_sys_info_hdl.h"
void FreeSib1Msg(SIB1_t *sib1Msg);
################################################################################
*******************************************************************************/
-#include "odu_common_codec.h"
-
/* Macros */
#define ODU_VALUE_ZERO 0
#define ODU_VALUE_ONE 1
#include "lrg.x"
#include "lkw.x"
#include "legtp.h"
+#include "du_app_mac_inf.h"
#include "du_cfg.h"
#include "du_ue_mgr.h"
+#include "du_utils.h"
#include<ProtocolIE-Field.h>
#include "F1AP-PDU.h"
DuMacDlCcchInd packMacDlCcchIndOpts[] =
{
packMacDlCcchInd, /* Loose coupling */
- MacHdlDlCcchInd, /* TIght coupling */
+ MacProcDlCcchInd, /* TIght coupling */
packMacDlCcchInd /* Light weight-loose coupling */
};
DuMacUeCreateReq packMacUeCreateReqOpts[] =
{
packDuMacUeCreateReq, /* Loose coupling */
- MacHdlUeCreateReq, /* TIght coupling */
+ MacProcUeCreateReq, /* TIght coupling */
packDuMacUeCreateReq, /* Light weight-loose coupling */
};
DU_FREE(dlCcchMsg, dlCcchMsgSize);
/* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTDUAPP;
- pst.dstEnt = ENTRG;
- pst.dstInst = 0;
- pst.srcInst = 0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = DU_APP_MEM_REGION;
- pst.pool = DU_POOL;
- pst.event = EVENT_MAC_DL_CCCH_IND;
-
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_DL_CCCH_IND);
ret = (*packMacDlCcchIndOpts[pst.selector])(&pst, dlCcchIndInfo);
if(ret != ROK)
{
}
else
{
- if(duCb.actvCellLst[cellId-1]->numActvUes < DU_MAX_UE)
+ if(duCb.actvCellLst[cellId-1]->numActvUes < MAX_NUM_UE)
{
ret = duCreateUeCb(&duCb.ueCcchCtxt[idx], gnbCuUeF1apId);
if(ret)
DU_LOG("\nDU_APP : BuildAndSendInitialRrcMsgTransfer failed");
}
- DU_FREE_SHRABL_BUF(MAC_MEM_REGION, RG_POOL, ulCcchIndInfo->ulCcchMsg, strlen((const char*)ulCcchIndInfo->ulCcchMsg));
- DU_FREE_SHRABL_BUF(MAC_MEM_REGION, RG_POOL, ulCcchIndInfo, sizeof(UlCcchIndInfo));
+ DU_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, ulCcchIndInfo->ulCcchMsg, strlen((const char*)ulCcchIndInfo->ulCcchMsg));
+ DU_FREE_SHRABL_BUF(MAC_MEM_REGION, MAC_POOL, ulCcchIndInfo, sizeof(UlCcchIndInfo));
return ret;
if(initDlBwp->pdcchCfg.numCRsetToAddMod <= MAX_NUM_CRSET)
{
initDlBwp->pdcchCfg.cRSetToAddModList[idx].cRSetId = \
- PDCCH_CTRL_RSRC_SET_ONE_ID;
+ PDCCH_CTRL_RSRC_SET_ONE_ID;
memset(initDlBwp->pdcchCfg.cRSetToAddModList[idx].freqDomainRsrc, 0,\
FREQ_DOM_RSRC_SIZE);
initDlBwp->pdcchCfg.cRSetToAddModList[idx].freqDomainRsrc[idx] =\
uint8_t ret = ROK;
uint8_t ueIdx;
- for(cellIdx = 0; cellIdx < DU_MAX_CELLS; cellIdx++)
+ for(cellIdx = 0; cellIdx < MAX_NUM_CELL; cellIdx++)
{
if(ueCcchCtxt->cellId == duCb.actvCellLst[cellIdx]->cellId)
{
GET_UE_IDX(ueCcchCtxt->crnti, ueIdx);
DU_LOG("\nDU_APP: Filling UeCb for ueIdx [%d]", ueIdx);
+
duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbDuUeF1apId = ueCcchCtxt->gnbDuUeF1apId;
duCb.actvCellLst[cellIdx]->ueCb[ueIdx].gnbCuUeF1apId = gnbCuUeF1apId;
duCb.actvCellLst[cellIdx]->ueCb[ueIdx].ueState = UE_ACTIVE;
/* Filling Mac Ue Config */
memset(&duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg, 0, sizeof(MacUeCfg));
- duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.cellId = ueCcchCtxt->cellId;
+ duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.cellId = ueCcchCtxt->cellId;
duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.ueIdx = ueIdx;
duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg.crnti = ueCcchCtxt->crnti;
fillMacUeCfg(&duCb.actvCellLst[cellIdx]->ueCb[ueIdx].macUeCfg);
memset(&pst, 0, sizeof(Pst));
/* Fill Pst */
- pst.selector = ODU_SELECTOR_LWLC;
- pst.srcEnt = ENTDUAPP;
- pst.srcInst = DU_INST;
- pst.dstEnt = ENTRG;
- pst.dstInst = 0;
- pst.dstProcId = DU_PROC;
- pst.srcProcId = DU_PROC;
- pst.region = DU_APP_MEM_REGION;
- pst.pool = DU_POOL;
- pst.event = EVENT_MAC_UE_CREATE_REQ;
+ FILL_PST_DUAPP_TO_MAC(pst, EVENT_MAC_UE_CREATE_REQ);
/* Copying ueCb to a sharable buffer */
DU_ALLOC_SHRABL_BUF(macUeCfg, sizeof(MacUeCfg));
--- /dev/null
+/*******************************************************************************
+################################################################################
+# Copyright (c) [2017-2019] [Radisys] #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+*******************************************************************************/
+
+/* Utility definitions to be used in du app */
+
+/* Memory related configs */
+#define DU_APP_MEM_REGION 0
+#define RLC_UL_MEM_REGION 1
+#define RLC_DL_MEM_REGION 4
+#define MAC_MEM_REGION 4
+
+#define DU_POOL 1
+#define RLC_POOL 1
+#define MAC_POOL 1
+
+/* allocate and zero out a static buffer */
+#define DU_ALLOC(_datPtr, _size) \
+{ \
+ int _ret; \
+ _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \
+ (Data **)&_datPtr, _size); \
+ if(_ret == ROK) \
+ cmMemset((U8*)_datPtr, 0, _size); \
+ else \
+ _datPtr = NULLP; \
+}
+
+/* free a static buffer */
+#define DU_FREE(_datPtr, _size) \
+ if(_datPtr) \
+ SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \
+ (Data *)_datPtr, _size);
+
+/* Allocate shared memory to be used for LWLC
+ * during inter-layer communication */
+#define DU_ALLOC_SHRABL_BUF(_buf, _size) \
+{ \
+ if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \
+ (Data **)&_buf, (Size) _size, 0) == ROK) \
+ { \
+ cmMemset((U8 *)(_buf), 0, _size); \
+ } \
+ else \
+ { \
+ (_buf) = NULLP; \
+ } \
+}
+
+/* Free shared memory, received through LWLC */
+#define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
+{ \
+ if (_buf != NULLP) \
+ { \
+ (Void) SPutStaticBuffer(_region, _pool, \
+ (Data *) _buf, (Size) _size, 0); \
+ _buf = NULLP; \
+ } \
+}
+
+/* Fill Pst structure for sending msg from DU APP to MAC */
+#define FILL_PST_DUAPP_TO_MAC(_pst, _event) \
+{ \
+ _pst.selector = ODU_SELECTOR_LWLC; \
+ _pst.srcEnt = ENTDUAPP; \
+ _pst.dstEnt = ENTRG; \
+ _pst.dstInst = 0; \
+ _pst.srcInst = 0; \
+ _pst.dstProcId = DU_PROC; \
+ _pst.srcProcId = DU_PROC; \
+ _pst.region = DU_APP_MEM_REGION; \
+ _pst.pool = DU_POOL; \
+ _pst.event = _event; \
+ _pst.route = 0; \
+ _pst.prior = 0; \
+ _pst.intfVer = 0; \
+}
+
+/**********************************************************************
+ End of file
+**********************************************************************/
/*This file contains stub for PHY to handle messages to/from MAC CL */
#include "common_def.h"
+#include "lrg.h"
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac_sch_interface.h"
#include "lwr_mac.h"
#include "lwr_mac_phy.h"
#ifdef INTEL_FAPI
#include "fapi.h"
#endif
#include "lphy_stub.h"
-#include "stdbool.h"
-#include "du_log.h"
-#include "rg.h"
+#include "lwr_mac_upr_inf.h"
+#include "mac_utils.h"
#define MAX_SLOT_VALUE 9
#define MAX_SFN_VALUE 1023
length, uint16_t value, uint32_t *msgLen));
EXTERN void fillMsgHeader ARGS((fapi_msg_t *hdr, uint16_t msgType, uint16_t msgLen));
#endif
-EXTERN void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
+EXTERN void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg);
/*******************************************************************
*
#ifdef INTEL_FAPI
uint8_t index = 0;
uint32_t msgLen = 0;
- fapi_param_resp_t *fapiParamRsp;
-
- MAC_ALLOC(fapiParamRsp, sizeof(fapi_param_resp_t));
- if(!fapiParamRsp)
- {
- DU_LOG("PHY STUB: Memory allocation failed");
- return RFAILED;
- }
-
- /* Cell Params */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_RELEASE_CAPABILITY_TAG, sizeof(uint16_t), 1, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PHY_STATE_TAG, sizeof(uint16_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SKIP_BLANK_DL_CONFIG_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SKIP_BLANK_UL_CONFIG_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_NUM_CONFIG_TLVS_TO_REPORT_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* Carrier Params */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CYCLIC_PREFIX_TAG, sizeof(uint8_t), 1, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_SUBCARRIER_SPACING_DL_TAG, sizeof(uint8_t), 1, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_BANDWIDTH_DL_TAG, sizeof(uint16_t), 1, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_SUBCARRIER_SPACING_UL_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_BANDWIDTH_UL_TAG, sizeof(uint16_t), 0, &msgLen);
-
- /* PDCCH Param*/
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CCE_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRECODER_GRANULARITY_CORESET_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDCCH_MU_MIMO_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDCCH_PRECODER_CYCLING_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDCCHS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* PUCCH Param */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUCCH_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PUCCHS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* PDSCH Param */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_ALLOCATION_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_VRB_TO_PRB_MAPPING_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_CBG_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_CONFIG_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_MAX_LENGTH_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_ADDITIONAL_POS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDSCHS_TBS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_MU_MIMO_USERS_DL_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PREMPTIONSUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_NON_SLOT_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* PUSCH Param */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_UCI_MUX_ULSCH_IN_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_UCI_ONLY_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_FREQUENCY_HOPPING_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_CONFIG_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_MAX_LEN_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_ADDITIONAL_POS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_CBG_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_ALLOCATION_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_VRB_TO_PRB_MAPPING_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_MAX_PTRS_PORTS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDUSCHS_TBS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_MODULATION_ORDER_UL_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_MU_MIMO_USERS_UL_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_DFTS_OFDM_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_AGGREGATION_FACTOR_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* PRACH Params */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_LONG_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_SHORT_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_RESTRICTED_SETS_TAG, sizeof(uint8_t), 0, &msgLen);
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
-
- /* MEASUREMENT TAG */
- fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_RSSI_MEASUREMENT_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
-
- fapiParamRsp->number_of_tlvs = index;
- msgLen += sizeof(fapi_param_resp_t) - sizeof(fapi_msg_t);
- fillMsgHeader(&fapiParamRsp->header, FAPI_PARAM_RESPONSE, msgLen);
- fapiParamRsp->error_code = MSG_OK;
-
- DU_LOG("\nPHY_STUB: Sending Param Request to Lower Mac");
- handlePhyMessages(fapiParamRsp->header.msg_id, sizeof(fapi_param_resp_t), (void *)fapiParamRsp);
- MAC_FREE(fapiParamRsp, sizeof(fapi_param_resp_t));
+ fapi_param_resp_t *fapiParamRsp;
+
+ MAC_ALLOC(fapiParamRsp, sizeof(fapi_param_resp_t));
+ if(!fapiParamRsp)
+ {
+ DU_LOG("PHY STUB: Memory allocation failed");
+ return RFAILED;
+ }
+
+ /* Cell Params */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_RELEASE_CAPABILITY_TAG, sizeof(uint16_t), 1, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PHY_STATE_TAG, sizeof(uint16_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SKIP_BLANK_DL_CONFIG_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SKIP_BLANK_UL_CONFIG_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_NUM_CONFIG_TLVS_TO_REPORT_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* Carrier Params */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CYCLIC_PREFIX_TAG, sizeof(uint8_t), 1, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_SUBCARRIER_SPACING_DL_TAG, sizeof(uint8_t), 1, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_BANDWIDTH_DL_TAG, sizeof(uint16_t), 1, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_SUBCARRIER_SPACING_UL_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_BANDWIDTH_UL_TAG, sizeof(uint16_t), 0, &msgLen);
+
+ /* PDCCH Param*/
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CCE_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_CORESET_OUTSIDE_FIRST_3_OFDM_SYMS_OF_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRECODER_GRANULARITY_CORESET_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDCCH_MU_MIMO_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDCCH_PRECODER_CYCLING_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDCCHS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* PUCCH Param */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUCCH_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PUCCHS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* PDSCH Param */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_ALLOCATION_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_VRB_TO_PRB_MAPPING_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_CBG_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_CONFIG_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_MAX_LENGTH_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DMRS_ADDITIONAL_POS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDSCHS_TBS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_NUMBER_MIMO_LAYERS_PDSCH_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_MAX_MODULATION_ORDER_DL_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_MU_MIMO_USERS_DL_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_DATA_IN_DMRS_SYMBOLS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PREMPTIONSUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PDSCH_NON_SLOT_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* PUSCH Param */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_UCI_MUX_ULSCH_IN_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_UCI_ONLY_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_FREQUENCY_HOPPING_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_CONFIG_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_MAX_LEN_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_DMRS_ADDITIONAL_POS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_CBG_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_MAPPING_TYPE_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_ALLOCATION_TYPES_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_VRB_TO_PRB_MAPPING_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_MAX_PTRS_PORTS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PDUSCHS_TBS_PER_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_NUMBER_MIMO_LAYERS_NON_CB_PUSCH_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_SUPPORTED_MODULATION_ORDER_UL_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_MU_MIMO_USERS_UL_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_DFTS_OFDM_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PUSCH_AGGREGATION_FACTOR_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* PRACH Params */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_LONG_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_SHORT_FORMATS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_PRACH_RESTRICTED_SETS_TAG, sizeof(uint8_t), 0, &msgLen);
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_MAX_PRACH_FD_OCCASIONS_IN_A_SLOT_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ /* MEASUREMENT TAG */
+ fillTlvs(&fapiParamRsp->tlvs[index++], FAPI_RSSI_MEASUREMENT_SUPPORT_TAG, sizeof(uint8_t), 0, &msgLen);
+
+ fapiParamRsp->number_of_tlvs = index;
+ msgLen += sizeof(fapi_param_resp_t) - sizeof(fapi_msg_t);
+ fillMsgHeader(&fapiParamRsp->header, FAPI_PARAM_RESPONSE, msgLen);
+ fapiParamRsp->error_code = MSG_OK;
+
+ DU_LOG("\nPHY_STUB: Sending Param Request to Lower Mac");
+ procPhyMessages(fapiParamRsp->header.msg_id, sizeof(fapi_param_resp_t), (void *)fapiParamRsp);
+ MAC_FREE(fapiParamRsp, sizeof(fapi_param_resp_t));
#endif
- return ROK;
+ return ROK;
}
/*******************************************************************
fapiConfigRsp->number_of_inv_tlvs_idle_only = NULLP;
fapiConfigRsp->number_of_missing_tlvs = NULLP;
fapiConfigRsp->error_code = MSG_OK;
- msgLen = sizeof(fapi_config_resp_t) - sizeof(fapi_msg_t);
+ msgLen = sizeof(fapi_config_resp_t) - sizeof(fapi_msg_t);
fillMsgHeader(&fapiConfigRsp->header, FAPI_CONFIG_RESPONSE, msgLen);
DU_LOG("\nPHY_STUB: Sending Config Response to Lower Mac");
- handlePhyMessages(fapiConfigRsp->header.msg_id, \
- sizeof(fapi_config_resp_t), (void *)fapiConfigRsp);
+ procPhyMessages(fapiConfigRsp->header.msg_id, \
+ sizeof(fapi_config_resp_t), (void *)fapiConfigRsp);
MAC_FREE(fapiConfigRsp, sizeof(fapi_config_resp_t));
#endif
return ROK;
{
#ifdef INTEL_FAPI
DU_LOG("\nPHY_STUB: Received Param Request in PHY");
-
+
/* Build and send PARAM RESPONSE */
if(l1BldAndSndParamRsp(msg)!= ROK)
{
DU_LOG("\nPHY_STUB: Failed Sending Param Response");
}
- MAC_FREE(msg, sizeof(fapi_param_req_t));
+ MAC_FREE(msg, sizeof(fapi_param_req_t));
#endif
}
PUBLIC void l1HdlConfigReq(uint32_t msgLen, void *msg)
{
#ifdef INTEL_FAPI
- fapi_config_req_t *configReq = (fapi_config_req_t *)msg;
+ fapi_config_req_t *configReq = (fapi_config_req_t *)msg;
DU_LOG("\nPHY_STUB: Received Config Request in PHY");
{
printf("\nPHY_STUB: Failed Sending config Response");
}
-
- MAC_FREE(configReq, msgLen);
+
+ MAC_FREE(configReq, msgLen);
#endif
}
#ifdef INTEL_FAPI
uint8_t idx = 0;
fapi_crc_ind_t *crcInd;
-
+
MAC_ALLOC(crcInd, sizeof(fapi_crc_ind_t));
if(!crcInd)
{
printf("\nPHY_STUB: Memory allocation failed for CRC Indication Message");
return RFAILED;
}
- memset(crcInd, 0, sizeof(fapi_crc_ind_t));
+ memset(crcInd, 0, sizeof(fapi_crc_ind_t));
/* TODO: Fill the required values. As of now only 1 CRC status PASS is filled */
crcInd->sfn = sfn;
crcInd->crc[idx].rssi = 0;
fillMsgHeader(&crcInd->header, FAPI_CRC_INDICATION, \
- sizeof(fapi_crc_ind_t) - sizeof(fapi_msg_t));
+ sizeof(fapi_crc_ind_t) - sizeof(fapi_msg_t));
/* Sending RACH indication to MAC */
DU_LOG("\nPHY STUB: Sending CRC Indication to MAC");
- handlePhyMessages(crcInd->header.msg_id, sizeof(fapi_crc_ind_t), (void *)crcInd);
+ procPhyMessages(crcInd->header.msg_id, sizeof(fapi_crc_ind_t), (void *)crcInd);
MAC_FREE(crcInd, sizeof(fapi_crc_ind_t));
#endif
return ROK;
fapi_rx_data_indication_t *rxDataInd;
fapi_pdu_ind_info_t *pduInfo;
uint8_t *pdu;
- uint16_t byteIdx = 0;
- uint32_t msgLen = 0;
-
+ uint16_t byteIdx = 0;
+ uint32_t msgLen = 0;
+
MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t));
if(!rxDataInd)
{
printf("\nPHY_STUB: Memory allocation failed for Rx Data Pdu");
return RFAILED;
}
-
+
/* Harcoded Initial RRC setup Request */
pdu = (uint8_t *)pduInfo->pduData;
pdu[byteIdx++] = 0;
pdu[byteIdx++] = 132;
pdu[byteIdx++] = 96;
- /* Harcoding the pad bytes */
- pdu[byteIdx++] = 63;
+ /* Harcoding the pad bytes */
+ pdu[byteIdx++] = 63;
- for(; byteIdx < pduInfo->pdu_length; byteIdx++)
- pdu[byteIdx] = 0;
+ for(; byteIdx < pduInfo->pdu_length; byteIdx++)
+ pdu[byteIdx] = 0;
msgLen += pduInfo->pdu_length;
fillMsgHeader(&rxDataInd->header, FAPI_RX_DATA_INDICATION, msgLen);
/* Sending Rx data indication to MAC */
DU_LOG("\nPHY STUB: Sending Rx data Indication to MAC");
- handlePhyMessages(rxDataInd->header.msg_id, sizeof(fapi_rx_data_indication_t), (void *)rxDataInd);
+ procPhyMessages(rxDataInd->header.msg_id, sizeof(fapi_rx_data_indication_t), (void *)rxDataInd);
if(pduInfo->pdu_length)
MAC_FREE(pduInfo->pduData, pduInfo->pdu_length);
fapi_rach_indication_t *rachInd;
/* Building RACH indication */
- MAC_ALLOC(rachInd, sizeof(fapi_rach_indication_t));
+ MAC_ALLOC(rachInd, sizeof(fapi_rach_indication_t));
if(!rachInd)
{
printf("\nPHY_STUB: Memory allocation failed for Rach Indication Message");
rachPdu->preambleInfo[preamIdx].preambleIndex = 3;
rachPdu->preambleInfo[preamIdx].timingAdvance = 0;
rachPdu->preambleInfo[preamIdx].preamblePwr = 0;
-
+
fillMsgHeader(&rachInd->header, FAPI_RACH_INDICATION, \
- sizeof(fapi_rach_indication_t) - sizeof(fapi_msg_t));
+ sizeof(fapi_rach_indication_t) - sizeof(fapi_msg_t));
/* Sending RACH indication to MAC */
DU_LOG("\nPHY STUB: Sending RACH Indication to MAC");
- handlePhyMessages(rachInd->header.msg_id, sizeof(fapi_rach_indication_t), (void *)rachInd);
+ procPhyMessages(rachInd->header.msg_id, sizeof(fapi_rach_indication_t), (void *)rachInd);
MAC_FREE(rachInd, sizeof(fapi_rach_indication_t));
#endif
return ROK;
fapi_slot_ind_t *slotIndMsg;
MAC_ALLOC(slotIndMsg, sizeof(fapi_slot_ind_t));
- if(!slotIndMsg)
+ if(!slotIndMsg)
{
- DU_LOG("\nPHY_STUB: Memory allocation failed for slot Indication Message");
- return RFAILED;
+ DU_LOG("\nPHY_STUB: Memory allocation failed for slot Indication Message");
+ return RFAILED;
}
else
{
- memset(slotIndMsg, 0, sizeof(fapi_slot_ind_t));
+ memset(slotIndMsg, 0, sizeof(fapi_slot_ind_t));
slotIndMsg->sfn = sfnValue;
slotIndMsg->slot = slotValue;
DU_LOG("\n\nPHY_STUB: SLOT indication [%d:%d]",sfnValue,slotValue);
- /* increment for the next TTI */
+ /* increment for the next TTI */
slotValue++;
if(sfnValue >= MAX_SFN_VALUE && slotValue > MAX_SLOT_VALUE)
{
- sfnValue = 0;
- slotValue = 0;
+ sfnValue = 0;
+ slotValue = 0;
}
else if(slotValue > MAX_SLOT_VALUE)
{
- sfnValue++;
- slotValue = 0;
+ sfnValue++;
+ slotValue = 0;
}
fillMsgHeader(&slotIndMsg->header, FAPI_SLOT_INDICATION, \
- sizeof(fapi_slot_ind_t) - sizeof(fapi_msg_t));
- handlePhyMessages(slotIndMsg->header.msg_id, sizeof(fapi_slot_ind_t), (void*)slotIndMsg);
+ sizeof(fapi_slot_ind_t) - sizeof(fapi_msg_t));
+ procPhyMessages(slotIndMsg->header.msg_id, sizeof(fapi_slot_ind_t), (void*)slotIndMsg);
MAC_FREE(slotIndMsg, sizeof(fapi_slot_ind_t));
}
#endif
#ifdef INTEL_FAPI
fapi_start_req_t *startReq = (fapi_start_req_t *)msg;
- if(clGlobalCp.phyState == PHY_STATE_CONFIGURED)
+ if(lwrMacCb.phyState == PHY_STATE_CONFIGURED)
{
l1HdlSlotIndicaion(FALSE);
- MAC_FREE(startReq, sizeof(fapi_start_req_t));
+ MAC_FREE(startReq, sizeof(fapi_start_req_t));
}
else
{
- DU_LOG("\nPHY_STUB: Received Start Req in PHY State %d", clGlobalCp.phyState);
+ DU_LOG("\nPHY_STUB: Received Start Req in PHY State %d", lwrMacCb.phyState);
return RFAILED;
}
#endif
}
/*******************************************************************
-*
-* @brief Handles Dl Tti request received from MAC
-*
-* @details
-*
-* Function : l1HdlDlTtiReq
-*
-* Functionality:
-* -Handles Dl Tti request received from MAC
-*
-* @params[in] Message length
-* Dl Tti request message pointer
-*
-* @return void
-*
-* ****************************************************************/
+ *
+ * @brief Handles Dl Tti request received from MAC
+ *
+ * @details
+ *
+ * Function : l1HdlDlTtiReq
+ *
+ * Functionality:
+ * -Handles Dl Tti request received from MAC
+ *
+ * @params[in] Message length
+ * Dl Tti request message pointer
+ *
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC S16 l1HdlDlTtiReq(uint16_t msgLen, void *msg)
{
printf("\nPHY_STUB: bchPayloadFlag %d", dlTtiReq->pdus->u.ssb_pdu.bchPayloadFlag);
printf("\nPHY_STUB: bchPayload %x", dlTtiReq->pdus->u.ssb_pdu.bchPayload);
#endif
- uint8_t pduCount = 0;
- if(dlTtiReq->nPdus == 0)
- {
- DU_LOG("\nPHY_STUB: No PDU in DL TTI Request");
+ uint8_t pduCount = 0;
+ if(dlTtiReq->nPdus == 0)
+ {
+ DU_LOG("\nPHY_STUB: No PDU in DL TTI Request");
+ }
+ for(pduCount=0; pduCount<dlTtiReq->nPdus; pduCount++)
+ {
+ if(dlTtiReq->pdus[pduCount].pduType == 3) //SSB_PDU_TYPE
+ DU_LOG("\nPHY_STUB: SSB PDU");
+ else if(dlTtiReq->pdus[pduCount].pduType == 0)
+ DU_LOG("\nPHY_STUB: PDCCH PDU");
+ else if(dlTtiReq->pdus[pduCount].pduType == 1)
+ DU_LOG("\nPHY_STUB: PDSCH PDU");
}
- for(pduCount=0; pduCount<dlTtiReq->nPdus; pduCount++)
- {
- if(dlTtiReq->pdus[pduCount].pduType == 3) //SSB_PDU_TYPE
- DU_LOG("\nPHY_STUB: SSB PDU");
- else if(dlTtiReq->pdus[pduCount].pduType == 0)
- DU_LOG("\nPHY_STUB: PDCCH PDU");
- else if(dlTtiReq->pdus[pduCount].pduType == 1)
- DU_LOG("\nPHY_STUB: PDSCH PDU");
- }
-
- /* Free FAPI message */
+
+ /* Free FAPI message */
MAC_FREE(dlTtiReq, msgLen);
#endif
}
/*******************************************************************
-*
-* @brief Handles tx_data request received from MAC
-*
-* @details
-*
-* Function : l1HdlTxDataReq
-*
-* Functionality:
-* -Handles tx_data request received from MAC
-*
-* @params[in] Message length
-* tx_data request message pointer
-*
-* @return void
-*
-* ****************************************************************/
+ *
+ * @brief Handles tx_data request received from MAC
+ *
+ * @details
+ *
+ * Function : l1HdlTxDataReq
+ *
+ * Functionality:
+ * -Handles tx_data request received from MAC
+ *
+ * @params[in] Message length
+ * tx_data request message pointer
+ *
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC S16 l1HdlTxDataReq(uint16_t msgLen, void *msg)
{
DU_LOG("\nPHY STUB: TX DATA Request at sfn=%d slot=%d",txDataReq->sfn,txDataReq->slot);
- MAC_FREE(txDataReq, msgLen);
+ MAC_FREE(txDataReq, msgLen);
#endif
return ROK;
}
/*******************************************************************
-*
-* @brief Handles Ul Tti request received from MAC
-*
-* @details
-*
-* Function : l1HdlUlTtiReq
-*
-* Functionality:
-* -Handles Ul Tti request received from MAC
-*
-* @params[in] Message length
-* Ul Tti request message pointer
-*
-* @return void
-*
-* ****************************************************************/
+ *
+ * @brief Handles Ul Tti request received from MAC
+ *
+ * @details
+ *
+ * Function : l1HdlUlTtiReq
+ *
+ * Functionality:
+ * -Handles Ul Tti request received from MAC
+ *
+ * @params[in] Message length
+ * Ul Tti request message pointer
+ *
+ * @return void
+ *
+ * ****************************************************************/
PUBLIC S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg)
{
ulTtiReq = (fapi_ul_tti_req_t *)msg;
uint8_t numPdus = ulTtiReq->nPdus;
-
- if(numPdus == 0)
- {
- DU_LOG("\nPHY STUB: No PDU in UL TTI");
+
+ if(numPdus == 0)
+ {
+ DU_LOG("\nPHY STUB: No PDU in UL TTI");
}
- while(numPdus)
- {
- if(ulTtiReq->pdus[numPdus-1].pduType == 0)
- {
- DU_LOG("\nPHY STUB: PRACH PDU");
- }
+ while(numPdus)
+ {
+ if(ulTtiReq->pdus[numPdus-1].pduType == 0)
+ {
+ DU_LOG("\nPHY STUB: PRACH PDU");
+ }
if(ulTtiReq->pdus[numPdus-1].pduType == 1)
{
- DU_LOG("\nPHY STUB: PUSCH PDU");
- l1BuildAndSendRxDataInd(ulTtiReq->slot, ulTtiReq->sfn, \
- ulTtiReq->pdus[numPdus-1].pdu.pusch_pdu);
+ DU_LOG("\nPHY STUB: PUSCH PDU");
+ l1BuildAndSendRxDataInd(ulTtiReq->slot, ulTtiReq->sfn, \
+ ulTtiReq->pdus[numPdus-1].pdu.pusch_pdu);
+ }
+ if(ulTtiReq->pdus[numPdus-1].pduType == 2)
+ {
+ DU_LOG("\nPHY STUB: PUCCH PDU");
}
- if(ulTtiReq->pdus[numPdus-1].pduType == 2)
- {
- DU_LOG("\nPHY STUB: PUCCH PDU");
- }
- numPdus--;
- }
+ numPdus--;
+ }
if(rachIndSent == false && ulTtiReq->sfn == 2 && ulTtiReq->slot == 6)
{
rachIndSent = true;
l1BuildAndSendRachInd(ulTtiReq->slot, ulTtiReq->sfn);
}
-
+
MAC_FREE(ulTtiReq, msgLen);
#endif
return ROK;
MAC_ALLOC(stopIndMsg, sizeof(fapi_stop_ind_t));
if(!stopIndMsg)
{
- DU_LOG("\nPHY_STUB: Memory allocation failed for stop Indication Message");
- return RFAILED;
+ DU_LOG("\nPHY_STUB: Memory allocation failed for stop Indication Message");
+ return RFAILED;
}
else
{
fillMsgHeader(&stopIndMsg->header, FAPI_STOP_INDICATION, msgLen);
DU_LOG("\n\nPHY_STUB: Processing Stop indication to MAC");
- handlePhyMessages(stopIndMsg->header.msg_id,\
- sizeof(fapi_stop_ind_t), (void*)stopIndMsg);
+ procPhyMessages(stopIndMsg->header.msg_id,\
+ sizeof(fapi_stop_ind_t), (void*)stopIndMsg);
MAC_FREE(stopIndMsg, sizeof(fapi_stop_ind_t));
}
#endif
#ifdef INTEL_FAPI
fapi_stop_req_t *stopReq = (fapi_stop_req_t *)msg;
- if(clGlobalCp.phyState == PHY_STATE_RUNNING)
+ if(lwrMacCb.phyState == PHY_STATE_RUNNING)
{
l1HdlSlotIndicaion(TRUE);
DU_LOG("\nPHY_STUB: Slot Indication is stopped successfully");
}
else
{
- DU_LOG("\nPHY_STUB: Received Stop Req in PHY State %d", clGlobalCp.phyState);
+ DU_LOG("\nPHY_STUB: Received Stop Req in PHY State %d", lwrMacCb.phyState);
return RFAILED;
}
#endif
{
#ifdef INTEL_FAPI
case FAPI_PARAM_REQUEST:
- l1HdlParamReq(msgLen, msg);
- break;
+ l1HdlParamReq(msgLen, msg);
+ break;
case FAPI_CONFIG_REQUEST:
- l1HdlConfigReq(msgLen, msg);
- break;
+ l1HdlConfigReq(msgLen, msg);
+ break;
case FAPI_START_REQUEST:
- l1HdlStartReq(msgLen, msg);
- break;
+ l1HdlStartReq(msgLen, msg);
+ break;
case FAPI_DL_TTI_REQUEST:
- l1HdlDlTtiReq(msgLen, msg);
- break;
+ l1HdlDlTtiReq(msgLen, msg);
+ break;
case FAPI_TX_DATA_REQUEST:
- l1HdlTxDataReq(msgLen, msg);
- break;
+ l1HdlTxDataReq(msgLen, msg);
+ break;
case FAPI_UL_TTI_REQUEST:
- l1HdlUlTtiReq(msgLen, msg);
- break;
+ l1HdlUlTtiReq(msgLen, msg);
+ break;
case FAPI_STOP_REQUEST:
- l1HdlStopReq(msgLen, msg);
- break;
+ l1HdlStopReq(msgLen, msg);
+ break;
default:
- DU_LOG("\nPHY_STUB: Invalid message type[%x] received at PHY", msgType);
- break;
+ DU_LOG("\nPHY_STUB: Invalid message type[%x] received at PHY", msgType);
+ break;
#endif
}
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/
/* This file contains E2AP message handler functions */
#include "common_def.h"
+#include "OCTET_STRING.h"
+#include "BIT_STRING.h"
#include "odu_common_codec.h"
#include "ric_stub.h"
#include "ric_stub_sctp.h"
/* This functions contains main() for ric_app */
#include "common_def.h"
-#include "odu_common_codec.h"
#include "ric_stub.h"
#include "ric_stub_sctp.h"
#include "du_log.h"
/* This file contains all SCTP related functionality */
#include "common_def.h"
-#include "odu_common_codec.h"
#include "ric_e2ap_msg_hdl.h"
#include "ric_stub_sctp.h"
#include "ric_stub.h"