• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ os_memoryFree函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中os_memoryFree函数的典型用法代码示例。如果您正苦于以下问题:C++ os_memoryFree函数的具体用法?C++ os_memoryFree怎么用?C++ os_memoryFree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了os_memoryFree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sme_Destroy

/** 
 * \fn     sme_Destroy
 * \brief  Destroys the SME object. De-allocates system resources
 * 
 * Destroys the SME object. De-allocates system resources
 * 
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     sme_Create
 */ 
void sme_Destroy (TI_HANDLE hSme)
{
    TSme        *pSme = (TSme*)hSme;

    /* destroy the scan result table */
    if (NULL != pSme->hScanResultTable)
    {
        scanResultTable_Destroy (pSme->hScanResultTable);
    }

    /* destroy the SME generic state machine */
    if (NULL != pSme->hSmeSm)
    {
        genSM_Unload (pSme->hSmeSm);
    }

    /* free the SME object */
    os_memoryFree (pSme->hOS, hSme, sizeof (TSme));
}
开发者ID:CyanogenDefy,项目名称:android_system_wlan_ti,代码行数:29,代码来源:sme.c


示例2: cmdHndlr_Destroy

/** 
 * \fn     cmdHndlr_Destroy
 * \brief  Destroy the module object
 * 
 * Destroy the module object.
 * 
 * \note   
 * \param  hCmdHndlr - The object                                          
 * \return TI_OK 
 * \sa     
 */ 
TI_STATUS cmdHndlr_Destroy (TI_HANDLE hCmdHndlr, TI_HANDLE hEvHandler)
{
    TCmdHndlrObj *pCmdHndlr = (TCmdHndlrObj *)hCmdHndlr;

	if (pCmdHndlr->hCmdInterpret)
	{
		cmdInterpret_Destroy (pCmdHndlr->hCmdInterpret, hEvHandler);
	}


	if (pCmdHndlr->hCmdQueue)
	{
		que_Destroy (pCmdHndlr->hCmdQueue);
	}

	os_memoryFree (pCmdHndlr->hOs, hCmdHndlr, sizeof(TCmdHndlrObj));

    return TI_OK;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:30,代码来源:CmdHndlr.c


示例3: release_module

/***********************************************************************
 *                        release_module									
 ***********************************************************************
DESCRIPTION:	Release all module resources - FSMs, timer and object.
                                                                                                   
INPUT:      hConn	-	Connection handle.

OUTPUT:		

RETURN:     void

************************************************************************/
static void release_module(conn_t *pConn)
{
	if (pConn->ibss_pFsm)
    {
		fsm_Unload (pConn->hOs, pConn->ibss_pFsm);
    }

    if (pConn->infra_pFsm)
    {
		fsm_Unload (pConn->hOs, pConn->infra_pFsm);
    }

	if (pConn->hConnTimer)
    {
		tmr_DestroyTimer (pConn->hConnTimer);
    }

	os_memoryFree(pConn->hOs, pConn, sizeof(conn_t));
}
开发者ID:aleho,项目名称:ti_wilink,代码行数:31,代码来源:conn.c


示例4: mainSec_unload

/**
*
* mainSec_config
*
* \b Description: 
*
* Init main security state machine state machine
*
* \b ARGS:
*
*  none
*
* \b RETURNS:
*
*  TI_OK on success, TI_NOK otherwise.
*
* \sa 
*/
TI_STATUS mainSec_unload(mainSec_t *pMainSec)
{
    TI_STATUS   status;

    if (pMainSec == NULL)
    {
        return TI_NOK;
    }

    status = mainKeys_unload(pMainSec->pMainKeys);

    status = fsm_Unload(pMainSec->hOs, pMainSec->pMainSecSm);

    status = externalSec_Destroy (pMainSec->pExternalSec);

    os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t));

    return TI_OK;
}
开发者ID:bluewater-cn,项目名称:ti_wilink,代码行数:37,代码来源:mainSecSm.c


示例5: connInfra_ScrWaitDisconn_to_disconnect

