How to set txpower on a radio with mt76?
I've been doing something like this...for a really long time:
./local/sbin/iw phy phy0 set txpower limit 1500
While debugging today, I notice that this never manages to send anything down to the mt7996 driver.
Part of it maybe that the driver doesn't handle the BSS_CHANGED_TXPOWER, but none of mt76 seems to support that, so maybe not a critical oversight?
As I understand it, in the method below, the call to ieee80211_hw_config(sdata->local, 0) is completely worthless since changed flags are 0 so method just returns?
If the driver cannot do per BSS txpower, what is the proper way to have mac80211 set the radio txpower?
bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_chanctx_conf *chanctx_conf;
int power;
rcu_read_lock();
chanctx_conf = rcu_dereference(sdata->vif.bss_conf.chanctx_conf);
if (!chanctx_conf) {
rcu_read_unlock();
return false;
}
power = ieee80211_chandef_max_power(&chanctx_conf->def);
rcu_read_unlock();
if (sdata->deflink.user_power_level != IEEE80211_UNSET_POWER_LEVEL)
power = min(power, sdata->deflink.user_power_level);
if (sdata->deflink.ap_power_level != IEEE80211_UNSET_POWER_LEVEL)
power = min(power, sdata->deflink.ap_power_level);
if (power != sdata->vif.bss_conf.txpower) {
sdata->vif.bss_conf.txpower = power;
ieee80211_hw_config(sdata->local, 0);
return true;
}
return false;
}Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com