本文整理汇总了C++中os_memoryZero函数的典型用法代码示例。如果您正苦于以下问题:C++ os_memoryZero函数的具体用法?C++ os_memoryZero怎么用?C++ os_memoryZero使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了os_memoryZero函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: txCtrlParams_getParam
/***************************************************************************
* txCtrlParams_getParam
****************************************************************************
* DESCRIPTION: Get a specific parameter by an external user application.
*
* OUTPUT: pParamInfo - structure which include the value of
* the requested parameter
***************************************************************************/
TI_STATUS txCtrlParams_getParam(TI_HANDLE hTxCtrl, paramInfo_t *pParamInfo)
{
txCtrl_t *pTxCtrl = (txCtrl_t *)hTxCtrl;
TI_UINT32 ac;
if (pTxCtrl == NULL) { /* check handle validity */
return TI_NOK;
}
switch (pParamInfo->paramType) {
case TX_CTRL_COUNTERS_PARAM:
/* Convert total-delays units from usec to mSec. */
for (ac = 0 ; ac < MAX_NUM_OF_AC ; ac++) {
pTxCtrl->txDataCounters[ac].SumTotalDelayMs = pTxCtrl->SumTotalDelayUs[ac] / 1000;
}
os_memoryCopy( pTxCtrl->hOs, pParamInfo->content.pTxDataCounters, &(pTxCtrl->txDataCounters[0]),
sizeof(TTxDataCounters) * MAX_NUM_OF_AC);
pParamInfo->paramLength = sizeof(TTxDataCounters) * MAX_NUM_OF_AC;
break;
case TX_CTRL_GET_DATA_FRAME_COUNTER:
pParamInfo->content.txPacketsCount = 0;
for (ac = 0; ac < MAX_NUM_OF_AC; ac++)
pParamInfo->content.txPacketsCount += pTxCtrl->txDataCounters[ac].XmitOk;
break;
case TX_CTRL_REPORT_TS_STATISTICS:
ac = pParamInfo->content.tsMetricsCounters.acID;
os_memoryCopy(pTxCtrl->hOs,
pParamInfo->content.tsMetricsCounters.pTxDataCounters,
&(pTxCtrl->txDataCounters[ac]),
sizeof(TTxDataCounters));
os_memoryZero(pTxCtrl->hOs, &(pTxCtrl->txDataCounters[ac]), sizeof(TTxDataCounters));
break;
case TX_CTRL_GENERIC_ETHERTYPE:
pParamInfo->content.txGenericEthertype = pTxCtrl->genericEthertype;
break;
default:
return PARAM_NOT_SUPPORTED;
}
return TI_OK;
}
示例2: 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;
}
示例3: context_Create
/**
* \fn context_Create
* \brief Create the module
*
* Allocate and clear the module object.
*
* \note
* \param hOs - Handle to Os Abstraction Layer
* \return Handle of the allocated object
* \sa context_Destroy
*/
TI_HANDLE context_Create (TI_HANDLE hOs)
{
TI_HANDLE hContext;
/* allocate module object */
hContext = os_memoryAlloc (hOs, sizeof(TContext));
if (!hContext)
{
WLAN_OS_REPORT (("context_Create(): Allocation failed!!\n"));
return NULL;
}
os_memoryZero (hOs, hContext, (sizeof(TContext)));
return (hContext);
}
示例4: os_memoryZero
/**
* \fn scanresultTbale_AllocateNewEntry
* \brief Allocates an empty entry for a new site
*
* Function Allocates an empty entry for a new site (and nullfiies required entry fields)
*
* \param hScanResultTable - handle to the scan result table object
* \return Pointer to the site entry (NULL if the table is full)
*/
TSiteEntry *scanResultTbale_AllocateNewEntry (TI_HANDLE hScanResultTable)
{
TScanResultTable *pScanResultTable = (TScanResultTable*)hScanResultTable;
/* if the table is full */
if (pScanResultTable->uCurrentSiteNumber >= TABLE_ENTRIES_NUMBER)
{
return NULL;
}
/* Nullify new site data */
os_memoryZero(pScanResultTable->hOS, &(pScanResultTable->pTable[ pScanResultTable->uCurrentSiteNumber ]), sizeof (TSiteEntry));
/* return the site (and update site count) */
pScanResultTable->uCurrentSiteNumber++;
return &(pScanResultTable->pTable[ pScanResultTable->uCurrentSiteNumber - 1 ]);
}
示例5: measurementMgr_receiveFrameRequest
/**
* Called when a frame with type measurement request is received.
*
* @param hMeasurementMgr A handle to the Measurement Manager module.
* @param frameType The frame type.
* @param dataLen The length of the frame.
* @param pData A pointer to the frame's content.
*
* @date 16-Dec-2005
*/
TI_STATUS measurementMgr_receiveFrameRequest(TI_HANDLE hMeasurementMgr,
EMeasurementFrameType frameType,
TI_INT32 dataLen,
TI_UINT8 * pData)
{
measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) hMeasurementMgr;
TMeasurementFrameRequest * frame = &(pMeasurementMgr->newFrameRequest);
TI_UINT16 currentFrameToken;
/* checking if measurement is enabled */
if (pMeasurementMgr->Mode == MSR_MODE_NONE)
return TI_NOK;
/* ignore broadcast/multicast request if unicast request is active */
if (frameType != MSR_FRAME_TYPE_UNICAST && pMeasurementMgr->currentFrameType == MSR_FRAME_TYPE_UNICAST)
{
return TI_NOK;
}
/* ignore broadcast request if multicast request is active */
if (frameType == MSR_FRAME_TYPE_BROADCAST && pMeasurementMgr->currentFrameType == MSR_FRAME_TYPE_MULTICAST)
{
return TI_NOK;
}
/* Parsing the Frame Request Header */
pMeasurementMgr->parserFrameReq(hMeasurementMgr, pData, dataLen,
frame);
frame->frameType = frameType;
/* checking if the received token frame is the same as the one that is being processed */
if ((requestHandler_getFrameToken(pMeasurementMgr->hRequestH, ¤tFrameToken) == TI_OK)
&& (currentFrameToken == frame->hdr->dialogToken))
{
os_memoryZero(pMeasurementMgr->hOs, &pMeasurementMgr->newFrameRequest,
sizeof(TMeasurementFrameRequest));
return TI_NOK;
}
/* Frame is Received for processing */
return measurementMgrSM_event((TI_UINT8 *) &(pMeasurementMgr->currentState),
MEASUREMENTMGR_EVENT_FRAME_RECV, pMeasurementMgr);
}
示例6: 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;
}
示例7: cmdMbox_Create
/*
* \brief Create the mailbox object
*
* \param hOs - OS module object handle
* \return Handle to the created object
*
* \par Description
* Calling this function creates a CmdMbox object
*
* \sa cmdMbox_Destroy
*/
TI_HANDLE cmdMbox_Create (TI_HANDLE hOs)
{
TCmdMbox *pCmdMbox;
pCmdMbox = os_memoryAlloc (hOs, sizeof (TCmdMbox));
if (pCmdMbox == NULL)
{
WLAN_OS_REPORT (("FATAL ERROR: cmdMbox_Create(): Error Creating CmdMbox - Aborting\n"));
return NULL;
}
/* reset control module control block */
os_memoryZero (hOs, pCmdMbox, sizeof (TCmdMbox));
pCmdMbox->hOs = hOs;
return pCmdMbox;
}
示例8: txDataQ_ResetQueueStatistics
/**
* \fn txDataQ_ResetQueueStatistics
* \brief Reset queues statistics
*
* Reset queues statistics
*
* \note
* \param hTxDataQ - The object
* \return void
* \sa
*/
void txDataQ_ResetQueueStatistics (TI_HANDLE hTxDataQ)
{
TTxDataQ *pTxDataQ = (TTxDataQ *)hTxDataQ;
TDataLinkQ *pLinkQ;
TI_UINT32 uHlid;
/*
* init all queues in all links
*/
for (uHlid = 0; uHlid < WLANLINKS_MAX_LINKS; uHlid++)
{
pLinkQ = &pTxDataQ->aDataLinkQ[uHlid]; /* Link queues */
os_memoryZero(pTxDataQ->hOs, &pLinkQ->aQueueCounters, sizeof(pLinkQ->aQueueCounters));
}
pTxDataQ->uTxSendPaceTimeoutsCount = 0;
}
示例9: 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);
}
示例10: buildQosNullDataTemplate
/************************************************************************
* buildQosNullDataTemplate *
************************************************************************
DESCRIPTION: This function build a qos null data template
performs the following:
- Build a template & set the template len, the template type is set in the site mgr
INPUT: pSiteMgr - Handle to site manager
pTemplate - Pointer to the template structure
pSsid - Desired SSID
OUTPUT:
RETURN: TI_OK
************************************************************************/
TI_STATUS buildQosNullDataTemplate(siteMgr_t * pSiteMgr,
TSetTemplate * pTemplate,
TI_UINT8 userPriority)
{
paramInfo_t param;
TI_UINT32 size;
QosNullDataTemplate_t *pBuffer =
(QosNullDataTemplate_t *) pTemplate->ptr;
siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
TI_UINT16 fc;
TI_UINT16 qosControl;
os_memoryZero(pSiteMgr->hOs, pBuffer, sizeof(QosNullDataTemplate_t));
/*
* Header First
*/
/* Set destination address */
if (pPrimarySite) {
MAC_COPY(pBuffer->hdr.address1, pPrimarySite->bssid);
/* Set BSSID address */
MAC_COPY(pBuffer->hdr.address3, pPrimarySite->bssid);
} else {
TRACE0(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION,
"No Primary site so cannot fill QosNullData template\n");
}
/* Build Source address */
param.paramType = CTRL_DATA_MAC_ADDRESS;
ctrlData_getParam(pSiteMgr->hCtrlData, ¶m);
MAC_COPY(pBuffer->hdr.address2, param.content.ctrlDataDeviceMacAddress);
fc = DOT11_FC_DATA_NULL_QOS | (1 << DOT11_FC_TO_DS_SHIFT);
COPY_WLAN_WORD(&pBuffer->hdr.fc, &fc); /* copy with endianess handling. */
qosControl = (TI_UINT16) userPriority;
qosControl <<= QOS_CONTROL_UP_SHIFT;
COPY_WLAN_WORD(&pBuffer->hdr.qosControl, &qosControl); /* copy with endianess handling. */
size = WLAN_QOS_HDR_LEN;
pTemplate->len = size;
return TI_OK;
}
示例11: 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);
}
示例12: 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;
}
示例13: 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;
}
示例14: measurementSRVHandleNoiseHistogramComplete
/**
* \\n
* \date 15-November-2005\n
* \brief Handles a noise histogram timer expiry, by requesting noise histogram
* reaults from the FW.\n
*
* Function Scope \e Private.\n
* \param hMeasurementSRV - handle to the measurement SRV object.\n
* \param requestIndex - index of the beacon request in the request structure.\n
*/
void measurementSRVHandleNoiseHistogramComplete( TI_HANDLE hMeasurementSRV, TI_INT32 requestIndex )
{
measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
TTwdParamInfo tTwdParam;
TNoiseHistogram pNoiseHistParams;
TI_STATUS status;
/* Set Noise Histogram Cmd Params */
pNoiseHistParams.cmd = STOP_NOISE_HIST;
pNoiseHistParams.sampleInterval = 0;
os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[0]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );
/* Send a Stop command to the FW */
status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);
if ( TI_OK != status )
{
/* mark that the specific measurment type has failed */
pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
/* if all measurement types has finished, an event will be send by request timer expired */
}
/* Get measurement results */
tTwdParam.paramType = TWD_NOISE_HISTOGRAM_PARAM_ID;
tTwdParam.content.interogateCmdCBParams.fCb = (void *)MacServices_measurementSRV_noiseHistCallBack;
tTwdParam.content.interogateCmdCBParams.hCb = hMeasurementSRV;
tTwdParam.content.interogateCmdCBParams.pCb = (TI_UINT8*)&pMeasurementSRV->noiseHistogramResults;
status = cmdBld_GetParam (pMeasurementSRV->hCmdBld, &tTwdParam);
if ( TI_OK == status )
{
/* setting On the Waitng for Noise Histogram Results Bit */
pMeasurementSRV->pendingParamCBs |= MSR_SRV_WAITING_NOISE_HIST_RESULTS;
}
else
{
/* mark that the specific measurment type has failed */
pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
/* if all measurement types has finished, an event will be send by request timer expired */
}
}
示例15: keyDeriveAes_derive
TI_STATUS keyDeriveAes_derive(struct _keyDerive_t *pKeyDerive, encodedKeyMaterial_t *pEncodedKey)
{
TI_STATUS status;
TSecurityKeys key;
keyMaterialAes_t *keyMaterialAes = NULL;
/* Small verification */
if ((pEncodedKey==NULL) || (pKeyDerive == NULL))
{
return TI_NOK;
}
/* Note: Reduce 2 bytes from the size of keyMaterialAes_t in the following check,
because it is added as padding at the end due to the OS_PACKED removal. */
if ( pEncodedKey->keyLen < (sizeof(keyMaterialAes_t) - 2) )
{
TRACE1(pKeyDerive->hReport, REPORT_SEVERITY_ERROR, "KEY_DERIVE_AES: ERROR: wrong key length %d !!!\n", pEncodedKey->keyLen);
return TI_NOK;
}
keyMaterialAes = (keyMaterialAes_t*)pEncodedKey->pData;
/* Fill security key structure */
os_memoryZero(pKeyDerive->hOs, &key, sizeof(TSecurityKeys));
key.keyType = KEY_AES;
key.keyIndex = (TI_UINT8)pEncodedKey->keyId;
key.encLen = DERIVE_AES_KEY_LEN;
os_memoryCopy(pKeyDerive->hOs, (void *)key.encKey, pEncodedKey->pData + MAC_ADDR_LEN+KEY_RSC_LEN,
DERIVE_AES_KEY_LEN);
/* Copy MAC address key */
MAC_COPY (key.macAddress, keyMaterialAes->macAddress);
/* Copy RSC */
os_memoryCopy(pKeyDerive->hOs, (void *)key.keyRsc, (void *)keyMaterialAes->keyRSC, KEY_RSC_LEN);
status = pKeyDerive->pMainKeys->setKey(pKeyDerive->pMainKeys, &key);
if (status == TI_OK)
{
os_memoryCopy(pKeyDerive->hOs, &pKeyDerive->key, pEncodedKey, sizeof(encodedKeyMaterial_t));
}
return status;
}