preliminary txpower test

This commit is contained in:
evilphish 2017-10-21 19:52:27 +02:00
parent ddf67e6260
commit 632bfd75cd
2 changed files with 29 additions and 1 deletions

View File

@ -457,8 +457,11 @@ void rtl8812_init_dm_priv(IN PADAPTER Adapter)
Init_ODM_ComInfo_8812(Adapter);
ODM_InitAllTimers(podmpriv);
pHalData->CurrentTxPwrIdx = 18;
}
void rtl8812_deinit_dm_priv(IN PADAPTER Adapter)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);

View File

@ -3163,6 +3163,27 @@ static int cfg80211_rtw_set_txpower(struct wiphy *wiphy,
enum tx_power_setting type, int dbm)
#endif
{
_adapter *padapter = wiphy_to_adapter(wiphy);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
int value;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) || defined(COMPAT_KERNEL_RELEASE)
value = mbm/100;
#else
value = dbm;
#endif
if(value < 0)
value = 0;
if(value > 40)
value = 40;
if(type == NL80211_TX_POWER_FIXED) {
pHalData->CurrentTxPwrIdx = value;
rtw_hal_set_tx_power_level(padapter, pHalData->CurrentChannel);
} else
return -EOPNOTSUPP;
#if 0
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
int ret;
@ -3199,9 +3220,13 @@ static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
#endif
int *dbm)
{
_adapter *padapter = wiphy_to_adapter(wiphy);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
RTW_INFO("%s\n", __func__);
*dbm = (12);
*dbm = pHalData->CurrentTxPwrIdx;
//*dbm = (12);
return 0;
}