Commit c8ee33e1 authored by Gregory Greenman's avatar Gregory Greenman Committed by Johannes Berg
Browse files

wifi: iwlwifi: mvm: sta preparation for MLO



Split iwl_mvm_sta into general and link specific parts. As a first
step, all link dependent parameters reside in deflink.

The change was done mostly using the spatch below with some manual
adjustments.

@iwl_mvm_sta@
struct iwl_mvm_sta *s;
identifier var = {sta_id, lq_sta, avg_energy};
@@

(
  s->
-    var
+    deflink.var
)

Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230328104948.34eace06d583.I1f8c5e919a71b21030460fbdd220d42401b688b1@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 650cadb7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,7 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id,
	if (mvmsta->bt_reduced_txpower == enable)
		return 0;

	value = mvmsta->sta_id;
	value = mvmsta->deflink.sta_id;

	if (enable)
		value |= BT_REDUCED_TX_POWER_BIT;
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ static ssize_t iwl_dbgfs_rs_data_read(struct file *file, char __user *user_buf,
{
	struct ieee80211_sta *sta = file->private_data;
	struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
	struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->lq_sta.rs_fw;
	struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->deflink.lq_sta.rs_fw;
	struct iwl_mvm *mvm = lq_sta->pers.drv;
	static const size_t bufsz = 2048;
	char *buff;
+10 −9
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw,
	switch (action) {
	case IEEE80211_AMPDU_RX_START:
		if (iwl_mvm_vif_from_mac80211(vif)->deflink.ap_sta_id ==
				iwl_mvm_sta_from_mac80211(sta)->sta_id) {
		    iwl_mvm_sta_from_mac80211(sta)->deflink.sta_id) {
			struct iwl_mvm_vif *mvmvif;
			u16 macid = iwl_mvm_vif_from_mac80211(vif)->id;
			struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[macid];
@@ -3116,7 +3116,7 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw,
		 */
		break;
	case STA_NOTIFY_AWAKE:
		if (WARN_ON(mvmsta->sta_id == IWL_MVM_INVALID_STA))
		if (WARN_ON(mvmsta->deflink.sta_id == IWL_MVM_INVALID_STA))
			break;

		if (txqs)
@@ -3206,8 +3206,8 @@ static void iwl_mvm_sta_pre_rcu_remove(struct ieee80211_hw *hw,
	 * callback deleted the station.
	 */
	mutex_lock(&mvm->mutex);
	if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id]))
		rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id],
	if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->deflink.sta_id]))
		rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->deflink.sta_id],
				   ERR_PTR(-ENOENT));

	mutex_unlock(&mvm->mutex);
@@ -3534,7 +3534,8 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
			     !iwlwifi_mod_params.disable_11ax) ||
			    (vif->bss_conf.eht_support &&
			     !iwlwifi_mod_params.disable_11be))
				iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->sta_id);
				iwl_mvm_cfg_he_sta(mvm, vif,
						   mvm_sta->deflink.sta_id);
		} else if (vif->type == NL80211_IFTYPE_STATION) {
			vif->bss_conf.he_support = sta->deflink.he_cap.has_he;

@@ -5470,13 +5471,13 @@ static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,
	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
	struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);

	if (mvmsta->avg_energy) {
		sinfo->signal_avg = -(s8)mvmsta->avg_energy;
	if (mvmsta->deflink.avg_energy) {
		sinfo->signal_avg = -(s8)mvmsta->deflink.avg_energy;
		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
	}

	if (iwl_mvm_has_tlc_offload(mvm)) {
		struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->lq_sta.rs_fw;
		struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->deflink.lq_sta.rs_fw;

		iwl_mvm_set_sta_rate(lq_sta->last_rate_n_flags, &sinfo->txrate);
		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
@@ -5491,7 +5492,7 @@ static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,

	mutex_lock(&mvm->mutex);

	if (mvmvif->deflink.ap_sta_id != mvmsta->sta_id)
	if (mvmvif->deflink.ap_sta_id != mvmsta->deflink.sta_id)
		goto unlock;

	if (iwl_mvm_request_statistics(mvm, false))
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm,
	if (sta) {
		struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);

		return BIT(mvmsta->sta_id);
		return BIT(mvmsta->deflink.sta_id);
	}

	if (vif->type == NL80211_IFTYPE_STATION &&
+2 −2
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ static int iwl_mvm_mld_disable_txq(struct iwl_mvm *mvm,
			.operation = cpu_to_le32(IWL_SCD_QUEUE_REMOVE),
			.u.remove.tid = cpu_to_le32(tid),
			.u.remove.sta_mask =
				cpu_to_le32(BIT(mvmsta->sta_id)),
				cpu_to_le32(BIT(mvmsta->deflink.sta_id)),
		};

		ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0,
@@ -348,7 +348,7 @@ static void iwl_mvm_mld_sta_modify_disable_tx(struct iwl_mvm *mvm,

	mvm_sta->disable_tx = disable;

	cmd.sta_id = cpu_to_le32(mvm_sta->sta_id);
	cmd.sta_id = cpu_to_le32(mvm_sta->deflink.sta_id);
	cmd.disable = cpu_to_le32(disable);

	ret = iwl_mvm_send_cmd_pdu(mvm,
Loading