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

Commit 6c4fbcbc authored by Emmanuel Grumbach's avatar Emmanuel Grumbach
Browse files

iwlwifi: add support for 12K Receive Buffers



802.11ac allows A-MSDU that can be up to 12KB long. Since
an entire A-MSDU needs to fit into one single Receive
Buffer (RB), add support for big RBs.
Since this adds lots of pressure to the memory manager and
significantly increase the true_size of the RX buffers,
don't enable this by default.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 7d162045
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,21 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	trans_cfg.op_mode = op_mode;
	trans_cfg.no_reclaim_cmds = no_reclaim_cmds;
	trans_cfg.n_no_reclaim_cmds = ARRAY_SIZE(no_reclaim_cmds);
	trans_cfg.rx_buf_size_8k = iwlwifi_mod_params.amsdu_size_8K;

	switch (iwlwifi_mod_params.amsdu_size) {
	case IWL_AMSDU_4K:
		trans_cfg.rx_buf_size = IWL_AMSDU_4K;
		break;
	case IWL_AMSDU_8K:
		trans_cfg.rx_buf_size = IWL_AMSDU_8K;
		break;
	case IWL_AMSDU_12K:
	default:
		trans_cfg.rx_buf_size = IWL_AMSDU_4K;
		pr_err("Unsupported amsdu_size: %d\n",
		       iwlwifi_mod_params.amsdu_size);
	}

	trans_cfg.cmd_q_wdg_timeout = IWL_WATCHDOG_DISABLED;

	trans_cfg.command_names = iwl_dvm_cmd_strings;
+2 −2
Original line number Diff line number Diff line
@@ -1637,9 +1637,9 @@ MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
MODULE_PARM_DESC(11n_disable,
	"disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX");
module_param_named(amsdu_size_8K, iwlwifi_mod_params.amsdu_size_8K,
module_param_named(amsdu_size, iwlwifi_mod_params.amsdu_size,
		   int, S_IRUGO);
MODULE_PARM_DESC(amsdu_size_8K, "enable 8K amsdu size (default 0)");
MODULE_PARM_DESC(amsdu_size, "amsdu size 0:4K 1:8K 2:12K (default 0)");
module_param_named(fw_restart, iwlwifi_mod_params.restart_fw, bool, S_IRUGO);
MODULE_PARM_DESC(fw_restart, "restart firmware in case of error (default true)");

+1 −1
Original line number Diff line number Diff line
@@ -766,7 +766,7 @@ void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,
	if (cfg->ht_params->ldpc)
		ht_info->cap |= IEEE80211_HT_CAP_LDPC_CODING;

	if (iwlwifi_mod_params.amsdu_size_8K)
	if (iwlwifi_mod_params.amsdu_size >= IWL_AMSDU_8K)
		ht_info->cap |= IEEE80211_HT_CAP_MAX_AMSDU;

	ht_info->ampdu_factor = cfg->max_ht_ampdu_exponent;
+8 −2
Original line number Diff line number Diff line
@@ -86,6 +86,12 @@ enum iwl_disable_11n {
	IWL_ENABLE_HT_TXAGG	 = BIT(3),
};

enum iwl_amsdu_size {
	IWL_AMSDU_4K = 0,
	IWL_AMSDU_8K = 1,
	IWL_AMSDU_12K = 2,
};

/**
 * struct iwl_mod_params
 *
@@ -94,7 +100,7 @@ enum iwl_disable_11n {
 * @sw_crypto: using hardware encryption, default = 0
 * @disable_11n: disable 11n capabilities, default = 0,
 *	use IWL_[DIS,EN]ABLE_HT_* constants
 * @amsdu_size_8K: enable 8K amsdu size, default = 0
 * @amsdu_size: enable 8K amsdu size, default = 4K. enum iwl_amsdu_size.
 * @restart_fw: restart firmware, default = 1
 * @bt_coex_active: enable bt coex, default = true
 * @led_mode: system default, default = 0
@@ -109,7 +115,7 @@ enum iwl_disable_11n {
struct iwl_mod_params {
	int sw_crypto;
	unsigned int disable_11n;
	int amsdu_size_8K;
	int amsdu_size;
	bool restart_fw;
	bool bt_coex_active;
	int led_mode;
+12 −1
Original line number Diff line number Diff line
@@ -379,8 +379,19 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg,
	else
		vht_cap->cap |= IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;

	if (iwlwifi_mod_params.amsdu_size_8K)
	switch (iwlwifi_mod_params.amsdu_size) {
	case IWL_AMSDU_4K:
		vht_cap->cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895;
		break;
	case IWL_AMSDU_8K:
		vht_cap->cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991;
		break;
	case IWL_AMSDU_12K:
		vht_cap->cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454;
		break;
	default:
		break;
	}

	vht_cap->vht_mcs.rx_mcs_map =
		cpu_to_le16(IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 |
Loading