From e8920ccb8f574f04d271fbcc994603bb79db396e Mon Sep 17 00:00:00 2001 From: Sergei Makarenkov Date: Sat, 11 Feb 2017 19:37:39 +0300 Subject: [PATCH] Check arguments of the set tx power ioctl --- os_dep/linux/ioctl_cfg80211.c | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index ff09de6..939c8b2 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -3459,35 +3459,12 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy, if(value > 40) value = 40; - pHalData->CurrentTxPwrIdx = value; - rtw_hal_set_tx_power_level(padapter, pHalData->CurrentChannel); - -#if 0 - struct iwm_priv *iwm = wiphy_to_iwm(wiphy); - int ret; - - switch (type) { - case NL80211_TX_POWER_AUTOMATIC: - return 0; - case NL80211_TX_POWER_FIXED: - if (mbm < 0 || (mbm % 100)) - return -EOPNOTSUPP; - - if (!test_bit(IWM_STATUS_READY, &iwm->status)) - return 0; - - ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, - CFG_TX_PWR_LIMIT_USR, - MBM_TO_DBM(mbm) * 2); - if (ret < 0) - return ret; - - return iwm_tx_power_trigger(iwm); - default: - IWM_ERR(iwm, "Unsupported power type: %d\n", type); + if(type == NL80211_TX_POWER_FIXED) { + pHalData->CurrentTxPwrIdx = value; + rtw_hal_set_tx_power_level(padapter, pHalData->CurrentChannel); + } else return -EOPNOTSUPP; - } -#endif + return 0; }