VOID Sta11ResetStep1( __in PSTATION pStation, __in MP_RESET_TYPE ResetType ) { UNREFERENCED_PARAMETER(ResetType); MP_SET_FLAG(pStation, STA_RESET_IN_PROGRESS); // // Pause the beaconing // Hw11StopAdHoc(pStation->pNic); // Stop periodic scan (must call before stopping the // connection, since a periodic scan can start // off the association process) StaStopPeriodicScan(pStation); // Cleanup connection context StaResetConnection(pStation, TRUE); // Reset the state we had maintained about for roaming StaResetRoamState(pStation); // Reset the AdHoc station Info but do not clear AdHoc station list. StaResetAdHocStaInfo(pStation, FALSE); // Reset configuration (including resetting cipher and key on hardware) StaResetStationConfig(pStation); // We dont clear the BSS list on a reset // Clears PMKID cache pStation->PMKIDCache.CheckingTime = 0; pStation->PMKIDCache.Count = 0; pStation->Statistics.ullMcastWEPExcludedCount = 0; pStation->Statistics.ullUcastWEPExcludedCount = 0; }
NDIS_STATUS Sta11InitializePort( _In_ PMP_PORT Port, _In_ PVOID RegistryInformation ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; BOOLEAN freeAdhoc = FALSE, freeScanContext = FALSE; PMP_EXTSTA_PORT extStaPort = MP_GET_STA_PORT(Port); do { // Save the registry value extStaPort->RegInfo = (PSTA_REG_INFO)RegistryInformation; // Setup default config StaInitializeStationConfig(extStaPort); ndisStatus = StaInitializeAdHocStaInfo(extStaPort); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } freeAdhoc = TRUE; ndisStatus = StaInitializeScanContext(extStaPort); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } freeScanContext = TRUE; ndisStatus = StaInitializeConnectionContext(extStaPort); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } // Reset all the state StaResetStationConfig(extStaPort); // // Now that we are ready, setup the handlers for other data handlers // Port->RequestHandler = Sta11OidHandler; Port->SendEventHandler = Sta11SendEventHandler; Port->SendCompleteEventHandler = BasePortSendCompleteEventHandler; Port->ReceiveEventHandler = Sta11ReceiveEventHandler; Port->ReturnEventHandler = BasePortReturnEventHandler; } while (FALSE); if (ndisStatus != NDIS_STATUS_SUCCESS) { if (freeAdhoc) { if (freeScanContext) { StaFreeScanContext(extStaPort); } StaFreeAdHocStaInfo(extStaPort); } } return ndisStatus; }