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

Commit cfecc6b4 authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by Reinette Chatre
Browse files

iwlwifi: turn on RTS/CTS after aggregation become operational



If RTS/CTS protection is needed for HT, wait until get operational
notification from mac80211, then inform uCode to switch to RTS/CTS
through RXON command.

Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent 0ab84cff
Loading
Loading
Loading
Loading
+5 −12
Original line number Original line Diff line number Diff line
@@ -324,18 +324,11 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid,
			      struct iwl_lq_sta *lq_data,
			      struct iwl_lq_sta *lq_data,
			      struct ieee80211_sta *sta)
			      struct ieee80211_sta *sta)
{
{
	if ((tid < TID_MAX_LOAD_COUNT) &&
	if (tid < TID_MAX_LOAD_COUNT)
	    !rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta)) {
		rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta);
		if (priv->cfg->use_rts_for_ht) {
	else
			/*
		IWL_ERR(priv, "tid exceeds max load count: %d/%d\n",
			 * switch to RTS/CTS if it is the prefer protection
			tid, TID_MAX_LOAD_COUNT);
			 * method for HT traffic
			 */
			IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n");
			priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
			iwlcore_commit_rxon(priv);
		}
	}
}
}


static inline int get_num_of_ant_from_rate(u32 rate_n_flags)
static inline int get_num_of_ant_from_rate(u32 rate_n_flags)
+27 −1
Original line number Original line Diff line number Diff line
@@ -3368,6 +3368,25 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
	return ret;
	return ret;
}
}


/*
 * switch to RTS/CTS for TX
 */
static void iwl_enable_rts_cts(struct iwl_priv *priv)
{

	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;

	priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
	if (!test_bit(STATUS_SCANNING, &priv->status)) {
		IWL_DEBUG_INFO(priv, "use RTS/CTS protection\n");
		iwlcore_commit_rxon(priv);
	} else {
		/* scanning, defer the request until scan completed */
		IWL_DEBUG_INFO(priv, "defer setting RTS/CTS protection\n");
	}
}

static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
				struct ieee80211_vif *vif,
				struct ieee80211_vif *vif,
				enum ieee80211_ampdu_mlme_action action,
				enum ieee80211_ampdu_mlme_action action,
@@ -3416,7 +3435,14 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
			ret = 0;
			ret = 0;
		break;
		break;
	case IEEE80211_AMPDU_TX_OPERATIONAL:
	case IEEE80211_AMPDU_TX_OPERATIONAL:
		/* do nothing, return value ignored */
		if (priv->cfg->use_rts_for_ht) {
			/*
			 * switch to RTS/CTS if it is the prefer protection
			 * method for HT traffic
			 */
			iwl_enable_rts_cts(priv);
		}
		ret = 0;
		break;
		break;
	}
	}
	mutex_unlock(&priv->mutex);
	mutex_unlock(&priv->mutex);
+9 −0
Original line number Original line Diff line number Diff line
@@ -537,6 +537,15 @@ void iwl_bg_scan_completed(struct work_struct *work)
	/* Since setting the TXPOWER may have been deferred while
	/* Since setting the TXPOWER may have been deferred while
	 * performing the scan, fire one off */
	 * performing the scan, fire one off */
	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
	iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);

	/*
	 * Since setting the RXON may have been deferred while
	 * performing the scan, fire one off if needed
	 */
	if (memcmp(&priv->active_rxon,
		   &priv->staging_rxon, sizeof(priv->staging_rxon)))
		iwlcore_commit_rxon(priv);

 out:
 out:
	mutex_unlock(&priv->mutex);
	mutex_unlock(&priv->mutex);