diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index c26bb07..ec885d2 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -3691,10 +3691,13 @@ if(type == NL80211_TX_POWER_FIXED) { // need any kernel patches to set the card to an arbitratry high power value, since they are well below the legal limit of // every country. Note, however, that the card is now not doing what linux tells it - but honestly, someone decided // to just map dBm values to some power index at some point anyways. - if(mbm>=0 && mbm<=63){ - padapter->registrypriv.RegTxPowerIndexOverride = mbm; - RTW_WARN("OpenHD:interpreting %d mBm as tx power index override",(int)mbm); - } + // 22.April: Simplify -> use tpi override value (and dummy tx power commits) + int openhd_override_tx_power_index=get_openhd_override_tx_power_index(); + if(openhd_override_tx_power_index>=0 && openhd_override_tx_power_index<=63){ + padapter->registrypriv.RegTxPowerIndexOverride = openhd_override_tx_power_index; + }else{ + padapter->registrypriv.RegTxPowerIndexOverride = 0; + } RTW_INFO("OpenHD:Tx power index override is %d",padapter->registrypriv.RegTxPowerIndexOverride); pHalData->CurrentTxPwrIdx = value; @@ -5170,6 +5173,7 @@ static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy // update if module param has been updated padapter->registrypriv.openhd_override_channel=get_openhd_override_channel(); padapter->registrypriv.openhd_override_channel_width=get_openhd_override_channel_width(); + RTW_WARN("OpenHD: override %d %d",padapter->registrypriv.openhd_override_channel,padapter->registrypriv.openhd_override_channel_width); { if(padapter->registrypriv.openhd_override_channel){ diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 4bd3a08..b7bdac8 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -595,6 +595,9 @@ MODULE_PARM_DESC(openhd_override_channel, "OpenHD easy (CRDA workaround)"); int openhd_override_channel_width = 0; module_param(openhd_override_channel_width, int, 0644); MODULE_PARM_DESC(openhd_override_channel_width, "OpenHD easy (CRDA workaround)"); +int openhd_override_tx_power_index = 0; +module_param(openhd_override_tx_power_index, int, 0644); +MODULE_PARM_DESC(openhd_override_tx_power_index, "OpenHD easy (CRDA workaround)"); // @@ -4871,3 +4874,6 @@ int get_openhd_override_channel(void){ int get_openhd_override_channel_width(void){ return openhd_override_channel_width; } +int get_openhd_override_tx_power_index(void){ + return openhd_override_tx_power_index; +}