Commit 66e863a5 authored by Wey-Yi Guy's avatar Wey-Yi Guy
Browse files

iwlagn: support dynamic aggregation for BT coex



Use dynamic aggregation threshold if bt traffic load is high
to reduce the impact on aggregated frame.

Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 95a5ede3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -546,6 +546,7 @@ static struct iwl_bt_params iwl6000_bt_params = {
	.bt_statistics = true,
	/* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
	.advanced_bt_coexist = true,
	.agg_time_limit = BT_AGG_THRESHOLD_DEF,
	.bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
	.bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
};
+2 −4
Original line number Diff line number Diff line
@@ -2025,7 +2025,6 @@ void iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
	struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif;
	struct iwlagn_bt_sco_cmd sco_cmd = { .flags = 0 };
	struct iwl_bt_uart_msg *uart_msg = &coex->last_bt_uart_msg;
	u8 last_traffic_load;

	IWL_DEBUG_NOTIF(priv, "BT Coex notification:\n");
	IWL_DEBUG_NOTIF(priv, "    status: %d\n", coex->bt_status);
@@ -2034,11 +2033,10 @@ void iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
			coex->bt_ci_compliance);
	iwlagn_print_uartmsg(priv, uart_msg);

	last_traffic_load = priv->notif_bt_traffic_load;
	priv->notif_bt_traffic_load = coex->bt_traffic_load;
	priv->last_bt_traffic_load = priv->bt_traffic_load;
	if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
		if (priv->bt_status != coex->bt_status ||
		    last_traffic_load != coex->bt_traffic_load) {
		    priv->last_bt_traffic_load != coex->bt_traffic_load) {
			if (coex->bt_status) {
				/* BT on */
				if (!priv->bt_ch_announce)
+17 −15
Original line number Diff line number Diff line
@@ -833,17 +833,23 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
			    struct iwl_lq_sta *lq_sta)
{
	struct iwl_scale_tbl_info *tbl;
	bool full_concurrent;
	bool full_concurrent = priv->bt_full_concurrent;
	unsigned long flags;

	if (priv->bt_ant_couple_ok) {
		/*
		 * Is there a need to switch between
		 * full concurrency and 3-wire?
		 */
		spin_lock_irqsave(&priv->lock, flags);
		if (priv->bt_ci_compliance && priv->bt_ant_couple_ok)
			full_concurrent = true;
		else
			full_concurrent = false;
		spin_unlock_irqrestore(&priv->lock, flags);

	if (priv->bt_full_concurrent != full_concurrent) {
	}
	if ((priv->bt_traffic_load != priv->last_bt_traffic_load) ||
	    (priv->bt_full_concurrent != full_concurrent)) {
		priv->bt_full_concurrent = full_concurrent;

		/* Update uCode's rate table. */
@@ -1040,8 +1046,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
	if (sta && sta->supp_rates[sband->band])
		rs_rate_scale_perform(priv, skb, sta, lq_sta);

	/* Is there a need to switch between full concurrency and 3-wire? */
	if (priv->bt_ant_couple_ok)
	if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)
		rs_bt_update_lq(priv, ctx, lq_sta);
}

@@ -3010,10 +3015,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
	 */
	if (priv && priv->cfg->bt_params &&
	    priv->cfg->bt_params->agg_time_limit &&
	    priv->cfg->bt_params->agg_time_limit >=
		LINK_QUAL_AGG_TIME_LIMIT_MIN &&
	    priv->cfg->bt_params->agg_time_limit <=
		 LINK_QUAL_AGG_TIME_LIMIT_MAX)
	    priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)
		lq_cmd->agg_params.agg_time_limit =
			cpu_to_le16(priv->cfg->bt_params->agg_time_limit);
}
+0 −1
Original line number Diff line number Diff line
@@ -3837,7 +3837,6 @@ static int iwl_init_drv(struct iwl_priv *priv)
		priv->bt_on_thresh = BT_ON_THRESHOLD_DEF;
		priv->bt_duration = BT_DURATION_LIMIT_DEF;
		priv->dynamic_frag_thresh = BT_FRAG_THRESHOLD_DEF;
		priv->dynamic_agg_thresh = BT_AGG_THRESHOLD_DEF;
	}

	/* Set the tx_power_user_lmt to the lowest power level
+1 −1
Original line number Diff line number Diff line
@@ -1469,7 +1469,7 @@ static void iwl_teardown_interface(struct iwl_priv *priv,
	 * both values are the same and zero.
	 */
	if (vif->type == NL80211_IFTYPE_ADHOC)
		priv->bt_traffic_load = priv->notif_bt_traffic_load;
		priv->bt_traffic_load = priv->last_bt_traffic_load;
}

void iwl_mac_remove_interface(struct ieee80211_hw *hw,
Loading