static TI_STATUS connInfra_WaitDisconnectToIdle(void *pData) { conn_t *pConn = (conn_t *)pData; EScrResourceId uResourceIndex; /* close all BA sessions */ TWD_CloseAllBaSessions(pConn->hTWD); /* Stop the disconnect timeout timer. */ tmr_StopTimer (pConn->hConnTimer); /* * In case of connection failuer we might get here without freeing the SCR. */ for (uResourceIndex = SCR_RESOURCE_SERVING_CHANNEL; uResourceIndex < SCR_RESOURCE_NUM_OF_RESOURCES; uResourceIndex++) { if (pConn->scrRequested[ uResourceIndex ] == TI_TRUE) { scr_clientComplete(pConn->hScr, SCR_CID_CONNECT, uResourceIndex ); pConn->scrRequested[ uResourceIndex ] = TI_FALSE; } } /* * Call the connection lost callback set by the SME or AP_CONN. */ pConn->pConnStatusCB( pConn->connStatCbObj, pConn->smContext.disAssocEventReason, pConn->smContext.disAssocEventStatusCode); return TI_OK; }
TI_STATUS TWD_Stop (TI_HANDLE hTWD) { TTwd *pTWD = (TTwd *)hTWD; ETxnStatus status; fwEvent_Stop (pTWD->hFwEvent); /* close all BA sessions */ TWD_CloseAllBaSessions(hTWD); cmdMbox_Restart (pTWD->hCmdMbox); cmdQueue_Restart (pTWD->hCmdQueue); cmdQueue_DisableMbox (pTWD->hCmdQueue); eventMbox_Stop (pTWD->hEventMbox); MacServices_restart (pTWD->hMacServices); status = twIf_Restart(pTWD->hTwIf); /* Call user stop callback */ if (status != TXN_STATUS_PENDING) { TWD_StopComplete (hTWD); } return TI_OK; }
static TI_STATUS connect_to_ScrWait(void *pData) { TI_STATUS status; paramInfo_t *pParam; conn_t *pConn = (conn_t *)pData; /* * This function performs roaming by two steps: * First - close the current connection without notify the SME. * Second - start new connection in reassociation mode. */ /* close all BA sessions */ TWD_CloseAllBaSessions(pConn->hTWD); status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys); if (status != TI_OK) return status; pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t)); if (!pParam) { return TI_NOK; } pParam->paramType = RX_DATA_PORT_STATUS_PARAM; pParam->content.rxDataPortStatus = CLOSE; status = rxData_setParam(pConn->hRxData, pParam); if (status == TI_OK) { /* Update TxMgmtQueue SM to close Tx path. */ txMgmtQ_SetConnState (((conn_t *)pData)->hTxMgmtQ, TX_CONN_STATE_CLOSE); status = mlme_stop(pConn->hMlmeSm, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP); if (status == TI_OK) { pParam->paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM; regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam); #ifdef XCC_MODULE_INCLUDED XCCMngr_updateIappInformation(pConn->hXCCMngr, XCC_DISASSOC); #endif /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the supported rates, and stopModules clears all rates. */ stopModules(pConn, TI_FALSE); txCtrlParams_setEapolEncryptionStatus(pConn->hTxCtrl, DEF_EAPOL_ENCRYPTION_STATUS); qosMngr_disconnect (pConn->hQosMngr, TI_FALSE); /* * Start new connection. */ connInfra_ScrWait(pConn); } } os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t)); return status; }