VOID Sta11StopStation( __in PSTATION pStation, __in NDIS_HALT_ACTION HaltAction ) { UNREFERENCED_PARAMETER(HaltAction); // Periodic scan StaStopPeriodicScan(pStation); // // Cleanup all the connection state // StaResetConnection(pStation, FALSE); // Cleanup the BSS list Sta11FlushBSSList(pStation); MPVERIFY(IsListEmpty(&(pStation->BSSList.List))); // Cleanup station configuration StaInitializeStationConfig(pStation); // Cleanup the AdHoc station list StaResetAdHocStaInfo(pStation, TRUE); }
NDIS_STATUS Sta11InitializeStation( __in PSTATION pStation, __in PADAPTER pAdapter, __in PNIC pNic ) { NDIS_STATUS ndisStatus = NDIS_STATUS_SUCCESS; BOOLEAN bFreeAdhoc = FALSE; do { pStation->pAdapter = pAdapter; pStation->pNic = pNic; // Setup default config StaInitializeStationConfig(pStation); StaInitializeBSSList(&pStation->BSSList); ndisStatus = StaInitializeAdHocStaInfo(pStation); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } bFreeAdhoc = TRUE; ndisStatus = StaInitializeScanContext(pStation); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } ndisStatus = StaInitializeConnectionContext(pStation); if (ndisStatus != NDIS_STATUS_SUCCESS) { break; } } while (FALSE); if (ndisStatus != NDIS_STATUS_SUCCESS) { StaFreeScanContext(pStation); if (bFreeAdhoc) { StaFreeAdHocStaInfo(pStation); } } return ndisStatus; }
VOID StaResetStationConfig( __in PSTATION pStation ) { // // Reset all state we have maintained // StaInitializeStationConfig(pStation); // // Set default auth and cipher algorithms // StaSetDefaultAuthAlgo(pStation); // // Reset power management state on hardware // StaSetPowerSavingLevel( pStation, DOT11_POWER_SAVING_NO_POWER_SAVING ); }
VOID Sta11TerminatePort( _In_ PMP_PORT Port ) { PMP_EXTSTA_PORT extStaPort = MP_GET_STA_PORT(Port); // // We should have been paused and have already // stopped periodic scanning. Ensure that that is the case // MPASSERT(STA_TEST_SCAN_FLAG(extStaPort, STA_STOP_PERIODIC_SCAN)); // // Cleanup all the connection state // StaResetConnection(extStaPort, FALSE); // Cleanup station configuration StaInitializeStationConfig(extStaPort); // Cleanup the AdHoc station list StaResetAdHocStaInfo(extStaPort, TRUE); }
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; }