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)
{
#ifdef FAPI
- /* stop TX and RX operation return PHy to configured State
- send stop.indication to l2/l3 */
+ uint32_t msgLen = 0;
+ fapi_stop_req_t *stopReq = NULLP;
+ LWR_MAC_ALLOC(stopReq, sizeof(fapi_stop_req_t));
+ if(stopReq != NULLP)
+ {
+ fillMsgHeader(&stopReq->header, FAPI_STOP_REQUEST, msgLen);
+ DU_LOG("\nLOWER MAC: Sending Stop Request to PHY");
+ LwrMacSendToPhy(stopReq->header.message_type_id, sizeof(fapi_stop_req_t), (void *)stopReq);
+ }
+ else
+ {
+ DU_LOG("\nLOWER MAC: Failed to allocate memory for Stop Request");
+ return RFAILED;
+ }
#endif
return ROK;
}
lwr_mac_handleConfigReqEvt,
lwr_mac_handleConfigRspEvt,
lwr_mac_handleInvalidEvt,
+ lwr_mac_handleInvalidEvt,
},
{
/* PHY_STATE_CONFIGURED */
lwr_mac_handleConfigReqEvt,
lwr_mac_handleConfigRspEvt,
lwr_mac_handleStartReqEvt,
+ lwr_mac_handleInvalidEvt,
},
{
/* PHY_STATE_RUNNING */
lwr_mac_handleConfigReqEvt,
lwr_mac_handleConfigRspEvt,
lwr_mac_handleInvalidEvt,
+ lwr_mac_handleStopReqEvt,
}
};
packRxDataInd
};
-
+/* Function pointer for stop indication from lower mac to mac */
+packStopIndMsg sendStopIndOpts[] =
+{
+ packStopInd,
+ fapiMacStopInd,
+ packStopInd
+};
/*******************************************************************
*
* @brief Fills post structure
return ret;
}
+/*******************************************************************
+ *
+ * @brief Handles stop indication recived from PHY
+ *
+ * @details
+ *
+ * Function : handleStopInd
+ *
+ * Functionality:
+ * Handles Stop Indication received from PHY
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t handleStopInd()
+{
+ uint8_t ret;
+ Pst pst;
+
+ clGlobalCp.phyState = 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);
+ return ret;
+}
/*******************************************************************
*
* @brief Processes Rach Indication from PHY and sends to MAC
rachInd = (fapi_rach_indication_t *)msg;
handleRachInd(rachInd);
break;
+ }
+ case FAPI_STOP_INDICATION:
+ {
+ DU_LOG("\nLWR_MAC: Handling Stop Indication");
+ handleStopInd();
+ break;
}
}
#ifdef INTEL_WLS
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Packs and Sends Stop Ind to MAC
+ *
+ * @details
+ *
+ * Function : packStopInd
+ *
+ * Functionality:
+ * Packs and Sends Stop Ind to MAC
+ *
+ * @params[in] Post structure pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packStopInd(Pst *pst)
+{
+ if((pst->selector == MAC_SELECTOR_LC) || (pst->selector == MAC_SELECTOR_LWLC))
+ {
+ return ROK;
+ }
+ else
+ {
+ return RFAILED;
+ }
+}
+
/**********************************************************************
End of file
**********************************************************************/
uint16_t packRachInd(Pst *pst, RachInd *rachInd);
uint16_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);
uint16_t packRxDataInd(Pst *pst, RxDataInd *rxDataInd);
uint16_t fapiMacRxDataInd(Pst *pst, RxDataInd *rxDataInd);
+typedef uint16_t (*packStopIndMsg)(Pst *pst);
+uint16_t packStopInd(Pst *pst);
+uint16_t fapiMacStopInd(Pst *pst);
#endif
/**********************************************************************
End of file
DU_LOG("\nMAC : Handling cell start request");
sendToLowerMac(START_REQUEST, 0, cellStartInfo);
- MAC_FREE_MEM(pst->region, pst->pool, cellStartInfo, \
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStartInfo, \
sizeof(MacCellStartInfo));
return ROK;
* ****************************************************************/
uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo *cellStopInfo)
{
- DU_LOG("\nMAC : Handling cell stop request");
- sendToLowerMac(STOP_REQUEST, 0, cellStopInfo);
+ #ifdef FAPI
+ DU_LOG("\nMAC : Sending cell stop request to Lower Mac");
+ sendToLowerMac(FAPI_STOP_REQUEST, 0, cellStopInfo);
+ #endif
- MAC_FREE_MEM(pst->region, pst->pool, cellStopInfo, \
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopInfo, \
sizeof(MacCellStopInfo));
return ROK;
--- /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. #
+################################################################################
+ *******************************************************************************/
+/* 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_mblk.h" /* common memory link list library */
+#include "cm_lte.h" /* Common LTE Defines */
+#include "tfu.h" /* RGU Interface includes */
+#include "lrg.h"
+#include "gen.x" /* general */
+#include "ssi.x" /* system services */
+#include "cm5.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_mblk.x" /* common memory link list library */
+#include "cm_lte.x" /* Common LTE Defines */
+#include "tfu.x" /* RGU Interface includes */
+#include "lrg.x"
+#include "du_app_mac_inf.h"
+#include "mac.h"
+#include "du_log.h"
+
+/*******************************************************************
+ * @brief process Stop indication to MAC
+ *
+ * @details
+ *
+ * Function : fapiMacStopInd
+ *
+ * @param[in] Pst *pst
+ * @return S16
+ * -# ROK
+ * -# RFAILED
+ ******************************************************************/
+PUBLIC S16 fapiMacStopInd(Pst *pst)
+{
+ uint8_t ret = ROK;
+ ret = sendStopIndMacToDuApp();
+ return ret;
+}
duHandleSlotInd,
packMacSlotInd
};
+/* Funtion pointer options for stop indication */
+DuMacStopInd packMacStopIndOpts[] =
+{
+ packMacStopInd,
+ duHandleStopInd,
+ packMacStopInd
+};
/*******************************************************************
*
return (*packMacSlotIndOpts[pst->selector])(pst, slotInfo);
}
+/*******************************************************************
+ *
+ * @brief Send stop indication to MAC
+ *
+ * @details
+ *
+ * Function : MacDuAppStopInd
+ *
+ * Functionality:
+ * Sends Stop Indication to MAC
+ *
+ * @params[in] Post structure pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+{
+ return (*packMacStopIndOpts[pst->selector])(pst, cellStopId);
+}
+
/**********************************************************************
End of file
**********************************************************************/
uint16_t MacDuAppSlotInd(Pst *pst, SlotInfo *slotInfo);
-
+uint16_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId);
/**********************************************************************
End of file
**********************************************************************/
return ret;
}
+/*******************************************************************
+ *
+ * @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 = DU_MAC_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.
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Packs and Sends stop ind from MAC to DUAPP
+ *
+ * @details
+ *
+ * Function : packMacStopInd
+ *
+ * Functionality:
+ * Packs and Sends stop ind from MAC to DUAPP
+ *
+ * @params[in] Post structure pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+{
+ Buffer *mBuf = NULLP;
+
+ if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK)
+ {
+ DU_LOG("\nDU APP : Memory allocation failed for stop Ind pack");
+ return RFAILED;
+ }
+
+ if(pst->selector == DU_SELECTOR_LC)
+ {
+ /*pack the payload here*/
+ DU_LOG("\nDU APP : Packed CellId");
+ CMCHKPK(SPkU16, cellStopId->cellId, mBuf);
+ CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopId, sizeof(MacCellStopInfo));
+ cellStopId = NULL;
+ }
+ else if(pst->selector == DU_SELECTOR_LWLC)
+ {
+ /* pack the address of the structure */
+ CMCHKPK(cmPkPtr,(PTR)cellStopId, mBuf);
+ }
+ else
+ {
+ SPutMsg(mBuf);
+ }
+
+ return SPstTsk(pst,mBuf);
+}
+
+/*******************************************************************
+ *
+ * @brief Unpacks stop indication from MAC
+ *
+ * @details
+ *
+ * Function : unpackMacStopInd
+ *
+ * Functionality:
+ * Unpacks stop indication from MAC
+ *
+ * @params[in] Pointer to Handler
+ * Post structure pointer
+ * Message Buffer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf)
+{
+ if(pst->selector == DU_SELECTOR_LWLC)
+ {
+ MacCellStopInfo *cellStopId;
+ /* unpack the address of the structure */
+ CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopId, mBuf);
+ SPutMsg(mBuf);
+ return (*func)(pst, cellStopId);
+ }
+ else if(pst->selector == DU_SELECTOR_LC)
+ {
+ MacCellStopInfo cellStopId;
+ CMCHKUNPK(SUnpkU16, &(cellStopId.cellId), mBuf);
+
+ SPutMsg(mBuf);
+ return (*func)(pst, &cellStopId);
+
+ }
+ else
+ {
+ /* Nothing to do for loose coupling */
+ SPutMsg(mBuf);
+ return ROK;
+ }
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/
#define EVENT_MAC_CELL_START_REQ 202
#define EVENT_MAC_CELL_STOP_REQ 203
#define EVENT_MAC_SLOT_IND 204
+#define EVENT_MAC_STOP_IND 205
typedef enum
{
extern uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf);
extern uint16_t duHandleSlotInd(Pst *pst, SlotInfo *slotInfo);
+/* Functions for stop Ind from MAC to DU APP*/
+typedef uint16_t (*DuMacStopInd) ARGS((
+ Pst *pst,
+ MacCellStopInfo *cellId ));
+
+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);
+
/* Functions for mac cell start req */
typedef uint16_t (*DuMacCellStartReq) ARGS((
Pst *pst,
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);
-
+uint8_t sendStopIndMacToDuApp();
#endif
/**********************************************************************
#include "stdio.h"
+#include "stdbool.h"
#include "envopt.h" /* Environment options */
#include "envdep.h" /* Environment dependent */
#include "envind.h" /* Environment independent */
#include "gen.x" /* General */
#include "ssi.x" /* System services */
-void duStartSlotIndicaion();
+void l1HdlSlotIndicaion(bool);
S16 buildAndSendSlotIndication();
S16 duSendEgtpSlotInd();
#define EVENT_CRC_IND_TO_MAC 28
#define EVENT_CRC_IND_TO_SCH 29
#define EVENT_RX_DATA_IND_TO_MAC 30
+#define EVENT_STOP_IND_TO_MAC 31
/** @} */
#define MAX_PREAM_PER_SLOT 1 /* Max number of preamble per slot */
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) \
{ \
S16 duSendEgtpDatInd(Buffer *mBuf);
S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
uint16_t duBuildAndSendMacCellStartReq();
+uint16_t duBuildAndSendMacCellStopReq();
#endif
ret = unpackMacSlotInd(duHandleSlotInd, pst, mBuf);
break;
}
+ case EVENT_MAC_STOP_IND:
+ {
+ ret = unpackMacStopInd(duHandleStopInd, pst, mBuf);
+ break;
+ }
default:
{
DU_LOG("\nDU_APP : Invalid event received at duActvTsk from ENTRG");
DU_LOG("\nDU APP : Building and Sending cell start request to MAC");
/* Send Cell Start Request to MAC */
- DU_ALLOC(cellStartInfo, sizeof(MacCellStartInfo));
+ DU_ALLOC_SHRABL_BUF(cellStartInfo, sizeof(MacCellStartInfo));
if(!cellStartInfo)
{
DU_LOG("\nDU APP : Memory alloc failed while building cell start request");
* RFAILED - failure
*
* ****************************************************************/
-S16 duBuildAndSendMacCellStopReq()
+uint16_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 */
- DU_ALLOC(cellStopInfo, sizeof(MacCellStopInfo));
+ DU_ALLOC_SHRABL_BUF(cellStopInfo, sizeof(MacCellStopInfo));
if(!cellStopInfo)
{
DU_LOG("\nDU APP : Memory alloc failed while building cell stop request");
return (*packMacCellStopReqOpts[pst.selector])(&pst, cellStopInfo);
}
+/*******************************************************************
+ *
+ * @brief Handles stop indication from MAC
+ *
+ * @details
+ *
+ * Function : duHandleStopInd
+ *
+ * Functionality:
+ * Handles stop indication from MAC
+ *
+ * @params[in] Post structure pointer
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint16_t duHandleStopInd(Pst *pst, MacCellStopInfo *cellStopId)
+{
+ if(cellStopId->cellId <=0 || cellStopId->cellId > DU_MAX_CELLS)
+ {
+ DU_LOG("\nDU APP : Invalid Cell Id %d", cellStopId->cellId);
+ }
+ 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;
+ }
+ }
+ }
+ if((pst->selector == DU_SELECTOR_LWLC) || (pst->selector == DU_SELECTOR_TC))
+ DU_FREE_SHRABL_BUF(MAC_MEM_REGION, pst->pool, cellStopId, sizeof(MacCellStopInfo));
+ return ROK;
+}
/**********************************************************************
End of file
**********************************************************************/
if(clGlobalCp.phyState == PHY_STATE_CONFIGURED)
{
- duStartSlotIndicaion();
- MAC_FREE(startReq, msgLen);
+ l1HdlSlotIndicaion(FALSE);
+ MAC_FREE(startReq, sizeof(fapi_start_req_t));
}
else
{
return ROK;
}
+/*******************************************************************
+ *
+ * @brief Builds and Send the stop Indication message to MAC
+ *
+ * @details
+ *
+ * Function : l1BuildAndSendStopInd
+ *
+ * Functionality:
+ * -Send the Stop indication Message to MAC
+ *
+ *
+ * @return void
+ *
+ * ****************************************************************/
+PUBLIC uint16_t l1BuildAndSendStopInd()
+{
+#ifdef FAPI
+ fapi_stop_ind_t *stopIndMsg = NULLP;
+ uint32_t msgLen = 0;
+
+ MAC_ALLOC(stopIndMsg, sizeof(fapi_stop_ind_t));
+ if(!stopIndMsg)
+ {
+ 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.message_type_id,\
+ sizeof(fapi_stop_ind_t), (void*)stopIndMsg);
+ MAC_FREE(stopIndMsg, sizeof(fapi_stop_ind_t));
+ }
+#endif
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles stop request received from MAC
+ *
+ * @details
+ *
+ * Function : l1HdlStopReq
+ *
+ * Functionality:
+ * -Handles stop request received from MAC
+ *
+ * @params[in] Message length
+ * stop request message pointer
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+PUBLIC S16 l1HdlStopReq(uint32_t msgLen, void *msg)
+{
+#ifdef FAPI
+ fapi_stop_req_t *stopReq = (fapi_stop_req_t *)msg;
+
+ if(clGlobalCp.phyState == PHY_STATE_RUNNING)
+ {
+ l1HdlSlotIndicaion(TRUE);
+ DU_LOG("\nPHY_STUB: Slot Indication is stopped successfully");
+ l1BuildAndSendStopInd();
+ MAC_FREE(stopReq, msgLen);
+ }
+ else
+ {
+ DU_LOG("\nPHY_STUB: Received Stop Req in PHY State %d", clGlobalCp.phyState);
+ return RFAILED;
+ }
+#endif
+ return ROK;
+}
+
/*******************************************************************
*
* @brief Receives message from MAC
case FAPI_UL_TTI_REQUEST:
l1HdlUlTtiReq(msgLen, msg);
break;
+ case FAPI_STOP_REQUEST:
+ l1HdlStopReq(msgLen, msg);
+ break;
default:
DU_LOG("\nPHY_STUB: Invalid message type[%x] received at PHY", msgType);
break;
/* This file handles slot indication */
#include <stdio.h>
+#include <stdbool.h>
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include "du_log.h"
uint16_t l1BuildAndSendSlotIndication();
+pthread_t thread = 0;
void *GenerateTicks(void *arg)
{
return((void *)NULLP);
}
-void duStartSlotIndicaion()
+void l1HdlSlotIndicaion(bool stopSlotInd)
{
- pthread_t thread;
int ret;
- ret = pthread_create(&thread, NULL, GenerateTicks, NULL);
- if(ret)
+ if(!stopSlotInd)
{
- DU_LOG("\nPHY_STUB: Unable to create thread");
+ ret = pthread_create(&thread, NULL, GenerateTicks, NULL);
+ if(ret)
+ {
+ DU_LOG("\nPHY_STUB: Unable to create thread");
+ }
+ }
+ else
+ {
+ ret = pthread_cancel(thread);
+ if(ret)
+ {
+ DU_LOG("\nPHY_STUB: Unable to stop thread");
+ }
}
}