Commit 108e80db authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg
Browse files

wifi: iwlwifi: mvm: prepare the tx_power handling to be per-link

parent 7953a1f5
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1466,15 +1466,16 @@ struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm)
	return NULL;
}

int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
int iwl_mvm_set_tx_power(struct iwl_mvm *mvm,
			 struct ieee80211_bss_conf *link_conf,
			 s16 tx_power)
{
	u32 cmd_id = REDUCE_TX_POWER_CMD;
	u32 mac_id = iwl_mvm_vif_from_mac80211(link_conf->vif)->id;
	int len;
	struct iwl_dev_tx_power_cmd_v3_v8 cmd = {
		.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC),
		.common.mac_context_id =
			cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id),
		.common.mac_context_id = cpu_to_le32(mac_id),
	};
	struct iwl_dev_tx_power_cmd cmd_v9_v10;
	u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 3);
@@ -1487,8 +1488,7 @@ int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
	if (cmd_ver > 8) {
		/* Those fields sit on the same place for v9 and v10 */
		cmd_v9_v10.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC);
		cmd_v9_v10.common.mac_context_id =
			cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id);
		cmd_v9_v10.common.mac_context_id = cpu_to_le32(mac_id);
		cmd_v9_v10.common.pwr_restriction = cpu_to_le16(u_tx_power);
		cmd_data = &cmd_v9_v10;
	}
@@ -3323,7 +3323,7 @@ static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw,
	if (changes & BSS_CHANGED_TXPOWER) {
		IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d dBm\n",
				bss_conf->txpower);
		iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower);
		iwl_mvm_set_tx_power(mvm, bss_conf, bss_conf->txpower);
	}
}

+1 −1
Original line number Diff line number Diff line
@@ -1038,7 +1038,7 @@ static void iwl_mvm_mld_link_info_changed(struct ieee80211_hw *hw,
	if (changes & BSS_CHANGED_TXPOWER) {
		IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d dBm\n",
				link_conf->txpower);
		iwl_mvm_set_tx_power(mvm, vif, link_conf->txpower);
		iwl_mvm_set_tx_power(mvm, link_conf, link_conf->txpower);
	}
}

+2 −1
Original line number Diff line number Diff line
@@ -2989,7 +2989,8 @@ void iwl_mvm_abort_pmsr(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
bool iwl_mvm_have_links_same_channel(struct iwl_mvm_vif *vif1,
				     struct iwl_mvm_vif *vif2);
bool iwl_mvm_vif_is_active(struct iwl_mvm_vif *mvmvif);
int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
int iwl_mvm_set_tx_power(struct iwl_mvm *mvm,
			 struct ieee80211_bss_conf *bss_conf,
			 s16 tx_power);
int iwl_mvm_set_hw_timestamp(struct ieee80211_hw *hw,
			     struct ieee80211_vif *vif,