All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 07/15] iwlwifi: mvm: add support for new  version of WOWLAN_TKIP_SETTING_API_S
Date: Sat, 26 Sep 2020 00:30:45 +0300	[thread overview]
Message-ID: <iwlwifi.20200926002540.5edc24ef3907.I68820c8c0946451cf0cca14dda171fa304b1dc43@changeid> (raw)
In-Reply-To: <20200925213053.454459-1-luca@coelho.fi>

From: Dan Halperin <Dan1.Halperin@intel.com>

Add a sta_id (__le32) to the cmd, in order to support CDB protocol.

Signed-off-by: Dan Halperin <Dan1.Halperin@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/fw/api/d3.h    | 15 ++++++++++++---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   | 19 ++++++++++++++++++-
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h b/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
index c4562e1f8d18..c44384be75ad 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
@@ -8,7 +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 - 2019 Intel Corporation
+ * Copyright(c) 2018 - 2020 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
@@ -31,7 +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 - 2019 Intel Corporation
+ * Copyright(c) 2018 - 2020 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -469,13 +469,22 @@ struct iwl_p1k_cache {
 
 #define IWL_NUM_RX_P1K_CACHE	2
 
-struct iwl_wowlan_tkip_params_cmd {
+struct iwl_wowlan_tkip_params_cmd_ver_1 {
 	struct iwl_mic_keys mic_keys;
 	struct iwl_p1k_cache tx;
 	struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
 	struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
 
+struct iwl_wowlan_tkip_params_cmd {
+	struct iwl_mic_keys mic_keys;
+	struct iwl_p1k_cache tx;
+	struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
+	struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
+	u8     reversed[2];
+	__le32 sta_id;
+} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */
+
 #define IWL_KCK_MAX_SIZE	32
 #define IWL_KEK_MAX_SIZE	32
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index bcdd2b376ce5..081d35497ccb 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -783,9 +783,26 @@ static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	if (key_data.use_tkip &&
 	    !fw_has_api(&mvm->fw->ucode_capa,
 			IWL_UCODE_TLV_API_TKIP_MIC_KEYS)) {
+		int ver = iwl_fw_lookup_cmd_ver(mvm->fw, LONG_GROUP,
+						WOWLAN_TKIP_PARAM);
+		int size;
+
+		if (ver == 2) {
+			size = sizeof(tkip_cmd);
+			key_data.tkip->sta_id =
+				cpu_to_le32(mvmvif->ap_sta_id);
+		} else if (ver == 1 || ver == IWL_FW_CMD_VER_UNKNOWN) {
+			size = sizeof(struct iwl_wowlan_tkip_params_cmd_ver_1);
+		} else {
+			ret =  -EINVAL;
+			WARN_ON_ONCE(1);
+			goto out;
+		}
+
+		/* send relevant data according to CMD version */
 		ret = iwl_mvm_send_cmd_pdu(mvm,
 					   WOWLAN_TKIP_PARAM,
-					   cmd_flags, sizeof(tkip_cmd),
+					   cmd_flags, size,
 					   &tkip_cmd);
 		if (ret)
 			goto out;
-- 
2.28.0


  parent reply	other threads:[~2020-09-25 21:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 21:30 [PATCH 00/15] iwlwifi: updates intended for v5.10 2020-09-26 Luca Coelho
2020-09-25 21:30 ` [PATCH 01/15] iwlwifi: dbg: remove IWL_FW_INI_TIME_POINT_WDG_TIMEOUT Luca Coelho
2020-10-01 18:57   ` Luca Coelho
2020-09-25 21:30 ` [PATCH 02/15] iwlwifi: dbg: add dumping special device memory Luca Coelho
2020-09-25 21:30 ` [PATCH 03/15] iwlwifi: regulatory: regulatory capabilities api change Luca Coelho
2020-09-25 21:30 ` [PATCH 04/15] iwl-trans: move dev_cmd_offs, page_offs to a common trans header Luca Coelho
2020-09-25 21:30 ` [PATCH 05/15] iwlwifi: mvm: split a print to avoid a WARNING in ROC Luca Coelho
2020-09-29  7:52   ` Kalle Valo
2020-09-29  8:09     ` Luca Coelho
2020-09-30  7:31   ` [PATCH v2 " Luca Coelho
2020-10-01 18:57     ` Luca Coelho
2020-09-25 21:30 ` [PATCH 06/15] iwlwifi: mvm: Don't install CMAC/GMAC key in AP mode Luca Coelho
2020-10-01 18:58   ` Luca Coelho
2020-09-25 21:30 ` Luca Coelho [this message]
2020-09-25 21:30 ` [PATCH 08/15] iwlwifi: mvm: process ba-notifications also when sta rcu is invalid Luca Coelho
2020-09-25 21:30 ` [PATCH 09/15] iwlwifi: don't export acpi functions unnecessarily Luca Coelho
2020-09-25 21:30 ` [PATCH 10/15] iwlwifi: mvm: add support for new WOWLAN_TSC_RSC_PARAM version Luca Coelho
2020-09-25 21:30 ` [PATCH 11/15] iwlwifi: mvm: remove redundant support_umac_log field Luca Coelho
2020-09-25 21:30 ` [PATCH 12/15] iwlwifi: mvm: use CHECKSUM_COMPLETE Luca Coelho
2020-09-25 21:30 ` [PATCH 13/15] iwlwifi: remove iwl_validate_sar_geo_profile() export Luca Coelho
2020-09-25 21:30 ` [PATCH 14/15] iwlwifi: acpi: remove dummy definition of iwl_sar_set_profile() Luca Coelho
2020-09-25 21:30 ` [PATCH 15/15] iwlwifi: add new card for MA family Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20200926002540.5edc24ef3907.I68820c8c0946451cf0cca14dda171fa304b1dc43@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.