📄 cmm_info.c
字号:
/* ************************************************************************* * Ralink Tech Inc. * 5F., No.36, Taiyuan St., Jhubei City, * Hsinchu County 302, * Taiwan, R.O.C. * * (c) Copyright 2002-2007, Ralink Technology, Inc. * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * ************************************************************************* */ #include "rt_config.h"INT Show_SSID_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_WirelessMode_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_TxBurst_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_TxPreamble_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_TxPower_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_Channel_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_BGProtection_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_RTSThreshold_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_FragThreshold_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#ifdef DOT11_N_SUPPORTINT Show_HtBw_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtMcs_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtGi_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtOpMode_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtExtcha_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtMpduDensity_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtBaWinSize_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtRdg_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtAmsdu_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_HtAutoBa_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#endif // DOT11_N_SUPPORT //INT Show_CountryRegion_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_CountryRegionABand_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_CountryCode_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#ifdef AGGREGATION_SUPPORTINT Show_PktAggregate_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#endif // AGGREGATION_SUPPORT //#ifdef WMM_SUPPORTINT Show_WmmCapable_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#endif // WMM_SUPPORT //INT Show_IEEE80211H_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#ifdef CONFIG_STA_SUPPORTINT Show_NetworkType_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);#endif // CONFIG_STA_SUPPORT //INT Show_AuthMode_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_EncrypType_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_DefaultKeyID_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_Key1_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_Key2_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_Key3_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_Key4_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);INT Show_WPAPSK_Proc( IN PRTMP_ADAPTER pAd, OUT PSTRING pBuf);static struct { PSTRING name; INT (*show_proc)(PRTMP_ADAPTER pAdapter, PSTRING arg);} *PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC, RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC[] = { {"SSID", Show_SSID_Proc}, {"WirelessMode", Show_WirelessMode_Proc}, {"TxBurst", Show_TxBurst_Proc}, {"TxPreamble", Show_TxPreamble_Proc}, {"TxPower", Show_TxPower_Proc}, {"Channel", Show_Channel_Proc}, {"BGProtection", Show_BGProtection_Proc}, {"RTSThreshold", Show_RTSThreshold_Proc}, {"FragThreshold", Show_FragThreshold_Proc}, #ifdef DOT11_N_SUPPORT {"HtBw", Show_HtBw_Proc}, {"HtMcs", Show_HtMcs_Proc}, {"HtGi", Show_HtGi_Proc}, {"HtOpMode", Show_HtOpMode_Proc}, {"HtExtcha", Show_HtExtcha_Proc}, {"HtMpduDensity", Show_HtMpduDensity_Proc}, {"HtBaWinSize", Show_HtBaWinSize_Proc}, {"HtRdg", Show_HtRdg_Proc}, {"HtAmsdu", Show_HtAmsdu_Proc}, {"HtAutoBa", Show_HtAutoBa_Proc},#endif // DOT11_N_SUPPORT // {"CountryRegion", Show_CountryRegion_Proc}, {"CountryRegionABand", Show_CountryRegionABand_Proc}, {"CountryCode", Show_CountryCode_Proc},#ifdef AGGREGATION_SUPPORT {"PktAggregate", Show_PktAggregate_Proc}, #endif#ifdef WMM_SUPPORT {"WmmCapable", Show_WmmCapable_Proc}, #endif {"IEEE80211H", Show_IEEE80211H_Proc},#ifdef CONFIG_STA_SUPPORT {"NetworkType", Show_NetworkType_Proc}, #endif // CONFIG_STA_SUPPORT // {"AuthMode", Show_AuthMode_Proc}, {"EncrypType", Show_EncrypType_Proc}, {"DefaultKeyID", Show_DefaultKeyID_Proc}, {"Key1", Show_Key1_Proc}, {"Key2", Show_Key2_Proc}, {"Key3", Show_Key3_Proc}, {"Key4", Show_Key4_Proc}, {"WPAPSK", Show_WPAPSK_Proc}, {NULL, NULL}};/* ========================================================================== Description: Get Driver version. Return: ==========================================================================*/INT Set_DriverVersion_Proc( IN PRTMP_ADAPTER pAd, IN PSTRING arg){#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) DBGPRINT(RT_DEBUG_TRACE, ("Driver version-%s\n", STA_DRIVER_VERSION));#endif // CONFIG_STA_SUPPORT // return TRUE;}/* ========================================================================== Description: Set Country Region. This command will not work, if the field of CountryRegion in eeprom is programmed. Return: TRUE if all parameters are OK, FALSE otherwise ==========================================================================*/INT Set_CountryRegion_Proc( IN PRTMP_ADAPTER pAd, IN PSTRING arg){ int retval; #ifdef EXT_BUILD_CHANNEL_LIST return -EOPNOTSUPP;#endif // EXT_BUILD_CHANNEL_LIST // retval = RT_CfgSetCountryRegion(pAd, arg, BAND_24G); if (retval == FALSE) return FALSE; // if set country region, driver needs to be reset BuildChannelList(pAd); DBGPRINT(RT_DEBUG_TRACE, ("Set_CountryRegion_Proc::(CountryRegion=%d)\n", pAd->CommonCfg.CountryRegion)); return TRUE;}/* ========================================================================== Description: Set Country Region for A band. This command will not work, if the field of CountryRegion in eeprom is programmed. Return: TRUE if all parameters are OK, FALSE otherwise ==========================================================================*/INT Set_CountryRegionABand_Proc( IN PRTMP_ADAPTER pAd, IN PSTRING arg){ int retval;#ifdef EXT_BUILD_CHANNEL_LIST return -EOPNOTSUPP;#endif // EXT_BUILD_CHANNEL_LIST // retval = RT_CfgSetCountryRegion(pAd, arg, BAND_5G); if (retval == FALSE) return FALSE; // if set country region, driver needs to be reset BuildChannelList(pAd); DBGPRINT(RT_DEBUG_TRACE, ("Set_CountryRegionABand_Proc::(CountryRegion=%d)\n", pAd->CommonCfg.CountryRegionForABand)); return TRUE;}/* ========================================================================== Description: Set Wireless Mode Return: TRUE if all parameters are OK, FALSE otherwise ==========================================================================*/INT Set_WirelessMode_Proc( IN PRTMP_ADAPTER pAd, IN PSTRING arg){ INT success = TRUE; success = RT_CfgSetWirelessMode(pAd, arg); if (success) {#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { LONG WirelessMode = pAd->CommonCfg.PhyMode; RTMPSetPhyMode(pAd, WirelessMode);#ifdef DOT11_N_SUPPORT if (WirelessMode >= PHY_11ABGN_MIXED) { pAd->CommonCfg.BACapability.field.AutoBA = TRUE; pAd->CommonCfg.REGBACapability.field.AutoBA = TRUE; } else { pAd->CommonCfg.BACapability.field.AutoBA = FALSE; pAd->CommonCfg.REGBACapability.field.AutoBA = FALSE; }#endif // DOT11_N_SUPPORT // // Set AdhocMode rates if (pAd->StaCfg.BssType == BSS_ADHOC) { MlmeUpdateTxRates(pAd, FALSE, 0); MakeIbssBeacon(pAd); // re-build BEACON frame AsicEnableIbssSync(pAd); // copy to on-chip memory } }#endif // CONFIG_STA_SUPPORT // // it is needed to set SSID to take effect#ifdef DOT11_N_SUPPORT SetCommonHT(pAd);#endif // DOT11_N_SUPPORT // DBGPRINT(RT_DEBUG_TRACE, ("Set_WirelessMode_Proc::(=%d)\n", pAd->CommonCfg.PhyMode)); } else { DBGPRINT(RT_DEBUG_ERROR, ("Set_WirelessMode_Proc::parameters out of range\n")); } return success;}/* ========================================================================== Description: Set Channel Return: TRUE if all parameters are OK, FALSE otherwise ==========================================================================*/INT Set_Channel_Proc( IN PRTMP_ADAPTER pAd, IN PSTRING arg){ INT success = TRUE; UCHAR Channel; Channel = (UCHAR) simple_strtol(arg, 0, 10); // check if this channel is valid if (ChannelSanity(pAd, Channel) == TRUE) {#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { pAd->CommonCfg.Channel = Channel; if (MONITOR_ON(pAd)) {#ifdef DOT11_N_SUPPORT N_ChannelCheck(pAd); if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED && pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40) { N_SetCenCh(pAd); AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); DBGPRINT(RT_DEBUG_TRACE, ("BW_40, control_channel(%d), CentralChannel(%d) \n", pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel)); } else#endif // DOT11_N_SUPPORT // { AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.Channel); DBGPRINT(RT_DEBUG_TRACE, ("BW_20, Channel(%d)\n", pAd->CommonCfg.Channel)); } } }#endif // CONFIG_STA_SUPPORT // success = TRUE; } else {#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) success = FALSE;#endif // CONFIG_STA_SUPPORT // }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -