BOOLEAN HwQueryShortPreambleOptionImplemented( _In_ PHW Hw, _In_ ULONG PhyId ) { PNICPHYMIB phyMib; phyMib = HalGetPhyMIB(Hw->Hal, PhyId); // // Depending on phy type, we report support // if (phyMib->PhyType == dot11_phy_type_erp) return TRUE; else return FALSE; }
ULONG HwQueryFrequencyBandsSupported( _In_ PHW Hw, _In_ ULONG PhyId ) { PNICPHYMIB phyMib; phyMib = HalGetPhyMIB(Hw->Hal, PhyId); if (phyMib->PhyType == dot11_phy_type_ofdm) { return DOT11_FREQUENCY_BANDS_LOWER | DOT11_FREQUENCY_BANDS_MIDDLE; } else { return 0; } }
ULONG HwQueryCCAModeSupported( _In_ PHW Hw, _In_ ULONG PhyId ) { PNICPHYMIB phyMib; phyMib = HalGetPhyMIB(Hw->Hal, PhyId); if (phyMib->PhyType == dot11_phy_type_dsss || phyMib->PhyType == dot11_phy_type_hrdsss || phyMib->PhyType == dot11_phy_type_erp) { return DOT11_CCA_MODE_CS_ONLY; } else { return 0; } }
NDIS_STATUS HwQuerySupportedDataRatesValue( _In_ PHW Hw, _In_ ULONG PhyId, _Out_ PDOT11_SUPPORTED_DATA_RATES_VALUE_V2 Dot11SupportedDataRatesValue ) { PNICPHYMIB phyMib; ULONG index; phyMib = HalGetPhyMIB(Hw->Hal, PhyId); for (index = 0; index < MAX_NUM_SUPPORTED_RATES_V2; index++) { Dot11SupportedDataRatesValue->ucSupportedTxDataRatesValue[index] = phyMib->SupportedDataRatesValue.ucSupportedTxDataRatesValue[index]; Dot11SupportedDataRatesValue->ucSupportedRxDataRatesValue[index] = phyMib->SupportedDataRatesValue.ucSupportedRxDataRatesValue[index]; } return NDIS_STATUS_SUCCESS; }
ULONG HwQueryEDThreshold( _In_ PHW Hw, _In_ ULONG PhyId ) { PNICPHYMIB phyMib; phyMib = HalGetPhyMIB(Hw->Hal, PhyId); if (phyMib->PhyType == dot11_phy_type_dsss || phyMib->PhyType == dot11_phy_type_hrdsss || phyMib->PhyType == dot11_phy_type_erp) { // NOTE: Hardcoded value is being used here return (ULONG)-65; } else { return 0; } }
NDIS_STATUS HwResetHAL( __in PHW Hw, __in PHW_HAL_RESET_PARAMETERS ResetParams, __in BOOLEAN DispatchLevel ) { UNREFERENCED_PARAMETER(ResetParams); UNREFERENCED_PARAMETER(DispatchLevel); MPASSERT(!DispatchLevel); // Since we wait, we cannot be called at dispatch HW_ACQUIRE_HARDWARE_LOCK(Hw, FALSE); HW_SET_ADAPTER_STATUS(Hw, HW_ADAPTER_HAL_IN_RESET); HW_RELEASE_HARDWARE_LOCK(Hw, FALSE); // Wait for active send threads to finish. We dont wait // for anything else on an HAL reset since some of those // operations themselves may be causing the reset (Eg. channel // switch of a scan) HW_WAIT_FOR_ACTIVE_SENDS_TO_FINISH(Hw); HwDisableInterrupt(Hw, HW_ISR_TRACKING_HAL_RESET); if (ResetParams->FullReset) { // Perform a full reset of the HW HalResetStart(Hw->Hal); HalStop(Hw->Hal); // Reset the send and receive engine HwWaitForPendingReceives(Hw, NULL); HwResetSendEngine(Hw, FALSE); HwResetReceiveEngine(Hw, FALSE); // Remove old keys, etc HwClearNicState(Hw); // Reset our MAC & PHY state HwResetSoftwareMacState(Hw); HwResetSoftwarePhyState(Hw); HalStart(Hw->Hal, TRUE); // Push the new state on the hardware HwSetNicState(Hw); HalResetEnd(Hw->Hal); } else { // TODO: Currently we are overloading the HalSwitchChannel API for doing a HalReset HalSwitchChannel(Hw->Hal, Hw->PhyState.OperatingPhyId, HalGetPhyMIB(Hw->Hal, Hw->PhyState.OperatingPhyId)->Channel, FALSE ); HwResetReceiveEngine(Hw, FALSE); HwResetSendEngine(Hw, FALSE); HalStartReceive(Hw->Hal); } HwEnableInterrupt(Hw, HW_ISR_TRACKING_HAL_RESET); HW_CLEAR_ADAPTER_STATUS(Hw, HW_ADAPTER_HAL_IN_RESET); return NDIS_STATUS_SUCCESS; }