static TI_STATUS connInfra_ScrWaitDisconn_to_disconnect(void *pData)
{
    TI_STATUS status;
    paramInfo_t *pParam;
    conn_t *pConn = (conn_t *)pData;
    
    status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
    if (status != TI_OK)
        return status;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = CLOSE;
    status = rxData_setParam(pConn->hRxData, pParam);
    if (status == TI_OK) 
    {
        /* Update TxMgmtQueue SM to close Tx path for all except Mgmt packets. */
        txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_MGMT);

        pParam->paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
        regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam);

        status = mlme_stop( pConn->hMlme, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP );
        if (status == TI_OK) 
        {
            /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
                supported rates, and stopModules clears all rates. */
            stopModules(pConn, TI_TRUE);
    
            /* send disconnect command to firmware */
            prepare_send_disconnect(pData);
        }
    }

    os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
    return status;
}
开发者ID:chambejp,项目名称:hardware,代码行数:42,代码来源:connInfra.c


示例6: externalSec_Destroy

/**
*
* Function  - externalSec_Destroy.
*
* \b Description:
*
* Called by mainSecSM (mainSec_unload).
*
* \b ARGS:
*
*
* \b RETURNS:
*
*  TI_STATUS - 0 on success, any other value on failure.
*
*/
TI_STATUS externalSec_Destroy(struct externalSec_t * pExternalSec)
{
	TI_STATUS status;

	if (pExternalSec == NULL) {
		return TI_NOK;
	}

	status = fsm_Unload(pExternalSec->hOs, pExternalSec->pExternalSecSm);
	if (status != TI_OK) {
		/* report failure but don't stop... */
		TRACE0(pExternalSec->hReport, REPORT_SEVERITY_ERROR,
		       "EXTERNAL SECURITY: Error releasing FSM memory \n");
	}

	os_memoryFree(pExternalSec->hOs, pExternalSec,
		      sizeof(struct externalSec_t));

	return TI_OK;
}
开发者ID:blueskycoco,项目名称:wang-linux,代码行数:36,代码来源:externalSec.c


示例7: RxQueue_Destroy

/**
 * \fn     RxQueue_Destroy()
 * \brief  Destroy the module.
 *
 * Free the module's queues and object.
 *
 * \param  hRxQueue - The module object
 * \return TI_OK on success or TI_NOK on failure
 * \sa     RxQueue_Create
 */
