ath11k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <jouni@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Lavanya Suresh <lavaks@codeaurora.org>,
	Jouni Malinen <jouni@codeaurora.org>
Subject: [PATCH 11/12] ath11k: Clear auth flag only for actual association in security mode
Date: Thu, 22 Jul 2021 00:20:28 +0300	[thread overview]
Message-ID: <20210721212029.142388-11-jouni@codeaurora.org> (raw)
In-Reply-To: <20210721212029.142388-1-jouni@codeaurora.org>

From: Lavanya Suresh <lavaks@codeaurora.org>

AUTH flag is needed when peer assoc command is sent from the host in
security mode for non-assoc cases. The firmware will handle AUTH flag
when the client is associating as AUTH flag will be set after key
exchange. For internally provided peer assoc commands from the host,
there won't be any key exchange, so AUTH flag is expected to be set in
the host.

Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 3 +++
 drivers/net/wireless/ath/ath11k/wmi.c | 2 +-
 drivers/net/wireless/ath/ath11k/wmi.h | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 11276617a11f..5ab42324a564 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -2300,6 +2300,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,
 
 	rcu_read_unlock();
 
+	peer_arg.is_assoc = true;
 	ret = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
@@ -3563,6 +3564,7 @@ static int ath11k_station_assoc(struct ath11k *ar,
 
 	ath11k_peer_assoc_prepare(ar, vif, sta, &peer_arg, reassoc);
 
+	peer_arg.is_assoc = true;
 	ret = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
 	if (ret) {
 		ath11k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n",
@@ -3774,6 +3776,7 @@ static void ath11k_sta_rc_update_wk(struct work_struct *wk)
 			ath11k_peer_assoc_prepare(ar, arvif->vif, sta,
 						  &peer_arg, true);
 
+			peer_arg.is_assoc = false;
 			err = ath11k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
 			if (err)
 				ath11k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n",
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 6d2696db1e07..5e196829ecf3 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -1762,7 +1762,7 @@ ath11k_wmi_copy_peer_flags(struct wmi_peer_assoc_complete_cmd *cmd,
 		cmd->peer_flags |= WMI_PEER_AUTH;
 	if (param->need_ptk_4_way) {
 		cmd->peer_flags |= WMI_PEER_NEED_PTK_4_WAY;
-		if (!hw_crypto_disabled)
+		if (!hw_crypto_disabled && param->is_assoc)
 			cmd->peer_flags &= ~WMI_PEER_AUTH;
 	}
 	if (param->need_gtk_2_way)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index 2587d22f42ce..e831d268db1d 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -3617,6 +3617,7 @@ struct peer_assoc_params {
 	u32 peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
 	bool twt_responder;
 	bool twt_requester;
+	bool is_assoc;
 	struct ath11k_ppe_threshold peer_ppet;
 };
 
-- 
2.25.1


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2021-07-21 21:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 21:20 [PATCH 01/12] ath11k: Fix pktlog lite rx events Jouni Malinen
2021-07-21 21:20 ` [PATCH 02/12] ath11k: Update pdev tx and rx firmware stats Jouni Malinen
2021-07-21 21:20 ` [PATCH 03/12] ath11k: Avoid reg rules update during firmware recovery Jouni Malinen
2021-07-21 21:20 ` [PATCH 04/12] ath11k: Avoid race during regd updates Jouni Malinen
2021-07-21 21:20 ` [PATCH 05/12] ath11k: Add vdev start flag to disable hardware encryption Jouni Malinen
2021-07-21 21:20 ` [PATCH 06/12] ath11k: Assign free_vdev_map value before ieee80211_register_hw Jouni Malinen
2021-07-21 21:20 ` [PATCH 07/12] ath11k: Fix crash during firmware recovery on reo cmd ring access Jouni Malinen
2021-07-21 21:20 ` [PATCH 08/12] ath11k: Avoid "No VIF found" warning message Jouni Malinen
2021-07-21 21:20 ` [PATCH 09/12] ath11k: Add wmi peer create conf event in wmi_tlv_event_id Jouni Malinen
2021-07-21 21:20 ` [PATCH 10/12] ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware Jouni Malinen
2021-09-28 10:46   ` Kalle Valo
2021-09-28 12:01     ` Rameshkumar Sundaram
2021-11-12  8:01   ` Kalle Valo
2021-07-21 21:20 ` Jouni Malinen [this message]
2021-07-21 21:20 ` [PATCH 12/12] ath11k: Change QCN9074 firmware to operate in mode-2 Jouni Malinen
2021-11-12  8:19   ` Kalle Valo
2021-12-08 12:39     ` Anilkumar Kolli
2021-09-28 10:58 ` [PATCH 01/12] ath11k: Fix pktlog lite rx events Kalle Valo

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=20210721212029.142388-11-jouni@codeaurora.org \
    --to=jouni@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --cc=lavaks@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).