wifi: mac80211: ieee80211_recalc_txpower receives a link

Handle the tx power per-link. Don't change the behavior for now. Just
change the signature of the function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241007144851.705bbf953d0a.I8a429dede07bab5801f4c730a6abff7ce23b22d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Emmanuel Grumbach
2024-10-07 15:00:50 +03:00
committed by Johannes Berg
parent eea3323c43
commit 9925aa855d
4 changed files with 11 additions and 10 deletions

View File

@@ -3096,7 +3096,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
sdata->vif.bss_conf.txpower_type = txp_type;
}
ieee80211_recalc_txpower(sdata, update_txp_type);
ieee80211_recalc_txpower(&sdata->deflink, update_txp_type);
return 0;
}
@@ -3127,7 +3127,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
continue;
ieee80211_recalc_txpower(sdata, update_txp_type);
ieee80211_recalc_txpower(&sdata->deflink, update_txp_type);
}
if (has_monitor) {
@@ -3139,7 +3139,8 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
update_txp_type = true;
sdata->vif.bss_conf.txpower_type = txp_type;
ieee80211_recalc_txpower(sdata, update_txp_type);
ieee80211_recalc_txpower(&sdata->deflink,
update_txp_type);
}
}

View File

@@ -905,7 +905,7 @@ static int ieee80211_assign_link_chanctx(struct ieee80211_link_data *link,
}
if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) {
ieee80211_recalc_txpower(sdata, false);
ieee80211_recalc_txpower(&sdata->deflink, false);
ieee80211_recalc_chanctx_min_def(local, new_ctx, NULL, false);
}
@@ -1712,7 +1712,7 @@ static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local)
link,
changed);
ieee80211_recalc_txpower(sdata, false);
ieee80211_recalc_txpower(&sdata->deflink, false);
}
ieee80211_recalc_chanctx_chantype(local, ctx);

View File

@@ -2034,7 +2034,7 @@ int ieee80211_add_virtual_monitor(struct ieee80211_local *local);
void ieee80211_del_virtual_monitor(struct ieee80211_local *local);
bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata);
void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
void ieee80211_recalc_txpower(struct ieee80211_link_data *link,
bool update_bss);
void ieee80211_recalc_offload(struct ieee80211_local *local);

View File

@@ -74,12 +74,12 @@ bool __ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata)
return false;
}
void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata,
void ieee80211_recalc_txpower(struct ieee80211_link_data *link,
bool update_bss)
{
if (__ieee80211_recalc_txpower(sdata) ||
(update_bss && ieee80211_sdata_running(sdata)))
ieee80211_link_info_change_notify(sdata, &sdata->deflink,
if (__ieee80211_recalc_txpower(link->sdata) ||
(update_bss && ieee80211_sdata_running(link->sdata)))
ieee80211_link_info_change_notify(link->sdata, link,
BSS_CHANGED_TXPOWER);
}