iwlwifi: mvm: add support for CT-KILL notification version 2
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sat, 29 Jan 2022 11:16:22 +0000 (13:16 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 18 Feb 2022 08:40:51 +0000 (10:40 +0200)
A new version was added to the CT-KILL notification API.
Add support for it.

In addition, print the two fields that was added in this version.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220129105618.b79be7a134e9.I7f5c67d79dd97bf5170492aab356ec983622d3b2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/phy.h
drivers/net/wireless/intel/iwlwifi/mvm/tt.c

index c04f2521fcb3be55cd24e89aa0b696da24dfeeb3..b1b9c29859c17e02ecd445d5e27929dffcc5c447 100644 (file)
@@ -166,14 +166,24 @@ struct iwl_dts_measurement_resp {
 
 /**
  * struct ct_kill_notif - CT-kill entry notification
+ * This structure represent both versions of this notification.
  *
  * @temperature: the current temperature in celsius
- * @reserved: reserved
+ * @dts: only in v2: DTS that trigger the CT Kill bitmap:
+ *                     bit 0: ToP master
+ *                     bit 1: PA chain A master
+ *                     bit 2: PA chain B master
+ *                     bit 3: ToP slave
+ *                     bit 4: PA chain A slave
+ *                     bit 5: PA chain B slave)
+ *                     bits 6,7: reserved (set to 0)
+ * @scheme: only for v2: scheme that trigger the CT Kill (0-SW, 1-HW)
  */
 struct ct_kill_notif {
        __le16 temperature;
-       __le16 reserved;
-} __packed; /* GRP_PHY_CT_KILL_NTF */
+       u8 dts;
+       u8 scheme;
+} __packed; /* CT_KILL_NOTIFICATION_API_S_VER_1, CT_KILL_NOTIFICATION_API_S_VER_2 */
 
 /**
 * enum ctdp_cmd_operation - CTDP command operations
index 9409ef7aee834a0784975e07fd078d25699dd189..69cf3a37275968d07eaf5ab27684ad6b5361264f 100644 (file)
@@ -160,6 +160,11 @@ void iwl_mvm_ct_kill_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
        notif = (struct ct_kill_notif *)pkt->data;
        IWL_DEBUG_TEMP(mvm, "CT Kill notification temperature = %d\n",
                       notif->temperature);
+       if (iwl_fw_lookup_notif_ver(mvm->fw, PHY_OPS_GROUP,
+                                   CT_KILL_NOTIFICATION, 0) > 1)
+               IWL_DEBUG_TEMP(mvm,
+                              "CT kill notification DTS bitmap = 0x%x, Scheme = %d\n",
+                              notif->dts, notif->scheme);
 
        iwl_mvm_enter_ctkill(mvm);
 }