Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

iwlwifi: clean up code in AGG



If we take a pointer to the tid_data, then use it.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 046db346
Loading
Loading
Loading
Loading
+10 −11
Original line number Original line Diff line number Diff line
@@ -541,9 +541,9 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
	spin_lock_bh(&priv->sta_lock);
	spin_lock_bh(&priv->sta_lock);


	tid_data = &priv->tid_data[sta_id][tid];
	tid_data = &priv->tid_data[sta_id][tid];
	txq_id = priv->tid_data[sta_id][tid].agg.txq_id;
	txq_id = tid_data->agg.txq_id;


	switch (priv->tid_data[sta_id][tid].agg.state) {
	switch (tid_data->agg.state) {
	case IWL_EMPTYING_HW_QUEUE_ADDBA:
	case IWL_EMPTYING_HW_QUEUE_ADDBA:
		/*
		/*
		* This can happen if the peer stops aggregation
		* This can happen if the peer stops aggregation
@@ -563,9 +563,9 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
	case IWL_AGG_ON:
	case IWL_AGG_ON:
		break;
		break;
	default:
	default:
		IWL_WARN(priv, "Stopping AGG while state not ON "
		IWL_WARN(priv,
			 "or starting for %d on %d (%d)\n", sta_id, tid,
			 "Stopping AGG while state not ON or starting for %d on %d (%d)\n",
			 priv->tid_data[sta_id][tid].agg.state);
			 sta_id, tid, tid_data->agg.state);
		spin_unlock_bh(&priv->sta_lock);
		spin_unlock_bh(&priv->sta_lock);
		return 0;
		return 0;
	}
	}
@@ -578,12 +578,11 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
			"stopping AGG on STA/TID %d/%d but hwq %d not used\n",
			"stopping AGG on STA/TID %d/%d but hwq %d not used\n",
			sta_id, tid, txq_id);
			sta_id, tid, txq_id);
	} else if (tid_data->agg.ssn != tid_data->next_reclaimed) {
	} else if (tid_data->agg.ssn != tid_data->next_reclaimed) {
		IWL_DEBUG_TX_QUEUES(priv, "Can't proceed: ssn %d, "
		IWL_DEBUG_TX_QUEUES(priv,
				    "next_recl = %d\n",
				    "Can't proceed: ssn %d, next_recl = %d\n",
				    tid_data->agg.ssn,
				    tid_data->agg.ssn,
				    tid_data->next_reclaimed);
				    tid_data->next_reclaimed);
		priv->tid_data[sta_id][tid].agg.state =
		tid_data->agg.state = IWL_EMPTYING_HW_QUEUE_DELBA;
			IWL_EMPTYING_HW_QUEUE_DELBA;
		spin_unlock_bh(&priv->sta_lock);
		spin_unlock_bh(&priv->sta_lock);
		return 0;
		return 0;
	}
	}
@@ -591,8 +590,8 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
	IWL_DEBUG_TX_QUEUES(priv, "Can proceed: ssn = next_recl = %d\n",
	IWL_DEBUG_TX_QUEUES(priv, "Can proceed: ssn = next_recl = %d\n",
			    tid_data->agg.ssn);
			    tid_data->agg.ssn);
turn_off:
turn_off:
	agg_state = priv->tid_data[sta_id][tid].agg.state;
	agg_state = tid_data->agg.state;
	priv->tid_data[sta_id][tid].agg.state = IWL_AGG_OFF;
	tid_data->agg.state = IWL_AGG_OFF;


	spin_unlock_bh(&priv->sta_lock);
	spin_unlock_bh(&priv->sta_lock);