From 719cc82cbb3d21edc03cccdae046f5a2d5f3d427 Mon Sep 17 00:00:00 2001 From: balajihands Date: Wed, 18 Mar 2020 11:20:17 +0530 Subject: [PATCH] macCellCfg Change-Id: I9562fb3e690952355b279aeb9b2896d346b7bd43 Signed-off-by: balajihands --- src/5gnrmac/rg.x | 3 +- src/5gnrmac/rg_ex_ms.c | 2 +- src/5gnrmac/rg_lmm.c | 13 +++---- src/cm/cm_gen.c | 9 ++--- src/cm/mac_interface.c | 87 +++++++++++++++++------------------------------ src/cm/mac_interface.h | 9 ++--- src/du_app/du_mgr_ex_ms.c | 2 +- src/du_app/du_msg_hdl.c | 4 +-- 8 files changed, 51 insertions(+), 78 deletions(-) diff --git a/src/5gnrmac/rg.x b/src/5gnrmac/rg.x index a4a1e9ac4..268ff0660 100755 --- a/src/5gnrmac/rg.x +++ b/src/5gnrmac/rg.x @@ -339,6 +339,8 @@ struct rgCellCb #ifdef EMTC_ENABLE U8 emtcEnable; #endif + /* 5GNR changes */ + MacCellCfg macCellCfg; /* MAC cell config paramters */ }; /** @@ -649,7 +651,6 @@ struct _rgCb RgCellCb *prevCell; /*!< Reference of last accessed cellCb*/ U8 bufCnt; /*!< Count of buffers in buffersToFree[] */ Buffer *bufToFree[RG_MAX_DFRD_FREE_BUFS];/*!< List of Shared Buffers to be freed */ - MacCellCfg macCellCfg; /* MAC cell config paramters */ }; /* Declaration for RgCb */ diff --git a/src/5gnrmac/rg_ex_ms.c b/src/5gnrmac/rg_ex_ms.c index 65f5fa228..b24e3e041 100755 --- a/src/5gnrmac/rg_ex_ms.c +++ b/src/5gnrmac/rg_ex_ms.c @@ -134,7 +134,7 @@ Buffer *mBuf; /* message buffer */ #endif /* LCRGMILRG */ case EVENT_MAC_CELL_CONFIG_REQ: /* Process MAC cell config */ - cmUnpackLwLcMacCellCfg(unpackMacCellCfgReq, pst, mBuf); + unpackDuMacCellCfg(handleMacCellCfgReq, pst, mBuf); break; default: RG_FREE_MSG(mBuf); diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index 4352ce38f..aa68fd597 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -131,13 +131,12 @@ Pst *cfmPst )); extern U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); -extern U16 cmPackTcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); extern U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm); packMacCellCfgCfm packMacCellCfmMt[] = { cmPackLcMacCellCfgCfm, /* packing for loosely coupled */ - cmPackTcMacCellCfgCfm, /* packing for tightly coupled */ + duHandleMacCellCfgCfm, /* packing for tightly coupled */ cmPackLwlcMacCellCfgCfm, /* packing for light weight loosly coupled */ }; @@ -2111,7 +2110,7 @@ Pst *cfmPst * * @details * - * Function : unpackMacCellCfgReq + * Function : handleMacCellCfgReq * * This function handles the gNB and cell configuration * request received from DU APP. @@ -2122,7 +2121,7 @@ Pst *cfmPst * @return S16 * -# ROK **/ -S16 unpackMacCellCfgReq +S16 handleMacCellCfgReq ( Pst *pst, MacCellCfg *macCellCfg @@ -2130,10 +2129,12 @@ S16 unpackMacCellCfgReq { U16 ret = ROK; MacCellCfgCfm macCellCfgCfm; + RgCellCb *cellCb; Pst cnfPst; Inst inst = pst->dstInst; - memcpy(&rgCb[inst].macCellCfg,macCellCfg,sizeof(MacCellCfg)); + cellCb = rgCb[inst].cell; + memcpy(&cellCb->macCellCfg,macCellCfg,sizeof(MacCellCfg)); macCellCfgFillCfmPst(pst,&cnfPst); @@ -2141,7 +2142,7 @@ S16 unpackMacCellCfgReq //ret = cmPackLcMacCellCfgCfm(&cnfPst,&macCellCfgCfm); ret = (*packMacCellCfmMt[cnfPst.selector])(&cnfPst,&macCellCfgCfm); return ret; -} /* end of unpackMacCellCfgReq */ +} /* end of handleMacCellCfgReq */ /********************************************************************** diff --git a/src/cm/cm_gen.c b/src/cm/cm_gen.c index 582049dc5..709bb3050 100644 --- a/src/cm/cm_gen.c +++ b/src/cm/cm_gen.c @@ -3556,7 +3556,7 @@ Buffer *mBuf; /* message buffer */ /* * -* Fun: cmGetTransId +* Fun: getTransId * * Desc: This function return the transaction ID used for interface transactions * @@ -3565,12 +3565,9 @@ Buffer *mBuf; /* message buffer */ * File: cm_gen.c * */ -U16 cmGetTransId() +U16 getTransId() { - if(gTransId<65535) - gTransId++; - else - gTransId = 0; + gTransId = (gTransId%65535) + 1; return gTransId; } /********************************************************************** diff --git a/src/cm/mac_interface.c b/src/cm/mac_interface.c index e4945ca13..e579c2ff1 100644 --- a/src/cm/mac_interface.c +++ b/src/cm/mac_interface.c @@ -24,6 +24,8 @@ #include "ss_queue.h" #include "ss_task.h" #include "ss_msg.h" +#include "du_cfg.h" + #include "gen.x" /* general */ #include "ssi.x" /* system services */ #include "cm_tkns.x" /* Common Token Definitions */ @@ -53,28 +55,7 @@ ***************************************************************************/ S16 packLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) { - return ROK; -} - -/************************************************************************** - * @brief Function to pack tightly Coupled - * MAC cell config parameters required by MAC - * - * @details - * - * Function : packTcMacCellCfg - * - * Functionality: - * packs the macCellCfg parameters - * - * @param[in] Pst *pst, Post structure of the primitive. - * @param[in] MacCellCfg *macCellCfg, mac cell config parameters. - * @return ROK - success - * RFAILED - failure - * - ***************************************************************************/ -S16 packTcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) -{ + /* we are now implemented only light wieght lossely coupled interface */ return ROK; } @@ -116,7 +97,7 @@ S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) * * @details * - * Function : unpackLwLcMacCellCfg + * Function : unpackDuMacCellCfg * * Functionality: * packs the macCellCfg parameters @@ -128,17 +109,27 @@ S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg) * RFAILED - failure * ***************************************************************************/ -void cmUnpackLwLcMacCellCfg( +void unpackDuMacCellCfg( DuMacCellCfgReq func, Pst *pst, Buffer *mBuf) { + U16 ret = ROK; MacCellCfg *macCellCfg; - /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf); - - RETVALUE((*func)(pst, macCellCfg)); + if(pst->selector == DU_SELECTOR_LWLC) + { + /* unpack the address of the structure */ + CMCHKUNPK(cmUnpkPtr, (PTR *)&macCellCfg, mBuf); + ret = (*func)(pst, macCellCfg); + } + else + { + /* only LWLC is implemented now */ + ret = ROK; + } + + return ret; } /************************************************************************** @@ -172,28 +163,6 @@ U16 cmPackLcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) RETVALUE(SPstTsk(pst,mBuf)); } -/************************************************************************** - * @brief Function to pack tightly Coupled - * MAC cell config confirm message - * - * @details - * - * Function : cmPackTcMacCellCfgCfm - * - * Functionality: - * packs the transaction ID - * - * @param[in] Pst *pst, Post structure of the primitive. - * @param[in] MacCellCfgCfm *macCellCfgCfm, mac cell config confirm. - * @return ROK - success - * RFAILED - failure - * - ***************************************************************************/ -U16 cmPackTcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) -{ - return ROK; -} - /************************************************************************** * @brief Function to pack light weight Loose Coupled * MAC cell config confirm message @@ -221,7 +190,7 @@ U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) * * @details * - * Function : cmUnpackLcMacCellCfgCfm + * Function : unpackMacCellCfgCfm * * Functionality: * packs the transaction ID @@ -233,14 +202,22 @@ U16 cmPackLwlcMacCellCfgCfm(Pst *pst, MacCellCfgCfm *macCellCfgCfm) * RFAILED - failure * ***************************************************************************/ -S16 cmUnpackLcMacCellCfgCfm( +S16 unpackMacCellCfgCfm( DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf) { MacCellCfgCfm macCellCfgCfm; - /* pack the transaction ID in CNF structure */ - CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf); - RETVALUE((*func)(&macCellCfgCfm)); + if(pst->selector == DU_SELECTOR_LC) + { + /* unpack the transaction ID in CNF structure */ + CMCHKUNPK(SUnpkU16, &(macCellCfgCfm.transId), mBuf); + + RETVALUE((*func)(&macCellCfgCfm)); + } + else + { + /* only loose coupling is suported */ + } } diff --git a/src/cm/mac_interface.h b/src/cm/mac_interface.h index b7043cfb2..87b1f94a3 100644 --- a/src/cm/mac_interface.h +++ b/src/cm/mac_interface.h @@ -158,9 +158,9 @@ typedef struct tddCfg typedef struct macCellCfg { U16 transId; + U16 cellId; /* Cell Id */ U8 numTlv; /* Number of configuration TLVs */ U8 carrierId; /* Carrired Index */ - U16 cellId; /* Cell Id */ U16 phyCellId; /* Physical cell id */ DuplexMode dupType; /* Duplex type: TDD/FDD */ CarrierCfg dlCarrCfg; /* DL Carrier configuration */ @@ -198,13 +198,10 @@ typedef S16 (*DuMacCellCfgCfm) ARGS(( )); S16 packLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg); - -S16 packTcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg); - S16 packLwLcMacCellCfg(Pst *pst, MacCellCfg *macCellCfg); -EXTERN S16 unpackMacCellCfgReq +EXTERN S16 handleMacCellCfgReq ( Pst *pst, MacCellCfg *macCellCfg @@ -215,7 +212,7 @@ void cmUnpackLwLcMacCellCfg( Pst *pst, Buffer *mBuf); -S16 cmUnpackLcMacCellCfgCfm( +S16 unpackMacCellCfgCfm( DuMacCellCfgCfm func, Pst *pst, Buffer *mBuf); diff --git a/src/du_app/du_mgr_ex_ms.c b/src/du_app/du_mgr_ex_ms.c index d2095e32e..a7653fc93 100644 --- a/src/du_app/du_mgr_ex_ms.c +++ b/src/du_app/du_mgr_ex_ms.c @@ -194,7 +194,7 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf) } case EVENT_MAC_CELL_CONFIG_CFM: { - ret = cmUnpackLcMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf); + ret = unpackMacCellCfgCfm(duHandleMacCellCfgCfm, pst, mBuf); break; } default: diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index 910386a4d..e8f712d97 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -40,7 +40,7 @@ extern S16 cmPkLrgCfgReq(Pst *pst, RgMngmt *cfg); packMacCellCfgReq packMacCellCfgMt[] = { packLcMacCellCfg, /* packing for loosely coupled */ - packTcMacCellCfg, /* packing for tightly coupled */ + handleMacCellCfgReq, /* packing for tightly coupled */ packLwLcMacCellCfg, /* packing for light weight loosly coupled */ }; @@ -1527,7 +1527,7 @@ S16 duBuildAndSendMacCellCfg() /* copy the mac config structure from duCfgParams */ memcpy(pMacCellCfg,&duCfgParam.macCellCfg,sizeof(MacCellCfg)); - pMacCellCfg->transId = cmGetTransId(); /* transaction ID */ + pMacCellCfg->transId = getTransId(); /* transaction ID */ /* Fill Pst */ pst.selector = DU_SELECTOR_LWLC; -- 2.16.6