/** * * roamingMngr_smStartIdle - Start event when in Idle state * * \b Description: * * Start event when in Idle state. * This function is called when the station becomes CONNECTED. * Perform the following: * - The current state becomes WAIT_4_TRIGGER * - Unmask Roaming events * - Set handoverWasPerformed to TI_FALSE * - Start the Scan Manager * * \b ARGS: * * I - pData - pointer to the roamingMngr SM context \n * * \b RETURNS: * * TI_OK if successful, TI_NOK otherwise. * * */ static void roamingMngr_smStartIdle(void *pData) { roamingMngr_t *pRoamingMngr; bssEntry_t *pCurBssEntry; pRoamingMngr = (roamingMngr_t*)pData; TRACE0(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_smStartIdle, Unmask Roaming events and start continuos scan \n"); pRoamingMngr->maskRoamingEvents = TI_FALSE; pRoamingMngr->handoverWasPerformed = TI_FALSE; pRoamingMngr->roamingTrigger = ROAMING_TRIGGER_NONE; pCurBssEntry = apConn_getBSSParams(pRoamingMngr->hAPConnection); if (pCurBssEntry != NULL) scanMngr_startContScan(pRoamingMngr->hScanMngr, &pCurBssEntry->BSSID, pCurBssEntry->band); /* Start pre-authentication in order to set PMKID for the current AP */ if (pRoamingMngr->staCapabilities.authMode==os802_11AuthModeWPA2) { /* No Pre-Auth is required */ bssList_t *pBssList; TRACE0(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_smStartIdle, Pre-Auth to cur AP\n"); pBssList = os_memoryAlloc(pRoamingMngr->hOs, sizeof(bssList_t)); if (!pBssList) { return; } pBssList->numOfEntries = 0; apConn_preAuthenticate(pRoamingMngr->hAPConnection, pBssList); os_memoryFree(pRoamingMngr->hOs, pBssList, sizeof(bssList_t)); } }
TI_STATUS roamingMngr_updateNewBssList(TI_HANDLE hRoamingMngr, bssList_t *bssList) { roamingMngr_t *pRoamingMngr; pRoamingMngr = (roamingMngr_t*)hRoamingMngr; if ((pRoamingMngr == NULL) || (bssList == NULL)) { return TI_NOK; } TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_updateNewBssList, number of APs = %d\n", bssList->numOfEntries); if (*(pRoamingMngr->pCurrentState) != ROAMING_STATE_WAIT_4_TRIGGER) { TRACE0(pRoamingMngr->hReport, REPORT_SEVERITY_WARNING, "roamingMngr_updateNewBssList, ignore APs when not in WAIT_4_TRIGGER state \n"); return TI_NOK; } if (pRoamingMngr->staCapabilities.authMode!=os802_11AuthModeWPA2) { /* No Pre-Auth is required */ TRACE0(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_updateNewBssList, No Pre-Auth is required\n"); return TI_OK; } apConn_preAuthenticate(pRoamingMngr->hAPConnection, bssList); return TI_OK; }
/** * * roamingMngr_smSuccHandover * * \b Description: * * This procedure is called when handover succeeded. * Inform Scan Manager about the new AP. * UnMask Roaming Triggers. * * \b ARGS: * * I - hRoamingMngr - roamingMngr SM context \n * * \b RETURNS: * * TI_OK if successful, TI_NOK otherwise. * * */ static void roamingMngr_smSuccHandover(TI_HANDLE hRoamingMngr) { roamingMngr_t *pRoamingMngr; bssEntry_t *pNewConnectedAp; pRoamingMngr = (roamingMngr_t*)hRoamingMngr; TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_smSuccHandover, candidateApIndex=%d \n", pRoamingMngr->candidateApIndex); if (pRoamingMngr->handoverWasPerformed && (pRoamingMngr->pListOfAPs != NULL) && (pRoamingMngr->pListOfAPs->numOfEntries>0)) { if (pRoamingMngr->candidateApIndex == CURRENT_AP_INDEX) { /* get the current AP */ pNewConnectedAp = apConn_getBSSParams(pRoamingMngr->hAPConnection); if (pNewConnectedAp == NULL) return; } else { /* get the candidate AP */ pNewConnectedAp = &pRoamingMngr->pListOfAPs->BSSList[pRoamingMngr->candidateApIndex]; } scanMngr_handoverDone(pRoamingMngr->hScanMngr, &pNewConnectedAp->BSSID, pNewConnectedAp->band); } pRoamingMngr->maskRoamingEvents = TI_FALSE; pRoamingMngr->candidateApIndex = INVALID_CANDIDATE_INDEX; pRoamingMngr->handoverWasPerformed = TI_FALSE; pRoamingMngr->roamingTrigger = ROAMING_TRIGGER_NONE; /* Start pre-authentication in order to set PMKID for the current AP */ if (pRoamingMngr->staCapabilities.authMode==os802_11AuthModeWPA2) { /* No Pre-Auth is required */ bssList_t *pBssList; pBssList = os_memoryAlloc(pRoamingMngr->hOs, sizeof(bssList_t)); if (!pBssList) { return; } pBssList->numOfEntries = 0; apConn_preAuthenticate(pRoamingMngr->hAPConnection, pBssList); os_memoryFree(pRoamingMngr->hOs, pBssList, sizeof(bssList_t)); } }