mirror of
https://github.com/aircrack-ng/rtl8188eus.git
synced 2026-06-01 23:19:46 +00:00
Implemented txpower control
This commit is contained in:
@@ -3925,6 +3925,26 @@ 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->current_channel);
|
||||
} else
|
||||
return -EOPNOTSUPP;
|
||||
#if 0
|
||||
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
|
||||
int ret;
|
||||
@@ -3961,9 +3981,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 = (12);
|
||||
*dbm = pHalData->CurrentTxPwrIdx;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user