X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_handle_phy.c;h=b46739b4c4a445dc39b265f8d6d0f291ac57d4af;hb=refs%2Fchanges%2F58%2F3458%2F3;hp=67f76d8c1f43ec82061eee17e82a80730c498d8c;hpb=f15bab416a36e421d42be3d2d1a42bf4c8c8b6c2;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_handle_phy.c b/src/5gnrmac/lwr_mac_handle_phy.c index 67f76d8c1..b46739b4c 100644 --- a/src/5gnrmac/lwr_mac_handle_phy.c +++ b/src/5gnrmac/lwr_mac_handle_phy.c @@ -1,3 +1,20 @@ +/******************************************************************************* +################################################################################ +# 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. # +################################################################################ +*******************************************************************************/ /* header include files (.h) */ #include "envopt.h" /* environment options */ @@ -11,8 +28,9 @@ #include "cm_lte.h" /* Common LTE Defines */ #include "cm_mblk.h" /* Common LTE Defines */ #include "tfu.h" /* RGU Interface defines */ -//#include "rg.h" +#ifdef FAPI #include "fapi.h" +#endif /* header/extern include files (.x) */ #include "gen.x" /* general */ @@ -24,17 +42,21 @@ #include "cm_lte.x" /* Common LTE Defines */ #include "cm_mblk.x" /* Common LTE Defines */ #include "tfu.x" /* RGU Interface includes */ -//#include "rg.x" +#include "du_log.h" +#include "lwr_mac_fsm.h" +#include "lwr_mac_phy.h" + +#ifdef FAPI /* function pointers for packing macCellCfg Request */ typedef S16 (*packSlotIndMsg) ARGS(( Pst *pst, - fapi_slot_ind_t *slotInd + SlotIndInfo *slotInd )); S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd); -S16 packTcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd); -S16 packLwlcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd); +S16 packTcSlotInd (Pst *pst, SlotIndInfo *slotInd); +S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd); packSlotIndMsg packSlotIndOpts[] = { @@ -58,12 +80,12 @@ S16 packLcSlotInd (Pst *pst, SlotIndInfo *slotInd) RETVALUE(SPstTsk(pst,mBuf)); } -S16 packTcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd) +S16 packTcSlotInd (Pst *pst, SlotIndInfo *slotInd) { return ROK; } -S16 packLwlcSlotInd (Pst *pst, fapi_slot_ind_t *slotInd) +S16 packLwlcSlotInd (Pst *pst, SlotIndInfo *slotInd) { return ROK; } @@ -72,6 +94,7 @@ U16 handleSlotInd(fapi_slot_ind_t *fapiSlotInd) { /* fill Pst structure to send to lwr_mac to MAC */ Pst pst; + uint16_t ret; SlotIndInfo slotInd; pst.srcProcId = 0; @@ -88,19 +111,44 @@ U16 handleSlotInd(fapi_slot_ind_t *fapiSlotInd) slotInd.sfn = fapiSlotInd->sfn; slotInd.slot = fapiSlotInd->slot; - return (*packSlotIndOpts[pst.selector])(&pst, &slotInd); + ret = (*packSlotIndOpts[pst.selector])(&pst, &slotInd); + +#ifdef INTEL_WLS + slotIndIdx++; + if(slotIndIdx > WLS_MEM_FREE_PRD) + { + slotIndIdx = 1; + } + freeWlsBlockList(slotIndIdx - 1); +#endif + + return ret; } +#endif -void handlePhyMessages(void *msg) +void handlePhyMessages(uint16_t msgType, uint32_t msgSize, void *msg) { +#ifdef FAPI /* extract the header */ fapi_msg_t *header; header = (fapi_msg_t *)msg; switch(header->message_type_id) { + case FAPI_PARAM_RESPONSE: + case FAPI_CONFIG_RESPONSE: + { + sendToLowerMac(msgType, msgSize, msg); + break; + } case FAPI_SLOT_INDICATION: { + if(clGlobalCp.phyState == PHY_STATE_CONFIGURED) + { + DU_LOG("\nLOWER MAC: PHY has moved to running state \n"); + clGlobalCp.phyState = PHY_STATE_RUNNING; + } + fapi_slot_ind_t *slotInd; slotInd = (fapi_slot_ind_t *)msg; handleSlotInd(slotInd); @@ -131,4 +179,12 @@ void handlePhyMessages(void *msg) break; } } +#ifdef INTEL_WLS + WLS_MEM_FREE(msg, LWR_MAC_WLS_BUF_SIZE); +#endif +#endif } + +/********************************************************************** + End of file +**********************************************************************/