本文整理汇总了C++中os_memoryAlloc函数的典型用法代码示例。如果您正苦于以下问题:C++ os_memoryAlloc函数的具体用法?C++ os_memoryAlloc怎么用?C++ os_memoryAlloc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了os_memoryAlloc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: txDataQ_Create
/**
* \fn txDataQ_Create
* \brief Create the module and its queues
*
* Create the Tx Data module and its queues.
*
* \note
* \param hOs - Handle to the Os Abstraction Layer
* \return Handle to the allocated Tx Data Queue module (NULL if failed)
* \sa
*/
TI_HANDLE txDataQ_Create(TI_HANDLE hOs)
{
TTxDataQ *pTxDataQ;
/* allocate TxDataQueue module */
pTxDataQ = os_memoryAlloc(hOs, (sizeof(TTxDataQ)));
if (!pTxDataQ) {
WLAN_OS_REPORT(("Error allocating the TxDataQueue Module\n"));
return NULL;
}
/* Reset TxDataQueue module */
os_memoryZero(hOs, pTxDataQ, (sizeof(TTxDataQ)));
return (TI_HANDLE) pTxDataQ;
}
示例2: twIf_Create
/**
* \fn twIf_Create
* \brief Create the module
*
* Allocate and clear the module's object.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object, NULL if allocation failed
* \sa twIf_Destroy
*/
TI_HANDLE twIf_Create (TI_HANDLE hOs)
{
TI_HANDLE hTwIf;
TTwIfObj *pTwIf;
hTwIf = os_memoryAlloc (hOs, sizeof(TTwIfObj));
if (hTwIf == NULL)
return NULL;
pTwIf = (TTwIfObj *)hTwIf;
os_memoryZero (hOs, hTwIf, sizeof(TTwIfObj));
pTwIf->hOs = hOs;
return pTwIf;
}
示例3: admCtrl_create
/**
*
* admCtrl_create
*
* \b Description:
*
* Create the admission control context.
*
* \b ARGS:
*
* I - role - admission cotrol role (AP or Station) \n
* I - authSuite - authentication suite to work with \n
*
* \b RETURNS:
*
* TI_OK on success, TI_NOK on failure.
*
* \sa
*/
admCtrl_t* admCtrl_create(TI_HANDLE hOs)
{
admCtrl_t *pHandle;
/* allocate rsniation context memory */
pHandle = (admCtrl_t*)os_memoryAlloc(hOs, sizeof(admCtrl_t));
if (pHandle == NULL)
{
return NULL;
}
os_memoryZero(hOs, pHandle, sizeof(admCtrl_t));
pHandle->hOs = hOs;
return pHandle;
}
示例4: fwDbg_Init
/*
* \brief Initialize the module
*
* \param hFwDebug - Handle to FW Debug
* \param hReport - Handle to report
* \param hTwif - Handle to TWIF
* \param hFwEvent - Handle to fwEvent
* \return none
*
* \par Description
*
*
* \sa
*/
void fwDbg_Init (TI_HANDLE hFwDebug,
TI_HANDLE hReport,
TI_HANDLE hTwif,
TI_HANDLE hFwEvent)
{
TFwDebug* pFwDebug = (TFwDebug*)hFwDebug;
pFwDebug->hReport = hReport;
pFwDebug->hTwif = hTwif;
pFwDebug->hFwEvent = hFwEvent;
/* Allocate DMA memory for read write transact */
pFwDebug->pDMABuf = (TI_UINT8*)os_memoryAlloc(pFwDebug->hOs,DMA_SIZE_BUF);
/* Init SDIO test variables */
pFwDebug->pSdioTestWriteBuf = NULL;
pFwDebug->pSdioTestReadBuf = NULL;
}
示例5: mainSec_create
/**
*
* mainSec_create
*
* \b Description:
*
* Allocate memory for the main security context, and create all the rest of the needed contexts.
*
* \b ARGS:
*
* I - hOs - OS handle for OS operations.
*
* \b RETURNS:
*
* pointer to main security context. If failed, returns NULL.
*
* \sa
*/
mainSec_t* mainSec_create(TI_HANDLE hOs)
{
mainSec_t *pHandle;
TI_STATUS status;
/* allocate association context memory */
pHandle = (mainSec_t*)os_memoryAlloc(hOs, sizeof(mainSec_t));
if (pHandle == NULL)
{
return NULL;
}
os_memoryZero(hOs, pHandle, sizeof(mainSec_t));
/* allocate memory for association state machine */
status = fsm_Create(hOs, &pHandle->pMainSecSm, MAIN_SEC_MAX_NUM_STATES, MAIN_SEC_MAX_NUM_EVENTS);
if (status != TI_OK)
{
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
pHandle->pMainKeys = mainKeys_create(hOs);
if (pHandle->pMainKeys == NULL)
{
fsm_Unload(hOs, pHandle->pMainSecSm);
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
pHandle->pKeyParser = pHandle->pMainKeys->pKeyParser;
pHandle->hOs = hOs;
/* created only for external security mode */
pHandle->pExternalSec = externalSec_create(hOs);
if (pHandle->pExternalSec == NULL)
{
fsm_Unload(hOs, pHandle->pMainSecSm);
mainKeys_unload(pHandle->pMainKeys);
os_memoryFree(hOs, pHandle, sizeof(mainSec_t));
return NULL;
}
return pHandle;
}
示例6: tmr_Create
/**
* \fn tmr_Create
* \brief Create the timer module
*
* Allocate and clear the timer module object.
*
* \note This is NOT a specific timer creation! (see tmr_CreateTimer)
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa tmr_Destroy
*/
TI_HANDLE tmr_Create (TI_HANDLE hOs)
{
TI_HANDLE hTimerModule;
/* allocate module object */
hTimerModule = os_memoryAlloc (hOs, sizeof(TTimerModule));
if (!hTimerModule)
{
WLAN_OS_REPORT (("tmr_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, hTimerModule, (sizeof(TTimerModule)));
return (hTimerModule);
}
示例7: cmdQueue_Create
/*
* \brief Create the TCmdQueue object
*
* \param hOs - OS module object handle
* \return Handle to the created object
*
* \par Description
* Calling this function creates a CmdQueue object
*
* \sa cmdQueue_Destroy
*/
TI_HANDLE cmdQueue_Create (TI_HANDLE hOs)
{
TCmdQueue *pCmdQueue;
pCmdQueue = os_memoryAlloc (hOs, sizeof(TCmdQueue));
if (pCmdQueue == NULL)
{
WLAN_OS_REPORT(("FATAL ERROR: cmdQueue_Create(): Error Creating aCmdQueue - Aborting\n"));
return NULL;
}
/* reset control module control block */
os_memoryZero (hOs, pCmdQueue, sizeof(TCmdQueue));
pCmdQueue->hOs = hOs;
return pCmdQueue;
}
示例8: StaCap_Create
/**
* \fn staCap_Create
* \brief Create the staCap module.
*
* Allocate and clear the staCap module object.
*
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa staCap_Destroy
*/
TI_HANDLE StaCap_Create (TI_HANDLE hOs)
{
TI_HANDLE hStaCap;
/* allocate module object */
hStaCap = os_memoryAlloc (hOs, sizeof(TStaCap));
if (!hStaCap)
{
WLAN_OS_REPORT (("StaCap_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, hStaCap, (sizeof(TStaCap)));
return (hStaCap);
}
示例9: RxQueue_Create
/**
* \fn RxQueue_Create()
* \brief Create the RxQueue module.
*
* Allocate and clear the RxQueue module object.
*
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa RxQueue_Destroy
*/
TI_HANDLE RxQueue_Create (TI_HANDLE hOs)
{
TRxQueue *pRxQueue;
/* allocate module object */
pRxQueue = os_memoryAlloc (hOs, sizeof(TRxQueue));
if (!pRxQueue) {
WLAN_OS_REPORT (("RxQueue_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, pRxQueue, (sizeof(TRxQueue)));
pRxQueue->hOs = hOs;
return (pRxQueue);
}
示例10: pwrState_Create
TI_HANDLE pwrState_Create (TI_HANDLE hOs)
{
TPwrState *pPwrState = NULL;
pPwrState = (TPwrState*) os_memoryAlloc (hOs, sizeof(TPwrState));
if ( NULL == pPwrState )
{
WLAN_OS_REPORT(("%s: Memory Allocation Error!\n", __func__));
return NULL;
}
os_memoryZero (hOs, pPwrState, sizeof(TPwrState));
pPwrState->hOs = hOs;
return pPwrState;
}
示例11: resident
/****************************************************************************************
* os_memoryAlloc()
****************************************************************************************
DESCRIPTION: Allocates resident (nonpaged) system-space memory.
ARGUMENTS: OsContext - our adapter context.
Size - Specifies the size, in bytes, to be allocated.
RETURN: Pointer to the allocated memory.
NULL if there is insufficient memory available.
NOTES: With the call to vmalloc it is assumed that this function will
never be called in an interrupt context. vmalloc has the potential to
sleep the caller while waiting for memory to become available.
*****************************************************************************************/
void* mem_Alloc (TI_HANDLE hMem, TI_UINT32 size)
{
TMemMng *pMemMng = (TMemMng *)hMem;
TMemBlock *pMemBlock;
TI_UINT32 total = size + sizeof(TMemBlock) + sizeof(TI_UINT32);
pMemBlock = (TMemBlock *) os_memoryAlloc (pMemMng->hOs, total);
pMemBlock->size = size;
pMemBlock->signature = MEM_BLOCK_START;
*(TI_UINT32 *)((TI_UINT8 *)pMemBlock + total - sizeof(TI_UINT32)) = MEM_BLOCK_END;
pMemMng->uCurAllocated += total;
if (pMemMng->uMaxAllocated < pMemMng->uCurAllocated) {
pMemMng->uMaxAllocated = pMemMng->uCurAllocated;
}
return (void*)((TI_UINT8 *)pMemBlock + sizeof(TMemBlock));
}
示例12: busDrv_Create
/**
* \fn busDrv_Create
* \brief Create the module
*
* Create and clear the bus driver's object, and the SDIO-adapter.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object, NULL if allocation failed
* \sa busDrv_Destroy
*/
TI_HANDLE busDrv_Create (TI_HANDLE hOs)
{
TI_HANDLE hBusDrv;
TBusDrvObj *pBusDrv;
hBusDrv = os_memoryAlloc(hOs, sizeof(TBusDrvObj));
if (hBusDrv == NULL)
{
return NULL;
}
pBusDrv = (TBusDrvObj *)hBusDrv;
os_memoryZero(hOs, hBusDrv, sizeof(TBusDrvObj));
pBusDrv->hOs = hOs;
return pBusDrv;
}
示例13: mlme_start
/**
* mlme_Start - Start event for the MLME SM
*
* \b Description:
* Start event for the MLME SM
*
* \b ARGS:
* I - hMlme - MLME SM context \n
* II - connectionType - roaming or initial? with FT (802.11r) or not?
* \b RETURNS:
* TI_OK if successful, TI_NOK otherwise.
*
* \sa mlme_Stop, mlme_Recv
*/
TI_STATUS mlme_start(TI_HANDLE hMlme, TI_UINT8 connectionType)
{
EConnType econnectionType = (EConnType)connectionType;
mlme_t *pMlme = (mlme_t*)hMlme;
paramInfo_t *pParam;
if (pMlme == NULL)
{
return TI_NOK;
}
pParam = (paramInfo_t *)os_memoryAlloc(pMlme->hOs, sizeof(paramInfo_t));
if (pParam == NULL)
{
return TI_NOK;
}
pMlme->assocInfo.disAssoc = TI_FALSE;
pParam->paramType = RSN_EXT_AUTHENTICATION_MODE;
rsn_getParam(pMlme->hRsn, pParam);
switch (econnectionType)
{
case CONN_TYPE_FIRST_CONN:
case CONN_TYPE_ROAM:
if (AUTH_LEGACY_SHARED_KEY == pParam->content.rsnExtAuthneticationMode)
{
pMlme->authInfo.authType = AUTH_LEGACY_SHARED_KEY;
}
else
{
pMlme->authInfo.authType = AUTH_LEGACY_OPEN_SYSTEM;
}
break;
default:
pMlme->authInfo.authType = AUTH_LEGACY_OPEN_SYSTEM;
break;
}
mlme_smEvent(pMlme->hMlmeSm, MLME_SM_EVENT_START, pMlme);
return TI_OK;
}
示例14: 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;
}
示例15: txnQ_Create
TI_HANDLE txnQ_Create (TI_HANDLE hOs)
{
TI_HANDLE hTxnQ;
TTxnQObj *pTxnQ;
TI_UINT32 i;
hTxnQ = os_memoryAlloc(hOs, sizeof(TTxnQObj));
if (hTxnQ == NULL)
return NULL;
pTxnQ = (TTxnQObj *)hTxnQ;
os_memoryZero(hOs, hTxnQ, sizeof(TTxnQObj));
pTxnQ->hOs = hOs;
pTxnQ->pCurrTxn = NULL;
pTxnQ->uMinFuncId = MAX_FUNCTIONS; /* Start at maximum and save minimal value in txnQ_Open */
pTxnQ->uMaxFuncId = 0; /* Start at minimum and save maximal value in txnQ_Open */
#ifdef TI_DBG
pTxnQ->pAggregQueue = NULL;
#endif
for (i = 0; i < MAX_FUNCTIONS; i++)
{
pTxnQ->aFuncInfo[i].eState = FUNC_STATE_NONE;
pTxnQ->aFuncInfo[i].uNumPrios = 0;
pTxnQ->aFuncInfo[i].pSingleStep = NULL;
pTxnQ->aFuncInfo[i].fTxnQueueDoneCb = NULL;
pTxnQ->aFuncInfo[i].hCbHandle = NULL;
}
/* Create the Bus-Driver module */
pTxnQ->hBusDrv = busDrv_Create (hOs);
if (pTxnQ->hBusDrv == NULL)
{
WLAN_OS_REPORT(("%s: Error - failed to create BusDrv\n", __FUNCTION__));
txnQ_Destroy (hTxnQ);
return NULL;
}
return pTxnQ;
}