TI_STATUS RxQueue_Destroy (TI_HANDLE hRxQueue)
{
	TRxQueue *pRxQueue;

	if (hRxQueue) {
		pRxQueue = (TRxQueue *)hRxQueue;

		if (pRxQueue->hMissingPktTimer) {
			tmr_DestroyTimer (pRxQueue->hMissingPktTimer);
			pRxQueue->hMissingPktTimer = NULL;
		}

		/* free module object */
		os_memoryFree (pRxQueue->hOs, pRxQueue, sizeof(TRxQueue));

		return TI_OK;
	}

	return TI_NOK;
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:30,代码来源:RxQueue.c


示例8: MacServices_destroy

/****************************************************************************************
 *                        MacServices_destroy                                                    *
 *****************************************************************************************
DESCRIPTION: destroys MacServices module
                                                                                                                               
INPUT:          hMacServices - handle to the Mac Services object.
OUTPUT:     
RETURN:     
****************************************************************************************/
void MacServices_destroy( TI_HANDLE hMacServices ) 
{
    MacServices_t *pMacServices = (MacServices_t*)hMacServices;
    
    /* destroy all SRV modules */
    if ( NULL != pMacServices->hScanSRV )
    {
        MacServices_scanSRV_destroy( pMacServices->hScanSRV );
    }
    if ( NULL != pMacServices->hMeasurementSRV )
    {
        MacServices_measurementSRV_destroy( pMacServices->hMeasurementSRV );
    }

    if(pMacServices->hPowerSrv)
    powerSrv_destroy(pMacServices->hPowerSrv);

    /* free the Mac services allocated context */
    os_memoryFree( pMacServices->hOS, (TI_HANDLE)pMacServices , sizeof(MacServices_t) );
}
开发者ID:bluewater-cn,项目名称:ti_wilink,代码行数:29,代码来源:MacServices.c


示例9: mem_Free

/****************************************************************************************
 *                        os_memoryFree()
 ****************************************************************************************
DESCRIPTION:    This function releases a block of memory previously allocated with the
                os_memoryAlloc function.


ARGUMENTS:      OsContext   -   our adapter context.
                pMemPtr     -   Pointer to the base virtual address of the allocated memory.
                                This address was returned by the os_memoryAlloc function.
                Size        -   Specifies the size, in bytes, of the memory block to be released.
                                This parameter must be identical to the Length that was passed to
                                os_memoryAlloc.

RETURN:         None

NOTES:
*****************************************************************************************/
void mem_Free (TI_HANDLE hMem, void* ptr, TI_UINT32 size)
{
	TMemMng *pMemMng = (TMemMng *)hMem;
	TMemBlock *pMemBlock = (TMemBlock *)((TI_UINT8 *)ptr - sizeof(TMemBlock));


	if (pMemBlock->signature == MEM_BLOCK_START) {
		*(TI_UINT8 *)(&pMemBlock->signature) = '~';
		if (*(TI_UINT32 *)((TI_UINT8 *)pMemBlock + pMemBlock->size + sizeof(TMemBlock)) != MEM_BLOCK_END) {
		}

		os_memoryFree (pMemMng->hOs, pMemBlock, pMemBlock->signature + sizeof(TMemBlock) + sizeof(TI_UINT32));

		pMemMng->uCurAllocated -= size + sizeof(TMemBlock) + sizeof(TI_UINT32);

		if ((int)pMemMng->uCurAllocated < 0) {
			pMemMng->uCurAllocated = 0;
		}
	}
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:38,代码来源:mem.c


示例10: twIf_Destroy

/** 
 * \fn     twIf_Destroy
 * \brief  Destroy the module. 
 * 
 * Unregister from TxnQ and free the TxnDone-queue and the module's object.
 * 
 * \note   
 * \param  The module's object
 * \return TI_OK on success or TI_NOK on failure 
 * \sa     twIf_Create
 */ 
TI_STATUS twIf_Destroy (TI_HANDLE hTwIf)
{
    TTwIfObj *pTwIf = (TTwIfObj*)hTwIf;

    if (pTwIf)
    {
        txnQ_Close (pTwIf->hTxnQ, TXN_FUNC_ID_WLAN);
        if (pTwIf->hTxnDoneQueue)
        {
            que_Destroy (pTwIf->hTxnDoneQueue);
        }
        if (pTwIf->hPendRestartTimer)
        {
            tmr_DestroyTimer (pTwIf->hPendRestartTimer);
        }
        os_memoryFree (pTwIf->hOs, pTwIf, sizeof(TTwIfObj));     
    }

    return TI_OK;
}
开发者ID:bluewater-cn,项目名称:ti_wilink,代码行数:31,代码来源:TwIf.c


示例11: measurementMgr_releaseModule

/**
 * Releases the module's allocated objects according to the given init vector.
 * 
 * @param pMeasurementMgr A handle to the Measurement Manager module.
 * @param initVec The init vector with a bit set for each allocated object.
 * 
 * @date 01-Jan-2006
 */
static void measurementMgr_releaseModule (measurementMgr_t * pMeasurementMgr)
{

    if (pMeasurementMgr->hActivationDelayTimer)
    {
        tmr_DestroyTimer (pMeasurementMgr->hActivationDelayTimer);
    }


    if (pMeasurementMgr->pMeasurementMgrSm)
    {
        fsm_Unload(pMeasurementMgr->hOs, pMeasurementMgr->pMeasurementMgrSm);
    }

    if (pMeasurementMgr->hRequestH)
    {
        requestHandler_destroy(pMeasurementMgr->hRequestH);
    }
    
    os_memoryFree(pMeasurementMgr->hOs, pMeasurementMgr, sizeof(measurementMgr_t));
}
开发者ID:chambejp,项目名称:hardware,代码行数:29,代码来源:measurementMgr.c


示例12: assoc_unload

/**
*
* assocunload - unload association SM from memory
*
* \b Description: 
*
* Unload association SM from memory
*
* \b ARGS:
*
*  I   - hAssoc - association SM context  \n
*
* \b RETURNS:
*
*  OK if successful, NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS assoc_unload(TI_HANDLE hAssoc)
{
    TI_STATUS 		status;
	assoc_t		*pHandle;

	pHandle = (assoc_t*)hAssoc;

	status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm);
    if (status != OK)
	{
		/* report failure but don't stop... */
		WLAN_REPORT_ERROR(pHandle->hReport, ASSOC_MODULE_LOG,
				  ("ASSOC_SM: Error releasing FSM memory \n"));
	}
	
	os_timerDestroy(pHandle->hOs, pHandle->timer);
	
	os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t));

	return OK;
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:39,代码来源:assocSM.c


示例13: txDataQ_Destroy

/** 
 * \fn     txDataQ_Destroy
 * \brief  Destroy the module and its queues
 * 
 * Clear and destroy the queues and then destroy the module object.
 * 
 * \note   
 * \param  hTxDataQ - The object                                          
 * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull 
 * \sa     
 */ 
