summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2020-09-28 12:23:13 +0300
committerLuca Coelho <luciano.coelho@intel.com>2020-10-01 21:59:34 +0300
commitdd2a1256e6a8d8162314ee5213cee8a163002c9a (patch)
tree86fbf13c150ab5f7fe370d5b5785e8b1eebfef18 /drivers/net/wireless/intel/iwlwifi/fw/api/power.h
parentfbb7957d28ac897b9dcd29f96750c23543118258 (diff)
downloadlinux-dd2a1256e6a8d8162314ee5213cee8a163002c9a.tar.xz
iwlwifi: acpi: rename geo structs to contain versioning
Add the version number to the iwl_geo_tx_power_profile_cmd structs and move the union into a common place. Additionally, reuse the code that sets elements that are at the same place in the struct across different versions. While at it remove an unused variable, add a comment and move the v2 specific element setting to inside the if statement. Additionally, invert the if for slightly more readability. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200928121852.23ec241f16cd.I8cd21fc5a2498e820b50e1f49a4cbfe545afe30e@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/api/power.h')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/api/power.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
index 062e34b5b4f8..c3111a1e9f57 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
@@ -460,7 +460,7 @@ struct iwl_per_chain_offset {
u8 chain_b;
} __packed; /* PER_CHAIN_LIMIT_OFFSET_PER_CHAIN_S_VER_1 */
-struct iwl_per_chain_offset_group {
+struct iwl_per_chain_offset_group_v1 {
struct iwl_per_chain_offset lb;
struct iwl_per_chain_offset hb;
} __packed; /* PER_CHAIN_LIMIT_OFFSET_GROUP_S_VER_1 */
@@ -472,7 +472,7 @@ struct iwl_per_chain_offset_group {
*/
struct iwl_geo_tx_power_profiles_cmd_v1 {
__le32 ops;
- struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES];
+ struct iwl_per_chain_offset_group_v1 table[IWL_NUM_GEO_PROFILES];
} __packed; /* GEO_TX_POWER_LIMIT_VER_1 */
/**
@@ -481,11 +481,16 @@ struct iwl_geo_tx_power_profiles_cmd_v1 {
* @table: offset profile per band.
* @table_revision: BIOS table revision.
*/
-struct iwl_geo_tx_power_profiles_cmd {
+struct iwl_geo_tx_power_profiles_cmd_v2 {
__le32 ops;
- struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES];
+ struct iwl_per_chain_offset_group_v1 table[IWL_NUM_GEO_PROFILES];
__le32 table_revision;
-} __packed; /* GEO_TX_POWER_LIMIT */
+} __packed; /* GEO_TX_POWER_LIMIT_VER_2 */
+
+union iwl_geo_tx_power_profiles_cmd {
+ struct iwl_geo_tx_power_profiles_cmd_v1 v1;
+ struct iwl_geo_tx_power_profiles_cmd_v2 v2;
+};
/**
* struct iwl_geo_tx_power_profiles_resp - response to GEO_TX_POWER_LIMIT cmd