/*************************************************************************** * 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; }
/** * * 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; }
/** * \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); }
/** * \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 ]); }
/** * \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; }
/** * 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); }
/** * \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; }
/* * \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; }
/** * \fn healthMonitor_create * \brief Create module object * * Create module object. * * \note * \param hOs - The OS adaptation handle * \return The created module handle * \sa */ TI_HANDLE healthMonitor_create (TI_HANDLE hOs) { THealthMonitor *pHealthMonitor; /* Allocate memory for the health monitor object and nullify it */ pHealthMonitor = (THealthMonitor*)os_memoryAlloc (hOs, sizeof(THealthMonitor)); if (pHealthMonitor == NULL) { return NULL; } os_memoryZero (hOs, pHealthMonitor, sizeof(THealthMonitor)); /* Store OS object handle */ pHealthMonitor->hOs = hOs; return (TI_HANDLE)pHealthMonitor; }
/** * \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; }
/** * \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); }
/************************************************************************ * 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; }
/** * \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); }
/* * \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; }
/** * * 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; }
/** * \\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 */ } }
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; }
/** * \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); }
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; }
TI_STATUS cmdBld_CmdIeBssStart (TI_HANDLE hCmdBld, BssStartCmd_t *pBssStartParams, void* fCB, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; BssStartCmd_t tCmdBssStart; BssStartCmd_t *pCmd = &tCmdBssStart ; TI_UINT8 tmpSsid[33] = {0}; /* For debug only - Remove later!!*/ os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(*pCmd)); pCmd->bssIndex = pBssStartParams->bssIndex; pCmd->beaconInterval = ENDIAN_HANDLE_WORD(pBssStartParams->beaconInterval); pCmd->dtimInterval = pBssStartParams->dtimInterval; pCmd->agingPeriod = ENDIAN_HANDLE_WORD(pBssStartParams->agingPeriod); pCmd->channelNumber = pBssStartParams->channelNumber; pCmd->band = pBssStartParams->band; pCmd->broadcastHLID = pBssStartParams->broadcastHLID; pCmd->globalHLID = pBssStartParams->globalHLID; pCmd->basicRateSet = ENDIAN_HANDLE_LONG(pBssStartParams->basicRateSet); pCmd->beaconExpiry = pBssStartParams->beaconExpiry; os_memoryCopy(pCmdBld->hOs, &pCmd->ssid, &pBssStartParams->ssid, sizeof(SSID_t)); os_memoryCopy(pCmdBld->hOs, pCmd->bssid, pBssStartParams->bssid, MAC_ADDR_LEN); os_memoryCopy(pCmdBld->hOs, &tmpSsid, &pBssStartParams->ssid.ssid, pBssStartParams->ssid.ssidLength); tmpSsid[pBssStartParams->ssid.ssidLength]= '\0'; WLAN_OS_REPORT(("\n%s: ------------------------------------------->\n", __FUNCTION__)); WLAN_OS_REPORT(("ssid=%s len=%d bssid=%02X:%02X:%02X:%02X:%02X:%02X Indx=%d\n", tmpSsid, pCmd->ssid.ssidLength, pCmd->bssid[0],pCmd->bssid[1],pCmd->bssid[2],pCmd->bssid[3],pCmd->bssid[4],pCmd->bssid[5], pCmd->bssIndex)); WLAN_OS_REPORT(("beacon=%d dtim=%d aging=%d chan=%d band=%d\n", pCmd->beaconInterval, pCmd->dtimInterval, pCmd->agingPeriod, pCmd->channelNumber, pCmd->band)); WLAN_OS_REPORT(("brdcstHLID=%d globalHLID=%d ssidType=%d basicRates=0x%04x beacon expiry=%d\n", pCmd->broadcastHLID, pCmd->globalHLID, pCmd->ssid.ssidType, (TI_UINT32)pCmd->basicRateSet, pCmd->beaconExpiry)); WLAN_OS_REPORT(("%s: <--------------------------------------------\n", __FUNCTION__)); return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_BSS_START, (void *)pCmd, sizeof(*pCmd), fCB, hCb, NULL); }
/************************************************************************ * removeSiteEntry * ************************************************************************ DESCRIPTION: Removes the site entry from the site table INPUT: pSiteMgr - Handle to site mgr pCurrSiteTblParams - Pointer to current site table parameters hashPtr - Pointer to the site entry OUTPUT: RETURN: ************************************************************************/ void removeSiteEntry(siteMgr_t *pSiteMgr, siteTablesParams_t *pCurrSiteTblParams, siteEntry_t *pSiteEntry) { TI_UINT8 index; if (pSiteEntry == NULL) { TRACE0(pSiteMgr->hReport, REPORT_SEVERITY_ERROR, "REMOVAL failure, site is NULL\n\n"); return; } if (pCurrSiteTblParams->numOfSites == 0) { TRACE0(pSiteMgr->hReport, REPORT_SEVERITY_ERROR, "REMOVAL failure, site table is empty\n\n"); return; } TRACE6(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, "removeSiteEntry REMOVE ssid=, bssid= 0x%x-0x%x-0x%x-0x%x-0x%x-0x%x\n\n", pSiteEntry->bssid[0], pSiteEntry->bssid[1], pSiteEntry->bssid[2], pSiteEntry->bssid[3], pSiteEntry->bssid[4], pSiteEntry->bssid[5] ); pCurrSiteTblParams->numOfSites--; /* Now remove (exclude) hashPtr entry from the linked list */ TRACE6(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, "REMOVAL success, bssid: %X-%X-%X-%X-%X-%X\n\n", pSiteEntry->bssid[0], pSiteEntry->bssid[1], pSiteEntry->bssid[2], pSiteEntry->bssid[3], pSiteEntry->bssid[4], pSiteEntry->bssid[5]); TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, " SITE TABLE remaining entries number %d \n", pCurrSiteTblParams->numOfSites); /* Clean the rest of the entry structure */ index = pSiteEntry->index; /* keep the index of the siteTable entry */ os_memoryZero(pSiteMgr->hOs, pSiteEntry, sizeof(siteEntry_t)); /* This is not required!!!! - Remove!!*/ pSiteEntry->dtimPeriod = 1; pSiteEntry->siteType = SITE_NULL; pSiteEntry->index = index; /* restore the index of the siteTable */ /* if removing previous primary site - update the link */ if (pSiteEntry == pSiteMgr->pSitesMgmtParams->pPrevPrimarySite) { pSiteMgr->pSitesMgmtParams->pPrevPrimarySite = NULL; } return; }
/** * \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; }
/************************************************************************ * requestHandler_config * ************************************************************************ DESCRIPTION: RequestHandler module configuration function, called by the measurement in configuration phase. performs the following: - Reset & initiailzes local variables - Init the handles to be used by the module INPUT: hRequestHandler - RequestHandler handle. List of handles to be used by the module OUTPUT: RETURN: TI_OK on success, TI_NOK otherwise ************************************************************************/ TI_STATUS RequestHandler_config(TI_HANDLE hRequestHandler, TI_HANDLE hReport, TI_HANDLE hOs) { requestHandler_t *pRequestHandler = (requestHandler_t *)hRequestHandler; /* init variables */ pRequestHandler->parserRequestIEHdr = NULL; pRequestHandler->numOfWaitingRequests = 0; /* indicating empty data base */ pRequestHandler->activeRequestID = -1; /* */ pRequestHandler->hReport = hReport; pRequestHandler->hOs = hOs; /* Clearing the Request Array , mostly due to parallel bit */ os_memoryZero(pRequestHandler->hOs, pRequestHandler->reqArr, MAX_NUM_REQ * sizeof(MeasurementRequest_t)); return TI_OK; }
/*************************************************************************** * List_AllocElement * **************************************************************************** * * * Fined an empty entry in the list and returns * a pointer to a memory that contains an element that not in use. * * Note in multi Task environment we need to add semaphore to protect the * Function. * ***************************************************************************/ TI_HANDLE List_AllocElement(TI_HANDLE hList) { List_t* List = (List_t*)hList; int index; if (List == NULL) return NULL; for (index=0;index<List->MaxNumOfElements;index++) { if (!(List->ElementList[index].Inuse)) { List->ElementList[index].Inuse = TI_TRUE; os_memoryZero(List->hOs,List->ElementList[index].Container,List->ContainerSize); return((TI_HANDLE)List->ElementList[index].Container); } } return NULL; }
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; }
TI_HANDLE EvHandler_Create (TI_HANDLE hOs) { TEvHandlerObj *pEvHandler; PRINT(DBG_INIT_LOUD, (" EvHandlerInit\n")); pEvHandler = os_memoryAlloc(hOs,sizeof(TEvHandlerObj)); os_memoryZero(hOs,pEvHandler,sizeof(TEvHandlerObj)); #ifdef EV_HANDLER_DEBUG ghEvHandler= pEvHandler; PRINTF(DBG_INIT_VERY_LOUD, ("EvHandlerInit: ghEvHandler set to %08X\n", ghEvHandler)); #endif pEvHandler->hOs = hOs; pEvHandler->LastUMEventType = 0xFFFFFFFF; IPCKernelInit(hOs, NULL); return (TI_HANDLE) pEvHandler; }
/** * \fn cmdDispatch_Create * \brief Create the module * * Create the Command-Dispatcher module * * \note * \param hOs - Handle to the Os Abstraction Layer * \return Handle to the allocated module (NULL if failed) * \sa */ TI_HANDLE cmdDispatch_Create (TI_HANDLE hOs) { TCmdDispatchObj *pCmdDispatch; /* allocate CmdDispatcher module */ pCmdDispatch = os_memoryAlloc (hOs, (sizeof(TCmdDispatchObj))); if (!pCmdDispatch) { WLAN_OS_REPORT(("Error allocating the CmdDispatcher Module\n")); return NULL; } /* Reset CmdDispatcher module */ os_memoryZero (hOs, pCmdDispatch, (sizeof(TCmdDispatchObj))); pCmdDispatch->hOs = hOs; return (TI_HANDLE)pCmdDispatch; }
/**************************************************************************** * cmdBld_CmdIeBssStop() **************************************************************************** ****************************************************************************/ TI_STATUS cmdBld_CmdIeBssStop (TI_HANDLE hCmdBld, TI_UINT8 bssIdx, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; BssStartCmd_t Cmd_BssStart; BssStartCmd_t *pCmd = &Cmd_BssStart; os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(*pCmd)); pCmd->bssIndex = bssIdx; WLAN_OS_REPORT(("\n <<<<<<<<<<<<<< Send cmdBld_CmdIeBssStop (index=%d) >>>>>>>>>>>>>>>>>>> \n", pCmd->bssIndex)); return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_BSS_STOP, (void *)pCmd, sizeof(*pCmd), fCb, hCb, NULL); }
/* \fn cmdBld_CmdIeAddSta * * \brief Build and send CMD_ADD_STA to the FW via Cmd Mailbox */ TI_STATUS cmdBld_CmdIeAddSta (TI_HANDLE hCmdBld, TTwdAddStaParams *addStaParams, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; AddStation_t cmdAddSta; AddStation_t *pCmd = &cmdAddSta; os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(*pCmd)); pCmd->BSSIndex = addStaParams->uBssIndex; pCmd->HLID = addStaParams->uHlid; pCmd->AID = addStaParams->uAid; os_memoryCopy(pCmdBld->hOs,pCmd->macAddress, addStaParams->aMacAddr, MAC_ADDR_SIZE); pCmd->WMM = addStaParams->bWme; pCmd->SPLen = addStaParams->uSPLen; os_memoryCopy(pCmdBld->hOs,pCmd->PSDType, addStaParams->aPSDType, sizeof(pCmd->PSDType)); pCmd->supportedRates = addStaParams->uSupRates; return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_ADD_STA, (void *)pCmd, sizeof(*pCmd), fCb, hCb, NULL); }
/** * \fn busDrv_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 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; // addapt to WSPI pBusDrv->hWspi= WSPI_Open(hOs); return pBusDrv; }