diff options
Diffstat (limited to 'sta_dk_4_0_4_32')
36 files changed, 810 insertions, 1337 deletions
diff --git a/sta_dk_4_0_4_32/Makefile b/sta_dk_4_0_4_32/Makefile index abb1bf6..802a7fb 100644 --- a/sta_dk_4_0_4_32/Makefile +++ b/sta_dk_4_0_4_32/Makefile @@ -82,7 +82,7 @@ OS_OBJS = $(patsubst %.c, %.o, $(OS_SRCS)) # # Remove debug info # -EXTRA_LDFLAGS += --strip-debug +EXTRA_LDFLAGS += --strip-debug ## ## diff --git a/sta_dk_4_0_4_32/common.inc b/sta_dk_4_0_4_32/common.inc index 53be0c1..4aa20e7 100644 --- a/sta_dk_4_0_4_32/common.inc +++ b/sta_dk_4_0_4_32/common.inc @@ -154,7 +154,7 @@ PFORM_DEFINES += -D FW_RUNNING_AS_STA PFORM_DEFINES += -D NOT_SUPPORT_08_BIT_ACCESS_COMMAND PFORM_DEFINES += -D FOUR_ALIGNMENT PFORM_DEFINES += -D USE_INIT_FILE -# PFORM_DEFINES += -D ENABLE_ROAMING_BY_DEFAULT +PFORM_DEFINES += -D ENABLE_ROAMING_BY_DEFAULT ifeq ($(FIRMWARE_DYNAMIC_LOAD),y) PFORM_DEFINES += -D FIRMWARE_DYNAMIC_LOAD diff --git a/sta_dk_4_0_4_32/common/inc/paramOut.h b/sta_dk_4_0_4_32/common/inc/paramOut.h index 7bc0265..89e29f3 100644 --- a/sta_dk_4_0_4_32/common/inc/paramOut.h +++ b/sta_dk_4_0_4_32/common/inc/paramOut.h @@ -860,6 +860,29 @@ typedef struct{ } content; } paramInfo_t; + +/* paramInfoPartial_t is part of paramInfo_t it is implemented to reduce stack usage */ +typedef struct{ + UINT32 paramType; + UINT32 paramLength; + + union + { + TspecConfigure_t TspecConfigure; + BOOL rsnPreAuthStatus; + macAddress_t rsnApMac; + cipherSuite_e rsnEncryptionStatus; + BOOL rsnMixedMode; + + /* Application Config Parameters Manager */ + applicationConfigBuffer_t applicationConfigBuffer; + + /* ctrl data section */ + preamble_e ctrlDataCurrentPreambleType; + + } content; +}paramInfoPartial_t; + /* Set/get params function prototype */ typedef TI_STATUS (*paramFunc_t)(TI_HANDLE handle, paramInfo_t *pParam); @@ -1224,16 +1247,16 @@ typedef struct UINT32 beaconReceiveTime; UINT8 hangoverPeriod; UINT8 beaconListenInterval; - UINT8 dtimListenInterval; + UINT8 dtimListenInterval; UINT8 nConsecutiveBeaconsMissed; UINT8 EnterTo802_11PsRetries; UINT8 HwPsPollResponseTimeout; - UINT16 autoModeInterval; - UINT16 autoModeActiveTH; - UINT16 autoModeDozeTH; + UINT16 autoModeInterval; + UINT16 autoModeActiveTH; + UINT16 autoModeDozeTH; PowerMgr_PowerMode_e autoModeDozeMode; - powerAutho_PowerPolicy_e defaultPowerLevel; + powerAutho_PowerPolicy_e defaultPowerLevel; powerAutho_PowerPolicy_e PowerSavePowerLevel; @@ -1254,7 +1277,7 @@ typedef struct UINT8 listenInterval; /* BET */ - UINT32 MaximalFullBeaconReceptionInterval; /* maximal time between full beacon reception */ + UINT32 MaximalFullBeaconReceptionInterval; /* maximal "beacon periods" between full beacon reception */ UINT8 BetEnableThreshold; UINT8 BetDisableThreshold; UINT8 BetEnable; diff --git a/sta_dk_4_0_4_32/common/inc/wspVer.h b/sta_dk_4_0_4_32/common/inc/wspVer.h index 637a82b..47c6348 100644 --- a/sta_dk_4_0_4_32/common/inc/wspVer.h +++ b/sta_dk_4_0_4_32/common/inc/wspVer.h @@ -51,9 +51,9 @@ /* base version */ -#define SW_RELEASE_MONTH 2 -#define SW_RELEASE_DAY 14 -#define SW_RELEASE_YEAR 2008 +#define SW_RELEASE_MONTH 6 +#define SW_RELEASE_DAY 5 +#define SW_RELEASE_YEAR 2008 #endif /* _WSP_VER_H_ */ diff --git a/sta_dk_4_0_4_32/common/src/Application/Roaming/roamingMngr.c b/sta_dk_4_0_4_32/common/src/Application/Roaming/roamingMngr.c index f046f44..7df98f2 100644 --- a/sta_dk_4_0_4_32/common/src/Application/Roaming/roamingMngr.c +++ b/sta_dk_4_0_4_32/common/src/Application/Roaming/roamingMngr.c @@ -426,6 +426,10 @@ TI_STATUS roamingMngr_init(TI_HANDLE hRoamingMngr, { roamingMngr_t *pRoamingMngr; TI_STATUS status; +#ifdef ENABLE_ROAMING_BY_DEFAULT + roamingMngrConfigParams_t InitRoamingParams; + paramInfo_t param; +#endif #ifdef TI_DBG UINT8 index; #endif @@ -520,15 +524,7 @@ TI_STATUS roamingMngr_init(TI_HANDLE hRoamingMngr, /* Init intrenal variables */ pRoamingMngr->currentState = ROAMING_STATE_IDLE; -#ifdef ENABLE_ROAMING_BY_DEFAULT - pRoamingMngr->roamingMngrConfig.enableDisable = ROAMING_ENABLED; - apConn_registerRoamMngrCallb(pRoamingMngr->hAPConnection, - roamingMngr_triggerRoamingCb, - roamingMngr_connStatusCb, - roamingMngr_updateNeighborApListCb); -#else pRoamingMngr->roamingMngrConfig.enableDisable = ROAMING_DISABLED; -#endif pRoamingMngr->roamingTrigger = ROAMING_TRIGGER_NONE; pRoamingMngr->maskRoamingEvents= TRUE; pRoamingMngr->scanType = ROAMING_NO_SCAN; @@ -564,7 +560,36 @@ TI_STATUS roamingMngr_init(TI_HANDLE hRoamingMngr, ROAMING_MNGR_NUM_STATES, ROAMING_MNGR_NUM_EVENTS, roamingMngr_smEvent, pRoamingMngr->hOs); - +#ifdef ENABLE_ROAMING_BY_DEFAULT + if (status != OK) + { + return status; + } + + param.paramType = ROAMING_MNGR_APPLICATION_CONFIGURATION; + param.content.applicationConfigBuffer.bufferSize = sizeof(roamingMngrConfigParams_t); + param.content.applicationConfigBuffer.buffer = (UINT8 *)¶m; + InitRoamingParams.roamingMngrConfig.enableDisable = ROAMING_ENABLED; + + InitRoamingParams.roamingMngrConfig.lowPassFilterRoamingAttempt = 30; + InitRoamingParams.roamingMngrConfig.apQualityThreshold = -70; + + InitRoamingParams.roamingMngrThresholdsConfig.dataRetryThreshold = 20; + InitRoamingParams.roamingMngrThresholdsConfig.numExpectedTbttForBSSLoss = 10; + InitRoamingParams.roamingMngrThresholdsConfig.txRateThreshold = 2; + InitRoamingParams.roamingMngrThresholdsConfig.lowRssiThreshold = -80; + InitRoamingParams.roamingMngrThresholdsConfig.lowSnrThreshold = 0; + InitRoamingParams.roamingMngrThresholdsConfig.lowQualityForBackgroungScanCondition = -60; + InitRoamingParams.roamingMngrThresholdsConfig.normalQualityForBackgroungScanCondition = -50; + InitRoamingParams.roamingMngrThresholdsConfig.rssiFilterWeight = 10; + InitRoamingParams.roamingMngrThresholdsConfig.snrFilterWeight = 10; + + param.paramType = ROAMING_MNGR_APPLICATION_CONFIGURATION; + param.content.applicationConfigBuffer.bufferSize = sizeof(roamingMngrConfigParams_t); + param.content.applicationConfigBuffer.buffer = (UINT8 *)&InitRoamingParams; + + roamingMngr_setParam (hRoamingMngr,¶m); +#endif return status; } @@ -680,7 +705,16 @@ TI_STATUS roamingMngr_setParam(TI_HANDLE hRoamingMngr, paramInfo_t *pParam) WLAN_REPORT_INFORMATION(pRoamingMngr->hReport, ROAMING_MANAGER_MODULE_LOG, ("roamingMngr_setParam TRIGGER_EVENT= %d \n", pParam->content.roamingTriggerType)); - apConn_reportRoamingEvent(pRoamingMngr->hAPConnection, (apConn_roamingTrigger_e)pParam->content.roamingTriggerType, NULL); + + if ((apConn_roamingTrigger_e)pParam->content.roamingTriggerType == ROAMING_TRIGGER_AP_DISCONNECT) + { + /* DeAuth packet with status code of deauth/disassoc packet equal to 1 */ + apConn_reportRoamingEventDisconnect(pRoamingMngr->hAPConnection ,1 ,TRUE); + } + else + { + apConn_reportRoamingEvent(pRoamingMngr->hAPConnection, (apConn_roamingTrigger_e)pParam->content.roamingTriggerType, NULL); + } break; case ROAMING_MNGR_CONN_STATUS: @@ -1286,7 +1320,7 @@ TI_STATUS roamingMngr_updateNewBssList(TI_HANDLE hRoamingMngr, bssList_t *bssLis ("roamingMngr_updateNewBssList, No Pre-Auth is required\n")); return OK; } - apConn_preAuthenticate(pRoamingMngr->hAPConnection, bssList); + apConn_preAuthenticate(pRoamingMngr->hAPConnection, bssList, bssList->numOfEntries); return OK; @@ -1408,7 +1442,11 @@ static TI_STATUS roamingMngr_smRoamTrigger(TI_HANDLE hRoamingMngr) apConn_prepareToRoaming(pRoamingMngr->hAPConnection, pRoamingMngr->roamingTrigger); /* Get the current BSSIDs from ScanMngr */ +#if 0 pRoamingMngr->pListOfAPs = scanMngr_getBSSList(pRoamingMngr->hScanMngr); +#else + pRoamingMngr->pListOfAPs = NULL; /* force immediate scan */ +#endif if ((pRoamingMngr->pListOfAPs != NULL) && (pRoamingMngr->pListOfAPs->numOfEntries > 0)) { /* No need to SCAN, start SELECTING */ roamingEvent = ROAMING_EVENT_SELECT; @@ -1466,6 +1504,8 @@ static TI_STATUS roamingMngr_smInvokeScan(TI_HANDLE hRoamingMngr) return NOK; } + scanMngrClearBSSListEntry(pRoamingMngr->hScanMngr); + /* check which scan should be performed: Partial on list of channels, or full scan */ if ((pRoamingMngr->scanType == ROAMING_PARTIAL_SCAN) || (pRoamingMngr->scanType == ROAMING_PARTIAL_SCAN_RETRY)) @@ -1832,12 +1872,11 @@ static TI_STATUS roamingMngr_smSuccHandover(TI_HANDLE hRoamingMngr) for the current AP */ if (pRoamingMngr->staCapabilities.authMode==os802_11AuthModeWPA2) { /* No Pre-Auth is required */ - bssList_t bssList; + UINT8 dummy; WLAN_REPORT_INFORMATION(pRoamingMngr->hReport, ROAMING_MANAGER_MODULE_LOG, ("roamingMngr_smStartIdle, Pre-Auth to cur AP\n")); - bssList.numOfEntries = 0; - apConn_preAuthenticate(pRoamingMngr->hAPConnection, &bssList); + apConn_preAuthenticate(pRoamingMngr->hAPConnection, (bssList_t *)&dummy, 0); } return OK; @@ -2025,12 +2064,10 @@ static TI_STATUS roamingMngr_smStartIdle(void *pData) for the current AP */ if (pRoamingMngr->staCapabilities.authMode==os802_11AuthModeWPA2) { /* No Pre-Auth is required */ - bssList_t bssList; - + UINT8 dummy; WLAN_REPORT_INFORMATION(pRoamingMngr->hReport, ROAMING_MANAGER_MODULE_LOG, ("roamingMngr_smStartIdle, Pre-Auth to cur AP\n")); - bssList.numOfEntries = 0; - apConn_preAuthenticate(pRoamingMngr->hAPConnection, &bssList); + apConn_preAuthenticate(pRoamingMngr->hAPConnection, (bssList_t *)&dummy, 0); } return OK; diff --git a/sta_dk_4_0_4_32/common/src/Application/ScanMngr/scanMngr.c b/sta_dk_4_0_4_32/common/src/Application/ScanMngr/scanMngr.c index de3a388..c65742c 100644 --- a/sta_dk_4_0_4_32/common/src/Application/ScanMngr/scanMngr.c +++ b/sta_dk_4_0_4_32/common/src/Application/ScanMngr/scanMngr.c @@ -3363,6 +3363,15 @@ void scanMngrAddNormalChannel( TI_HANDLE hScanMngr, scan_Method_t* scanMethod, U MAC_ADDR_LEN ); } +/* Clear all candidate BSSList for Roaming */ +void scanMngrClearBSSListEntry( TI_HANDLE hScanMngr ) +{ + scanMngr_t* pScanMngr = (scanMngr_t*)hScanMngr; + + while(pScanMngr->BSSList.numOfEntries) + scanMngrRemoveBSSListEntry(hScanMngr, pScanMngr->BSSList.numOfEntries-1); +} + /** * \author Ronen Kalish\n * \date 02-Mar-2005\n diff --git a/sta_dk_4_0_4_32/common/src/Application/inc/scanMngrApi.h b/sta_dk_4_0_4_32/common/src/Application/inc/scanMngrApi.h index 3a129be..50fc482 100644 --- a/sta_dk_4_0_4_32/common/src/Application/inc/scanMngrApi.h +++ b/sta_dk_4_0_4_32/common/src/Application/inc/scanMngrApi.h @@ -300,6 +300,9 @@ TI_STATUS scanMngr_setParam( TI_HANDLE hScanMngr, paramInfo_t *pParam ); */ void scanMngr_setScanPolicy( TI_HANDLE hScanMngr, scan_Policy_t* scanPolicy ); +/* Clear all candidate BSSList for Roaming */ +void scanMngrClearBSSListEntry( TI_HANDLE hScanMngr ); + #ifdef TI_DBG /** * \author Ronen Kalish\n diff --git a/sta_dk_4_0_4_32/common/src/Management/QOS/Inc/qosMngr_API.h b/sta_dk_4_0_4_32/common/src/Management/QOS/Inc/qosMngr_API.h index 3335715..46d9021 100644 --- a/sta_dk_4_0_4_32/common/src/Management/QOS/Inc/qosMngr_API.h +++ b/sta_dk_4_0_4_32/common/src/Management/QOS/Inc/qosMngr_API.h @@ -104,8 +104,12 @@ TI_STATUS qosMngr_connect(TI_HANDLE hQosMngr); TI_STATUS qosMngr_setParams(TI_HANDLE hQosMngr,paramInfo_t *pParamInfo); +TI_STATUS qosMngr_setParamsPartial(TI_HANDLE hQosMngr,paramInfoPartial_t *pParamInfo); + TI_STATUS qosMngr_getParams(TI_HANDLE hQosMngr,paramInfo_t *pParamInfo); +TI_STATUS qosMngr_getParamsPatial(TI_HANDLE hQosMngr,paramInfoPartial_t *pParamInfo); + TI_STATUS qosMngr_assocReqBuild(TI_HANDLE hQosMngr, UINT8 *pQosIe, UINT8 *pLen); TI_STATUS qosMngr_setSite(TI_HANDLE hQosMngr, assocRsp_t *assocRsp); diff --git a/sta_dk_4_0_4_32/common/src/Management/QOS/qosMngr.c b/sta_dk_4_0_4_32/common/src/Management/QOS/qosMngr.c index 05d9841..48afd4e 100644 --- a/sta_dk_4_0_4_32/common/src/Management/QOS/qosMngr.c +++ b/sta_dk_4_0_4_32/common/src/Management/QOS/qosMngr.c @@ -735,7 +735,93 @@ UINT8 qosMngr_evalSite(TI_HANDLE hQosMngr, BOOL siteAPSDSupport) return 0; } +/************************************************************************ + * qosMngr_getParamsPatial * + ************************************************************************ +DESCRIPTION: The function is an API for external modules to qet qos parameters + +INPUT: hQosMngr - Qos Manager handle. + pParamInfo - qos parameters information. + + +OUTPUT: + +RETURN: OK on success, NOK otherwise + +************************************************************************/ + +TI_STATUS qosMngr_getParamsPatial(TI_HANDLE hQosMngr,paramInfoPartial_t *pParamInfo) +{ + qosMngr_t *pQosMngr = (qosMngr_t *)hQosMngr; + + if(pQosMngr == NULL) + return NOK; + + WLAN_REPORT_INFORMATION(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, ("qosMngr_getParams: %x\n", pParamInfo->paramType)); + + switch(pParamInfo->paramType) + { + + case QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC: + /* Check if voice call present. If so, store current TSPEC configuration */ + pParamInfo->content.TspecConfigure.voiceTspecConfigure = (UINT8)pQosMngr->voiceTspecConfigured; + pParamInfo->content.TspecConfigure.videoTspecConfigure = (UINT8)pQosMngr->videoTspecConfigured; + + WLAN_REPORT_INFORMATION(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, ("qosMngr_getParams: QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC=%d\n", pQosMngr->voiceTspecConfigured)); + + if (pQosMngr->voiceTspecConfigured == TRUE) + { + OS_802_11_QOS_TSPEC_PARAMS *pTspecParams; + tspecInfo_t *pConfiguredParams; + + /* Store voice TSPEC params - must be configured */ + pTspecParams = &pQosMngr->tspecRenegotiationParams[USER_PRIORITY_6]; + pConfiguredParams = &pQosMngr->resourceMgmtTable.candidateTspecInfo[USER_PRIORITY_6]; + + pTspecParams->uUserPriority = pConfiguredParams->userPriority; + pTspecParams->uNominalMSDUsize = pConfiguredParams->nominalMsduSize; + pTspecParams->uMeanDataRate = pConfiguredParams->meanDataRate; + pTspecParams->uMinimumPHYRate = pConfiguredParams->minimumPHYRate; + pTspecParams->uSurplusBandwidthAllowance = pConfiguredParams->surplausBwAllowance; + pTspecParams->uAPSDFlag = pConfiguredParams->UPSDFlag; + pTspecParams->uMediumTime = pConfiguredParams->mediumTime; + } + else + { + pQosMngr->tspecRenegotiationParams[USER_PRIORITY_6].uUserPriority = MAX_USER_PRIORITY; + } + + if (pQosMngr->videoTspecConfigured == TRUE) + { + OS_802_11_QOS_TSPEC_PARAMS *pTspecParams; + tspecInfo_t *pConfiguredParams; + + /* Store signalling TSPEC params if configured in user priority 4 */ + pTspecParams = &pQosMngr->tspecRenegotiationParams[USER_PRIORITY_4]; + pConfiguredParams = &pQosMngr->resourceMgmtTable.candidateTspecInfo[USER_PRIORITY_4]; + + pTspecParams->uUserPriority = pConfiguredParams->userPriority; + pTspecParams->uNominalMSDUsize = pConfiguredParams->nominalMsduSize; + pTspecParams->uMeanDataRate = pConfiguredParams->meanDataRate; + pTspecParams->uMinimumPHYRate = pConfiguredParams->minimumPHYRate; + pTspecParams->uSurplusBandwidthAllowance = pConfiguredParams->surplausBwAllowance; + pTspecParams->uAPSDFlag = pConfiguredParams->UPSDFlag; + pTspecParams->uMediumTime = pConfiguredParams->mediumTime; + } + else + { + pQosMngr->tspecRenegotiationParams[USER_PRIORITY_4].uUserPriority = MAX_USER_PRIORITY; + } + break; + + default: + WLAN_REPORT_ERROR(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, + ("qosMngr_getParamsExtend Error: unknown paramType 0x%x!\n",pParamInfo->paramType)); + return (PARAM_NOT_SUPPORTED); + } + return OK; +} /************************************************************************ * qosMngr_getACparams * @@ -1207,6 +1293,43 @@ TI_STATUS qosMngr_setParams(TI_HANDLE hQosMngr,paramInfo_t *pParamInfo) } +TI_STATUS qosMngr_setParamsPartial(TI_HANDLE hQosMngr,paramInfoPartial_t *pParamInfo) +{ + qosMngr_t *pQosMngr = (qosMngr_t *)hQosMngr; + + if(pQosMngr == NULL) + return NOK; + + if(pParamInfo == NULL) + { + WLAN_REPORT_ERROR(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, + ("qosMngr_setParams :Error trying to set NULL params!\n")); + return NOK; + } + + WLAN_REPORT_INFORMATION(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, ("qosMngr_setParams: %x\n", pParamInfo->paramType)); + + switch(pParamInfo->paramType) + { + case QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC: + if( pParamInfo->content.TspecConfigure.voiceTspecConfigure || pParamInfo->content.TspecConfigure.videoTspecConfigure) + pQosMngr->performTSPECRenegotiation = TRUE; + else + pQosMngr->performTSPECRenegotiation = FALSE; + + WLAN_REPORT_INFORMATION(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, + ("qosMngr_setParams: QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC=%d\n", pQosMngr->performTSPECRenegotiation)); + break; + + default: + WLAN_REPORT_ERROR(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG, + ("qosMngr_getParams Error: unknown paramType 0x%x!\n",pParamInfo->paramType)); + return (PARAM_NOT_SUPPORTED); + } + + return OK; +} + /************************************************************************ * verifyAndConfigTrafficParams * ************************************************************************ @@ -2283,7 +2406,6 @@ TI_STATUS qosMngr_requestAdmission(TI_HANDLE hQosMngr, } /* check msdu size validity */ - if( (addTspecParams->uNominalMSDUsize & !FIX_MSDU_SIZE) > MAX_DATA_BODY_LENGTH) { WLAN_REPORT_ERROR(pQosMngr->hReport, QOS_MANAGER_MODULE_LOG,("uNominalMSDUsize = %d > 2312, !!!\n",addTspecParams->uNominalMSDUsize)); diff --git a/sta_dk_4_0_4_32/common/src/Management/apConn/apConn.c b/sta_dk_4_0_4_32/common/src/Management/apConn/apConn.c index 26df7d9..d025f8e 100644 --- a/sta_dk_4_0_4_32/common/src/Management/apConn/apConn.c +++ b/sta_dk_4_0_4_32/common/src/Management/apConn/apConn.c @@ -1204,13 +1204,13 @@ BOOL apConn_getPreAuthAPStatus(TI_HANDLE hAPConnection, macAddress_t *givenAp) { apConn_t *pAPConnection = (apConn_t *)hAPConnection; - paramInfo_t param; + paramInfoPartial_t param; AP_CONN_VALIDATE_HANDLE(hAPConnection); param.paramType = RSN_PRE_AUTH_STATUS; os_memoryCopy(pAPConnection->hOs, (void *)param.content.rsnApMac.addr, (void *)givenAp->addr, MAC_ADDR_LEN); - rsn_getParam(pAPConnection->hPrivacy, ¶m); + rsn_getParamPartial(pAPConnection->hPrivacy, ¶m); return param.content.rsnPreAuthStatus; } @@ -1237,7 +1237,7 @@ BOOL apConn_getPreAuthAPStatus(TI_HANDLE hAPConnection, * * \sa */ -TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs) +TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs, UINT8 listAPs_numOfEntries) { apConn_t *pAPConnection = (apConn_t *)hAPConnection; bssidList4PreAuth_t apList; @@ -1255,27 +1255,34 @@ TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs) WLAN_REPORT_INFORMATION(pAPConnection->hReport, SITE_MGR_MODULE_LOG, ("apConn_reserveResources \n")); #endif - for (listIndex=0, apListIndex=0; listIndex<listAPs->numOfEntries; listIndex++) - { - os_memoryCopy(pAPConnection->hOs, &(apList.bssidList[apListIndex].bssId), - (void *)listAPs->BSSList[listIndex].BSSID.addr, MAC_ADDR_LEN); - - /* search in the buffer pointer to the beginning of the - RSN IE according to the IE ID */ - if (!parseIeBuffer(pAPConnection->hOs, listAPs->BSSList[listIndex].pBuffer, listAPs->BSSList[listIndex].bufferLength, RSN_IE_ID, &pRsnIEs, NULL, 0)) + if (listAPs_numOfEntries != 0) { + for (listIndex=0, apListIndex=0; listIndex<listAPs->numOfEntries; listIndex++) + { + os_memoryCopy(pAPConnection->hOs, &(apList.bssidList[apListIndex].bssId), + (void *)listAPs->BSSList[listIndex].BSSID.addr, MAC_ADDR_LEN); + + /* search in the buffer pointer to the beginning of the + RSN IE according to the IE ID */ + if (!parseIeBuffer(pAPConnection->hOs, listAPs->BSSList[listIndex].pBuffer, listAPs->BSSList[listIndex].bufferLength, RSN_IE_ID, &pRsnIEs, NULL, 0)) + { + WLAN_REPORT_INFORMATION(pAPConnection->hReport, ROAMING_MANAGER_MODULE_LOG, + ("apConn_preAuthenticate, no RSN IE was found \n")); + WLAN_REPORT_HEX_INFORMATION(pAPConnection->hReport, ROAMING_MANAGER_MODULE_LOG, + listAPs->BSSList[listIndex].pBuffer, listAPs->BSSList[listIndex].bufferLength); + + continue; + } + + apList.bssidList[apListIndex].pRsnIEs = (dot11_RSN_t*)pRsnIEs; + apList.bssidList[apListIndex].rsnIeLen = apList.bssidList[apListIndex].pRsnIEs->hdr.eleLen+2; + apListIndex++; + } + } + else { - WLAN_REPORT_INFORMATION(pAPConnection->hReport, ROAMING_MANAGER_MODULE_LOG, - ("apConn_preAuthenticate, no RSN IE was found \n")); - WLAN_REPORT_HEX_INFORMATION(pAPConnection->hReport, ROAMING_MANAGER_MODULE_LOG, - listAPs->BSSList[listIndex].pBuffer, listAPs->BSSList[listIndex].bufferLength); - - continue; - } - - apList.bssidList[apListIndex].pRsnIEs = (dot11_RSN_t*)pRsnIEs; - apList.bssidList[apListIndex].rsnIeLen = apList.bssidList[apListIndex].pRsnIEs->hdr.eleLen+2; - apListIndex++; - } + listIndex=0; + apListIndex=0; + } /* Start pre-auth after any Conn succ (including first), and not only when a New BSSID was added, in order to save/refresh @@ -1472,6 +1479,37 @@ TI_STATUS apConn_stop(TI_HANDLE hAPConnection, BOOLEAN removeKeys, BOOLEAN immed return OK; } +/** +* +* apConn_reportRoamingEventDisconnect +* +* \b Description: +* +* Called by Roaming Manager to inform of Disconnect +* uStatusCode - status code of deauth/disassoc packet +* bDeAuthenticate - Whether this packet is DeAuth ( if +* DisAssoc than FALSE) +* +* \b ARGS: +* +* +* \b RETURNS: +* +* OK if successful, NOK otherwise. +* +* \sa +*/ +TI_STATUS apConn_reportRoamingEventDisconnect(TI_HANDLE hAPConnection,UINT16 uStatusCode,BOOLEAN bDeAuthenticate ) +{ + apConn_t *pAPConnection = (apConn_t *)hAPConnection; + roamingEventData_u RoamingEventData; + + RoamingEventData.APDisconnect.uStatusCode = uStatusCode ; /* status code of deauth/disassoc packet */ + RoamingEventData.APDisconnect.bDeAuthenticate = bDeAuthenticate; /* TRUE state that it is DeAuth packet */ + apConn_reportRoamingEvent(pAPConnection, ROAMING_TRIGGER_AP_DISCONNECT, &RoamingEventData); + return( TI_OK ); +} + /** * @@ -1618,19 +1656,14 @@ TI_STATUS apConn_reportRoamingEvent(TI_HANDLE hAPConnection, return OK; } - if (roamingEventType == ROAMING_TRIGGER_LOW_QUALITY) - { - EvHandlerSendEvent(pAPConnection->hEvHandler, IPC_EVENT_LOW_RSSI, NULL,0); - } - else if (roamingEventType == ROAMING_TRIGGER_LOW_SNR) - { - EvHandlerSendEvent(pAPConnection->hEvHandler, IPC_EVENT_LOW_SNR, NULL,0); - } - /* 5. Report Roaming Manager */ if ((pAPConnection->roamingEnabled == TRUE) && (pAPConnection->roamEventCallb != NULL)) { WLAN_REPORT_INFORMATION(pAPConnection->hReport, ROAMING_MANAGER_MODULE_LOG, ("Roaming event raised: ev = %d\n", roamingEventType)); + if (roamingEventType == ROAMING_TRIGGER_LOW_QUALITY) + { + EvHandlerSendEvent(pAPConnection->hEvHandler, IPC_EVENT_LOW_RSSI, NULL,0); + } /* Report to Roaming Manager */ pAPConnection->roamEventCallb(pAPConnection->hRoamMng, &roamingEventType); } @@ -1789,6 +1822,28 @@ void apConn_resetRoamingStatistics(TI_HANDLE hAPConnection) /** * +* apConn_stopRoamingStatistics +* +* \b Description: +* +* Called from Measurement CCX sub-module in order to stop roaming statistics. +* +* \b ARGS: AP Connection handle +* +* \b RETURNS: +* +* \sa +*/ +void apConn_stopRoamingStatistics(TI_HANDLE hAPConnection) +{ + apConn_t *pAPConnection = (apConn_t *)hAPConnection; + + pAPConnection->resetReportedRoamingStatistics = FALSE; +} + + +/** +* * apConn_printStatistics * * \b Description: @@ -1815,7 +1870,7 @@ void apConn_printStatistics(TI_HANDLE hAPConnection) WLAN_OS_REPORT(("- AP Disconnect = %d\n", ((apConn_t *)hAPConnection)->roamingTriggerEvents[ROAMING_TRIGGER_AP_DISCONNECT])); WLAN_OS_REPORT(("- SEC attack = %d\n", ((apConn_t *)hAPConnection)->roamingTriggerEvents[ROAMING_TRIGGER_SECURITY_ATTACK])); WLAN_OS_REPORT(("\n")); - WLAN_OS_REPORT(("- Succesfull roaming = %d\n", ((apConn_t *)hAPConnection)->roamingSuccesfulHandoverTotalNum)); + WLAN_OS_REPORT(("- Succesfull Total roaming = %d\n", ((apConn_t *)hAPConnection)->roamingSuccesfulHandoverTotalNum)); WLAN_OS_REPORT(("- Unsuccesfull roaming = %d\n", ((apConn_t *)hAPConnection)->roamingFailedHandoverNum)); WLAN_OS_REPORT(("- Giving up roaming = %d\n", ((apConn_t *)hAPConnection)->retainCurrAPNum)); WLAN_OS_REPORT(("- Disconnect cmd from roaming manager = %d\n", ((apConn_t *)hAPConnection)->disconnectFromRoamMngrNum)); @@ -1985,7 +2040,7 @@ static TI_STATUS apConn_startWaitingForTriggers(void *pData) { apConn_t *pAPConnection; apConn_connStatus_t reportStatus; - paramInfo_t param; + paramInfoPartial_t param; pAPConnection = (apConn_t *)pData; @@ -1993,7 +2048,7 @@ static TI_STATUS apConn_startWaitingForTriggers(void *pData) { param.paramType = ASSOC_ASSOCIATION_RESP_PARAM; - assoc_getParam(pAPConnection->hAssoc, ¶m); + assoc_getParamPartial(pAPConnection->hAssoc, ¶m); reportStatus.dataBuf = (char *)(param.content.applicationConfigBuffer.buffer); reportStatus.dataBufLength = param.content.applicationConfigBuffer.bufferSize; @@ -2034,7 +2089,7 @@ static TI_STATUS apConn_connectedToNewAP(void *pData) { apConn_t *pAPConnection; apConn_connStatus_t reportStatus; - paramInfo_t param; + paramInfoPartial_t param; pAPConnection = (apConn_t *)pData; @@ -2055,7 +2110,7 @@ static TI_STATUS apConn_connectedToNewAP(void *pData) { param.paramType = ASSOC_ASSOCIATION_RESP_PARAM; - assoc_getParam(pAPConnection->hAssoc, ¶m); + assoc_getParamPartial(pAPConnection->hAssoc, ¶m); reportStatus.dataBuf = (char *)(param.content.applicationConfigBuffer.buffer); reportStatus.dataBufLength = param.content.applicationConfigBuffer.bufferSize; @@ -2378,7 +2433,7 @@ static TI_STATUS apConn_invokeConnectionToNewAp(void *data) { apConn_t *pAPConnection; connType_e connType; - paramInfo_t param; + paramInfoPartial_t param; UINT8 staPrivacySupported, apPrivacySupported; BOOL renegotiateTspec = FALSE; @@ -2388,7 +2443,7 @@ static TI_STATUS apConn_invokeConnectionToNewAp(void *data) /* Check privacy compatibility */ param.paramType = RSN_ENCRYPTION_STATUS_PARAM; - rsn_getParam(pAPConnection->hPrivacy, ¶m); + rsn_getParamPartial(pAPConnection->hPrivacy, ¶m); staPrivacySupported = (param.content.rsnEncryptionStatus == RSN_CIPHER_NONE) ? FALSE : TRUE; apPrivacySupported = ((pAPConnection->newAP->capabilities >> CAP_PRIVACY_SHIFT) & CAP_PRIVACY_MASK) ? TRUE : FALSE; @@ -2396,7 +2451,7 @@ static TI_STATUS apConn_invokeConnectionToNewAp(void *data) if (staPrivacySupported != apPrivacySupported) { param.paramType = RSN_MIXED_MODE; - rsn_getParam(pAPConnection->hPrivacy, ¶m); + rsn_getParamPartial(pAPConnection->hPrivacy, ¶m); if (apPrivacySupported || (!param.content.rsnMixedMode && staPrivacySupported)) @@ -2477,7 +2532,7 @@ static TI_STATUS apConn_reportConnFail(void *data) { apConn_t *pAPConnection; apConn_connStatus_t reportStatus; - paramInfo_t param; + paramInfoPartial_t param; pAPConnection = (apConn_t *)data; @@ -2492,7 +2547,7 @@ static TI_STATUS apConn_reportConnFail(void *data) { param.paramType = ASSOC_ASSOCIATION_RESP_PARAM; - assoc_getParam(pAPConnection->hAssoc, ¶m); + assoc_getParamPartial(pAPConnection->hAssoc, ¶m); reportStatus.dataBuf = (char *)(param.content.applicationConfigBuffer.buffer); reportStatus.dataBufLength = param.content.applicationConfigBuffer.bufferSize; @@ -2526,12 +2581,12 @@ static TI_STATUS apConn_reportConnFail(void *data) static TI_STATUS apConn_configureDriverBeforeRoaming(void *pData) { apConn_t *pAPConnection = (apConn_t*)pData; - paramInfo_t param; + paramInfoPartial_t param; /* Configure SCR group of allowed clients according to 'Roaming' rule */ scr_setGroup (pAPConnection->hScr, SCR_GID_ROAMING); param.paramType = QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC; - qosMngr_getParams(pAPConnection->hQos, ¶m); + qosMngr_getParamsPatial(pAPConnection->hQos, ¶m); pAPConnection->voiceTspecConfigured = param.content.TspecConfigure.voiceTspecConfigure; pAPConnection->videoTspecConfigured = param.content.TspecConfigure.videoTspecConfigure; pAPConnection->resetReportedRoamingStatistics = FALSE; diff --git a/sta_dk_4_0_4_32/common/src/TNETW_Driver/MacServices/src/PowerAuthorization/PowerAuthorization.c b/sta_dk_4_0_4_32/common/src/TNETW_Driver/MacServices/src/PowerAuthorization/PowerAuthorization.c index fe9471a..f22c1e4 100644 --- a/sta_dk_4_0_4_32/common/src/TNETW_Driver/MacServices/src/PowerAuthorization/PowerAuthorization.c +++ b/sta_dk_4_0_4_32/common/src/TNETW_Driver/MacServices/src/PowerAuthorization/PowerAuthorization.c @@ -212,7 +212,6 @@ int powerAutho_CalcMinPowerLevel(TI_HANDLE hPowerAutho) { powerAutho_t *pPowerAutho = (powerAutho_t*)hPowerAutho; powerAutho_PowerPolicy_e newMinPowerLevel; - whalParamInfo_t ParamInfo; /* calc the new MinPowerLevel */ if(pPowerAutho->m_AwakeRequired > 0) @@ -235,10 +234,7 @@ int powerAutho_CalcMinPowerLevel(TI_HANDLE hPowerAutho) whalCtrl_ElpCtrl_SetMode(pPowerAutho->hHalCtrl, pPowerAutho->m_ElpCtrl_Mode_LUT[newMinPowerLevel]); /* Send MIB with PowerPolicy */ - ParamInfo.paramType = (UINT32)HAL_CTRL_MIN_POWER_LEVEL; - ParamInfo.paramLength = sizeof(powerAutho_PowerPolicy_e); - ParamInfo.content.minPowerPolicy = newMinPowerLevel; - whalCtrl_SetParam(pPowerAutho->hHalCtrl, &ParamInfo); + whalCtrl_SetMinPowerLevel(pPowerAutho->hHalCtrl, newMinPowerLevel); return OK; } } @@ -297,13 +293,12 @@ int powerAutho_Restart(TI_HANDLE hMacServices) { powerAutho_t *pPowerAutho = (powerAutho_t*)(((MacServices_t*)hMacServices)->hPowerAutho); - /* set as 'before init complete' */ + /* set as 'before init complete' */ pPowerAutho->initComplete = FALSE; pPowerAutho->m_PowerPolicy = POWERAUTHO_POLICY_AWAKE; pPowerAutho->m_MinPowerLevel = POWERAUTHO_POLICY_AWAKE; - return pPowerAutho->m_MinPowerLevel; } diff --git a/sta_dk_4_0_4_32/common/src/TNETW_Driver/TNETWIF/BusTxn/whalHwAccess.c b/sta_dk_4_0_4_32/common/src/TNETW_Driver/TNETWIF/BusTxn/whalHwAccess.c index 500a11a..9f3c601 100644 --- a/sta_dk_4_0_4_32/common/src/TNETW_Driver/TNETWIF/BusTxn/whalHwAccess.c +++ b/sta_dk_4_0_4_32/common/src/TNETW_Driver/TNETWIF/BusTxn/whalHwAccess.c @@ -117,7 +117,7 @@ #else /* ifdef _WINDOWS */ #endif /* ifdef _WINDOWS */ -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) #include "wspi.h" @@ -357,7 +357,7 @@ TI_HANDLE whal_hwAccess_Create(TI_HANDLE hOs) status = SDIO_Init(&configParams, &pHwAccess->hDriver); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) pHwAccess->AsyncMode = TRUE; @@ -403,7 +403,7 @@ int whal_hwAccess_Destroy(TI_HANDLE hHwAccess) SDIO_Stop(pHwAccess->hDriver, 0); SDIO_Shutdown(pHwAccess->hDriver); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) WSPI_Close(pHwAccess->hDriver); @@ -463,7 +463,7 @@ int whal_hwAccess_Config(TI_HANDLE hHwAccess, TI_HANDLE hReport,UINT32 RegBaseAd status = (status == SDIO_SUCCESS) ? TNETWIF_COMPLETE : TNETWIF_ERROR; -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) wspi_config.isFixedAddress = FALSE; wspi_config.fixedBusyLength = HW_ACCESS_WSPI_FIXED_BUSY_LEN; @@ -509,7 +509,7 @@ int whal_hwAccess_ReConfig(TI_HANDLE hHwAccess) #ifdef HW_ACCESS_SDIO SDIO_Stop (pHwAccess->hDriver, 0); SDIO_Start (pHwAccess->hDriver); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* TODO*/ #endif #endif /* _WINDOWS */ @@ -539,7 +539,7 @@ int whal_hwAccess_WriteELP (TI_HANDLE hHwAccess, UINT32 data) #ifdef HW_ACCESS_SDIO status = SDIO_TNETW_Set_ELP_Reg(pHwAccess->hDriver, HW_ACCESS_ELP_CTRL_REG_ADDR, data); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) status = WSPI_WriteSync (pHwAccess->hDriver, HW_ACCESS_ELP_CTRL_REG_ADDR, (UINT8*)&data, HW_ACCESS_REGISTER_SIZE); #endif @@ -738,7 +738,7 @@ int whal_hwAccess_ReadMem_Align(TI_HANDLE hHwAccess, UINT32 addr, UINT8* os_profile (pHwAccess->hOs, 3, 0); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* check address */ if (((addr+len) > pHwAccess->workingPartUpperLimit) || (addr < pHwAccess->MemRegionAddr)) @@ -839,7 +839,7 @@ int whal_hwAccess_WriteMem_Align(TI_HANDLE hHwAccess, UINT32 addr, UINT8 os_profile (pHwAccess->hOs, 3, 0); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* check address */ if (((addr+len) > pHwAccess->workingPartUpperLimit) || (addr < pHwAccess->MemRegionAddr)) @@ -1123,7 +1123,7 @@ int whal_hwAccess_ReadMem(TI_HANDLE hHwAccess, UINT32 addr, UINT8* data, #ifdef HW_ACCESS_SDIO struct SDIO_Request request; -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) int reminder = len%HW_ACCESS_WSPI_ALIGNED_SIZE; int tempLen = len - reminder; UINT32 mask = 0; @@ -1189,7 +1189,7 @@ int whal_hwAccess_ReadMem(TI_HANDLE hHwAccess, UINT32 addr, UINT8* data, return status; } -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* check address */ if (((addr+len) > pHwAccess->workingPartUpperLimit) || (addr < pHwAccess->MemRegionAddr)) @@ -1297,7 +1297,7 @@ int whal_hwAccess_WriteMem(TI_HANDLE hHwAccess, UINT32 addr, UINT8* data #ifdef HW_ACCESS_SDIO struct SDIO_Request request; -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) int reminder = len % HW_ACCESS_WSPI_ALIGNED_SIZE; int tempLen = len - reminder; UINT32 mask = 0; @@ -1360,7 +1360,7 @@ int whal_hwAccess_WriteMem(TI_HANDLE hHwAccess, UINT32 addr, UINT8* data return status; } -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* check address */ if (((addr+len) > pHwAccess->workingPartUpperLimit) || (addr < pHwAccess->MemRegionAddr)) @@ -1705,7 +1705,7 @@ int whal_hwAccess_ReadMemAsync (TI_HANDLE hHwAccess, UINT32 addr, UINT8* data, U return TNETWIF_COMPLETE; } -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) os_profile (pHwAccess->hOs, 2, 0); @@ -1779,7 +1779,7 @@ int whal_hwAccess_ReadReg(TI_HANDLE hHwAccess, UINT32 addr, UINT32* data os_profile (pHwAccess->hOs, 3, 0); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) status = whal_hwAccess_ReadRegAsync(hHwAccess, addr, data); if (status == TNETWIF_COMPLETE) @@ -1856,7 +1856,7 @@ int whal_hwAccess_Stop(TI_HANDLE hHwAccess) #ifdef HW_ACCESS_SDIO SDIO_Stop(pHwAccess->hDriver,0); -#elif defined (HW_ACCESS_WSPI) +#elif defined(HW_ACCESS_WSPI) /* TODO*/ #endif return OK; @@ -1914,7 +1914,7 @@ int whal_hwAccess_WriteReg(TI_HANDLE hHwAccess, UINT32 addr, UINT32 data os_profile (pHwAccess->hOs, 3, 0); -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) status = whal_hwAccess_WriteRegAsync(hHwAccess, addr, data); if (status == TNETWIF_COMPLETE) { @@ -2176,7 +2176,7 @@ int whal_hwAccess_SetPartitions (TI_HANDLE hHwAccess, TNETIF_HwAccess_SetPartiti status = (status == SDIO_SUCCESS) ? SDIO_TNETWConfig(pHwAccess->hDriver, &cfg) : status; status = (status == SDIO_SUCCESS) ? TNETWIF_COMPLETE : TNETWIF_ERROR; -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* * IMPORTANT NOTE (TODO): the ASYNC API is used here assuming the call will always * be completed synchronously. This is done because only the Async API is wokring @@ -2272,7 +2272,7 @@ int whal_hwAccess_SetPartitionsAsync (TI_HANDLE hHwAccess, TNETIF_HwAccess_SetPa status = (status == SDIO_SUCCESS) ? SDIO_TNETWConfig(pHwAccess->hDriver, &cfg) : status; status = (status == SDIO_SUCCESS) ? TNETWIF_COMPLETE : TNETWIF_ERROR; -#elif HW_ACCESS_WSPI +#elif defined(HW_ACCESS_WSPI) /* May use only one write because the addresses in the firmware are sequential */ status = WSPI_WriteAsync (pHwAccess->hDriver, @@ -2867,7 +2867,7 @@ void whal_hwAccess_Print(TI_HANDLE hHwAccess) return (status == SDIO_SUCCESS) ? OK : NOK; } -#elif defined (HW_ACCESS_WSPI) +#elif defined(HW_ACCESS_WSPI) TI_STATUS whal_hwAccess_RecreateInterface(TI_HANDLE hHwAccess) { HwAccess_T_new *pHwAccess = (HwAccess_T_new*)hHwAccess; diff --git a/sta_dk_4_0_4_32/common/src/core/ExpInc/apConnApi.h b/sta_dk_4_0_4_32/common/src/core/ExpInc/apConnApi.h index b064aca..75d6669 100644 --- a/sta_dk_4_0_4_32/common/src/core/ExpInc/apConnApi.h +++ b/sta_dk_4_0_4_32/common/src/core/ExpInc/apConnApi.h @@ -177,8 +177,9 @@ BOOL apConn_isSiteBanned(TI_HANDLE hAPConnection, macAddress_t * bssid); BOOL apConn_getPreAuthAPStatus(TI_HANDLE hAPConnection, macAddress_t *givenAp); -TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs); +TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs, UINT8 listAPs_numOfEntries); TI_STATUS apConn_prepareToRoaming(TI_HANDLE hAPConnection, apConn_roamingTrigger_e reason); +TI_STATUS apConn_reportRoamingEventDisconnect(TI_HANDLE hAPConnection,UINT16 uStatusCode,BOOLEAN bDeAuthenticate ); #endif /* _AP_CONNECTION_API_H_*/ diff --git a/sta_dk_4_0_4_32/common/src/core/data_ctrl/Ctrl/Ctrl.c b/sta_dk_4_0_4_32/common/src/core/data_ctrl/Ctrl/Ctrl.c index ac72e51..bcf57e1 100644 --- a/sta_dk_4_0_4_32/common/src/core/data_ctrl/Ctrl/Ctrl.c +++ b/sta_dk_4_0_4_32/common/src/core/data_ctrl/Ctrl/Ctrl.c @@ -220,7 +220,6 @@ TI_STATUS ctrlData_config(TI_HANDLE hCtrlData, pCtrlData->disassocSentCBObj = disassocSentCBObj; pCtrlData->disassocSentCBFunc = disassocSentCBFunc; - /* set Control module parameters */ pCtrlData->ctrlDataRateControlEnable = ctrlDataInitParams->ctrlDataRateControlEnable; pCtrlData->ctrlDataIbssProtectionType = ctrlDataInitParams->ctrlDataDesiredIbssProtection; @@ -491,6 +490,39 @@ TI_STATUS ctrlData_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo) return (OK); } + +/*************************************************************************** +* ctrlData_getParam * +**************************************************************************** +* DESCRIPTION: get a specific parameter +* +* INPUTS: hCtrlData - the object +* +* +* OUTPUT: pParamInfo - structure which include the value of +* the requested parameter +* +* RETURNS: OK +* NOK +***************************************************************************/ +/* note: ctrlData_getParamPartial() is part of ctrlData_getParam() it was implemented to reduce Stack usage */ +TI_STATUS ctrlData_getParamPartial(TI_HANDLE hCtrlData, paramInfoPartial_t *pParamInfo) +{ + ctrlData_t *pCtrlData = (ctrlData_t *)hCtrlData; + + switch (pParamInfo->paramType) + { + case CTRL_DATA_CURRENT_PREAMBLE_TYPE_PARAM: + pParamInfo->content.ctrlDataCurrentPreambleType = pCtrlData->ctrlDataCurrentPreambleType; + break; + + default: + return (PARAM_NOT_SUPPORTED); + } + + return (OK); +} + /*************************************************************************** * ctrlData_buildSupportedHwRates * **************************************************************************** @@ -1374,6 +1406,7 @@ void ctrlData_txCompleteStatus( TI_HANDLE hCtrlData, ("De Auth TxCmplt: txStatus = %d, txActualRate = %d \n",pTxCompleteAttr->status,pTxCompleteAttr->rate)); pCtrlData->disassocSentCBFunc( pCtrlData->disassocSentCBObj ); } + if(txData_isQueueUseMediumTime(pCtrlData->hTxData , qId) == TRUE ) { WLAN_REPORT_INFORMATION(pCtrlData->hReport, CTRL_DATA_MODULE_LOG, diff --git a/sta_dk_4_0_4_32/common/src/core/inc/DataCtrl_Api.h b/sta_dk_4_0_4_32/common/src/core/inc/DataCtrl_Api.h index d376a39..d17061b 100644 --- a/sta_dk_4_0_4_32/common/src/core/inc/DataCtrl_Api.h +++ b/sta_dk_4_0_4_32/common/src/core/inc/DataCtrl_Api.h @@ -86,7 +86,7 @@ TI_STATUS rxData_config(TI_HANDLE hRxData, TI_HANDLE hCtrlData, TI_HANDLE hTxData, TI_HANDLE hTnetwDrv, - TI_HANDLE hHalCtrl, + TI_HANDLE hHalCtrl, TI_HANDLE hMlme, TI_HANDLE hRsn, TI_HANDLE hSiteMgr, @@ -94,8 +94,8 @@ TI_STATUS rxData_config(TI_HANDLE hRxData, TI_HANDLE hOs, TI_HANDLE hReport, TI_HANDLE hMemMngr, - TI_HANDLE hEvHandler, - rxDataInitParams_t * rxDataInitParams); + TI_HANDLE hEvHandler, + rxDataInitParams_t * rxDataInitParams); void rxData_receiveMsduFromWlan(TI_HANDLE hRxData, mem_MSDU_T *pMsdu, Rx_attr_t* pRxAttr); @@ -326,6 +326,8 @@ TI_STATUS ctrlData_unLoad(TI_HANDLE hCtrlData); TI_STATUS ctrlData_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo); +TI_STATUS ctrlData_getParamPartial(TI_HANDLE hCtrlData, paramInfoPartial_t *pParamInfo); + TI_STATUS ctrlData_setParam(TI_HANDLE hCtrlData, paramInfo_t *pParamInfo); TI_STATUS ctrlData_start(TI_HANDLE hCtrlData); diff --git a/sta_dk_4_0_4_32/common/src/core/inc/mlmeApi.h b/sta_dk_4_0_4_32/common/src/core/inc/mlmeApi.h index c15079b..ffd458d 100644 --- a/sta_dk_4_0_4_32/common/src/core/inc/mlmeApi.h +++ b/sta_dk_4_0_4_32/common/src/core/inc/mlmeApi.h @@ -232,6 +232,8 @@ TI_STATUS assoc_setParam(TI_HANDLE hCtrlData, paramInfo_t *pParam); TI_STATUS assoc_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParam); +TI_STATUS assoc_getParamPartial(TI_HANDLE hAssoc, paramInfoPartial_t *pParam); + /* Authentication SM API */ TI_HANDLE auth_create(TI_HANDLE hOs); diff --git a/sta_dk_4_0_4_32/common/src/core/inc/rsnApi.h b/sta_dk_4_0_4_32/common/src/core/inc/rsnApi.h index eb06c0a..beb90c5 100644 --- a/sta_dk_4_0_4_32/common/src/core/inc/rsnApi.h +++ b/sta_dk_4_0_4_32/common/src/core/inc/rsnApi.h @@ -171,6 +171,8 @@ TI_STATUS rsn_setParam(TI_HANDLE hCtrlData, paramInfo_t *pParam); TI_STATUS rsn_getParam(TI_HANDLE hCtrlData, paramInfo_t *pParam); +TI_STATUS rsn_getParamPartial(TI_HANDLE hRsn, paramInfoPartial_t *pParam); + TI_STATUS rsn_evalSite(TI_HANDLE hRsn, rsnData_t *pRsnData, bssType_e bssType, macAddress_t bssid, UINT32 *pMetric); TI_STATUS rsn_setSite(TI_HANDLE hRsn, rsnData_t *pRsnData, UINT8 *pAssocIe, UINT8 *pAssocIeLen); diff --git a/sta_dk_4_0_4_32/common/src/core/mlme/Assoc/assocSM.c b/sta_dk_4_0_4_32/common/src/core/mlme/Assoc/assocSM.c index 48acd72..d9b9668 100644 --- a/sta_dk_4_0_4_32/common/src/core/mlme/Assoc/assocSM.c +++ b/sta_dk_4_0_4_32/common/src/core/mlme/Assoc/assocSM.c @@ -767,6 +767,55 @@ TI_STATUS assoc_getParam(TI_HANDLE hAssoc, paramInfo_t *pParam) /** * +* assoc_getParamPartial - Get a specific parameter from the association SM +* +* \b Description: +* +* Get a specific parameter from the association SM. +* +* \b ARGS: +* +* I - hAssoc - Association SM context \n +* I/O - pParam - Parameter \n +* +* \b RETURNS: +* +* OK if successful, NOK otherwise. +* +* \sa assoc_Start, assoc_Stop +*/ +/* note: assoc_getParamPartial() is part of assoc_getParam() it was implemented to reduce Stack usage */ +TI_STATUS assoc_getParamPartial(TI_HANDLE hAssoc, paramInfoPartial_t *pParam) +{ + assoc_t *pHandle; + + pHandle = (assoc_t*)hAssoc; + + if ((pHandle == NULL) || (pParam == NULL)) + { + return NOK; + } + + /* serch parameter type */ + switch (pParam->paramType) + { + case ASSOC_ASSOCIATION_RESP_PARAM: + pParam->content.applicationConfigBuffer.buffer = pHandle->assocRespBuffer; + pParam->content.applicationConfigBuffer.bufferSize = pHandle->assocRespLen; + break; + + default: + WLAN_REPORT_ERROR(pHandle->hReport, ASSOC_MODULE_LOG, + ("assoc_getParamPartial no such entry %d\n",pParam->paramType)); + return NOK; + } + + return OK; +} + + +/** +* * assoc_setParam - Set a specific parameter to the association SM * * \b Description: @@ -963,7 +1012,7 @@ TI_STATUS assoc_smFailureWait(assoc_t *pAssoc) else /* (uRspStatus == 0) how did we get here ? */ { WLAN_REPORT_ERROR(pAssoc->hReport, ASSOC_MODULE_LOG, - ("%s while Response status is OK (0) !!! \n")); + ("assoc_smFailureWait: while Response status is OK (0) !!! \n")); status = assoc_smReportFailure(pAssoc, (UINT16)NOK); } diff --git a/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa.c b/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa.c index c878cf1..66a705f 100644 --- a/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa.c +++ b/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa.c @@ -73,6 +73,15 @@ #define MAX_WPA_CIPHER_SUITE 7 +/**************************************************************/ +/* reduce stack usage (admCtrlWpa_setSite)*/ +/**************************************************************/ +static paramInfo_t param; +static whalParamInfo_t whalParam; +static wpaIeData_t gWpaDataIE; +/**************************************************************/ + + /* Enumerations */ @@ -711,9 +720,6 @@ TI_STATUS admCtrlWpa_getInfoElement(admCtrl_t *pAdmCtrl, UINT8 *pIe, UINT8 *pLen TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pAssocIe, UINT8 *pAssocIeLen) { TI_STATUS status; - paramInfo_t param; - whalParamInfo_t whalParam; - wpaIeData_t wpaData; cipherSuite_e encryptionStatus; admCtrlWpa_validity_t *pAdmCtrlWpa_validity=NULL; UINT8 *pWpaIe; @@ -763,23 +769,23 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA { return status; } - status = admCtrlWpa_parseIe(pAdmCtrl, pWpaIe, &wpaData); + status = admCtrlWpa_parseIe(pAdmCtrl, pWpaIe, &gWpaDataIE); if (status != OK) { return status; } - if ((wpaData.unicastSuite[0]>=MAX_WPA_CIPHER_SUITE) || - (wpaData.broadcastSuite>=MAX_WPA_CIPHER_SUITE) || + if ((gWpaDataIE.unicastSuite[0]>=MAX_WPA_CIPHER_SUITE) || + (gWpaDataIE.broadcastSuite>=MAX_WPA_CIPHER_SUITE) || (pAdmCtrl->unicastSuite>=MAX_WPA_CIPHER_SUITE)) { return NOK; } - pAdmCtrl->encrInSw = wpaData.excKp; - pAdmCtrl->micInSw = wpaData.excMic; + pAdmCtrl->encrInSw = gWpaDataIE.excKp; + pAdmCtrl->micInSw = gWpaDataIE.excMic; /*Because ckip is a proprietary encryption for Cisco then a different validity check is needed */ - if(wpaData.broadcastSuite == RSN_CIPHER_CKIP || wpaData.unicastSuite[0] == RSN_CIPHER_CKIP) + if(gWpaDataIE.broadcastSuite == RSN_CIPHER_CKIP || gWpaDataIE.unicastSuite[0] == RSN_CIPHER_CKIP) { pAdmCtrl->getCipherSuite(pAdmCtrl, &encryptionStatus); /*Funk supplicant can support CCKM only if it configures the driver to TKIP encryption. */ @@ -791,15 +797,15 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA else { /* Check validity of Group suite */ - if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][wpaData.broadcastSuite]) + if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][gWpaDataIE.broadcastSuite]) { /* check Group suite validity */ return NOK; } pAdmCtrl->getCipherSuite(pAdmCtrl, &encryptionStatus); - for (index=0; index<wpaData.unicastSuiteCnt; index++) + for (index=0; index<gWpaDataIE.unicastSuiteCnt; index++) { - pAdmCtrlWpa_validity = &admCtrlWpa_validityTable[wpaData.unicastSuite[index]][wpaData.broadcastSuite][encryptionStatus]; + pAdmCtrlWpa_validity = &admCtrlWpa_validityTable[gWpaDataIE.unicastSuite[index]][gWpaDataIE.broadcastSuite][encryptionStatus]; if (pAdmCtrlWpa_validity->status ==OK) { break; @@ -812,11 +818,11 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA } /* set cipher suites */ - wpaData.unicastSuite[0] = pAdmCtrlWpa_validity->unicast ;/*wpaData.unicastSuite[0];*/ - wpaData.broadcastSuite = pAdmCtrlWpa_validity->broadcast; /*wpaData.broadcastSuite;*/ + gWpaDataIE.unicastSuite[0] = pAdmCtrlWpa_validity->unicast ;/*wpaData.unicastSuite[0];*/ + gWpaDataIE.broadcastSuite = pAdmCtrlWpa_validity->broadcast; /*wpaData.broadcastSuite;*/ } /* set external auth mode according to the key Mng Suite */ - switch (wpaData.KeyMngSuite[0]) + switch (gWpaDataIE.KeyMngSuite[0]) { case WPA_IE_KEY_MNG_NONE: pAdmCtrl->externalAuthMode = RSN_EXT_AUTH_MODE_OPEN; @@ -839,16 +845,16 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA #ifdef EXC_MODULE_INCLUDED param.paramType = EXC_CCKM_EXISTS; - param.content.excCckmExists = (wpaData.KeyMngSuite[0]==WPA_IE_KEY_MNG_CCKM) ? TRUE : FALSE; + param.content.excCckmExists = (gWpaDataIE.KeyMngSuite[0]==WPA_IE_KEY_MNG_CCKM) ? TRUE : FALSE; excMngr_setParam(pAdmCtrl->hExcMngr, ¶m); #endif /* set replay counter */ - pAdmCtrl->replayCnt = wpaData.replayCounters; + pAdmCtrl->replayCnt = gWpaDataIE.replayCounters; *pAssocIeLen = pRsnData->ieLen; if (pAssocIe != NULL) { - os_memoryCopy(pAdmCtrl->hOs, pAssocIe, &wpaData, sizeof(wpaIeData_t)); + os_memoryCopy(pAdmCtrl->hOs, pAssocIe, &gWpaDataIE, sizeof(wpaIeData_t)); } @@ -883,7 +889,7 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA /* Configure privacy status in HAL so that HW is prepared to recieve keys */ whalParam.paramType = HAL_CTRL_RSN_SECURITY_MODE_PARAM; - whalParam.content.rsnEncryptionStatus = (halCtrl_CipherSuite_e)wpaData.unicastSuite[0]; + whalParam.content.rsnEncryptionStatus = (halCtrl_CipherSuite_e)gWpaDataIE.unicastSuite[0]; status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam); if (status != OK) { @@ -894,14 +900,14 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA /* set MIC and KP in HAL */ whalParam.paramType = HAL_CTRL_RSN_EXC_SW_ENC_ENABLE_PARAM; - whalParam.content.rsnExcSwEncFlag = wpaData.excKp; + whalParam.content.rsnExcSwEncFlag = gWpaDataIE.excKp; status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam); if (status != OK) { return status; } whalParam.paramType = HAL_CTRL_RSN_EXC_MIC_FIELD_ENABLE_PARAM; - whalParam.content.rsnExcMicFieldFlag = wpaData.excMic; + whalParam.content.rsnExcMicFieldFlag = gWpaDataIE.excMic; status = whalCtrl_SetParam(pAdmCtrl->pRsn->hWhalCtrl, &whalParam); if (status != OK) @@ -911,7 +917,7 @@ TI_STATUS admCtrlWpa_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pA #endif /*EXC_MODULE_INCLUDED*/ /* re-config PAE */ - status = admCtrlWpa_dynamicConfig(pAdmCtrl,&wpaData); + status = admCtrlWpa_dynamicConfig(pAdmCtrl,&gWpaDataIE); if (status != OK) { return status; diff --git a/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa2.c b/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa2.c index f83b762..9e3fb36 100644 --- a/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa2.c +++ b/sta_dk_4_0_4_32/common/src/core/rsn/admCtrlWpa2.c @@ -93,6 +93,14 @@ /* Global variables */ static UINT8 wpa2IeOuiIe[3] = { 0x00, 0x0f, 0xac}; +/**************************************************************/ +/* reduce stack usage (admCtrlWpa_setSite)*/ +/**************************************************************/ +static paramInfo_t param; +static whalParamInfo_t whalParam; +static wpa2IeData_t wpa2DataIE; +/**************************************************************/ + static BOOL broadcastCipherSuiteValidity[MAX_NETWORK_MODE][MAX_WPA2_CIPHER_SUITE]= { /* RSN_IBSS */ { @@ -716,9 +724,6 @@ TI_STATUS admCtrlWpa2_getInfoElement(admCtrl_t *pAdmCtrl, UINT8 *pIe, UINT8 *pLe TI_STATUS admCtrlWpa2_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *pAssocIe, UINT8 *pAssocIeLen) { TI_STATUS status; - paramInfo_t param; - whalParamInfo_t whalParam; - wpa2IeData_t wpa2Data; rsn_paeConfig_t paeConfig; UINT8 *pWpa2Ie; cipherSuite_e uSuite, bSuite; @@ -769,34 +774,34 @@ TI_STATUS admCtrlWpa2_setSite(admCtrl_t *pAdmCtrl, rsnData_t *pRsnData, UINT8 *p WLAN_REPORT_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG, ("admCtrlWpa2_setSite: RSN_IE=\n")); WLAN_REPORT_HEX_INFORMATION(pAdmCtrl->hReport, RSN_MODULE_LOG, pRsnData->pIe, pRsnData->ieLen); - status = admCtrlWpa2_parseIe(pAdmCtrl, pWpa2Ie, &wpa2Data); + status = admCtrlWpa2_parseIe(pAdmCtrl, pWpa2Ie, &wpa2DataIE); if (status != OK) { return status; } - if ((wpa2Data.unicastSuite[0]>=MAX_WPA2_CIPHER_SUITE) || - (wpa2Data.broadcastSuite>=MAX_WPA2_CIPHER_SUITE) || + if ((wpa2DataIE.unicastSuite[0]>=MAX_WPA2_CIPHER_SUITE) || + (wpa2DataIE.broadcastSuite>=MAX_WPA2_CIPHER_SUITE) || (pAdmCtrl->unicastSuite>=MAX_WPA2_CIPHER_SUITE)) { return NOK; } /* Check validity of Group suite */ - if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][wpa2Data.broadcastSuite]) + if (!broadcastCipherSuiteValidity[pAdmCtrl->networkMode][wpa2DataIE.broadcastSuite]) { /* check Group suite validity */ return NOK; } - if(admCtrlWpa2_getCipherSuiteMetric (pAdmCtrl, &wpa2Data, NULL, &uSuite, &bSuite) != OK) + if(admCtrlWpa2_getCipherSuiteMetric (pAdmCtrl, &wpa2DataIE, NULL, &uSuite, &bSuite) != OK) return NOK; /* set replay counter */ - pAdmCtrl->replayCnt = wpa2Data.ptkReplayCounters; + pAdmCtrl->replayCnt = wpa2DataIE.ptkReplayCounters; *pAssocIeLen = pRsnData->ieLen; if (pAssocIe != NULL) { - os_memoryCopy(pAdmCtrl->hOs, pAssocIe, &wpa2Data, sizeof(wpa2IeData_t)); + os_memoryCopy(pAdmCtrl->hOs, pAssocIe, &wpa2DataIE, sizeof(wpa2IeData_t)); } /* re-config PAE with updated unicast and broadcast suite values */ diff --git a/sta_dk_4_0_4_32/common/src/core/rsn/rsn.c b/sta_dk_4_0_4_32/common/src/core/rsn/rsn.c index 713b25c..e49d733 100644 --- a/sta_dk_4_0_4_32/common/src/core/rsn/rsn.c +++ b/sta_dk_4_0_4_32/common/src/core/rsn/rsn.c @@ -765,6 +765,63 @@ TI_STATUS rsn_getParam(TI_HANDLE hRsn, paramInfo_t *pParam) /** * +* rsn_getParamPartial - Get a specific parameter from the rsniation SM +* +* \b Description: +* +* Get a specific parameter from the rsniation SM. +* +* \b ARGS: +* +* I - hRsn - Rsniation SM context \n +* I/O - pParam - Parameter \n +* +* \b RETURNS: +* +* OK if successful, NOK otherwise. +* +* \sa rsn_Start, rsn_Stop +*/ + +/* note: rsn_getParamPartial() is part of rsn_getParam() it was implemented to reduce Stack usage */ +TI_STATUS rsn_getParamPartial(TI_HANDLE hRsn, paramInfoPartial_t *pParam) +{ + rsn_t *pRsn; + TI_STATUS status = OK; + + pRsn = (rsn_t*)hRsn; + + if ((pRsn == NULL) || (pParam == NULL)) + { + return NOK; + } + + switch (pParam->paramType) + { + case RSN_PRE_AUTH_STATUS: + { + UINT8 cacheIndex; + + pParam->content.rsnPreAuthStatus = pRsn->pAdmCtrl->getPreAuthStatus (pRsn->pAdmCtrl, &pParam->content.rsnApMac, &cacheIndex); + } + break; + + case RSN_ENCRYPTION_STATUS_PARAM: + status = pRsn->pAdmCtrl->getCipherSuite (pRsn->pAdmCtrl, &pParam->content.rsnEncryptionStatus); + break; + + case RSN_MIXED_MODE: + status = pRsn->pAdmCtrl->getMixedMode (pRsn->pAdmCtrl, &pParam->content.rsnMixedMode); + break; + + default: + return NOK; + } + + return status; +} +/** +* * rsn_SetParam - Set a specific parameter to the rsniation SM * * \b Description: diff --git a/sta_dk_4_0_4_32/common/src/core/sme/conn/conn.c b/sta_dk_4_0_4_32/common/src/core/sme/conn/conn.c index df26ad9..0ee57d9 100644 --- a/sta_dk_4_0_4_32/common/src/core/sme/conn/conn.c +++ b/sta_dk_4_0_4_32/common/src/core/sme/conn/conn.c @@ -383,7 +383,7 @@ TI_STATUS conn_start(TI_HANDLE hConn, connType_e connType, BOOL reNegotiateTspec) { conn_t *pConn = (conn_t *)hConn; - paramInfo_t param; + paramInfoPartial_t param; pConn->pConnStatusCB = pConnStatusCB; pConn->connStatCbObj = connStatCbObj; @@ -399,7 +399,7 @@ TI_STATUS conn_start(TI_HANDLE hConn, connType_e connType, param.paramType = QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC; param.content.TspecConfigure.voiceTspecConfigure = reNegotiateTspec; param.content.TspecConfigure.videoTspecConfigure = reNegotiateTspec; - qosMngr_setParams(pConn->hQosMngr, ¶m); + qosMngr_setParamsPartial(pConn->hQosMngr, ¶m); switch(pConn->currentConnType) { @@ -671,7 +671,7 @@ static void release_module(conn_t *pConn, UINT32 initVec) if (initVec & (1 << TIMER_INIT_BIT)) utils_nullTimerDestroy(pConn->hOs, pConn->pTimer); - if (initVec & (1 << CONN_INIT_BIT)) + if (initVec & (1 << CONN_INIT_BIT)) utils_nullMemoryFree(pConn->hOs, pConn, sizeof(conn_t)); initVec = 0; diff --git a/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/select.c b/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/select.c index 0872bfa..16e444c 100644 --- a/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/select.c +++ b/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/select.c @@ -177,6 +177,14 @@ static TI_STATUS sendProbeResponse(siteMgr_t *pSiteMgr, macAddress_t *pBssid); /* Interface functions Implementation */ +/**************************************************************/ +/* DEBUG CLI CRASH (systemConfig stack usage reduction) */ +/**************************************************************/ + +static paramInfo_t gSystemCfgParam; +static UINT8 curRsnData[255]; +/**************************************************************/ + /*********************************************************************** * siteMgr_disSelectSite *********************************************************************** @@ -1150,13 +1158,11 @@ RETURN: OK ************************************************************************/ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) { - paramInfo_t param; siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite; rsnData_t rsnData; UINT8 rsnAssocIeLen; dot11_RSN_t *pRsnIe; UINT8 rsnIECount=0; - UINT8 curRsnData[255]; UINT16 length; UINT16 capabilities; UINT16 PktLength=0; @@ -1269,21 +1275,21 @@ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) pSiteMgr->currentDataModulation = pSiteMgr->chosenModulation; /***************** Config Data CTRL *************************/ - param.paramType = CTRL_DATA_CURRENT_BSSID_PARAM; /* Current BSSID */ - os_memoryCopy(pSiteMgr->hOs, &(param.content.ctrlDataCurrentBSSID), &(pPrimarySite->bssid), sizeof(macAddress_t)); - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_BSSID_PARAM; /* Current BSSID */ + os_memoryCopy(pSiteMgr->hOs, &(gSystemCfgParam.content.ctrlDataCurrentBSSID), &(pPrimarySite->bssid), sizeof(macAddress_t)); + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); - param.paramType = CTRL_DATA_CURRENT_BSS_TYPE_PARAM; /* Current BSS Type */ - param.content.ctrlDataCurrentBssType = pPrimarySite->bssType; - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_BSS_TYPE_PARAM; /* Current BSS Type */ + gSystemCfgParam.content.ctrlDataCurrentBssType = pPrimarySite->bssType; + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); - param.paramType = CTRL_DATA_CURRENT_PREAMBLE_TYPE_PARAM; /* Current Preamble Type */ + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_PREAMBLE_TYPE_PARAM; /* Current Preamble Type */ if ((pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_SHORT) && (pPrimarySite->currentPreambleType == PREAMBLE_SHORT)) - param.content.ctrlDataCurrentPreambleType = PREAMBLE_SHORT; + gSystemCfgParam.content.ctrlDataCurrentPreambleType = PREAMBLE_SHORT; else - param.content.ctrlDataCurrentPreambleType = PREAMBLE_LONG; - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + gSystemCfgParam.content.ctrlDataCurrentPreambleType = PREAMBLE_LONG; + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); /* Mutual Rates Matching */ StaTotalRates = pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.basicRateMask | @@ -1307,29 +1313,27 @@ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) pSiteMgr->pDesiredParams->siteMgrMatchedMaxActiveRate = MAX(pSiteMgr->pDesiredParams->siteMgrMatchedMaxBasicRate,pSiteMgr->pDesiredParams->siteMgrMatchedMaxActiveRate); - param.paramType = CTRL_DATA_CURRENT_BASIC_RATE_PARAM; /* Current Basic Rate */ - param.content.ctrlDataCurrentBasicRate = (rate_e)pSiteMgr->pDesiredParams->siteMgrMatchedMaxBasicRate; - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_BASIC_RATE_PARAM; /* Current Basic Rate */ + gSystemCfgParam.content.ctrlDataCurrentBasicRate = (rate_e)pSiteMgr->pDesiredParams->siteMgrMatchedMaxBasicRate; + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); - param.paramType = CTRL_DATA_CURRENT_BASIC_RATE_MASK_PARAM; - param.content.ctrlDataBasicRateBitMask = pSiteMgr->pDesiredParams->siteMgrMatchedBasicRateMask; - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); - - param.paramType = CTRL_DATA_CURRENT_BASIC_MODULATION_PARAM; /* Current Mgmt Rate */ + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_BASIC_RATE_MASK_PARAM; + gSystemCfgParam.content.ctrlDataBasicRateBitMask = pSiteMgr->pDesiredParams->siteMgrMatchedBasicRateMask; + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_BASIC_MODULATION_PARAM; /* Current Mgmt Rate */ if ((pPrimarySite->maxBasicRate == DRV_RATE_1M) || (pPrimarySite->maxBasicRate == DRV_RATE_2M)) - param.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_QPSK; + gSystemCfgParam.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_QPSK; else if (pPrimarySite->maxBasicRate == DRV_RATE_22M) - param.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_PBCC; + gSystemCfgParam.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_PBCC; else if (pPrimarySite->maxBasicRate < DRV_RATE_22M) - param.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_CCK; + gSystemCfgParam.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_CCK; else - param.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_OFDM; - - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + gSystemCfgParam.content.ctrlDataCurrentBasicModulationType = DRV_MODULATION_OFDM; - param.paramType = CTRL_DATA_CURRENT_PROTECTION_STATUS_PARAM; - param.content.ctrlDataProtectionEnabled = pPrimarySite->useProtection; - ctrlData_setParam(pSiteMgr->hCtrlData, ¶m); + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); + gSystemCfgParam.paramType = CTRL_DATA_CURRENT_PROTECTION_STATUS_PARAM; + gSystemCfgParam.content.ctrlDataProtectionEnabled = pPrimarySite->useProtection; + ctrlData_setParam(pSiteMgr->hCtrlData, &gSystemCfgParam); ctrlData_setSite(pSiteMgr->hCtrlData, &pPrimarySite->fourXParams); @@ -1341,30 +1345,30 @@ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) status = siteMgr_getWMEParamsSite(pSiteMgr,&p_ACParametersDummy); if(status == OK) { - param.content.qosSiteProtocol = WME; + gSystemCfgParam.content.qosSiteProtocol = WME; } else { - param.content.qosSiteProtocol = NONE_QOS; + gSystemCfgParam.content.qosSiteProtocol = NONE_QOS; } WLAN_REPORT_DEBUG_TX(pSiteMgr->hReport, - (" systemConfigt() : param.content.qosSiteProtoco %d\n", param.content.qosSiteProtocol)); + (" systemConfigt() : param.content.qosSiteProtoco %d\n", gSystemCfgParam.content.qosSiteProtocol)); - param.paramType = QOS_MNGR_SET_SITE_PROTOCOL; - qosMngr_setParams(pSiteMgr->hQosMngr,¶m); + gSystemCfgParam.paramType = QOS_MNGR_SET_SITE_PROTOCOL; + qosMngr_setParams(pSiteMgr->hQosMngr,&gSystemCfgParam); /* Set active protocol in qosMngr according to station desired mode and site capabilities Must be called BEFORE setting the "CURRENT_PS_MODE" into the QosMngr */ qosMngr_selectActiveProtocol(pSiteMgr->hQosMngr); /* set PS capability parameter */ - param.paramType = QOS_MNGR_CURRENT_PS_MODE; + gSystemCfgParam.paramType = QOS_MNGR_CURRENT_PS_MODE; if(pPrimarySite->APSDSupport == TRUE) - param.content.currentPsMode = PS_SCHEME_UPSD_TRIGGER; + gSystemCfgParam.content.currentPsMode = PS_SCHEME_UPSD_TRIGGER; else - param.content.currentPsMode = PS_SCHEME_LEGACY_PSPOLL; - qosMngr_setParams(pSiteMgr->hQosMngr,¶m); + gSystemCfgParam.content.currentPsMode = PS_SCHEME_LEGACY_PSPOLL; + qosMngr_setParams(pSiteMgr->hQosMngr,&gSystemCfgParam); /* Set upsd/ps_poll configuration */ /* Must be done AFTER setting the active Protocol */ @@ -1406,9 +1410,9 @@ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) { WLAN_REPORT_INFORMATION(pSiteMgr->hReport, SITE_MGR_MODULE_LOG, ("Select Exc_ParseClientTP == OK: Dbm = %d\n",ExternTxPower)); - param.paramType = REGULATORY_DOMAIN_EXTERN_TX_POWER_PREFERRED; - param.content.ExternTxPowerPreferred = ExternTxPower; - regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,¶m); + gSystemCfgParam.paramType = REGULATORY_DOMAIN_EXTERN_TX_POWER_PREFERRED; + gSystemCfgParam.content.ExternTxPowerPreferred = ExternTxPower; + regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,&gSystemCfgParam); } /* Parse and save the EXC Version Number if exists */ excMngr_parseExcVer(pSiteMgr->hExcMngr, pIeBuffer, PktLength); @@ -1418,9 +1422,9 @@ TI_STATUS systemConfig(siteMgr_t *pSiteMgr) /* Note: TX Power Control adjustment is now done through siteMgr_assocReport() */ if (pPrimarySite->powerConstraint>0) { /* setting power constraint */ - param.paramType = REGULATORY_DOMAIN_SET_POWER_CONSTRAINT_PARAM; - param.content.powerConstraint = pPrimarySite->powerConstraint; - regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,¶m); + gSystemCfgParam.paramType = REGULATORY_DOMAIN_SET_POWER_CONSTRAINT_PARAM; + gSystemCfgParam.content.powerConstraint = pPrimarySite->powerConstraint; + regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,&gSystemCfgParam); } diff --git a/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/siteMgr.c b/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/siteMgr.c index 18ea43e..61099c9 100644 --- a/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/siteMgr.c +++ b/sta_dk_4_0_4_32/common/src/core/sme/siteMgr/siteMgr.c @@ -207,7 +207,16 @@ 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)) @@ -1434,7 +1443,7 @@ TI_STATUS siteMgr_getParam(TI_HANDLE hSiteMgr, break; case SITE_MGR_DESIRED_DOT11_MODE_PARAM: - pParam->content.siteMgrDot11Mode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode; + pParam->content.siteMgrDot11Mode = pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode; break; case SITE_MGR_NETWORK_TYPE_IN_USE: @@ -1636,16 +1645,9 @@ RETURN: OK on success, NOK otherwise TI_STATUS siteMgr_join(TI_HANDLE hSiteMgr) { siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr; - whalCtrl_joinBss_t joinParams; - whalCtrl_setTemplate_t templateStruct; - probeRspTemplate_t probeRspTemplate; - nullDataTemplate_t nullDataTemplate; - psPollTemplate_t psPollTemplate; - QosNullDataTemplate_t QosNullDataTemplate; siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite; rate_e rate; - paramInfo_t param; - + paramInfoPartial_t param; if (pPrimarySite == NULL) { @@ -1679,7 +1681,7 @@ TI_STATUS siteMgr_join(TI_HANDLE hSiteMgr) joinParams.hwGenCtrlTxRate = rate; param.paramType = CTRL_DATA_CURRENT_PREAMBLE_TYPE_PARAM; - ctrlData_getParam(pSiteMgr->hCtrlData, ¶m); + ctrlData_getParamPartial(pSiteMgr->hCtrlData, ¶m); joinParams.preamble = param.content.ctrlDataCurrentPreambleType; /*set the preamble before the join*/ whalCtrl_SetPreamble(pSiteMgr->hHalCtrl, joinParams.preamble); @@ -2543,15 +2545,14 @@ static void updateSiteInfo(siteMgr_t *pSiteMgr, mlmeFrameInfo_t *pFrameInfo, sit UPDATE_CAPABILITIES(pSite, pFrameInfo); - if (utils_isIESSID_Broadcast(pFrameInfo->content.iePacket.pSsid) == FALSE) - { /* And the SSID is not Broadcast */ + if (utils_isIESSID_Broadcast(pFrameInfo->content.iePacket.pSsid) == FALSE) + { /* And the SSID is not Broadcast */ ssidUpdated = TRUE; UPDATE_SSID(pSite, pFrameInfo); - } + } if (ssidUpdated) { - UPDATE_PRIVACY(pSite, pFrameInfo); } @@ -2593,7 +2594,6 @@ static void updateSiteInfo(siteMgr_t *pSiteMgr, mlmeFrameInfo_t *pFrameInfo, sit /* Updating QoS params */ updateBeaconQosParams(pSiteMgr, pSite, pFrameInfo); - /* updating CountryIE */ if ((pFrameInfo->content.iePacket.country != NULL) && (pFrameInfo->content.iePacket.country->hdr.eleLen != 0)) @@ -2790,7 +2790,7 @@ static void updateSiteInfo(siteMgr_t *pSiteMgr, mlmeFrameInfo_t *pFrameInfo, sit param.paramType = REGULATORY_DOMAIN_COUNTRY_PARAM; param.content.pCountry = (country_t *)pFrameInfo->content.iePacket.country; regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain,¶m); - } + } UPDATE_LOCAL_TIME_STAMP(pSiteMgr, pSite, pFrameInfo); diff --git a/sta_dk_4_0_4_32/common/src/utils/utils.c b/sta_dk_4_0_4_32/common/src/utils/utils.c index cd9ad9f..cf3c672 100644 --- a/sta_dk_4_0_4_32/common/src/utils/utils.c +++ b/sta_dk_4_0_4_32/common/src/utils/utils.c @@ -1617,9 +1617,10 @@ BOOL utils_isJunkSSID(ssid_t *pSsid) if (pSsid->len > 2) { - if ((pSsid->ssidString[0] < FIRST_VALID_CHAR) && - (pSsid->ssidString[1] < FIRST_VALID_CHAR) && - (pSsid->ssidString[2] < FIRST_VALID_CHAR)) + unsigned char *ssidString = (unsigned char *)pSsid->ssidString; + if ((ssidString[0] < FIRST_VALID_CHAR) && + (ssidString[1] < FIRST_VALID_CHAR) && + (ssidString[2] < FIRST_VALID_CHAR)) { return TRUE; } @@ -2015,5 +2016,3 @@ void util_printProfile(void) #endif /* UTIL_DEBUG_PROFILE */ - - diff --git a/sta_dk_4_0_4_32/config/tiwlan.ini b/sta_dk_4_0_4_32/config/tiwlan.ini index 44dc5a5..8e9898b 100644 --- a/sta_dk_4_0_4_32/config/tiwlan.ini +++ b/sta_dk_4_0_4_32/config/tiwlan.ini @@ -205,8 +205,8 @@ TxEnergyDetection = 0 # Use 1 for enabling TriggeredScanTimeOut = 50000 # Maximum time in Us between 2 channels on triggered scan # PsPoll delivery failure solution -PsPollDeliveryFailureRecoveryPeriod = 20 # Time in Ms to stay ACTIVE ('0' to disable feature) -ConsecutivePsPollDeliveryFailureThreshold = 4 # Number of failed PsPoll's to start ACTIVE time out +PsPollDeliveryFailureRecoveryPeriod = 1000 # Time in Ms to stay ACTIVE ('0' to disable feature) (orig = 20) +ConsecutivePsPollDeliveryFailureThreshold = 15 # Number of failed PsPoll's to start ACTIVE time out (orig = 4) # BT Coexistence configuration BThWlanCoexistEnable = 2 # 0 - SG_ENABLE diff --git a/sta_dk_4_0_4_32/config/wpa_supplicant.conf b/sta_dk_4_0_4_32/config/wpa_supplicant.conf index 7476f0e..638a61e 100644 --- a/sta_dk_4_0_4_32/config/wpa_supplicant.conf +++ b/sta_dk_4_0_4_32/config/wpa_supplicant.conf @@ -1,747 +1,6 @@ -##### Example wpa_supplicant configuration file ############################### -# -# This file describes configuration file format and lists all available option. -# Please also take a look at simpler configuration examples in 'examples' -# subdirectory. -# -# Empty lines and lines starting with # are ignored - -# NOTE! This file may contain password information and should probably be made -# readable only by root user on multiuser systems. - -# Note: All file paths in this configuration file should use full (absolute, -# not relative to working directory) path in order to allow working directory -# to be changed. This can happen if wpa_supplicant is run in the background. - -# Whether to allow wpa_supplicant to update (overwrite) configuration -# -# This option can be used to allow wpa_supplicant to overwrite configuration -# file whenever configuration is changed (e.g., new network block is added with -# wpa_cli or wpa_gui, or a password is changed). This is required for -# wpa_cli/wpa_gui to be able to store the configuration changes permanently. -# Please note that overwriting configuration file will remove the comments from -# it. +##### wpa_supplicant configuration file template ##### update_config=1 - -# global configuration (shared by all network blocks) -# -# Parameters for the control interface. If this is specified, wpa_supplicant -# will open a control interface that is available for external programs to -# manage wpa_supplicant. The meaning of this string depends on which control -# interface mechanism is used. For all cases, the existance of this parameter -# in configuration is used to determine whether the control interface is -# enabled. -# -# For UNIX domain sockets (default on Linux and BSD): This is a directory that -# will be created for UNIX domain sockets for listening to requests from -# external programs (CLI/GUI, etc.) for status information and configuration. -# The socket file will be named based on the interface name, so multiple -# wpa_supplicant processes can be run at the same time if more than one -# interface is used. -# /var/run/wpa_supplicant is the recommended directory for sockets and by -# default, wpa_cli will use it when trying to connect with wpa_supplicant. -# -# Access control for the control interface can be configured by setting the -# directory to allow only members of a group to use sockets. This way, it is -# possible to run wpa_supplicant as root (since it needs to change network -# configuration and open raw sockets) and still allow GUI/CLI components to be -# run as non-root users. However, since the control interface can be used to -# change the network configuration, this access needs to be protected in many -# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you -# want to allow non-root users to use the control interface, add a new group -# and change this value to match with that group. Add users that should have -# control interface access to this group. If this variable is commented out or -# not included in the configuration file, group will not be changed from the -# value it got by default when the directory or socket was created. -# -# When configuring both the directory and group, use following format: -# DIR=/var/run/wpa_supplicant GROUP=wheel -# DIR=/var/run/wpa_supplicant GROUP=0 -# (group can be either group name or gid) -# -# For UDP connections (default on Windows): The value will be ignored. This -# variable is just used to select that the control interface is to be created. -# The value can be set to, e.g., udp (ctrl_interface=udp) -# -# For Windows Named Pipe: This value can be used to set the security descriptor -# for controlling access to the control interface. Security descriptor can be -# set using Security Descriptor String Format (see http://msdn.microsoft.com/ -# library/default.asp?url=/library/en-us/secauthz/security/ -# security_descriptor_string_format.asp). The descriptor string needs to be -# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty -# DACL (which will reject all connections). See README-Windows.txt for more -# information about SDDL string format. -# ctrl_interface=tiwlan0 - -# IEEE 802.1X/EAPOL version -# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines -# EAPOL version 2. However, there are many APs that do not handle the new -# version number correctly (they seem to drop the frames completely). In order -# to make wpa_supplicant interoperate with these APs, the version number is set -# to 1 by default. This configuration value can be used to set it to the new -# version (2). eapol_version=1 - -# AP scanning/selection -# By default, wpa_supplicant requests driver to perform AP scanning and then -# uses the scan results to select a suitable AP. Another alternative is to -# allow the driver to take care of AP scanning and selection and use -# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association -# information from the driver. -# 1: wpa_supplicant initiates scanning and AP selection -# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association -# parameters (e.g., WPA IE generation); this mode can also be used with -# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with -# APs (i.e., external program needs to control association). This mode must -# also be used when using wired Ethernet drivers. -# 2: like 0, but associate with APs using security policy and SSID (but not -# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to -# enable operation with hidden SSIDs and optimized roaming; in this mode, -# the network blocks in the configuration file are tried one by one until -# the driver reports successful association; each network block should have -# explicit security policy (i.e., only one option in the lists) for -# key_mgmt, pairwise, group, proto variables ap_scan=1 - -# EAP fast re-authentication -# By default, fast re-authentication is enabled for all EAP methods that -# support it. This variable can be used to disable fast re-authentication. -# Normally, there is no need to disable this. fast_reauth=1 - -# OpenSSL Engine support -# These options can be used to load OpenSSL engines. -# The two engines that are supported currently are shown below: -# They are both from the opensc project (http://www.opensc.org/) -# By default no engines are loaded. -# make the opensc engine available -#opensc_engine_path=/usr/lib/opensc/engine_opensc.so -# make the pkcs11 engine available -#pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so -# configure the path to the pkcs11 module required by the pkcs11 engine -#pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so - -# Dynamic EAP methods -# If EAP methods were built dynamically as shared object files, they need to be -# loaded here before being used in the network blocks. By default, EAP methods -# are included statically in the build, so these lines are not needed -#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so -#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so - -# Driver interface parameters -# This field can be used to configure arbitrary driver interace parameters. The -# format is specific to the selected driver interface. This field is not used -# in most cases. -#driver_param="field=value" - -# Maximum lifetime for PMKSA in seconds; default 43200 -#dot11RSNAConfigPMKLifetime=43200 -# Threshold for reauthentication (percentage of PMK lifetime); default 70 -#dot11RSNAConfigPMKReauthThreshold=70 -# Timeout for security association negotiation in seconds; default 60 -#dot11RSNAConfigSATimeout=60 - -# network block -# -# Each network (usually AP's sharing the same SSID) is configured as a separate -# block in this configuration file. The network blocks are in preference order -# (the first match is used). -# -# network block fields: -# -# disabled: -# 0 = this network can be used (default) -# 1 = this network block is disabled (can be enabled through ctrl_iface, -# e.g., with wpa_cli or wpa_gui) -# -# id_str: Network identifier string for external scripts. This value is passed -# to external action script through wpa_cli as WPA_ID_STR environment -# variable to make it easier to do network specific configuration. -# -# ssid: SSID (mandatory); either as an ASCII string with double quotation or -# as hex string; network name -# -# scan_ssid: -# 0 = do not scan this SSID with specific Probe Request frames (default) -# 1 = scan with SSID-specific Probe Request frames (this can be used to -# find APs that do not accept broadcast SSID or use multiple SSIDs; -# this will add latency to scanning, so enable this only when needed) -# -# bssid: BSSID (optional); if set, this network block is used only when -# associating with the AP using the configured BSSID -# -# priority: priority group (integer) -# By default, all networks will get same priority group (0). If some of the -# networks are more desirable, this field can be used to change the order in -# which wpa_supplicant goes through the networks when selecting a BSS. The -# priority groups will be iterated in decreasing priority (i.e., the larger the -# priority value, the sooner the network is matched against the scan results). -# Within each priority group, networks will be selected based on security -# policy, signal strength, etc. -# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not -# using this priority to select the order for scanning. Instead, they try the -# networks in the order that used in the configuration file. -# -# mode: IEEE 802.11 operation mode -# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) -# 1 = IBSS (ad-hoc, peer-to-peer) -# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) -# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has -# to be set to 2 for IBSS. WPA-None requires following network block options: -# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not -# both), and psk must also be set. -# -# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., -# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial -# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. -# In addition, this value is only used by the station that creates the IBSS. If -# an IBSS network with the configured SSID is already present, the frequency of -# the network will be used instead of this configured value. -# -# proto: list of accepted protocols -# WPA = WPA/IEEE 802.11i/D3.0 -# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) -# If not set, this defaults to: WPA RSN -# -# key_mgmt: list of accepted authenticated key management protocols -# WPA-PSK = WPA pre-shared key (this requires 'psk' field) -# WPA-EAP = WPA using EAP authentication (this can use an external -# program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication -# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically -# generated WEP keys -# NONE = WPA is not used; plaintext or static WEP could be used -# If not set, this defaults to: WPA-PSK WPA-EAP -# -# auth_alg: list of allowed IEEE 802.11 authentication algorithms -# OPEN = Open System authentication (required for WPA/WPA2) -# SHARED = Shared Key authentication (requires static WEP keys) -# LEAP = LEAP/Network EAP (only used with LEAP) -# If not set, automatic selection is used (Open System with LEAP enabled if -# LEAP is allowed as one of the EAP methods). -# -# pairwise: list of accepted pairwise (unicast) ciphers for WPA -# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] -# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] -# NONE = Use only Group Keys (deprecated, should not be included if APs support -# pairwise keys) -# If not set, this defaults to: CCMP TKIP -# -# group: list of accepted group (broadcast/multicast) ciphers for WPA -# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] -# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] -# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key -# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11] -# If not set, this defaults to: CCMP TKIP WEP104 WEP40 -# -# psk: WPA preshared key; 256-bit pre-shared key -# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e., -# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be -# generated using the passphrase and SSID). ASCII passphrase must be between -# 8 and 63 characters (inclusive). -# This field is not needed, if WPA-EAP is used. -# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys -# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant -# startup and reconfiguration time can be optimized by generating the PSK only -# only when the passphrase or SSID has actually changed. -# -# eapol_flags: IEEE 802.1X/EAPOL options (bit field) -# Dynamic WEP key required for non-WPA mode -# bit0 (1): require dynamically generated unicast WEP key -# bit1 (2): require dynamically generated broadcast WEP key -# (3 = require both keys; default) -# Note: When using wired authentication, eapol_flags must be set to 0 for the -# authentication to be completed successfully. -# -# mixed_cell: This option can be used to configure whether so called mixed -# cells, i.e., networks that use both plaintext and encryption in the same -# SSID, are allowed when selecting a BSS form scan results. -# 0 = disabled (default) -# 1 = enabled -# -# proactive_key_caching: -# Enable/disable opportunistic PMKSA caching for WPA2. -# 0 = disabled (default) -# 1 = enabled -# -# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or -# hex without quotation, e.g., 0102030405) -# wep_tx_keyidx: Default WEP key index (TX) (0..3) -# -# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is -# allowed. This is only used with RSN/WPA2. -# 0 = disabled (default) -# 1 = enabled -#peerkey=1 -# -# Following fields are only used with internal EAP implementation. -# eap: space-separated list of accepted EAP methods -# MD5 = EAP-MD5 (unsecure and does not generate keying material -> -# cannot be used with WPA; to be used as a Phase 2 method -# with EAP-PEAP or EAP-TTLS) -# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used -# as a Phase 2 method with EAP-PEAP or EAP-TTLS) -# OTP = EAP-OTP (cannot be used separately with WPA; to be used -# as a Phase 2 method with EAP-PEAP or EAP-TTLS) -# GTC = EAP-GTC (cannot be used separately with WPA; to be used -# as a Phase 2 method with EAP-PEAP or EAP-TTLS) -# TLS = EAP-TLS (client and server certificate) -# PEAP = EAP-PEAP (with tunnelled EAP authentication) -# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2 -# authentication) -# If not set, all compiled in methods are allowed. -# -# identity: Identity string for EAP -# anonymous_identity: Anonymous identity string for EAP (to be used as the -# unencrypted identity with EAP types that support different tunnelled -# identity, e.g., EAP-TTLS) -# password: Password string for EAP -# ca_cert: File path to CA certificate file (PEM/DER). This file can have one -# or more trusted CA certificates. If ca_cert and ca_path are not -# included, server certificate will not be verified. This is insecure and -# a trusted CA certificate should always be configured when using -# EAP-TLS/TTLS/PEAP. Full path should be used since working directory may -# change when wpa_supplicant is run in the background. -# On Windows, trusted CA certificates can be loaded from the system -# certificate store by setting this to cert_store://<name>, e.g., -# ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". -# Note that when running wpa_supplicant as an application, the user -# certificate store (My user account) is used, whereas computer store -# (Computer account) is used when running wpasvc as a service. -# ca_path: Directory path for CA certificate files (PEM). This path may -# contain multiple CA certificates in OpenSSL format. Common use for this -# is to point to system trusted CA list which is often installed into -# directory like /etc/ssl/certs. If configured, these certificates are -# added to the list of trusted CAs. ca_cert may also be included in that -# case, but it is not required. -# client_cert: File path to client certificate file (PEM/DER) -# Full path should be used since working directory may change when -# wpa_supplicant is run in the background. -# Alternatively, a named configuration blob can be used by setting this -# to blob://<blob name>. -# private_key: File path to client private key file (PEM/DER/PFX) -# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be -# commented out. Both the private key and certificate will be read from -# the PKCS#12 file in this case. Full path should be used since working -# directory may change when wpa_supplicant is run in the background. -# Windows certificate store can be used by leaving client_cert out and -# configuring private_key in one of the following formats: -# cert://substring_to_match -# hash://certificate_thumbprint_in_hex -# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4" -# Note that when running wpa_supplicant as an application, the user -# certificate store (My user account) is used, whereas computer store -# (Computer account) is used when running wpasvc as a service. -# Alternatively, a named configuration blob can be used by setting this -# to blob://<blob name>. -# private_key_passwd: Password for private key file (if left out, this will be -# asked through control interface) -# dh_file: File path to DH/DSA parameters file (in PEM format) -# This is an optional configuration file for setting parameters for an -# ephemeral DH key exchange. In most cases, the default RSA -# authentication does not use this configuration. However, it is possible -# setup RSA to use ephemeral DH key exchange. In addition, ciphers with -# DSA keys always use ephemeral DH keys. This can be used to achieve -# forward secrecy. If the file is in DSA parameters format, it will be -# automatically converted into DH params. -# subject_match: Substring to be matched against the subject of the -# authentication server certificate. If this string is set, the server -# sertificate is only accepted if it contains this string in the subject. -# The subject string is in following format: -# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com -# altsubject_match: Semicolon separated string of entries to be matched against -# the alternative subject name of the authentication server certificate. -# If this string is set, the server sertificate is only accepted if it -# contains one of the entries in an alternative subject name extension. -# altSubjectName string is in following format: TYPE:VALUE -# Example: EMAIL:server@example.com -# Example: DNS:server.example.com;DNS:server2.example.com -# Following types are supported: EMAIL, DNS, URI -# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters -# (string with field-value pairs, e.g., "peapver=0" or -# "peapver=1 peaplabel=1") -# 'peapver' can be used to force which PEAP version (0 or 1) is used. -# 'peaplabel=1' can be used to force new label, "client PEAP encryption", -# to be used during key derivation when PEAPv1 or newer. Most existing -# PEAPv1 implementation seem to be using the old label, "client EAP -# encryption", and wpa_supplicant is now using that as the default value. -# Some servers, e.g., Radiator, may require peaplabel=1 configuration to -# interoperate with PEAPv1; see eap_testing.txt for more details. -# 'peap_outer_success=0' can be used to terminate PEAP authentication on -# tunneled EAP-Success. This is required with some RADIUS servers that -# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g., -# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode) -# include_tls_length=1 can be used to force wpa_supplicant to include -# TLS Message Length field in all TLS messages even if they are not -# fragmented. -# sim_min_num_chal=3 can be used to configure EAP-SIM to require three -# challenges (by default, it accepts 2 or 3) -# phase2: Phase2 (inner authentication with TLS tunnel) parameters -# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or -# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS) -# Following certificate/private key fields are used in inner Phase2 -# authentication when using EAP-TTLS or EAP-PEAP. -# ca_cert2: File path to CA certificate file. This file can have one or more -# trusted CA certificates. If ca_cert2 and ca_path2 are not included, -# server certificate will not be verified. This is insecure and a trusted -# CA certificate should always be configured. -# ca_path2: Directory path for CA certificate files (PEM) -# client_cert2: File path to client certificate file -# private_key2: File path to client private key file -# private_key2_passwd: Password for private key file -# dh_file2: File path to DH/DSA parameters file (in PEM format) -# subject_match2: Substring to be matched against the subject of the -# authentication server certificate. -# altsubject_match2: Substring to be matched against the alternative subject -# name of the authentication server certificate. -# -# fragment_size: Maximum EAP fragment size in bytes (default 1398). -# This value limits the fragment size for EAP methods that support -# fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set -# small enough to make the EAP messages fit in MTU of the network -# interface used for EAPOL. The default value is suitable for most -# cases. -# -# EAP-PSK variables: -# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format -# nai: user NAI -# -# EAP-PAX variables: -# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format -# -# EAP-SAKE variables: -# eappsk: 32-byte (256-bit, 64 hex digits) pre-shared key in hex format -# (this is concatenation of Root-Secret-A and Root-Secret-B) -# nai: user NAI (PEERID) -# -# EAP-GPSK variables: -# eappsk: Pre-shared key in hex format (at least 128 bits, i.e., 32 hex digits) -# nai: user NAI (ID_Client) -# -# EAP-FAST variables: -# pac_file: File path for the PAC entries. wpa_supplicant will need to be able -# to create this file and write updates to it when PAC is being -# provisioned or refreshed. Full path to the file should be used since -# working directory may change when wpa_supplicant is run in the -# background. Alternatively, a named configuration blob can be used by -# setting this to blob://<blob name> -# phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST -# credentials (PAC) -# -# wpa_supplicant supports number of "EAP workarounds" to work around -# interoperability issues with incorrectly behaving authentication servers. -# These are enabled by default because some of the issues are present in large -# number of authentication servers. Strict EAP conformance mode can be -# configured by disabling workarounds with eap_workaround=0. - -# Example blocks: - -# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers -#network={ -# ssid="simple" -# psk="very secret passphrase" -# priority=5 -#} - -# Same as previous, but request SSID-specific scanning (for APs that reject -# broadcast SSID) -#network={ -# ssid="second ssid" -# scan_ssid=1 -# psk="very secret passphrase" -# priority=2 -#} - -# Only WPA-PSK is used. Any valid cipher combination is accepted. -#network={ -# ssid="example" -# proto=WPA -# key_mgmt=WPA-PSK -# pairwise=CCMP TKIP -# group=CCMP TKIP WEP104 WEP40 -# psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb -# priority=2 -#} - -# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104 -# or WEP40 as the group cipher will not be accepted. -#network={ -# ssid="example" -# proto=RSN -# key_mgmt=WPA-EAP -# pairwise=CCMP TKIP -# group=CCMP TKIP -# eap=TLS -# identity="user@example.com" -# ca_cert="/etc/cert/ca.pem" -# client_cert="/etc/cert/user.pem" -# private_key="/etc/cert/user.prv" -# private_key_passwd="password" -# priority=1 -#} - -# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel -# (e.g., Radiator) -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=PEAP -# identity="user@example.com" -# password="foobar" -# ca_cert="/etc/cert/ca.pem" -# phase1="peaplabel=1" -# phase2="auth=MSCHAPV2" -# priority=10 -#} - -# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the -# unencrypted use. Real identity is sent only within an encrypted TLS tunnel. -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=TTLS -# identity="user@example.com" -# anonymous_identity="anonymous@example.com" -# password="foobar" -# ca_cert="/etc/cert/ca.pem" -# priority=2 -#} - -# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted -# use. Real identity is sent only within an encrypted TLS tunnel. -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=TTLS -# identity="user@example.com" -# anonymous_identity="anonymous@example.com" -# password="foobar" -# ca_cert="/etc/cert/ca.pem" -# phase2="auth=MSCHAPV2" -#} - -# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner -# authentication. -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=TTLS -# # Phase1 / outer authentication -# anonymous_identity="anonymous@example.com" -# ca_cert="/etc/cert/ca.pem" -# # Phase 2 / inner authentication -# phase2="autheap=TLS" -# ca_cert2="/etc/cert/ca2.pem" -# client_cert2="/etc/cer/user.pem" -# private_key2="/etc/cer/user.prv" -# private_key2_passwd="password" -# priority=2 -#} - -# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and -# group cipher. -#network={ -# ssid="example" -# bssid=00:11:22:33:44:55 -# proto=WPA RSN -# key_mgmt=WPA-PSK WPA-EAP -# pairwise=CCMP -# group=CCMP -# psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb -#} - -# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP -# and all valid ciphers. -#network={ -# ssid=00010203 -# psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f -#} - - -# EAP-SIM with a GSM SIM or USIM -#network={ -# ssid="eap-sim-test" -# key_mgmt=WPA-EAP -# eap=SIM -# pin="1234" -# pcsc="" -#} - - -# EAP-PSK -#network={ -# ssid="eap-psk-test" -# key_mgmt=WPA-EAP -# eap=PSK -# identity="eap_psk_user" -# eappsk=06b4be19da289f475aa46a33cb793029 -# nai="eap_psk_user@example.com" -#} - - -# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using -# EAP-TLS for authentication and key generation; require both unicast and -# broadcast WEP keys. -#network={ -# ssid="1x-test" -# key_mgmt=IEEE8021X -# eap=TLS -# identity="user@example.com" -# ca_cert="/etc/cert/ca.pem" -# client_cert="/etc/cert/user.pem" -# private_key="/etc/cert/user.prv" -# private_key_passwd="password" -# eapol_flags=3 -#} - - -# LEAP with dynamic WEP keys -#network={ -# ssid="leap-example" -# key_mgmt=IEEE8021X -# eap=LEAP -# identity="user" -# password="foobar" -#} - -# EAP-FAST with WPA (WPA or WPA2) -#network={ -# ssid="eap-fast-test" -# key_mgmt=WPA-EAP -# eap=FAST -# anonymous_identity="FAST-000102030405" -# identity="username" -# password="password" -# phase1="fast_provisioning=1" -# pac_file="/etc/wpa_supplicant.eap-fast-pac" -#} - -#network={ -# ssid="eap-fast-test" -# key_mgmt=WPA-EAP -# eap=FAST -# anonymous_identity="FAST-000102030405" -# identity="username" -# password="password" -# phase1="fast_provisioning=1" -# pac_file="blob://eap-fast-pac" -#} - -# Plaintext connection (no WPA, no IEEE 802.1X) -#network={ -# ssid="plaintext-test" -# key_mgmt=NONE -#} - - -# Shared WEP key connection (no WPA, no IEEE 802.1X) -#network={ -# ssid="static-wep-test" -# key_mgmt=NONE -# wep_key0="abcde" -# wep_key1=0102030405 -# wep_key2="1234567890123" -# wep_tx_keyidx=0 -# priority=5 -#} - - -# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key -# IEEE 802.11 authentication -#network={ -# ssid="static-wep-test2" -# key_mgmt=NONE -# wep_key0="abcde" -# wep_key1=0102030405 -# wep_key2="1234567890123" -# wep_tx_keyidx=0 -# priority=5 -# auth_alg=SHARED -#} - - -# IBSS/ad-hoc network with WPA-None/TKIP. -#network={ -# ssid="test adhoc" -# mode=1 -# frequency=2412 -# proto=WPA -# key_mgmt=WPA-NONE -# pairwise=NONE -# group=TKIP -# psk="secret passphrase" -#} - - -# Catch all example that allows more or less all configuration modes -#network={ -# ssid="example" -# scan_ssid=1 -# key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE -# pairwise=CCMP TKIP -# group=CCMP TKIP WEP104 WEP40 -# psk="very secret passphrase" -# eap=TTLS PEAP TLS -# identity="user@example.com" -# password="foobar" -# ca_cert="/etc/cert/ca.pem" -# client_cert="/etc/cert/user.pem" -# private_key="/etc/cert/user.prv" -# private_key_passwd="password" -# phase1="peaplabel=0" -#} - -# Example of EAP-TLS with smartcard (openssl engine) -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=TLS -# proto=RSN -# pairwise=CCMP TKIP -# group=CCMP TKIP -# identity="user@example.com" -# ca_cert="/etc/cert/ca.pem" -# client_cert="/etc/cert/user.pem" -# -# engine=1 -# - # The engine configured here must be available. Look at - # OpenSSL engine support in the global section. - # The key available through the engine must be the private key - # matching the client certificate configured above. - - # use the opensc engine - #engine_id="opensc" - #key_id="45" - - # use the pkcs11 engine -# engine_id="pkcs11" -# key_id="id_45" - - # Optional PIN configuration; this can be left out and PIN will be - # asked through the control interface -# pin="1234" -#} - -# Example configuration showing how to use an inlined blob as a CA certificate -# data instead of using external file -#network={ -# ssid="example" -# key_mgmt=WPA-EAP -# eap=TTLS -# identity="user@example.com" -# anonymous_identity="anonymous@example.com" -# password="foobar" -# ca_cert="blob://exampleblob" -# priority=20 -#} - -#blob-base64-exampleblob={ -#SGVsbG8gV29ybGQhCg== -#} - -# Wildcard match for SSID (plaintext APs only). This example selects any -# open AP regardless of its SSID. -#network={ -# key_mgmt=NONE -#} diff --git a/sta_dk_4_0_4_32/pform/common/src/osRgstry.c b/sta_dk_4_0_4_32/pform/common/src/osRgstry.c index eb1048e..d625868 100644 --- a/sta_dk_4_0_4_32/pform/common/src/osRgstry.c +++ b/sta_dk_4_0_4_32/pform/common/src/osRgstry.c @@ -914,19 +914,17 @@ Return Value: -----------------------------------------------------------------------------*/ void regConvertStringtoMACAddress(UINT8 *staMACAddressString,UINT8 *MacAddressArray) { - -char *ptr; -UINT8 *tmpMacAddr; -UINT8 value=0,value_l,value_h,add_value; -int i; - + char *ptr; + UINT8 *tmpMacAddr; + UINT8 value = 0, value_l, value_h, add_value; + int i, str_len; /* Take the pointer to the string MAC Address to convert it to the Array MAC Address */ - ptr=(char *)staMACAddressString; + ptr = (char *)staMACAddressString; tmpMacAddr = MacAddressArray; - + str_len = 3 * MAC_ADDR_LEN - 1; #if 0 - for(i=0 ; i<MAC_ADDR_LEN ; ptr++) + for(i=0; i<MAC_ADDR_LEN ; ptr++) { value_l = (*ptr-'0'); @@ -936,8 +934,6 @@ int i; { value = value*10 + value_l; /* PRINTF(DBG_REGISTRY,("value %d value_l %d \n",value,value_l));*/ - - } else { @@ -946,18 +942,18 @@ int i; value = 0; i++; } - } - #else - - for(i=0 ; i<MAC_ADDR_LEN ; ptr++) + for(i=0;(i < MAC_ADDR_LEN);ptr++,str_len--) { - - /* The value can be or "0-9" or from "a-f" */ - value_l = (*ptr-'0'); - value_h = (*ptr - 'a'); - + if (str_len > 0) { + /* The value can be or "0-9" or from "a-f" */ + value_l = (*ptr - '0'); + value_h = (*ptr - 'a'); + } + else { /* last element */ + value_l = value_h = 16; + } /*PRINTF(DBG_REGISTRY,("value_l [%d] value_h [%d] *ptr %c value %d\n",value_l,value_h,*ptr,value));*/ if( (value_l <= 9) || (value_h <= 15 ) ) @@ -974,19 +970,16 @@ int i; /* 'a' is in fact 10 decimal in hexa */ add_value = value_h + 10; } - value = value*16 + add_value; - /* PRINTF(DBG_REGISTRY,("value %d add_value %d \n",value,add_value));*/ - - + value = value * 16 + add_value; + /*PRINTF(DBG_REGISTRY,("value %d add_value %d \n",value,add_value));*/ } else { tmpMacAddr[i] = value; - /* PRINTF(DBG_REGISTRY,("tmpMacAddr[%d] is %x\n",i,tmpMacAddr[i]));*/ + /*PRINTF(DBG_REGISTRY,("tmpMacAddr[%d] is %x\n",i,tmpMacAddr[i]));*/ value = 0; i++; } - } #endif @@ -4913,17 +4906,15 @@ Return Value: -----------------------------------------------------------------------------*/ void regConvertStringtoBeaconIETable(UINT8 *staIpAddressString,UINT8 *IpAddressArray, UINT8 size) { - -char *ptr; -UINT8 *tmpIpAddr; -UINT8 value=0,value_l,value_h,add_value; -int i; - + char *ptr; + UINT8 *tmpIpAddr; + UINT8 value = 0, value_l, value_h, add_value; + int i, str_len; /* Take the pointer to the string MAC Address to convert it to the Array MAC Address */ - ptr=(char *)staIpAddressString; + ptr = (char *)staIpAddressString; tmpIpAddr = IpAddressArray; - + str_len = 3 * size - 1; #if 0 for(i=0 ; i<size ; ptr++) { @@ -4935,8 +4926,6 @@ int i; { value = value*10 + value_l; /* PRINTF(DBG_REGISTRY,("value %d value_l %d \n",value,value_l));*/ - - } else { @@ -4947,16 +4936,17 @@ int i; } } - #else - - for(i=0 ; i<size ; ptr++) + for(i=0;(i < size);ptr++,str_len--) { - - /* The value can be or "0-9" or from "a-f" */ - value_l = (*ptr-'0'); - value_h = (*ptr - 'a'); - + if (str_len > 0) { + /* The value can be or "0-9" or from "a-f" */ + value_l = (*ptr - '0'); + value_h = (*ptr - 'a'); + } + else { /* last element */ + value_l = value_h = 16; + } /*PRINTF(DBG_REGISTRY,("value_l [%d] value_h [%d] *ptr %c value %d\n",value_l,value_h,*ptr,value));*/ if( (value_l <= 9) || (value_h <= 15 ) ) @@ -4973,22 +4963,18 @@ int i; /* 'a' is in fact 10 decimal in hexa */ add_value = value_h + 10; } - value = value*16 + add_value; - /* PRINTF(DBG_REGISTRY,("value %d add_value %d \n",value,add_value));*/ - - + value = value * 16 + add_value; + /*PRINTF(DBG_REGISTRY,("value %d add_value %d \n",value,add_value));*/ } else { tmpIpAddr[i] = value; - /* PRINTF(DBG_REGISTRY,("tmpMacAddr[%d] is %x\n",i,tmpMacAddr[i]));*/ + /*PRINTF(DBG_REGISTRY,("tmpMacAddr[%d] is %x\n",i,tmpMacAddr[i]));*/ value = 0; i++; } - } #endif - } //TRS:WDK provide callback functions diff --git a/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c b/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c index 32c8627..669e9cc 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c +++ b/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c @@ -1534,7 +1534,14 @@ static void tiwlan_destroy_drv(tiwlan_net_dev_t *drv) } else del_timer_sync(&drv->poll_timer); - +#ifdef DM_USE_WORKQUEUE + flush_work(&drv->tirq); + flush_work(&drv->tw); + flush_work(&drv->txmit); +#if defined(CONFIG_TROUT_PWRSINK) || defined(CONFIG_HTC_PWRSINK) + cancel_delayed_work_sync(&drv->trxw); +#endif +#endif /* Unload all modules (free memory) & destroy timers */ configMgr_UnloadModules (drv->adapter.CoreHalCtx); @@ -2022,18 +2029,16 @@ static int __init tiwlan_module_init(void) /* rc = tiwlan_create_drv(0, 0, 0, 0, 0, TROUT_IRQ, NULL, NULL); -- Called in probe */ tiwlan_calibration = create_proc_entry("calibration", 0644, NULL); - if (tiwlan_calibration == NULL) { - remove_proc_entry(TIWLAN_DBG_PROC, NULL); - return -EINVAL; + if (tiwlan_calibration) { + tiwlan_calibration->size = tiwlan_get_nvs_size(); + tiwlan_calibration->read_proc = tiwlan_calibration_read_proc; + tiwlan_calibration->write_proc = tiwlan_calibration_write_proc; } - tiwlan_calibration->size = tiwlan_get_nvs_size(); - tiwlan_calibration->read_proc = tiwlan_calibration_read_proc; - tiwlan_calibration->write_proc = tiwlan_calibration_write_proc; - if (!wait_for_completion_timeout(&sdio_wait, msecs_to_jiffies(10000))) { printk(KERN_ERR "%s: Timed out waiting for device detect\n", __func__); remove_proc_entry(TIWLAN_DBG_PROC, NULL); - remove_proc_entry("calibration", NULL); + if (tiwlan_calibration) + remove_proc_entry("calibration", NULL); sdio_unregister_driver(&tiwlan_sdio_drv); #ifdef CONFIG_WIFI_CONTROL_FUNC wifi_del_dev(); @@ -2072,7 +2077,8 @@ static void __exit tiwlan_module_cleanup(void) } remove_proc_entry(TIWLAN_DBG_PROC, NULL); #ifdef TIWLAN_MSM7000 - remove_proc_entry("calibration", NULL); + if(tiwlan_calibration) + remove_proc_entry("calibration", NULL); sdio_unregister_driver(&tiwlan_sdio_drv); #ifdef CONFIG_WIFI_CONTROL_FUNC wifi_del_dev(); diff --git a/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c b/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c index 9975c75..9a0bc24 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c +++ b/sta_dk_4_0_4_32/pform/linux/src/ipc_k.c @@ -61,60 +61,62 @@ UINT32 IPCKernelDeInit (TI_HANDLE hAdapter) /*******************************************************/ INT32 IPC_EventSend(TI_HANDLE hAdapter, tiUINT8* pEvData, UINT32 EvDataSize) { - struct sk_buff *skb; - int res; - tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *) hAdapter; - UINT32 realSize = 0; - UINT32 msgSize; - struct nlmsghdr *nlh; - tiUINT8 *msg; - - /* This event is targetted to the OS process Id 0 is not a valid pId for LINUX*/ - - if ((( IPC_EVENT_PARAMS *) pEvData) ->uProcessID == 0) - { - (( IPC_EVENT_PARAMS *) pEvData) ->pfEventCallback(( IPC_EV_DATA *) pEvData); - return 0; - } - - /* set the payload size */ - msgSize = (( IPC_EV_DATA *) pEvData) ->uBufferSize + offsetof(IPC_EV_DATA,uBuffer); - - /* add the netlink header size */ - realSize = NLMSG_SPACE(msgSize); - - /* allocate the complete message */ - skb = dev_alloc_skb(realSize); - if (!skb) { + struct sk_buff *skb; + int res; + tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *) hAdapter; + UINT32 realSize = 0; + UINT32 msgSize; + struct nlmsghdr *nlh; + tiUINT8 *msg; + +#ifdef CONFIG_ANDROID_POWER + drv->receive_packet = 1; /* Remember to stay awake */ +#endif + /* This event is targetted to the OS process Id 0 is not a valid pId for LINUX*/ + if (((IPC_EVENT_PARAMS *)pEvData)->uProcessID == 0) + { + ((IPC_EVENT_PARAMS *)pEvData)->pfEventCallback((IPC_EV_DATA *)pEvData); + return 0; + } + + /* set the payload size */ + msgSize = (( IPC_EV_DATA *) pEvData) ->uBufferSize + offsetof(IPC_EV_DATA,uBuffer); + + /* add the netlink header size */ + realSize = NLMSG_SPACE(msgSize); + + /* allocate the complete message */ + skb = dev_alloc_skb(realSize); + if (!skb) { printk(KERN_ERR "Failed to allocate new skb with size=%u.\n",realSize); return -1; - } - - /* set the netlink header params */ - nlh = NLMSG_PUT(skb, 0, 0, NLMSG_DONE, realSize - sizeof(*nlh)); - - /* get the payload pointer */ - msg = (char *)NLMSG_DATA(nlh); - - /* copy the data to the payload */ - memcpy(msg,pEvData,msgSize); - - NETLINK_CB(skb).pid = 0; /* from kernel */ - NETLINK_CB(skb).dst_group = RTNLGRP_LINK; + } + + /* set the netlink header params */ + nlh = NLMSG_PUT(skb, 0, 0, NLMSG_DONE, realSize - sizeof(*nlh)); + + /* get the payload pointer */ + msg = (char *)NLMSG_DATA(nlh); + + /* copy the data to the payload */ + memcpy(msg,pEvData,msgSize); + + NETLINK_CB(skb).pid = 0; /* from kernel */ + NETLINK_CB(skb).dst_group = RTNLGRP_LINK; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) - NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID; /* Dm: */ + NETLINK_CB(skb).dst_pid = (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID; /* Dm: */ #endif - /* send the message*/ - res = netlink_unicast(drv->wl_sock, skb, (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID, MSG_DONTWAIT); + /* send the message*/ + res = netlink_unicast(drv->wl_sock, skb, (( IPC_EVENT_PARAMS *) pEvData) ->uProcessID, MSG_DONTWAIT); - /* Sanity checks. As far as we're concerned this error is unrecovarable.*/ - if (res >= 0) - { + /* Sanity checks. As far as we're concerned this error is unrecovarable.*/ + if (res >= 0) + { return 0; - } + } nlmsg_failure: - ti_dprintf(TIWLAN_LOG_INFO,"IPC kernel: did not send the netlink message\n"); + ti_dprintf(TIWLAN_LOG_INFO,"IPC kernel: did not send the netlink message\n"); return -1; } diff --git a/sta_dk_4_0_4_32/pform/linux/src/osmemapi.c b/sta_dk_4_0_4_32/pform/linux/src/osmemapi.c index d22eacb..28ff423 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/osmemapi.c +++ b/sta_dk_4_0_4_32/pform/linux/src/osmemapi.c @@ -108,7 +108,7 @@ os_memoryAlloc( otherwise allocate from virtual pool. */ /* 2 pages */ - if (Size <= 2 * 4096) + if (total_size < 2 * 4096) { if (in_atomic()) blk = kmalloc(total_size, GFP_ATOMIC); diff --git a/sta_dk_4_0_4_32/wpa_supplicant_lib/Android.mk b/sta_dk_4_0_4_32/wpa_supplicant_lib/Android.mk index 67cf6fc..7f5a5cb 100644 --- a/sta_dk_4_0_4_32/wpa_supplicant_lib/Android.mk +++ b/sta_dk_4_0_4_32/wpa_supplicant_lib/Android.mk @@ -29,6 +29,7 @@ OS_ROOT = $(BOARD_WLAN_TI_STA_DK_ROOT)/pform COMMON = $(DK_ROOT)/common COMSRC = $(COMMON)/src CUDK_ROOT = $(DK_ROOT)/CUDK +LIB = ../../lib include external/wpa_supplicant/.config @@ -125,13 +126,13 @@ INCLUDES = $(COMMON)/inc \ $(CUDK_ROOT)/UtilityAdapter \ external/openssl/include \ external/wpa_supplicant \ - system/core/adb + $(DK_ROOT)/../lib L_CFLAGS += -DCONFIG_DRIVER_CUSTOM -DHOST_COMPILE ifeq ($(notdir $(BOARD_WLAN_TI_STA_DK_ROOT)),sta_dk_5_0_0_94) L_CFLAGS += -DSTA_DK_VER_5_0_0_94 endif -OBJS = driver_ti.c scanmerge.c ../../../../core/adb/shlist.c +OBJS = driver_ti.c $(LIB)/scanmerge.c $(LIB)/shlist.c ifdef CONFIG_NO_STDOUT_DEBUG L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG diff --git a/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.c b/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.c index 3c0f322..f5c1aa9 100644 --- a/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.c +++ b/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.c @@ -64,44 +64,24 @@ static int lfp; #endif /*-------------------------------------------------------------------*/ -#ifdef ANDROID -typedef struct REG_DOMAIN_STRUCT { - char tmzn_name[PROPERTY_VALUE_MAX]; - int size; - int num_of_channels; -} reg_domain_struct_t; - -reg_domain_struct_t reg_domain_str[] = { - { "US", 2, NUMBER_SCAN_CHANNELS_FCC }, - { "AU", 2, NUMBER_SCAN_CHANNELS_FCC }, - { "SG", 2, NUMBER_SCAN_CHANNELS_FCC }, - { "CA", 2, NUMBER_SCAN_CHANNELS_FCC }, - { "GB", 2, NUMBER_SCAN_CHANNELS_ETSI }, - { "JP", 2, NUMBER_SCAN_CHANNELS_MKK1 }, - { "ZZ", 2, NUMBER_SCAN_CHANNELS_FCC } -}; -#endif + /*----------------------------------------------------------------------------- -Routine Name: check_and_get_carrier_channels -Routine Description: get number of allowed channels according to locale -as determined by the carrier being used. +Routine Name: check_and_get_build_channels +Routine Description: get number of allowed channels according to a build var. Arguments: None Return Value: Number of channels -----------------------------------------------------------------------------*/ -static int check_and_get_carrier_channels( void ) +static int check_and_get_build_channels( void ) { #ifdef ANDROID char prop_status[PROPERTY_VALUE_MAX]; - char *prop_name = "ro.product.locale.region"; - int default_channels = NUMBER_SCAN_CHANNELS_ETSI; - unsigned i; - - if( !property_get(prop_name, prop_status, NULL) ) - return default_channels; - for(i=0;( i < (sizeof(reg_domain_str)/sizeof(reg_domain_struct_t)) );i++) { - if( strncmp(prop_status, reg_domain_str[i].tmzn_name, - reg_domain_str[i].size) == 0 ) - return reg_domain_str[i].num_of_channels; + char *prop_name = "ro.wifi.channels"; + int i, default_channels = NUMBER_SCAN_CHANNELS_ETSI; + + if( property_get(prop_name, prop_status, NULL) ) { + i = atoi(prop_status); + if( i != 0 ) + default_channels = i; } return( default_channels ); #else @@ -464,7 +444,8 @@ static int wpa_driver_tista_set_auth_mode( void *priv ) wpa_printf(MSG_DEBUG, "proto: %d", myDrv->proto); /* should be set BEFORE */ wpa_printf(MSG_DEBUG, "auth_alg: %d",myDrv->auth_alg); - if( myDrv->auth_alg == AUTH_ALG_OPEN_SYSTEM ) { + if( (myDrv->auth_alg == AUTH_ALG_OPEN_SYSTEM) || + (myDrv->auth_alg == AUTH_ALG_LEAP) ) { switch( myDrv->key_mgmt ) { case KEY_MGMT_802_1X: if( myDrv->proto & WPA_PROTO_WPA ) { @@ -495,8 +476,9 @@ static int wpa_driver_tista_set_auth_mode( void *priv ) else if( myDrv->auth_alg == AUTH_ALG_SHARED_KEY ) { myAuth = os802_11AuthModeShared; } - else if( myDrv->auth_alg == AUTH_ALG_LEAP ) { /* Dm: ??? */ - myAuth = os802_11AuthModeWPA; + if( myDrv->auth_alg == AUTH_ALG_LEAP ) { + TI_SetEAPType( myDrv->hDriver, OS_EAP_TYPE_LEAP ); + TI_SetEAPTypeDriver( myDrv->hDriver, OS_EAP_TYPE_LEAP ); } wpa_driver_tista_print_auth_mode( myAuth ); ret = TI_SetAuthenticationMode( myDrv->hDriver, myAuth ); @@ -792,13 +774,14 @@ Return Value: None -----------------------------------------------------------------------------*/ static void ti_init_scan_params( scan_Params_t *pScanParams, scan_Policy_t *pScanPolicy, + int scan_type, struct wpa_driver_ti_data *myDrv ) { UINT32 scanMaxDwellTime = SME_SCAN_BG_MAX_DWELL_TIME_DEF; UINT32 scanMinDwellTime = SME_SCAN_BG_MIN_DWELL_TIME_DEF; UINT32 chanMaxDwellTime = SME_SCAN_BG_MIN_DWELL_TIME_DEF; UINT32 chanMinDwellTime = SME_SCAN_BG_MIN_DWELL_TIME_DEF / 2; - int scanType = myDrv->scan_type; + int scanType = scan_type; int noOfChan = myDrv->scan_channels; int btCoexScan = myDrv->btcoex_scan; int i, j; @@ -856,7 +839,7 @@ static void ti_init_scan_params( scan_Params_t *pScanParams, for(i=0;( i < noOfChan );i++) { pScanPolicy->bandScanPolicy[ 0 ].channelList[ i ] = i + 1; } - pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.scanType = scanType; + pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.scanType = SCAN_TYPE_NO_SCAN; pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE; pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0; pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.maxChannelDwellTime = chanMaxDwellTime; @@ -868,7 +851,7 @@ static void ti_init_scan_params( scan_Params_t *pScanParams, #else pScanPolicy->bandScanPolicy[ 0 ].trackingMethod.method.basicMethodParams.probReqParams.txPowerDbm = MAX_TX_POWER; #endif - pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.scanType = scanType; + pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.scanType = SCAN_TYPE_NO_SCAN; pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE; pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0; pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.maxChannelDwellTime = chanMaxDwellTime; @@ -880,7 +863,7 @@ static void ti_init_scan_params( scan_Params_t *pScanParams, #else pScanPolicy->bandScanPolicy[ 0 ].discoveryMethod.method.basicMethodParams.probReqParams.txPowerDbm = MAX_TX_POWER; #endif - pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.scanType = scanType; + pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.scanType = btCoexScan ? SCAN_TYPE_TRIGGERED_ACTIVE : SCAN_TYPE_NORMAL_ACTIVE; pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.earlyTerminationEvent = SCAN_ET_COND_DISABLE; pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.ETMaxNumberOfApFrames = 0; pScanPolicy->bandScanPolicy[ 0 ].immediateScanMethod.method.basicMethodParams.maxChannelDwellTime = chanMaxDwellTime; @@ -905,22 +888,39 @@ Return Value: 0 on success, -1 on failure -----------------------------------------------------------------------------*/ static int wpa_driver_tista_scan( void *priv, const UINT8 *ssid, size_t ssid_len ) { + struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv; + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)(myDrv->hWpaSupplicant); + struct wpa_ssid *issid; scan_Params_t scanParams; scan_Policy_t scanPolicy; - struct wpa_driver_ti_data *myDrv = (struct wpa_driver_ti_data *)priv; - int ret; + int scan_type, ret, scan_probe_flag = 0; wpa_printf(MSG_DEBUG,"wpa_driver_tista_scan called"); /* If driver is not initialized yet - we cannot access it so return */ TI_CHECK_DRIVER( myDrv->driver_is_loaded, -1 ); - ti_init_scan_params( &scanParams, &scanPolicy, myDrv ); - if (ssid && ssid_len > 0 && ssid_len <= sizeof(scanParams.desiredSsid.ssidString)) { + scan_type = myDrv->scan_type; + if (wpa_s->prev_scan_ssid != BROADCAST_SSID_SCAN) { + if (wpa_s->prev_scan_ssid->scan_ssid) { + scan_type = SCAN_TYPE_NORMAL_ACTIVE; + scan_probe_flag = 1; + } + } + + ti_init_scan_params( &scanParams, &scanPolicy, scan_type, myDrv ); + + myDrv->force_merge_flag = 0; /* Set merge flag */ + + if ((scan_probe_flag && ssid) && + (ssid_len > 0 && ssid_len <= sizeof(scanParams.desiredSsid.ssidString))) { os_memcpy(scanParams.desiredSsid.ssidString, ssid, ssid_len); + if (ssid_len < sizeof(scanParams.desiredSsid.ssidString)) + scanParams.desiredSsid.ssidString[ssid_len] = '\0'; scanParams.desiredSsid.len = ssid_len; + myDrv->force_merge_flag = 1; } TI_SetScanPolicy( myDrv->hDriver, (UINT8 *)&scanPolicy, sizeof(scan_Policy_t) ); - myDrv->last_scan = myDrv->scan_type; /* Remember scan type for last scan */ + myDrv->last_scan = scan_type; /* Remember scan type for last scan */ ret = TI_StartScan( myDrv->hDriver, (scan_Params_t *)&scanParams ); return( TI2WPA_STATUS(ret) ); } @@ -953,22 +953,26 @@ Return Value: pointer to BSSID structure or NULL -----------------------------------------------------------------------------*/ static OS_802_11_BSSID_EX *wpa_driver_tista_get_bssid_info( TI_HANDLE hDriver ) { - OS_802_11_BSSID_EX mySelectedBssidInfo; OS_802_11_BSSID_LIST_EX *bssid_list; OS_802_11_BSSID_EX *pBssid, *nBssid = NULL; int i, number_items, res; + OS_802_11_MAC_ADDRESS bssid; + OS_802_11_SSID ssid; - res = TI_GetSelectedBSSIDInfo( hDriver, &mySelectedBssidInfo ); - if( res != TI_RESULT_OK ) + if( TI_GetBSSIDList( hDriver, &bssid_list ) || !bssid_list ) return( nBssid ); - if( TI_GetBSSIDList( hDriver, &bssid_list ) || !bssid_list ) + if( TI_GetBSSID( hDriver, &bssid ) != TI_RESULT_OK ) + return( nBssid ); + + if( TI_GetCurrentSSID( hDriver, &ssid ) != TI_RESULT_OK ) return( nBssid ); pBssid = &bssid_list->Bssid[0]; number_items = (int)(bssid_list->NumberOfItems); for(i=0;( i < number_items );i++) { - if( os_memcmp( mySelectedBssidInfo.Ssid.Ssid, pBssid->Ssid.Ssid, pBssid->Ssid.SsidLength ) == 0 ) { + if( !os_memcmp((void *)&bssid, pBssid->MacAddress, MAC_ADDR_LEN) && + !os_memcmp(ssid.Ssid, pBssid->Ssid.Ssid, pBssid->Ssid.SsidLength) ) { nBssid = (OS_802_11_BSSID_EX *)os_malloc( pBssid->Length ); if( nBssid != NULL ) os_memcpy( nBssid, pBssid, pBssid->Length ); @@ -1078,7 +1082,7 @@ static int wpa_driver_tista_get_scan_results( void *priv, pBssid = (OS_802_11_BSSID_EX *)(((u8 *)pBssid) + pBssid->Length); } /* Merge new results with previous */ - number_items = scan_merge( myDrv, results, number_items, max_size ); + number_items = scan_merge( myDrv, results, myDrv->force_merge_flag, number_items, max_size ); qsort( results, number_items, sizeof(struct wpa_scan_result), wpa_driver_tista_scan_result_compare ); @@ -1147,7 +1151,7 @@ static void wpa_driver_tista_receive_driver_event( int sock, void *priv, void *s /* Get AP Beacon IEs - especially WPA/RSN IE */ pSelectedBssidInfo = wpa_driver_tista_get_bssid_info( mySuppl->hDriver ); if( pSelectedBssidInfo ) { - if( pSelectedBssidInfo->IELength && pSelectedBssidInfo->IEs ) { // Dm: Fixed IEs ??? + if( pSelectedBssidInfo->IELength && pSelectedBssidInfo->IEs ) { /* Dm: Fixed IEs */ myEventData.assoc_info.beacon_ies = (UINT8 *)pSelectedBssidInfo->IEs + sizeof(OS_802_11_FIXED_IEs); myEventData.assoc_info.beacon_ies_len = pSelectedBssidInfo->IELength - sizeof(OS_802_11_FIXED_IEs); } @@ -1369,15 +1373,16 @@ static void *wpa_driver_tista_init( void *priv, const char *ifname ) wpa_printf(MSG_DEBUG,"driver events socket is 0x%x...",myDrv->driverEventsSocket); - /* Signal that driver is not loaded yet */ + /* Signal that driver is not stopped */ myDrv->driver_is_loaded = TRUE; /* Set default scan type */ myDrv->scan_type = SCAN_TYPE_NORMAL_ACTIVE; + myDrv->force_merge_flag = 0; scan_init( myDrv ); /* Set default amount of channels */ - myDrv->scan_channels = check_and_get_carrier_channels(); + myDrv->scan_channels = check_and_get_build_channels(); /* Link Speed will be set by the message from the driver */ myDrv->link_speed = 0; @@ -1504,30 +1509,30 @@ Return Value: 0 - success, -1 - error static int prepare_filter_struct( void *priv, int type, TIWLAN_DATA_FILTER_REQUEST *dfreq_ptr ) { - const u8 *macaddr; + u8 *macaddr = NULL; size_t len = 0; - u8 mask; + u8 mask = 0; int ret = -1; wpa_printf(MSG_ERROR, "%s: type=%d", __func__, type); switch (type ) { case RX_SELF_FILTER: - macaddr = wpa_driver_tista_get_mac_addr(priv); + macaddr = (u8 *)wpa_driver_tista_get_mac_addr(priv); len = MAC_ADDR_LEN; mask = 0x3F; /* 6 bytes */ break; case RX_BROADCAST_FILTER: - macaddr = (const u8 *)"\xFF\xFF\xFF\xFF\xFF\xFF"; + macaddr = (u8 *)"\xFF\xFF\xFF\xFF\xFF\xFF"; len = MAC_ADDR_LEN; mask = 0x3F; /* 6 bytes */ break; case RX_IPV4_MULTICAST_FILTER: - macaddr = (const u8 *)"\x01\x00\x5E"; + macaddr = (u8 *)"\x01\x00\x5E"; len = 3; mask = 0x7; /* 3 bytes */ break; case RX_IPV6_MULTICAST_FILTER: - macaddr = (const u8 *)"\x33\x33"; + macaddr = (u8 *)"\x33\x33"; len = 2; mask = 0x3; /* 2 bytes */ break; @@ -1569,7 +1574,6 @@ int wpa_driver_tista_driver_cmd( void *priv, char *cmd, char *buf, size_t buf_le if( ret == OK ) { /* Signal that driver is not loaded yet */ myDrv->driver_is_loaded = TRUE; - myDrv->scan_channels = check_and_get_carrier_channels(); wpa_msg(myDrv->hWpaSupplicant, MSG_INFO, WPA_EVENT_DRIVER_STATE "STARTED"); } else @@ -1647,6 +1651,29 @@ int wpa_driver_tista_driver_cmd( void *priv, char *cmd, char *buf, size_t buf_le } } } + else if( os_strcasecmp(cmd, "rssi-approx") == 0 ) { + struct wpa_scan_result *cur_res; + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)(myDrv->hWpaSupplicant); + int rssi, len; + + wpa_printf(MSG_DEBUG,"rssi-approx command"); + + if( !wpa_s ) + return( ret ); + cur_res = scan_get_by_bssid( myDrv, wpa_s->bssid ); + if( cur_res ) { + len = (int)(cur_res->ssid_len); + rssi = cur_res->level; + if( (len > 0) && (len <= MAX_SSID_LEN) && (len < (int)buf_len)) { + os_memcpy( (void *)buf, (void *)(cur_res->ssid), len ); + ret = len; + ret += snprintf(&buf[ret], buf_len-len, " rssi %d\n", rssi); + if (ret < (int)buf_len) { + return( ret ); + } + } + } + } else if( os_strcasecmp(cmd, "rssi") == 0 ) { #if 1 u8 ssid[MAX_SSID_LEN]; diff --git a/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.h b/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.h index 7e6a1ca..7d4c632 100644 --- a/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.h +++ b/sta_dk_4_0_4_32/wpa_supplicant_lib/driver_ti.h @@ -92,6 +92,7 @@ struct wpa_driver_ti_data { int btcoex_scan; /* BtCoex Scan */ unsigned rts_threshold; /* RTS Threshold */ int last_scan; /* Last scan type */ + int force_merge_flag; /* Force scan results merge */ SHLIST scan_merge_list; /* Previous scan list */ int driverEventsSocket; int block_disassoc_events; diff --git a/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.c b/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.c deleted file mode 100644 index c0f3bfe..0000000 --- a/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.c +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*-------------------------------------------------------------------*/ -#include "includes.h" -#include "scanmerge.h" -#include "shlist.h" - -/*----------------------------------------------------------------------------- -Routine Name: scan_init -Routine Description: Inits scan merge list -Arguments: - mydrv - pointer to private driver data structure -Return Value: ------------------------------------------------------------------------------*/ -void scan_init( struct wpa_driver_ti_data *mydrv ) -{ - mydrv->last_scan = -1; - shListInitList( &(mydrv->scan_merge_list) ); -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_free -Routine Description: Frees scan structure private data -Arguments: - ptr - pointer to private data structure -Return Value: ------------------------------------------------------------------------------*/ -static void scan_free( void *ptr ) -{ - os_free( ptr ); -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_exit -Routine Description: Cleans scan merge list -Arguments: - mydrv - pointer to private driver data structure -Return Value: ------------------------------------------------------------------------------*/ -void scan_exit( struct wpa_driver_ti_data *mydrv ) -{ - shListDelAllItems( &(mydrv->scan_merge_list), scan_free ); -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_equal -Routine Description: Compares bssid of scan result and scan merge structure -Arguments: - val - pointer to scan result structure - idata - pointer to scan merge structure -Return Value: 1 - if equal, 0 - if not ------------------------------------------------------------------------------*/ -static int scan_equal( void *val, void *idata ) -{ - struct wpa_scan_result *new_res = (struct wpa_scan_result *)val; - struct wpa_scan_result *lst_res = - (struct wpa_scan_result *)(&(((scan_merge_t *)idata)->scanres)); - - return( !os_memcmp(new_res->bssid, lst_res->bssid, ETH_ALEN) ); -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_add -Routine Description: adds scan result structure to scan merge list -Arguments: - head - pointer to scan merge list head - res_ptr - pointer to scan result structure -Return Value: Pointer to scan merge item ------------------------------------------------------------------------------*/ -static scan_merge_t *scan_add( SHLIST *head, struct wpa_scan_result *res_ptr ) -{ - scan_merge_t *scan_ptr; - - scan_ptr = (scan_merge_t *)os_malloc( sizeof(scan_merge_t) ); - if( !scan_ptr ) - return( NULL ); - os_memcpy( &(scan_ptr->scanres), res_ptr, sizeof(struct wpa_scan_result) ); - scan_ptr->count = SCAN_MERGE_COUNT; - shListInsLastItem( head, (void *)scan_ptr ); - return scan_ptr; -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_find -Routine Description: Looks for scan merge item in scan results array -Arguments: - scan_ptr - pointer to scan merge item - results - pointer to scan results array - number_items - current number of items -Return Value: 1 - if item was found, 0 - otherwise ------------------------------------------------------------------------------*/ -static int scan_find( scan_merge_t *scan_ptr, struct wpa_scan_result *results, - unsigned int number_items ) -{ - unsigned int i; - - for(i=0;( i < number_items );i++) { - if( scan_equal( &(results[i]), scan_ptr ) ) - return 1; - } - return 0; -} - -/*----------------------------------------------------------------------------- -Routine Name: scan_merge -Routine Description: Merges current scan results with previous -Arguments: - mydrv - pointer to private driver data structure - results - pointer to scan results array - number_items - current number of items - max_size - maximum namber of items -Return Value: Merged number of items ------------------------------------------------------------------------------*/ -unsigned int scan_merge( struct wpa_driver_ti_data *mydrv, - struct wpa_scan_result *results, - unsigned int number_items, unsigned int max_size ) -{ - SHLIST *head = &(mydrv->scan_merge_list); - SHLIST *item, *del_item; - scan_merge_t *scan_ptr; - unsigned int i; - - if( mydrv->last_scan == SCAN_TYPE_NORMAL_PASSIVE ) { /* Merge results */ - for(i=0;( i < number_items );i++) { /* Find/Add new items */ - item = shListFindItem( head, &(results[i]), scan_equal ); - if( item ) { - scan_ptr = (scan_merge_t *)(item->data); - os_memcpy( &(scan_ptr->scanres), &(results[i]), - sizeof(struct wpa_scan_result) ); - scan_ptr->count = SCAN_MERGE_COUNT; - } - else { - scan_add( head, &(results[i]) ); - } - } - item = shListGetFirstItem( head ); /* Add/Remove missing items */ - if( item == NULL ) - return( number_items ); - do { - del_item = NULL; - scan_ptr = (scan_merge_t *)(item->data); - if( !scan_find( scan_ptr, results, number_items ) ) { - scan_ptr->count--; - if( scan_ptr->count == 0 ) { - del_item = item; - } - else { - if( number_items < max_size ) { - os_memcpy(&(results[number_items]), - &(scan_ptr->scanres),sizeof(struct wpa_scan_result)); - number_items++; - } - } - } - item = shListGetNextItem( head, item ); - shListDelItem( head, del_item, scan_free ); - } while( item != NULL ); - } - else if( mydrv->last_scan == SCAN_TYPE_NORMAL_ACTIVE ) { /* Copy results */ - shListDelAllItems( head, scan_free ); - for(i=0;( i < number_items );i++) { - if( scan_add( head, &(results[i]) ) == NULL ) - return( i ); - } - } - return( number_items ); -} diff --git a/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.h b/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.h deleted file mode 100644 index 4eda8be..0000000 --- a/sta_dk_4_0_4_32/wpa_supplicant_lib/scanmerge.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/*-------------------------------------------------------------------*/ -#ifndef _SCANMERGE_H_ -#define _SCANMERGE_H_ - -#include "common.h" -#include "driver.h" -#include "driver_ti.h" - -#define SCAN_MERGE_COUNT 4 - -typedef struct SCANMERGE_STRUCT { - struct wpa_scan_result scanres; - unsigned long count; -} scan_merge_t; - -void scan_init( struct wpa_driver_ti_data *mydrv ); -void scan_exit( struct wpa_driver_ti_data *mydrv ); -unsigned int scan_merge( struct wpa_driver_ti_data *mydrv, - struct wpa_scan_result *results, - unsigned int number_items, unsigned int max_size ); - -#endif |