]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: support absolute thresholds in bf configuration
authorAvigail Grinstein <avigail.grinstein@intel.com>
Sun, 28 Oct 2018 15:16:44 +0000 (17:16 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 4 Feb 2019 10:28:07 +0000 (12:28 +0200)
Update iwl_beacon_filter_cmd to support
BEACON_FILTER_CONFIG_API_S_VER_4.

Currently driver configs them to be zero
(i.e. disable them, so no change is applied).

Signed-off-by: Avigail Grinstein <avigail.grinstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/power.h
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/mvm/power.c

index 286a22da232dca4fcebb0c9bb4151556ef0beb7c..5844898ee92c3bfb27d3dc29b9eba9ee47271b03 100644 (file)
@@ -470,6 +470,13 @@ struct iwl_geo_tx_power_profiles_resp {
  * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed
  *      for a longer period of time then this escape-timeout. Units: Beacons.
  * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled.
+ * @bf_threshold_absolute_low: See below.
+ * @bf_threshold_absolute_high: Send Beacon to driver if Energy value calculated
+ *      for this beacon crossed this absolute threshold. For the 'Increase'
+ *      direction the bf_energy_absolute_low[i] is used. For the 'Decrease'
+ *      direction the bf_energy_absolute_high[i] is used. Zero value means
+ *      that this specific threshold is ignored for beacon filtering, and
+ *      beacon will not be forced to be sent to driver due to this setting.
  */
 struct iwl_beacon_filter_cmd {
        __le32 bf_energy_delta;
@@ -483,7 +490,9 @@ struct iwl_beacon_filter_cmd {
        __le32 bf_escape_timer;
        __le32 ba_escape_timer;
        __le32 ba_enable_beacon_abort;
-} __packed;
+       __le32 bf_threshold_absolute_low[2];
+       __le32 bf_threshold_absolute_high[2];
+} __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */
 
 /* Beacon filtering and beacon abort */
 #define IWL_BF_ENERGY_DELTA_DEFAULT 5
index a6dd27fbe4aaf9e3a4329bc193214199b16de30f..8c6ce4142204de311fce28e3a89fb4ca61cf2d7a 100644 (file)
@@ -265,6 +265,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
  *     the REDUCE_TX_POWER_CMD.
  * @IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF: This ucode supports the short
  *     version of the beacon notification.
+ * @IWL_UCODE_TLV_API_BEACON_FILTER_V4: This ucode supports v4 of
+ *     BEACON_FILTER_CONFIG_API_S_VER_4.
  *
  * @NUM_IWL_UCODE_TLV_API: number of bits used
  */
@@ -290,6 +292,7 @@ enum iwl_ucode_tlv_api {
        IWL_UCODE_TLV_API_FRAG_EBS              = (__force iwl_ucode_tlv_api_t)44,
        IWL_UCODE_TLV_API_REDUCE_TX_POWER       = (__force iwl_ucode_tlv_api_t)45,
        IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF    = (__force iwl_ucode_tlv_api_t)46,
+       IWL_UCODE_TLV_API_BEACON_FILTER_V4      = (__force iwl_ucode_tlv_api_t)47,
 
        NUM_IWL_UCODE_TLV_API
 #ifdef __CHECKER__
index 5a0a28fd762d7557071694b449cc1013a56ec638..df9f1d6cdf78c8db51d4d09096f477f8972a4f95 100644 (file)
@@ -8,6 +8,7 @@
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
+ * Copyright (C) 2018 Intel Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -30,6 +31,7 @@
  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
+ * Copyright (C) 2018 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -79,6 +81,8 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
                                   struct iwl_beacon_filter_cmd *cmd,
                                   u32 flags)
 {
+       u16 len;
+
        IWL_DEBUG_POWER(mvm, "ba_enable_beacon_abort is: %d\n",
                        le32_to_cpu(cmd->ba_enable_beacon_abort));
        IWL_DEBUG_POWER(mvm, "ba_escape_timer is: %d\n",
@@ -101,9 +105,23 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
                        le32_to_cpu(cmd->bf_temp_fast_filter));
        IWL_DEBUG_POWER(mvm, "bf_temp_slow_filter is: %d\n",
                        le32_to_cpu(cmd->bf_temp_slow_filter));
+       IWL_DEBUG_POWER(mvm, "bf_threshold_absolute_low is: %d, %d\n",
+                       le32_to_cpu(cmd->bf_threshold_absolute_low[0]),
+                       le32_to_cpu(cmd->bf_threshold_absolute_low[1]));
+
+       IWL_DEBUG_POWER(mvm, "bf_threshold_absolute_high is: %d, %d\n",
+                       le32_to_cpu(cmd->bf_threshold_absolute_high[0]),
+                       le32_to_cpu(cmd->bf_threshold_absolute_high[1]));
+
+       if (fw_has_api(&mvm->fw->ucode_capa,
+                      IWL_UCODE_TLV_API_BEACON_FILTER_V4))
+               len = sizeof(struct iwl_beacon_filter_cmd);
+       else
+               len = offsetof(struct iwl_beacon_filter_cmd,
+                              bf_threshold_absolute_low);
 
        return iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, flags,
-                                   sizeof(struct iwl_beacon_filter_cmd), cmd);
+                                   len, cmd);
 }
 
 static