aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2015-01-15 13:22:34 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-01-22 10:55:24 -0500
commitc5d679a55dce1c025b12bcea5063d882565622b8 (patch)
tree6778028815c3bd060983a5798e4b159cdafdd1d8
parent2c59d80c448c8b6c0978986bd687466a233bd8ae (diff)
iwlwifi: mvm: use a new API for enabling STBC
The new API tells the FW that it's allowed to use STBC but the FW will decide on its own whether to use STBC or SISO (and in the future Beamformer). Keep support for the old API which sets STBC explicitly in the rates in the LQ table while we still support old FW revisions. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fw-file.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h15
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rs.c14
3 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
index b998aaf5efd1..e4f589898eda 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
@@ -249,6 +249,7 @@ enum iwl_ucode_tlv_flag {
249 * through the dedicated host command. 249 * through the dedicated host command.
250 * @IWL_UCODE_TLV_API_SINGLE_SCAN_EBS: EBS is supported for single scans too. 250 * @IWL_UCODE_TLV_API_SINGLE_SCAN_EBS: EBS is supported for single scans too.
251 * @IWL_UCODE_TLV_API_ASYNC_DTM: Async temperature notifications are supported. 251 * @IWL_UCODE_TLV_API_ASYNC_DTM: Async temperature notifications are supported.
252 * @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params
252 */ 253 */
253enum iwl_ucode_tlv_api { 254enum iwl_ucode_tlv_api {
254 IWL_UCODE_TLV_API_BT_COEX_SPLIT = BIT(3), 255 IWL_UCODE_TLV_API_BT_COEX_SPLIT = BIT(3),
@@ -261,6 +262,7 @@ enum iwl_ucode_tlv_api {
261 IWL_UCODE_TLV_API_SCD_CFG = BIT(15), 262 IWL_UCODE_TLV_API_SCD_CFG = BIT(15),
262 IWL_UCODE_TLV_API_SINGLE_SCAN_EBS = BIT(16), 263 IWL_UCODE_TLV_API_SINGLE_SCAN_EBS = BIT(16),
263 IWL_UCODE_TLV_API_ASYNC_DTM = BIT(17), 264 IWL_UCODE_TLV_API_ASYNC_DTM = BIT(17),
265 IWL_UCODE_TLV_API_LQ_SS_PARAMS = BIT(18),
264}; 266};
265 267
266/** 268/**
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h
index 8bb5b94bf963..6a2a6b0ab91b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h
@@ -308,6 +308,17 @@ enum {
308#define LQ_FLAG_DYNAMIC_BW_POS 6 308#define LQ_FLAG_DYNAMIC_BW_POS 6
309#define LQ_FLAG_DYNAMIC_BW_MSK (1 << LQ_FLAG_DYNAMIC_BW_POS) 309#define LQ_FLAG_DYNAMIC_BW_MSK (1 << LQ_FLAG_DYNAMIC_BW_POS)
310 310
311/* Single Stream Parameters
312 * SS_STBC/BFER_ALLOWED - Controls whether STBC or Beamformer (BFER) is allowed
313 * ucode will make a smart decision between SISO/STBC/BFER
314 * SS_PARAMS_VALID - if not set ignore the ss_params field.
315 */
316enum {
317 RS_SS_STBC_ALLOWED = BIT(0),
318 RS_SS_BFER_ALLOWED = BIT(1),
319 RS_SS_PARAMS_VALID = BIT(31),
320};
321
311/** 322/**
312 * struct iwl_lq_cmd - link quality command 323 * struct iwl_lq_cmd - link quality command
313 * @sta_id: station to update 324 * @sta_id: station to update
@@ -330,7 +341,7 @@ enum {
330 * 2 - 0x3f: maximal number of frames (up to 3f == 63) 341 * 2 - 0x3f: maximal number of frames (up to 3f == 63)
331 * @rs_table: array of rates for each TX try, each is rate_n_flags, 342 * @rs_table: array of rates for each TX try, each is rate_n_flags,
332 * meaning it is a combination of RATE_MCS_* and IWL_RATE_*_PLCP 343 * meaning it is a combination of RATE_MCS_* and IWL_RATE_*_PLCP
333 * @bf_params: beam forming params, currently not used 344 * @ss_params: single stream features. declare whether STBC or BFER are allowed.
334 */ 345 */
335struct iwl_lq_cmd { 346struct iwl_lq_cmd {
336 u8 sta_id; 347 u8 sta_id;
@@ -348,6 +359,6 @@ struct iwl_lq_cmd {
348 u8 agg_frame_cnt_limit; 359 u8 agg_frame_cnt_limit;
349 __le32 reserved2; 360 __le32 reserved2;
350 __le32 rs_table[LQ_MAX_RETRY_NUM]; 361 __le32 rs_table[LQ_MAX_RETRY_NUM];
351 __le32 bf_params; 362 __le32 ss_params;
352}; /* LINK_QUALITY_CMD_API_S_VER_1 */ 363}; /* LINK_QUALITY_CMD_API_S_VER_1 */
353#endif /* __fw_api_rs_h__ */ 364#endif /* __fw_api_rs_h__ */
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index 554b3a5e442c..f30eff20cb6b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -2868,11 +2868,23 @@ static void rs_build_rates_table(struct iwl_mvm *mvm,
2868 u8 valid_tx_ant = 0; 2868 u8 valid_tx_ant = 0;
2869 struct iwl_lq_cmd *lq_cmd = &lq_sta->lq; 2869 struct iwl_lq_cmd *lq_cmd = &lq_sta->lq;
2870 bool toggle_ant = false; 2870 bool toggle_ant = false;
2871 bool stbc_allowed = false;
2871 2872
2872 memcpy(&rate, initial_rate, sizeof(rate)); 2873 memcpy(&rate, initial_rate, sizeof(rate));
2873 2874
2874 valid_tx_ant = iwl_mvm_get_valid_tx_ant(mvm); 2875 valid_tx_ant = iwl_mvm_get_valid_tx_ant(mvm);
2875 rate.stbc = rs_stbc_allow(mvm, sta, lq_sta); 2876
2877 stbc_allowed = rs_stbc_allow(mvm, sta, lq_sta);
2878 if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LQ_SS_PARAMS) {
2879 u32 ss_params = RS_SS_PARAMS_VALID;
2880
2881 if (stbc_allowed)
2882 ss_params |= RS_SS_STBC_ALLOWED;
2883 lq_cmd->ss_params = cpu_to_le32(ss_params);
2884 } else {
2885 /* TODO: remove old API when min FW API hits 14 */
2886 rate.stbc = stbc_allowed;
2887 }
2876 2888
2877 if (is_siso(&rate)) { 2889 if (is_siso(&rate)) {
2878 num_rates = IWL_MVM_RS_INITIAL_SISO_NUM_RATES; 2890 num_rates = IWL_MVM_RS_INITIAL_SISO_NUM_RATES;