TI_STATUS txDataQ_Destroy (TI_HANDLE hTxDataQ)
{
    TTxDataQ  *pTxDataQ = (TTxDataQ *)hTxDataQ;
    TI_STATUS  status = TI_OK;
    TI_UINT32  uQueId;
    TDataLinkQ *pLinkQ;
    TI_UINT32  uHlid;

    /* Dequeue and free all queued packets */
    txDataQ_ClearQueues (hTxDataQ);

    /* 
     * init all queues in all links 
     */
    for (uHlid = 0; uHlid < WLANLINKS_MAX_LINKS; uHlid++)
    {
        pLinkQ = &pTxDataQ->aDataLinkQ[uHlid]; /* Link queues */

        /* Free Data queues */
        for (uQueId = 0 ; uQueId < pTxDataQ->uNumQueues ; uQueId++)
        {
            if (que_Destroy(pLinkQ->aQueues[uQueId]) != TI_OK)
            {
                TRACE1(pTxDataQ->hReport, REPORT_SEVERITY_ERROR, "txDataQueue_unLoad: fail to free Data Queue number: %d\n",uQueId);
    			status = TI_NOK;
            }
        }
    }

    /* free timer */
    if (pTxDataQ->hTxSendPaceTimer)
    {
        tmr_DestroyTimer (pTxDataQ->hTxSendPaceTimer);
    }

    /* Free Tx Data Queue Module */
    os_memoryFree (pTxDataQ->hOs, pTxDataQ, sizeof(TTxDataQ));

    return status;
}
开发者ID:Achotjan,项目名称:FreeXperia,代码行数:51,代码来源:txDataQueue.c


示例14: broadcastKey_unload

TI_STATUS broadcastKey_unload(struct _broadcastKey_t *pBroadcastKey)
{
	TI_STATUS		status;

	status = keyDerive_unload(pBroadcastKey->pKeyDerive);

	if (status != TI_OK) {
		TRACE0(pBroadcastKey->hReport, REPORT_SEVERITY_CONSOLE, "BCAST_KEY_SM: Error in unloading key derivation module\n");
		WLAN_OS_REPORT(("BCAST_KEY_SM: Error in unloading key derivation module\n"));
	}

	status = fsm_Unload(pBroadcastKey->hOs, pBroadcastKey->pBcastKeySm);
	if (status != TI_OK) {
		TRACE0(pBroadcastKey->hReport, REPORT_SEVERITY_CONSOLE, "BCAST_KEY_SM: Error in unloading state machine\n");
		WLAN_OS_REPORT(("BCAST_KEY_SM: Error in unloading state machine\n"));
	}

	/* free key parser context memory */
	os_memoryFree(pBroadcastKey->hOs, pBroadcastKey, sizeof(broadcastKey_t));

	return TI_OK;
}
开发者ID:3ig,项目名称:Xperia-2011-Official-Kernel-Sources,代码行数:22,代码来源:broadcastKeySM.c


示例15: tmr_DestroyTimer

/** 
 * \fn     tmr_DestroyTimer
 * \brief  Destroy the specified timer
 * 
 * Destroy the specified timer object, icluding the timer in the OS-API.  
 * 
 * \note   This timer destruction function should be used before tmr_Destroy() is executed!!
 * \param  hTimerInfo - The timer handle
 * \return TI_OK on success or TI_NOK on failure 
 * \sa     tmr_CreateTimer
 */ 
TI_STATUS tmr_DestroyTimer (TI_HANDLE hTimerInfo)
{
    TTimerInfo   *pTimerInfo   = (TTimerInfo *)hTimerInfo;                 /* The timer handle */     
    TTimerModule *pTimerModule;                  /* The timer module handle */
    if (!pTimerInfo)
    {
        return TI_NOK;
    }
    pTimerModule = (TTimerModule *)pTimerInfo->hTimerModule;
    if (!pTimerModule)
    {
        WLAN_OS_REPORT (("tmr_DestroyTimer(): ERROR - NULL timer!\n"));
        return TI_NOK;
    }

    /* Free the OS-API timer */
    if ((pTimerInfo->hOsTimerObj) &&  (pTimerModule->hOs))
    {
    	os_timerDestroy (pTimerModule->hOs, pTimerInfo->hOsTimerObj);
    	if (pTimerModule->uTimersCount>0)
    	{
			pTimerModule->uTimersCount--;  /* update created timers number */
    	}
    	else
    	{
    		WLAN_OS_REPORT (("tmr_DestroyTimer(): ERROR - timers count < 0!\n"));
    	}
    }
    else
    {
    	WLAN_OS_REPORT (("tmr_DestroyTimer(): ERROR - NULL pointers!\n"));
    }
    /* Free the timer object */
    os_memoryFree (pTimerModule->hOs, hTimerInfo, sizeof(TTimerInfo));
	

    return TI_OK;
}
开发者ID:nadlabak,项目名称:tiwlan,代码行数:49,代码来源:timer.c


