/drivers/net/wireless/tiwlan1251/common/src/core/sme/siteMgr/siteMgr.c
C | 5078 lines | 3114 code | 869 blank | 1095 comment | 612 complexity | fc5aa5f93c7269c70b6e0b8c26ae5906 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
Large files files are truncated, but you can click here to view the full file
- /****************************************************************************
- **+-----------------------------------------------------------------------+**
- **| |**
- **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |**
- **| All rights reserved. |**
- **| |**
- **| Redistribution and use in source and binary forms, with or without |**
- **| modification, are permitted provided that the following conditions |**
- **| are met: |**
- **| |**
- **| * Redistributions of source code must retain the above copyright |**
- **| notice, this list of conditions and the following disclaimer. |**
- **| * Redistributions in binary form must reproduce the above copyright |**
- **| notice, this list of conditions and the following disclaimer in |**
- **| the documentation and/or other materials provided with the |**
- **| distribution. |**
- **| * Neither the name Texas Instruments nor the names of its |**
- **| contributors may be used to endorse or promote products derived |**
- **| from this software without specific prior written permission. |**
- **| |**
- **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |**
- **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |**
- **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
- **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |**
- **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
- **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |**
- **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
- **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
- **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |**
- **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
- **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |**
- **| |**
- **+-----------------------------------------------------------------------+**
- ****************************************************************************/
- /** \file siteMgr.c
- * \brief Site Manager implementation
- *
- * \see siteMgr.h
- */
- #include "report.h"
- #include "osTIType.h"
- #include "osApi.h"
- #include "siteMgrApi.h"
- #include "siteHash.h"
- #include "smeApi.h"
- #include "utils.h"
- #include "connApi.h"
- #include "mlmeSm.h"
- #include "smeSmApi.h"
- #include "DataCtrl_Api.h"
- #include "regulatoryDomainApi.h"
- #include "rsnApi.h"
- #include "measurementMgrApi.h"
- #include "qosMngr_API.h"
- #include "PowerMgr_API.h"
- #include "EvHandler.h"
- #include "TI_IPC_Api.h"
- #include "MacServices_api.h"
- #include "whalHwDefs.h"
- #include "apConn.h"
- #include "currBss.h"
- #include "PowerMgr.h"
- #ifdef EXC_MODULE_INCLUDED
- #include "excMngr.h"
- #endif
- #include "configMgr.h"
- /* definitions */
- #define JOIN_RATE_MASK_1M 0x01
- #define JOIN_RATE_MASK_2M 0x02
- #define JOIN_RATE_MASK_5_5M 0x04
- #define JOIN_RATE_MASK_11M 0x08
- #define JOIN_RATE_MASK_22M 0x10
- #define SITE_MGR_INIT_BIT 1
- #define TIMER_INIT_BIT 2
- #define DESIRED_PARAMS_INIT_BIT 3
- #define MGMT_PARAMS_INIT_BIT 4
- #define BUILT_IN_TEST_PERIOD 500
- #define KEEP_ALIVE_SEND_NULL_DATA_PERIOD 10000
- #define SITE_MGR_IBSS_AGING_TIMEOUT_DEF 10 * 1000 /* 10 seconds */
- #define DEAFULT_BEACON_FILTERING_NUM (10)
- /* Reconfig constants */
- #define SCAN_FAIL_THRESHOLD_FOR_RECONFIG 4 /* After 4 times we reset the 580 register and still no AP found - make recovery */
- #define SCAN_FAIL_THRESHOLD_FOR_RESET_REG_580 90 /* After 90 times (45 seconds) and no AP found - reset the 580 register */
- #define SCAN_FAIL_RECONFIG_ENABLED TRUE
- #define SCAN_FAIL_RECONFIG_DISABLED FALSE
- /* Local Macros */
- #define UPDATE_BEACON_INTERVAL(pSite, pFrameInfo) pSite->beaconInterval = pFrameInfo->content.iePacket.beaconInerval
- #define UPDATE_CAPABILITIES(pSite, pFrameInfo) pSite->capabilities = pFrameInfo->content.iePacket.capabilities
- #define UPDATE_PRIVACY(pSite, pFrameInfo) pSite->privacy = ((pFrameInfo->content.iePacket.capabilities >> CAP_PRIVACY_SHIFT) & CAP_PRIVACY_MASK) ? TRUE : FALSE
- #define UPDATE_AGILITY(pSite, pFrameInfo) pSite->agility = ((pFrameInfo->content.iePacket.capabilities >> CAP_AGILE_SHIFT) & CAP_AGILE_MASK) ? TRUE : FALSE
- #define UPDATE_SLOT_TIME(pSite, pFrameInfo) pSite->newSlotTime = ((pFrameInfo->content.iePacket.capabilities >> CAP_SLOT_TIME_SHIFT) & CAP_SLOT_TIME_MASK) ? PHY_SLOT_TIME_SHORT : PHY_SLOT_TIME_LONG
- #define UPDATE_PROTECTION(pSite, pFrameInfo) pSite->useProtection = (pFrameInfo->content.iePacket.useProtection)
- #define UPDATE_SSID(pSite, pFrameInfo) if (pFrameInfo->content.iePacket.pSsid != NULL) { \
- pSite->ssid.len = pFrameInfo->content.iePacket.pSsid->hdr.eleLen; \
- os_memoryCopy(pSiteMgr->hOs, (void *)pSite->ssid.ssidString, (void *)pFrameInfo->content.iePacket.pSsid->serviceSetId, pFrameInfo->content.iePacket.pSsid->hdr.eleLen) ;}
- #define UPDATE_CHANNEL(pSite, pFrameInfo, rxChannel) if (pFrameInfo->content.iePacket.pDSParamsSet == NULL) \
- pSite->channel = rxChannel; \
- else \
- pSite->channel = pFrameInfo->content.iePacket.pDSParamsSet->currChannel;
- #define UPDATE_DTIM_PERIOD(pSite, pFrameInfo) if (pFrameInfo->content.iePacket.pTIM != NULL) \
- pSite->dtimPeriod = pFrameInfo->content.iePacket.pTIM->dtimPeriod
- #define UPDATE_ATIM_WINDOW(pSite, pFrameInfo) if (pFrameInfo->content.iePacket.pIBSSParamsSet != NULL) \
- pSite->atimWindow = pFrameInfo->content.iePacket.pIBSSParamsSet->atimWindow
- #define UPDATE_BEACON_AP_TX_POWER(pSite, pFrameInfo) if (pFrameInfo->content.iePacket.TPCReport != NULL) \
- pSite->APTxPower = pFrameInfo->content.iePacket.TPCReport->transmitPower
- #define UPDATE_PROBE_AP_TX_POWER(pSite, pFrameInfo) if (pFrameInfo->content.iePacket.TPCReport != NULL) \
- pSite->APTxPower = pFrameInfo->content.iePacket.TPCReport->transmitPower
- #define UPDATE_BSS_TYPE(pSite, pFrameInfo) pSite->bssType = ((pFrameInfo->content.iePacket.capabilities >> CAP_ESS_SHIFT) & CAP_ESS_MASK) ? BSS_INFRASTRUCTURE : BSS_INDEPENDENT
- #define UPDATE_LOCAL_TIME_STAMP(pSiteMgr, pSite, pFrameInfo) pSite->localTimeStamp = os_timeStampMs(pSiteMgr->hOs)
- #define UPDATE_DTIM_TIME(pSiteMgr, pSite, pFrameInfo) pSite->dtimTimeStamp = os_timeStampMs(pSiteMgr->hOs)
- /* Updated from beacons */
- #define UPDATE_BEACON_MODULATION(pSite, pFrameInfo) pSite->beaconModulation = ((pFrameInfo->content.iePacket.capabilities >> CAP_PBCC_SHIFT) & CAP_PBCC_MASK) ? DRV_MODULATION_PBCC : DRV_MODULATION_CCK
- /* Updated from probes */
- #define UPDATE_PROBE_MODULATION(pSite, pFrameInfo) pSite->probeModulation = ((pFrameInfo->content.iePacket.capabilities >> CAP_PBCC_SHIFT) & CAP_PBCC_MASK) ? DRV_MODULATION_PBCC : DRV_MODULATION_CCK
- #define UPDATE_BEACON_RECV(pSite) pSite->beaconRecv = TRUE
- #define UPDATE_PROBE_RECV(pSite) pSite->probeRecv = TRUE
- #define UPDATE_RSN_IE(pSite, pRsnIe, rsnIeLen) if (pRsnIe != NULL) { \
- UINT8 length=0, index=0;\
- pSite->rsnIeLen = rsnIeLen;\
- while ((length < pSite->rsnIeLen) && (index<MAX_RSN_IE)){\
- pSite->pRsnIe[index].hdr = pRsnIe->hdr;\
- os_memoryCopy(pSiteMgr->hOs, (void *)pSite->pRsnIe[index].rsnIeData, (void *)pRsnIe->rsnIeData, pRsnIe->hdr.eleLen);\
- length += (pRsnIe->hdr.eleLen+2); \
- pRsnIe += 1; \
- index++;}\
- } \
- else {pSite->rsnIeLen = 0;}
- #define UPDATE_BEACON_TIMESTAMP(pSiteMgr, pSite, pFrameInfo) os_memoryCopy(pSiteMgr->hOs, pSite->tsfTimeStamp, (void *)pFrameInfo->content.iePacket.timestamp, TIME_STAMP_LEN)
- #define SET_ENTRY_FLAG_IN_SITE_TABLE(pSite) pSite->Not_Received = 0
- /* Local functions definitions*/
- static void update_apsd(siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static void release_module(siteMgr_t *pSiteMgr, UINT32 initVec);
- static void updateSiteInfo(siteMgr_t *pSiteMgr, mlmeFrameInfo_t *pFrameInfo, siteEntry_t *pSite, UINT8 rxChannel);
- static void updateRates(siteMgr_t *pSiteMgr, siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static void updateBeaconQosParams(siteMgr_t *pSiteMgr, siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static void updateProbeQosParams(siteMgr_t *pSiteMgr, siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static void updatePreamble(siteMgr_t *pSiteMgr, siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static void updateFourX(siteMgr_t *pSiteMgr, siteEntry_t *pSite, mlmeFrameInfo_t *pFrameInfo);
- static TI_STATUS getBssidList(siteMgr_t *pSiteMgr, OS_802_11_BSSID_LIST_EX *bssidList, UINT32* pLength, BOOL allVarIes);
- static void getPrimarySiteDesc(siteMgr_t *pSiteMgr, OS_802_11_BSSID *pPrimarySiteDesc, BOOL supplyExtendedInfo);
- static TI_STATUS getPrimaryBssid(siteMgr_t *pSiteMgr, OS_802_11_BSSID_EX *primaryBssid, UINT32 *pLength);
- static rate_e translateRateMaskToValue(siteMgr_t *pSiteMgr, UINT32 rateMask);
- static void getSupportedRateSet(siteMgr_t *pSiteMgr, rates_t *pRatesSet);
- static TI_STATUS setSupportedRateSet(siteMgr_t *pSiteMgr, rates_t *pRatesSet);
- static void validateDesiredTxRate(rate_e desiredTxRate,modulationType_e desiredModulation,UINT32 suppRates,UINT32 *bitMap,BOOL *txDesiredRateSupported);
- static TI_STATUS calculateBssidListSize(siteMgr_t *pSiteMgr, UINT32 *pLength, BOOL allVarIes);
- static void siteMgr_externalConfigurationParametersSet(TI_HANDLE hSiteMgr);
- void siteMgr_gotFirstBcn(TI_HANDLE hSiteMgr);
- /**************************************************************/
- /* DEBUG CLI CRASH */
- /**************************************************************/
- static whalCtrl_joinBss_t joinParams;
- static whalCtrl_setTemplate_t templateStruct;
- static probeRspTemplate_t probeRspTemplate;
- static nullDataTemplate_t nullDataTemplate;
- static psPollTemplate_t psPollTemplate;
- static QosNullDataTemplate_t QosNullDataTemplate;
- /**************************************************************/
- #define CHAN_FREQ_TABLE_SIZE (sizeof(ChanFreq) / sizeof(struct CHAN_FREQ))
- struct CHAN_FREQ {
- UINT8 chan;
- UINT32 freq;
- } ChanFreq[] = {
- {1,2412000}, {2,2417000}, {3,2422000}, {4,2427000},
- {5,2432000}, {6,2437000}, {7,2442000}, {8,2447000},
- {9,2452000},
- {10,2457000}, {11,2462000}, {12,2467000}, {13,2472000},
- {14,2484000}, {36,5180000}, {40,5200000}, {44,5220000},
- {48,5240000}, {52,5260000}, {56,5280000}, {60,5300000},
- {64,5320000},
- {100,5500000}, {104,5520000}, {108,5540000}, {112,5560000},
- {116,5580000}, {120,5600000}, {124,5620000}, {128,5640000},
- {132,5660000}, {136,5680000}, {140,5700000}, {149,5745000},
- {153,5765000}, {157,5785000}, {161,5805000} };
- static UINT8 Freq2Chan(UINT32 freq)
- {
- UINT32 i;
- for(i=0; i<CHAN_FREQ_TABLE_SIZE; i++)
- if(ChanFreq[i].freq == freq) return ChanFreq[i].chan;
- return 0;
- }
- static UINT32 Chan2Freq(UINT8 chan)
- {
- UINT32 i;
- for(i=0; i<CHAN_FREQ_TABLE_SIZE; i++)
- if(ChanFreq[i].chan == chan) return ChanFreq[i].freq;
- return 0;
- }
- /************************************************************************
- * siteMgr_setTemporaryTxPower *
- *************************************************************************
- DESCRIPTION: This function is used to start the Tx Power Control adjust mechanism
- in regulatoryDomain.
- INPUT: bActivateTempFix - Whether the power should be adjusted
- ************************************************************************/
- void siteMgr_setTemporaryTxPower(siteMgr_t* pSiteMgr, BOOL bActivateTempFix)
- {
- paramInfo_t param;
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("siteMgr_setTemporaryTxPower is = %s \n", (bActivateTempFix ? "ON" : "OFF")));
- /* Set the temporary Power Level via the Regulatory Domain*/
- param.paramType = REGULATORY_DOMAIN_TEMPORARY_TX_ATTENUATION_PARAM;
- param.content.bActivateTempPowerFix = bActivateTempFix;
- regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,¶m);
- }
- /* Interface functions Implementation */
- /*static void UPDATE_RSN_IE (siteMgr_t* pSiteMgr, siteEntry_t *pSite, dot11_RSN_t *pRsnIe, UINT8 rsnIeLen)
- {
- if (pRsnIe != NULL) {
- UINT8 length=0, index=0;
- pSite->rsnIeLen = rsnIeLen;
- while ((length < pSite->rsnIeLen) && (index<MAX_RSN_IE)){
- pSite->pRsnIe[index].hdr = pRsnIe->hdr;
- os_memoryCopy(pSiteMgr->hOs, pSite->pRsnIe[index].rsnIeData, pRsnIe->rsnIeData, pRsnIe->hdr.eleLen);
- length += (pRsnIe->hdr.eleLen+2);
- pRsnIe += 1;
- index++;}
- }
- else {pSite->rsnIeLen = 0;}
- }*/
- /************************************************************************
- * siteMgr_create *
- ************************************************************************
- DESCRIPTION: Site manager module creation function, called by the config mgr in creation phase
- performs the following:
- - Allocate the site manager handle
- - Allocate the desired & mgmt params structure
- INPUT: hOs - Handle to OS
- OUTPUT:
- RETURN: Handle to the site manager module on success, NULL otherwise
- ************************************************************************/
- TI_HANDLE siteMgr_create(TI_HANDLE hOs)
- {
- siteMgr_t *pSiteMgr;
- UINT32 initVec;
- initVec = 0;
- pSiteMgr = os_memoryAlloc(hOs, sizeof(siteMgr_t));
- if (pSiteMgr == NULL)
- return NULL;
- os_memoryZero(hOs, pSiteMgr, sizeof(siteMgr_t));
- initVec |= (1 << SITE_MGR_INIT_BIT);
- pSiteMgr->pDesiredParams = os_memoryAlloc(hOs, sizeof(siteMgrInitParams_t));
- if (pSiteMgr->pDesiredParams == NULL)
- {
- release_module(pSiteMgr, initVec);
- return NULL;
- }
- initVec |= (1 << DESIRED_PARAMS_INIT_BIT);
- pSiteMgr->pSitesMgmtParams = os_memoryAlloc(hOs, sizeof(sitesMgmtParams_t));
- if (pSiteMgr->pSitesMgmtParams == NULL)
- {
- release_module(pSiteMgr, initVec);
- return NULL;
- }
- initVec |= (1 << MGMT_PARAMS_INIT_BIT);
- pSiteMgr->hOs = hOs;
- return(pSiteMgr);
- }
- /************************************************************************
- * siteMgr_config *
- ************************************************************************
- DESCRIPTION: Site manager module configuration function, called by the config mgr in configuration phase
- performs the following:
- - Reset & initiailzes local variables
- - Init the handles to be used by the module
- INPUT: hSiteMgr - site manager handle
- List of handles to be used by the module
- pSiteMgrInitParams - Init table of the module, contains the following:
- - Parameters read from registry
- - Chip parameters
- OUTPUT:
- RETURN: OK on success, NOK otherwise
- ************************************************************************/
- TI_STATUS siteMgr_config( TI_HANDLE hSiteMgr,
- TI_HANDLE hConn,
- TI_HANDLE hSmeSm,
- TI_HANDLE hCtrlData,
- TI_HANDLE hRxData,
- TI_HANDLE hTxData,
- TI_HANDLE hRsn,
- TI_HANDLE hAuth,
- TI_HANDLE hAssoc,
- TI_HANDLE hHalCtrl,
- TI_HANDLE hMlmeSm,
- TI_HANDLE hRegulatoryDomain,
- TI_HANDLE hMeasurementMgr,
- TI_HANDLE hApConn,
- TI_HANDLE hCurrBss,
- TI_HANDLE hReport,
- TI_HANDLE hOs ,
- TI_HANDLE hExcMngr,
- TI_HANDLE hQosMngr,
- TI_HANDLE thePowerMgrHandle,
- TI_HANDLE hScr,
- TI_HANDLE hEvHandler,
- TI_HANDLE hMacServices,
- siteMgrInitParams_t *pSiteMgrInitParams)
- {
- siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
- UINT32 timestamp;
- slotTime_e slotTime;
- paramInfo_t saParam;
- TI_STATUS status;
- /* Init handles */
- pSiteMgr->hConn = hConn;
- pSiteMgr->hSmeSm = hSmeSm;
- pSiteMgr->hHalCtrl = hHalCtrl;
- pSiteMgr->hCtrlData = hCtrlData;
- pSiteMgr->hRxData = hRxData;
- pSiteMgr->hTxData = hTxData;
- pSiteMgr->hRsn = hRsn;
- pSiteMgr->hAuth = hAuth;
- pSiteMgr->hAssoc = hAssoc;
- pSiteMgr->hRegulatoryDomain = hRegulatoryDomain;
- pSiteMgr->hMeasurementMgr = hMeasurementMgr;
- pSiteMgr->hReport = hReport;
- pSiteMgr->hOs = hOs;
- pSiteMgr->hMlmeSm = hMlmeSm;
- pSiteMgr->hAssoc = hAssoc;
- pSiteMgr->hReport = hReport;
- pSiteMgr->hExcMngr = hExcMngr;
- pSiteMgr->hApConn = hApConn;
- pSiteMgr->hCurrBss = hCurrBss;
- pSiteMgr->hQosMngr = hQosMngr;
- pSiteMgr->hPowerMgr = thePowerMgrHandle;
- pSiteMgr->hScr = hScr;
- pSiteMgr->hEvHandler = hEvHandler;
- pSiteMgr->hMacServices = hMacServices;
- /* Reset counter for Tx Power Control adjustment */
- pSiteMgr->siteMgrTxPowerCheckTime = 0;
- /* Init desired parameters */
- os_memoryCopy(hOs, pSiteMgr->pDesiredParams, pSiteMgrInitParams, sizeof(siteMgrInitParams_t));
- /* Init Beacon Filter Desired State */
- pSiteMgr->beaconFilterParams.desiredState = pSiteMgrInitParams->beaconFilterParams.desiredState;
- /* Init Beacon Filter numOfStored parameter */
- pSiteMgr->beaconFilterParams.numOfStored = pSiteMgrInitParams->beaconFilterParams.numOfStored;
- /* Init management params */
- pSiteMgr->pSitesMgmtParams->dot11A_sitesTables.maxNumOfSites = MAX_SITES_A_BAND;
- siteMgr_resetSiteTable(pSiteMgr,(siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables);
- pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables.maxNumOfSites = MAX_SITES_BG_BAND;
- siteMgr_resetSiteTable(pSiteMgr,&pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables);
- /* calculate random BSSID for usage in IBSS */
- timestamp = os_timeStampMs(pSiteMgr->hOs);
- os_memoryCopy(pSiteMgr->hOs, (void *)&(pSiteMgr->ibssBssid.addr[0]), ×tamp, sizeof(UINT32));
- pSiteMgr->ibssBssid.addr[0] = 0x00;
- timestamp = os_timeStampMs(pSiteMgr->hOs);
- os_memoryCopy(pSiteMgr->hOs, (void *)&(pSiteMgr->ibssBssid.addr[2]), ×tamp, sizeof(UINT32));
- /* Get the Source MAC address in order to use it for AD-Hoc BSSID, solving Conexant ST issue for WiFi test */
- saParam.paramType = CTRL_DATA_MAC_ADDRESS;
- status = ctrlData_getParam(hCtrlData, &saParam);
- if (status != OK)
- {
- WLAN_OS_REPORT(("\n ERROR !!! : siteMgr_config - Error in getting MAC address\n" ));
- return NOK;
- }
- pSiteMgr->ibssBssid.addr[0] = 0x02;
- pSiteMgr->ibssBssid.addr[1] = saParam.content.ctrlDataDeviceMacAddress.addr[1];
- pSiteMgr->ibssBssid.addr[2] = saParam.content.ctrlDataDeviceMacAddress.addr[2];
- pSiteMgr->keepAliveEnable = pSiteMgrInitParams->siteMgrDesiredkeepAliveEnable;
- pSiteMgr->numOfBeaconFiltering = DEAFULT_BEACON_FILTERING_NUM;
- switch(pSiteMgr->pDesiredParams->siteMgrRadioValues.siteMgr_radioType)
- {
- case MAXIM:
- pSiteMgr->pDesiredParams->siteMgrRadioValues.pSiteMgr_selectedRadioValues =
- &pSiteMgr->pDesiredParams->siteMgrRadioValues.siteMgr_maximRadioValues;
- pSiteMgr->pDesiredParams->siteMgrSupportedBand = RADIO_BAND_2_4_GHZ;
- WLAN_REPORT_INIT(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("MAXIM !!! \n"));
-
- break;
- case RFMD:
- pSiteMgr->pDesiredParams->siteMgrRadioValues.pSiteMgr_selectedRadioValues =
- &pSiteMgr->pDesiredParams->siteMgrRadioValues.siteMgr_rfmdRadioValues;
- pSiteMgr->pDesiredParams->siteMgrSupportedBand = RADIO_BAND_2_4_GHZ;
- WLAN_REPORT_INIT(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("RFMD !!! \n"));
- break;
- case RADIA_BG:
- pSiteMgr->pDesiredParams->siteMgrRadioValues.pSiteMgr_selectedRadioValues =
- &pSiteMgr->pDesiredParams->siteMgrRadioValues.siteMgr_radiaRadioValues;
- pSiteMgr->pDesiredParams->siteMgrSupportedBand = RADIO_BAND_2_4_GHZ;
- WLAN_REPORT_INIT(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("RADIA bg !!! \n"));
- break;
- case RADIA_ABG:
- pSiteMgr->pDesiredParams->siteMgrRadioValues.pSiteMgr_selectedRadioValues =
- &pSiteMgr->pDesiredParams->siteMgrRadioValues.siteMgr_radiaRadioValues;
- pSiteMgr->pDesiredParams->siteMgrSupportedBand = RADIO_BAND_DUAL;
- WLAN_REPORT_INIT(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("RADIA abg !!! \n"));
- break;
- default:
- pSiteMgr->pDesiredParams->siteMgrRadioValues.pSiteMgr_selectedRadioValues = NULL;
- WLAN_REPORT_ERROR(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("!!!.....UnKnown Radio Type !!!\n"));
- }
- pSiteMgr->beaconSentCount = 0;
- pSiteMgr->pDesiredParams->siteMgrDesiredAtimWindow = 0;
- if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE)
- {
- if(pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_DUAL)
- {
- pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- slotTime = pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime;
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- }
- else if(pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_2_4_GHZ)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode = DOT11_G_MODE;
- pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- slotTime = pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime;
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- }
- else
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode = DOT11_A_MODE;
- pSiteMgr->siteMgrOperationalMode = DOT11_A_MODE;
- pSiteMgr->radioBand = RADIO_BAND_5_0_GHZ;
- slotTime = PHY_SLOT_TIME_SHORT;
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
- }
- }
- else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_G_MODE)
- {
- slotTime = pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- if((pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_DUAL) ||
- (pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_2_4_GHZ))
- {
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- pSiteMgr->siteMgrOperationalMode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode;
- }
- else
- {
- WLAN_OS_REPORT(("\nERROR !!!.....The radio doesn't support the desired dot11 mode !!! \n"));
- return NOK;
- }
- }
- else if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_B_MODE)
- {
- slotTime = PHY_SLOT_TIME_LONG;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- if((pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_DUAL) ||
- (pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_2_4_GHZ))
- {
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- pSiteMgr->siteMgrOperationalMode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode;
- }
- else
- {
- WLAN_OS_REPORT(("\nERROR !!!.....The radio doesn't support the desired dot11 mode !!! \n"));
- return NOK;
- }
- }
- else
- {
- slotTime = PHY_SLOT_TIME_SHORT;
- pSiteMgr->radioBand = RADIO_BAND_5_0_GHZ;
- if((pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_DUAL) ||
- (pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_5_0_GHZ))
- {
- pSiteMgr->siteMgrOperationalMode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode;
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
- }
- else
- {
- WLAN_OS_REPORT(("\nERROR !!!.....The radio doesn't support the desired dot11 mode !!! \n"));
- return NOK;
- }
- }
- /* configure hal with common core-hal parameters */
- whalCtrl_SetRadioBand(pSiteMgr->hHalCtrl, pSiteMgr->radioBand);
- whalCtrl_SetSlotTime(pSiteMgr->hHalCtrl, slotTime);
- siteMgr_ConfigRate(hSiteMgr);
- WLAN_REPORT_INIT(hReport, SITE_MGR_MODULE_LOG,
- (" SiteMgr - numOfElements = %d IETableSize = %d\n" , pSiteMgrInitParams->beaconFilterParams.numOfElements, pSiteMgrInitParams->beaconFilterParams.IETableSize)) ;
- /*send the table regardless to the state*/
- whalCtrl_SetBeaconFilterIETable(pSiteMgr->hHalCtrl ,(UINT8 *)&(pSiteMgrInitParams->beaconFilterParams.numOfElements), (UINT8 *)&(pSiteMgrInitParams->beaconFilterParams.IETable[0]) , (UINT8 *)&(pSiteMgrInitParams->beaconFilterParams.IETableSize)) ;
- /* At start-up Set the Beacon Filter state as the User required */
- whalCtrl_SetBeaconFiltering(pSiteMgr->hHalCtrl, pSiteMgrInitParams->beaconFilterParams.desiredState, pSiteMgr->beaconFilterParams.numOfStored);
-
- pSiteMgr->pSitesMgmtParams->pPrevPrimarySite = NULL;
- pSiteMgr->powerSaveLdMode = FALSE;
- WLAN_REPORT_INIT(hReport, SITE_MGR_MODULE_LOG, (".....Site manager configured successfully\n"));
- return OK;
- }
- /************************************************************************
- * siteMgr_unLoad *
- ************************************************************************
- DESCRIPTION: site manager module unload function, called by the config mgr in the unlod phase
- performs the following:
- - Free all memory aloocated by the module
- INPUT: hSiteMgr - site mgr handle.
- OUTPUT:
- RETURN: OK on success, NOK otherwise
- ************************************************************************/
- TI_STATUS siteMgr_unLoad(TI_HANDLE hSiteMgr)
- {
- UINT32 initVec;
- siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
- if (!pSiteMgr)
- return OK;
- initVec = 0xFFFF;
- release_module(pSiteMgr, initVec);
- return OK;
- }
- /***********************************************************************
- * siteMgr_setParam
- ***********************************************************************
- DESCRIPTION: site mgr set param function, called by the following:
- - config mgr in order to set a parameter from the OS abstraction layer.
- In this fuction, the site manager OS abstraction layer configures the site manager to the desired params.
- Sometimes it requires a re scan, depending in the parameter type
- INPUT: hSiteMgr - Connection handle.
- pParam - Pointer to the parameter
- OUTPUT:
- RETURN: RE_SCAN_NEEDED if re scan needed, OK on success, NOK on failure
- ************************************************************************/
- TI_STATUS siteMgr_setParam(TI_HANDLE hSiteMgr,
- paramInfo_t *pParam)
- {
- siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
- siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
- OS_802_11_CONFIGURATION *pConfig;
- UINT32 channel;
- slotTime_e slotTime;
- switch(pParam->paramType)
- {
- case SITE_MGR_CONFIGURATION_PARAM:
- pConfig = pParam->content.pSiteMgrConfiguration;
- /* for(channel = 0; channel < SITE_MGR_CHANNEL_MAX+1; channel++)
- {
- if(pConfig->channel == pSiteMgr->pDesiredParams->siteMgrFreq2ChannelTable[channel])
- break;
- }*/
- channel = Freq2Chan(pConfig->Union.channel);
- if(channel == 0 || channel > SITE_MGR_CHANNEL_MAX)
- return PARAM_VALUE_NOT_VALID;
- else
- pConfig->Union.channel = channel;
- if((pSiteMgr->pDesiredParams->siteMgrDesiredChannel != pConfig->Union.channel) ||
- (pSiteMgr->pDesiredParams->siteMgrDesiredChannel != pConfig->Union.channel) ||
- (pSiteMgr->pDesiredParams->siteMgrDesiredAtimWindow != pConfig->ATIMWindow))
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredChannel = (UINT8)pConfig->Union.channel;
- pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval = (UINT16)pConfig->BeaconPeriod;
- pSiteMgr->pDesiredParams->siteMgrDesiredAtimWindow = pConfig->ATIMWindow;
- }
- return OK;
- case SITE_MGR_DESIRED_CHANNEL_PARAM:
- if (pParam->content.siteMgrDesiredChannel > SITE_MGR_CHANNEL_MAX)
- return PARAM_VALUE_NOT_VALID;
- if (pSiteMgr->pDesiredParams->siteMgrDesiredChannel != pParam->content.siteMgrDesiredChannel)
- pSiteMgr->pDesiredParams->siteMgrDesiredChannel = (UINT8)pParam->content.siteMgrDesiredChannel;
- return OK;
- case SITE_MGR_DESIRED_BSSID_PARAM:
- os_memoryCopy(pSiteMgr->hOs, (void *)pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr, (void *)pParam->content.siteMgrDesiredBSSID.addr, sizeof(macAddress_t));
- #if 0
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("Set BSSID = 0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x \n",
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[0],
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[1],
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[2],
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[3],
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[4],
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSID.addr[5]));
- #endif
- return OK;
-
- case SITE_MGR_DESIRED_SSID_PARAM:
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("\nSet new SSID=%s (len=%d) \n",
- pParam->content.siteMgrDesiredSSID.ssidString,
- pParam->content.siteMgrDesiredSSID.len));
- if (pParam->content.siteMgrDesiredSSID.len > MAX_SSID_LEN)
- return PARAM_VALUE_NOT_VALID;
- os_memoryCopy(pSiteMgr->hOs, &pSiteMgr->pDesiredParams->siteMgrDesiredSSID, &pParam->content.siteMgrDesiredSSID, sizeof(ssid_t));
- /* only add null at the end of the string if the string length is less than 32 bytes and so we have one char left
- TODO: another byte must be added, and the alignment change MUST be tested (esp. in CLI commands with ssid_t */
- if ( MAX_SSID_LEN > pSiteMgr->pDesiredParams->siteMgrDesiredSSID.len )
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.ssidString[pSiteMgr->pDesiredParams->siteMgrDesiredSSID.len] = '\0';
- }
- /* increase the random IBSS BSSID calculated during init */
- pSiteMgr->ibssBssid.addr[MAC_ADDR_LEN - 1] ++;
- if (utils_isJunkSSID(&pSiteMgr->pDesiredParams->siteMgrDesiredSSID))
- {
- rsn_removedDefKeys(pSiteMgr->hRsn);
- }
- return RE_SCAN_NEEDED;
- case SITE_MGR_DESIRED_BSS_TYPE_PARAM:
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("\nSet BssType = %d\n", pParam->content.siteMgrDesiredBSSType));
- if (pParam->content.siteMgrDesiredBSSType > BSS_ANY)
- return PARAM_VALUE_NOT_VALID;
- if (pSiteMgr->pDesiredParams->siteMgrDesiredBSSType != pParam->content.siteMgrDesiredBSSType)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredBSSType = pParam->content.siteMgrDesiredBSSType;
- /* If the new BSS type is NOT Ad_Hoc, We make sure that the rate masks are set to G */
- if(pSiteMgr->pDesiredParams->siteMgrDesiredBSSType != BSS_INDEPENDENT)
- {
- pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
- siteMgr_ConfigRate(pSiteMgr);
- }
- /* If the new BSS type is Ad_Hoc, increase the random BSSID calculated during init */
- if(pSiteMgr->pDesiredParams->siteMgrDesiredBSSType == BSS_INDEPENDENT)
- {
- pSiteMgr->ibssBssid.addr[MAC_ADDR_LEN - 1] ++;
- }
- /* go to B_ONLY Mode only if WiFI bit is Set*/
- if (pSiteMgr->pDesiredParams->siteMgrWiFiAdhoc == TRUE)
- { /* Configuration For AdHoc when using external configuration */
- if(pSiteMgr->pDesiredParams->siteMgrExternalConfiguration == FALSE)
- {
- siteMgr_externalConfigurationParametersSet(hSiteMgr);
- }
- }
- }
- return OK;
- case SITE_MGR_DESIRED_MODULATION_TYPE_PARAM:
- if ((pParam->content.siteMgrDesiredModulationType < DRV_MODULATION_CCK) ||
- (pParam->content.siteMgrDesiredModulationType > DRV_MODULATION_OFDM))
- return PARAM_VALUE_NOT_VALID;
- if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType != pParam->content.siteMgrDesiredModulationType)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredModulationType = pParam->content.siteMgrDesiredModulationType;
- /* means that we are moving from non-pbcc network to pbcc */
- if (pParam->content.siteMgrDesiredModulationType == DRV_MODULATION_PBCC)
- return RE_SCAN_NEEDED;
- return OK;
- }
- return OK;
- case SITE_MGR_BEACON_RECV:
- if (!pPrimarySite)
- {
- return NO_SITE_SELECTED_YET;
- }
- pPrimarySite->beaconRecv = pParam->content.siteMgrBeaconRecv;
- return OK;
- case SITE_MGR_DESIRED_BEACON_INTERVAL_PARAM:
- if (pParam->content.siteMgrDesiredBeaconInterval < SITE_MGR_BEACON_INTERVAL_MIN)
- return PARAM_VALUE_NOT_VALID;
- if (pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval != pParam->content.siteMgrDesiredBeaconInterval)
- pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval = pParam->content.siteMgrDesiredBeaconInterval;
- return OK;
- case SITE_MGR_DESIRED_PREAMBLE_TYPE_PARAM:
- if ((pParam->content.siteMgrDesiredPreambleType != PREAMBLE_LONG) &&
- (pParam->content.siteMgrDesiredPreambleType != PREAMBLE_SHORT))
- return PARAM_VALUE_NOT_VALID;
- if (pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType != pParam->content.siteMgrDesiredPreambleType)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType = pParam->content.siteMgrDesiredPreambleType;
- }
- return OK;
- case SITE_MGR_DESIRED_SUPPORTED_RATE_SET_PARAM:
- return setSupportedRateSet(pSiteMgr, &(pParam->content.siteMgrDesiredSupportedRateSet));
- case SITE_MGR_DESIRED_DOT11_MODE_PARAM:
- if(pParam->content.siteMgrDot11Mode > DOT11_MAX_MODE)
- return PARAM_VALUE_NOT_VALID;
- if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode != pParam->content.siteMgrDot11Mode)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode = pParam->content.siteMgrDot11Mode;
- /* since the dot11ABAmode changed, the STA operational mode should be changed */
- if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_DUAL_MODE)
- {
- if(pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_DUAL)
- {
- pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
- }
- else if(pSiteMgr->pDesiredParams->siteMgrSupportedBand == RADIO_BAND_2_4_GHZ)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode = DOT11_G_MODE;
- pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
- }
- else
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode = DOT11_G_MODE;
- pSiteMgr->siteMgrOperationalMode = DOT11_A_MODE;
- }
- }
- else
- pSiteMgr->siteMgrOperationalMode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode;
- /* configure HAL with new parameters update rates and select site table */
- pSiteMgr->prevRadioBand = pSiteMgr->radioBand;
- if(pSiteMgr->siteMgrOperationalMode == DOT11_A_MODE)
- {
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
- pSiteMgr->radioBand = RADIO_BAND_5_0_GHZ;
- slotTime = PHY_SLOT_TIME_SHORT;
- }
- else if(pSiteMgr->siteMgrOperationalMode == DOT11_G_MODE)
- {
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- slotTime = pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime;
- }
- else
- {
- pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
- pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
- slotTime = PHY_SLOT_TIME_LONG;
- }
- if(pSiteMgr->prevRadioBand != pSiteMgr->radioBand)
- siteMgr_bandParamsConfig(pSiteMgr, TRUE);
- /* configure HAL */
- whalCtrl_SetRadioBand(pSiteMgr->hHalCtrl, pSiteMgr->radioBand);
- whalCtrl_SetSlotTime(pSiteMgr->hHalCtrl, slotTime);
- /* If the BSS type is Ad_Hoc, increase the random BSSID calculated during init */
- if(pSiteMgr->pDesiredParams->siteMgrDesiredBSSType == BSS_INDEPENDENT)
- {
- pSiteMgr->ibssBssid.addr[MAC_ADDR_LEN - 1] ++;
- }
- /*siteMgr_resetAllSiteTables(pSiteMgr); */
- return RE_SCAN_NEEDED;
- }
- return OK;
- case SITE_MGR_OPERATIONAL_MODE_PARAM:
- if(pParam->content.siteMgrDot11OperationalMode < DOT11_B_MODE ||
- pParam->content.siteMgrDot11OperationalMode > DOT11_G_MODE )
- return PARAM_VALUE_NOT_VALID;
- pSiteMgr->siteMgrOperationalMode = pParam->content.siteMgrDot11OperationalMode;
- break;
- case SITE_MGR_USE_DRAFT_NUM_PARAM:
- if(pParam->content.siteMgrUseDraftNum != DRAFT_5_AND_EARLIER &&
- pParam->content.siteMgrUseDraftNum != DRAFT_6_AND_LATER)
- return PARAM_VALUE_NOT_VALID;
- if(pSiteMgr->pDesiredParams->siteMgrUseDraftNum != pParam->content.siteMgrUseDraftNum)
- {
- pSiteMgr->pDesiredParams->siteMgrUseDraftNum = pParam->content.siteMgrUseDraftNum;
- return RE_SCAN_NEEDED;
- }
- return OK;
- case SITE_MGR_RADIO_BAND_PARAM:
- if((INT8)pParam->content.siteMgrRadioBand < RADIO_BAND_2_4_GHZ ||
- (INT8)pParam->content.siteMgrRadioBand > RADIO_BAND_DUAL )
- return PARAM_VALUE_NOT_VALID;
- pSiteMgr->prevRadioBand = pSiteMgr->radioBand;
- pSiteMgr->radioBand = pParam->content.siteMgrRadioBand;
- if(pSiteMgr->prevRadioBand != pSiteMgr->radioBand)
- siteMgr_bandParamsConfig(pSiteMgr, FALSE);
- break;
- case SITE_MGR_DESIRED_SLOT_TIME_PARAM:
- if(pParam->content.siteMgrSlotTime != PHY_SLOT_TIME_LONG &&
- pParam->content.siteMgrSlotTime != PHY_SLOT_TIME_SHORT)
- return PARAM_VALUE_NOT_VALID;
- if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime != pParam->content.siteMgrSlotTime)
- {
- if(pSiteMgr->siteMgrOperationalMode == DOT11_G_MODE)
- {
- pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime = pParam->content.siteMgrSlotTime;
- if(!pPrimarySite)
- whalCtrl_SetSlotTime(pSiteMgr->hHalCtrl, pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime);
- else if(pPrimarySite->bssType != BSS_INFRASTRUCTURE)
- whalCtrl_SetSlotTime(pSiteMgr->hHalCtrl, pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime);
- }
- }
- return OK;
- case SITE_MGR_BEACON_FILTER_DESIRED_STATE_PARAM:
- {
- int desiredStateBeforeChange = pSiteMgr->beaconFilterParams.desiredState;
- /* Set the New Desired User request of Beacon Filter */
- pSiteMgr->beaconFilterParams.desiredState = pParam->content.siteMgrDesiredBeaconFilterState;
-
- /* Check if the Desired mode has changed - If not no need to send the MIB to the FW */
- if ( pSiteMgr->beaconFilterParams.desiredState == desiredStateBeforeChange )
- {
- WLAN_REPORT_DEBUG_CONTROL(pSiteMgr->hReport,
- ("Beacon Filter already %s" , (TRUE == desiredStateBeforeChange)? "ENABLED":"DISABLED" ) );
- break;
- }
- WLAN_REPORT_DEBUG_CONTROL(pSiteMgr->hReport,
- ("\n New Beacon Filter Desired State is : %s pSiteMgr->beaconFilterParams.currentState %s\n" , ( TRUE == (pSiteMgr->beaconFilterParams.desiredState) )?"ENABLED":"DISABLED",( TRUE == (pSiteMgr->beaconFilterParams.currentState) )?"ENABLED":"DISABLED"));
- /* Check if the new Desired state is TRUE then Also check the Current State and then if FALSEdo not send the MIB to FW*/
- if ( (TRUE == pSiteMgr->beaconFilterParams.desiredState ) && (FALSE == pSiteMgr->beaconFilterParams.currentState ))
- {
- WLAN_REPORT_DEBUG_CONTROL(pSiteMgr->hReport,
- ("\n New Beacon Filter Desired State is TRUE But Current State is DISABLED So the MIBwill be sent Later !!!!"));
- }
- /* In any other cases the User required Beacon Filter Configuration will be sent to FW immediately */
- else
- {
- WLAN_REPORT_DEBUG_CONTROL(pSiteMgr->hReport,
- ("\n New Sending Beacon Filter Desired State To FW !!!!"));
- whalCtrl_SetBeaconFiltering(pSiteMgr->hHalCtrl, pSiteMgr->beaconFilterParams.desiredState, pSiteMgr->beaconFilterParams.numOfStored);
- }
- }
- break;
- case SITE_MGR_DISASSOCIATE_PARAM:
- case SITE_MGR_DEAUTHENTICATE_PARAM:
- if(!pPrimarySite)
- return OK;
- else { /* Set Junk SSID */
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.len = 4;
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.ssidString[0]=1;
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.ssidString[1]=1;
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.ssidString[2]=1;
- pSiteMgr->pDesiredParams->siteMgrDesiredSSID.ssidString[3]=1;
- return RE_SCAN_NEEDED;
- }
- case SITE_MGR_BSSID_LIST_SCAN_PARAM:
- #if 0
- /* TODO - merge fix from WinCE version (and generalize it if time permits) */
- /* Must return NOK in each case the scan is not actually performed */
- if(!pPrimarySite)
- {
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("Not connected to Network => do the BSSID_LIST_SCAN command\n"));
- smeSm_startScan(pSiteMgr->hSmeSm);
- }
- param.paramType = RX_DATA_COUNTERS_PARAM;
- rxData_getParam(pSiteMgr->hRxData, ¶m);
- /* get current received data frames counter */
- currRxPacketsCount = param.content.siteMgrTiWlanCounters.DirectedFramesRecv;
- if((pSiteMgr->rxPacketsCount + 1) < currRxPacketsCount)
- {
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("Traffic is active now => ignoring the BSSID_LIST_SCAN command\n"));
- return NOK;
- }
- else
- {
- WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG,
- ("Traffic is not active now => do the BSSID_LIST_SCAN command\n"));
- smeSm_startScan(pSiteMgr->hSmeSm);
- }
- }
- #endif
- return OK;
- case SITE_MGR_LAST_RX_RATE_PARAM:
- if (pPrimarySite != NULL)
- {
- pPrimarySite->rxRate = pParam->content.ctrlDataCurrentBasicRate;
- }
- break;
- case SITE_MGR_CURRENT_CHANNEL_PARAM:
- if (!pPrimarySite)
- {
- return NO_SITE_SELECTED_YET;
- }
- pPrimarySite->channel = pParam->content.siteMgrCurrentChannel;
- break;
- case SITE_MGR_CURRENT_SIGNAL_PARAM:
- if (!pPrimarySite)
- {
- return NO_SITE_SELECTED_YET;
- }
- pPrimarySite->rssi = pParam->content.siteMgrCurrentSignal.rssi;
- break;
- default:
- WLAN_REPORT_ERROR(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("Set param, Params is not supported, %d\n", pParam->paramType));
- return PARAM_NOT_SUPPORTED;
- }
- return OK;
- }
- /***********************************************************************
- * siteMgr_getParam
- ***********************************************************************
- DESCRIPTION: Site mgr get param function, called by the following:
- - config mgr in order to get a parameter from the OS abstraction layer.
- - From inside the dirver
- INPUT: hSiteMgr - site mgr handle.
- pParam - Pointer to the parameter
- OUTPUT:
- RETURN: OK on success, NOK otherwise
- ************************************************************************/
- TI_STATUS siteMgr_getParam(TI_HANDLE hSiteMgr,
- paramInfo_t *pParam)
- {
- siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
- siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
- TI_STATUS status = OK;
- UINT8 siteEntryIndex;
- UINT32 dtimInterval;
- UINT32 delta;
- whalParamInfo_t whalParam;
- switch(pParam->paramType)
- {
- case SITE_MGR_CONFIGURATION_PARAM:
- pParam->content.pSiteMgrConfiguration->Length = sizeof(OS_802_11_CONFIGURATION);
- pParam->content.pSiteMgrConfiguration->ATIMWindow = pSiteMgr->pDesiredParams->siteMgrDesiredAtimWindow;
- pParam->content.pSiteMgrConfiguration->BeaconPeriod = pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval;
- pParam->content.pSiteMgrConfiguration->Union.channel =
- Chan2Freq(pSiteMgr->pDesiredParams->siteMgrDesiredChannel);
- /*pSiteMgr->pDesiredParams->siteMgrFreq2ChannelTable[pSiteMgr->pDesiredParams->siteMgrDesiredChannel];*/
- if(pPrimarySite) {
- pParam->content.pSiteMgrConfiguration->FHConfig.DwellTime = pPrimarySite->FHParams.dwellTime;
- pParam->content.pSiteMgrConfiguration->FHConfig.HopPattern = pPrimarySite->FHParams.hopPattern;
- pParam->content.pSiteMgrConfiguration->FHConfig.HopSet = pPrimarySite->FHParams.hopSet;
- }
- else {
- pParam->content.pSiteMgrConfiguration->FHConfig.DwellTime = 0;
- pParam->content.pSiteMgrConfiguration->FHConfig.HopPattern = 0;
- pParam->content.pSiteMgrConfiguration->FHConfig.HopSet = 0;
- …
Large files files are truncated, but you can click here to view the full file