mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-29 08:27:41 +00:00
Check arguments of the set tx power ioctl
This commit is contained in:
parent
e37acdc291
commit
e8920ccb8f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user