示例16: assoc_unload

/**
*
* assocunload - unload association SM from memory
*
* \b Description: 
*
* Unload association SM from memory
*
* \b ARGS:
*
*  I   - hAssoc - association SM context  \n
*
* \b RETURNS:
*
*  TI_OK if successful, TI_NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_STATUS assoc_unload(TI_HANDLE hAssoc)
{
    TI_STATUS       status;
    assoc_t     *pHandle;

    pHandle = (assoc_t*)hAssoc;

    status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm);
    if (status != TI_OK)
    {
        /* report failure but don't stop... */
        TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: Error releasing FSM memory \n");
    }
    
	if (pHandle->hAssocSmTimer)
	{
		tmr_DestroyTimer (pHandle->hAssocSmTimer);
	}
    
    os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t));

    return TI_OK;
}
开发者ID:0omega,项目名称:platform_system_wlan_ti,代码行数:41,代码来源:assocSM.c


示例17: txMgmtQ_Destroy

/** 
 * \fn     txMgmtQ_Destroy
 * \brief  Destroy the module and its queues
 * 
 * Clear and destroy the queues and then destroy the module object.
 * 
 * \note   
 * \param  hTxMgmtQ - The module's object                                          
 * \return TI_OK - Unload succesfull, TI_NOK - Unload unsuccesfull 
 * \sa     
 */ 
TI_STATUS txMgmtQ_Destroy (TI_HANDLE hTxMgmtQ)
{
    TTxMgmtQ  *pTxMgmtQ = (TTxMgmtQ *)hTxMgmtQ;
    TI_STATUS  eStatus = TI_OK;
    int        uQueId;


    /* free Mgmt queues */
    for (uQueId = 0 ; uQueId < NUM_OF_MGMT_QUEUES ; uQueId++)
    {
        if (que_Destroy(pTxMgmtQ->aQueues[uQueId]) != TI_OK)
		{
TRACE1(pTxMgmtQ->hReport, REPORT_SEVERITY_ERROR, "txMgmtQueue_unLoad: fail to free Mgmt Queue number: %d\n",uQueId);

			eStatus = TI_NOK;
		}
    }

    /* free Tx Mgmt Queue Module */
    os_memoryFree (pTxMgmtQ->hOs, pTxMgmtQ, sizeof(TTxMgmtQ));

    return eStatus;
}
开发者ID:chambejp,项目名称:hardware,代码行数:34,代码来源:txMgmtQueue.c


示例18: mlmeWait_to_WaitDisconnect

/* STOP_MLME, SET_DATA_PORT_CLOSE, DIS_JOIN */
static TI_STATUS mlmeWait_to_WaitDisconnect(void *pData)
{
    TI_STATUS   status;
    paramInfo_t *pParam;
    conn_t      *pConn = (conn_t *)pData;

    status = mlme_stop( pConn->hMlmeSm, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP );
    if (status != TI_OK)
        return status;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = CLOSE;
    rxData_setParam(pConn->hRxData, pParam);


    /* Update TxMgmtQueue SM to close Tx path. */
    txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_CLOSE);

    /* Start the disconnect complete time out timer. 
       Disconect Complete event, which stops the timer. */
    tmr_StartTimer (pConn->hConnTimer, conn_timeout, (TI_HANDLE)pConn, DISCONNECT_TIMEOUT_MSEC, TI_FALSE);

    /* FW will send the disconn frame according to disConnType */ 
    TWD_CmdFwDisconnect (pConn->hTWD, pConn->disConnType, pConn->disConnReasonToAP); 

#ifdef XCC_MODULE_INCLUDED
    XCCMngr_updateIappInformation(pConn->hXCCMngr, XCC_DISASSOC);
#endif
    os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
    return TI_OK;
}
开发者ID:bluewater-cn,项目名称:ti_wilink,代码行数:38,代码来源:connInfra.c


示例19: smeSm_Connect

/**
 * \fn     smeSm_Connect
 * \brief  Starts a connection process with the selected network
 *
 * Starts a connection process with the selected network
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_PreConnect, smeSm_ConnectSuccess
 */
void smeSm_Connect (TI_HANDLE hSme)
{
	TSme            *pSme = (TSme*)hSme;
	TI_STATUS       tStatus;
	paramInfo_t     *pParam;

	/* Sanity check - if no connection candidate was found so far */
	if (NULL == pSme->pCandidate) {
		sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_CONNECT_FAILURE, hSme);
	} else {
		pParam = (paramInfo_t *)os_memoryAlloc(pSme->hOS, sizeof(paramInfo_t));
		if (!pParam) {
			return;
		}

		/* set SCR group */
		if (BSS_INFRASTRUCTURE == pSme->pCandidate->bssType) {
			scr_setGroup (pSme->hScr, SCR_GID_CONNECT);
		}

		/***************** Config Connection *************************/
		pParam->paramType = CONN_TYPE_PARAM;
		if (BSS_INDEPENDENT == pSme->pCandidate->bssType)
			if (SITE_SELF == pSme->pCandidate->siteType) {
				pParam->content.connType = CONNECTION_SELF;
			} else {
				pParam->content.connType = CONNECTION_IBSS;
			}
		else
			pParam->content.connType = CONNECTION_INFRA;
		conn_setParam(pSme->hConn, pParam);
		os_memoryFree(pSme->hOS, pParam, sizeof(paramInfo_t));

		/* start the connection process */
		tStatus = conn_start (pSme->hConn, CONN_TYPE_FIRST_CONN, sme_ReportConnStatus, hSme, TI_FALSE, TI_FALSE);
	}
}
开发者ID:IdeosDev,项目名称:vendor_ti_wlan,代码行数:47,代码来源:smeSm.c


示例20: tmr_CreateTimer

/** 
 * \fn     tmr_CreateTimer
 * \brief  Create a new timer
 * 
 * Create a new timer object, icluding creating a timer in the OS-API.  
 * 
 * \note   This timer creation may be used only after tmr_Create() and tmr_Init() were executed!!
 * \param  hTimerModule - The module handle
 * \return TI_HANDLE    - The created timer handle
 * \sa     tmr_DestroyTimer
 */ 
TI_HANDLE tmr_CreateTimer (TI_HANDLE hTimerModule)
{
    TTimerModule *pTimerModule = (TTimerModule *)hTimerModule; /* The timer module handle */
    TTimerInfo   *pTimerInfo;  /* The created timer handle */

    if (!pTimerModule)
    {
        WLAN_OS_REPORT (("tmr_CreateTimer(): ERROR - NULL timer!\n"));
        return NULL;
    }

    /* Allocate timer object */
    pTimerInfo = os_memoryAlloc (pTimerModule->hOs, sizeof(TTimerInfo));
    if (!pTimerInfo)
    {
        WLAN_OS_REPORT (("tmr_CreateTimer():  Timer allocation failed!!\n"));
        return NULL;
    }
    os_memoryZero (pTimerModule->hOs, pTimerInfo, (sizeof(TTimerInfo)));

    /* Allocate OS-API timer, providing the common expiry callback with the current timer handle */
    pTimerInfo->hOsTimerObj = os_timerCreate(pTimerModule->hOs, tmr_GetExpiry, (TI_HANDLE)pTimerInfo);
    if (!pTimerInfo->hOsTimerObj)
    {
        TRACE0(pTimerModule->hReport, REPORT_SEVERITY_CONSOLE ,"tmr_CreateTimer():  OS-API Timer allocation failed!!\n");
        os_memoryFree (pTimerModule->hOs, pTimerInfo, sizeof(TTimerInfo));
        WLAN_OS_REPORT (("tmr_CreateTimer():  OS-API Timer allocation failed!!\n"));
        return NULL;
    }

    /* Save the timer module handle in the created timer object (needed for the expiry callback) */
    pTimerInfo->hTimerModule = hTimerModule;
    pTimerModule->uTimersCount++;  /* count created timers */

    /* Return the created timer handle */
    return (TI_HANDLE)pTimerInfo;
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:48,代码来源:timer.c



注:本文中的os_memoryFree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ os_memoryZero函数代码示例发布时间:2022-05-30
下一篇:
C++ os_memoryCopy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap