From nobody Sun Dec 14 12:13:39 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52171221F0E; Fri, 23 May 2025 03:49:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747972168; cv=none; b=PSTomD90NDIimCikGswMRWx9FkQ0A/aLlF2E7SXm1AUsFecTJEL4q4nnOsCRJmuWpl8NnVutWOr1gsCWlvFLTbM7GQ56FEImgxjcD+uZbU0SmWhYANs1PEA08EaXtNqTN971EPPB0Tcq6ObtWzeyyvneXSvtDHdBh7ovv7ogKVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747972168; c=relaxed/simple; bh=/N9Ibj1g9u4oW+wOJnwTR743a1afUrE/gy6QniazbsE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=Y/dBvwlhdK5d0zqqLa78GIefmDPMWXS0efSawM8fek+BxRURDRcwMrQvCTkOEXcMjcCKGGdTMGXi+O6APFYx2w13uel6ZMy0PmLKz5V+OT0CN0gbivC/eC37m5WMbD/ZHLvXiKJ4vCXcTALpf7QLjDITxDMWFki0geucIxXpl2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=JOndwHgU; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="JOndwHgU" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54MIQFHr027725; Fri, 23 May 2025 03:49:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= XwNVOArfi6yagzNOWMVdlGDMKyNdJ81OM8YRIL/zqJc=; b=JOndwHgUan/jNAyF fld/0GxFny4XSeeW4D6FNmIeC0yaR3dMt40OviVbeQPsldHA4W+B2OG+nrbfTohV j6IG/YtLV7Yp+3k3gLXZ46cOtDzk/zj+kqZNy0YfzLOHop/T0TJiwcwGVY+3wL7v 3I1cojzHTsM0HoY7SWRA0BD+wkuOXIVw4d4HAaW/9wBHtl0EmQbXO43NLh0fq452 VJCYTl3R1diyxSD3It3uf+wA6A/qFmVDj5jxFgT8OkROlEtRvQ5Ox9VusvY+chi8 rU9d8Goq/byKrbxjRS153Vl7gLKvo9O7ZuTasKvnh2m6gL+C8aV2k8UqeScKJSH1 7p/8xw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf9gb8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 May 2025 03:49:21 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54N3nK46001321 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 May 2025 03:49:20 GMT Received: from [127.0.1.1] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 22 May 2025 20:49:18 -0700 From: Baochen Qiang Date: Fri, 23 May 2025 11:49:01 +0800 Subject: [PATCH ath-next 1/2] wifi: ath12k: avoid bit operation on key flags Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250523-ath12k-unicast-key-first-v1-1-f53c3880e6d8@quicinc.com> References: <20250523-ath12k-unicast-key-first-v1-0-f53c3880e6d8@quicinc.com> In-Reply-To: <20250523-ath12k-unicast-key-first-v1-0-f53c3880e6d8@quicinc.com> To: Jeff Johnson CC: , , , Baochen Qiang X-Mailer: b4 0.14.2 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: zebZ5g__iV2gvVKobA-NVIfQob_A1FfM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIzMDAzMiBTYWx0ZWRfX6gWIw+xuLDkX xmOaZW8jg5Bg4qtS5yJSoiE34ENjVJw8Kfob0dHn2o3pgGiIoztMoCcbNd6yt0q/zypRQuFickR IRyeQZnC1gmvDm8EBYnVHP9+40+4QR2gwp7lyiXoShwpa1lUeyLdyWHNttW6Tk4ADct1WvfCTlK 9UbLHFarkEbGSE9+A3+OXoqkwVPq7yXOJDjZisphJflFWyOCBX1Gixhm/DPKZ6iucqhNHFNAmci rDkCJhSncBKV1CCtacu5xm4e9T/QINKh6defZ9i2cD5HZSxXgNOwJl7nIdXXJChYawF33cj4+ax DJbR9+0EQcwPkQEXibMkUtx8jLP5qZbRZSsAHc1smmxWnhKIbKAAhF1LY6BN7fXeg3RyCXb/8kO 5uWQpDzBYSN83iEsfSyRHfX543Gn6MoNC9BHwb2QiXmlnWrn/tw2peU6dO8sm8KEtFKaBExV X-Authority-Analysis: v=2.4 cv=GawXnRXL c=1 sm=1 tr=0 ts=682ff041 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=TahXmFVQDa20seucTHQA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: zebZ5g__iV2gvVKobA-NVIfQob_A1FfM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-23_02,2025-05-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=836 lowpriorityscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 suspectscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505230032 WMI_KEY_PAIRWISE and WMI_KEY_GROUP are not bit fields, change bit operation to direct assignment to avoid confusion. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICO= NZ-1.15378.4 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00217-QCAHKSWPL_SILICONZ-1 Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index 88b59f3ff87af8b48cb3fafcd364fd9ced4ff197..eb3c6d10e116b098d44cd94ba8e= 0257a77b54af8 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4881,9 +4881,9 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum= set_key_cmd cmd, } =20 if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) - flags |=3D WMI_KEY_PAIRWISE; + flags =3D WMI_KEY_PAIRWISE; else - flags |=3D WMI_KEY_GROUP; + flags =3D WMI_KEY_GROUP; =20 ret =3D ath12k_install_key(arvif, key, cmd, peer_addr, flags); if (ret) { --=20 2.34.1 From nobody Sun Dec 14 12:13:39 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B862E2248AF; Fri, 23 May 2025 03:49:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747972170; cv=none; b=U27TgrkVfMZM2AoJ98qnAvbWWQ4T3LDLor2iWh8Qo4VZZRbZzpKKCYoOLI801Fm6bz/GPj+BDIcFq5lpAz35NGTYMTGpPqEv/vuTb72HtMjjZ7WxvPiysoqblJLMFqT63z4CKzWvuvaOKCHQx0IZDFyFGxH7nBNU42Er9iB5HwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747972170; c=relaxed/simple; bh=dh2U0ckUKeXrDzfpi2n29F/wXhZB92itqUUDhxI7rcE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=TJkzbH9tV6pks4JqtfJrsG4J6s6qMe9APftkDZA84wTo5vvbChXDniUce2HhhjP7WTFJdaPPR4lbNrhmAybqGLxM8f8p65xU+8Mr+f2eeQo8b3ZesuoXXCtLt596i3Xlhl9LnodLf9bZ3f5gUEPnBHIQh+WCNsBnIzCzgvrWsIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=GcF1Kitb; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="GcF1Kitb" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54MJCsTj015696; Fri, 23 May 2025 03:49:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= EFhnzja1lN7ubOuZj4j/MRchltTHdJqE/HzNH29dwI8=; b=GcF1KitbpYIaXLkx MS4aAV4m33X7BB/aDqrXDrGP1x659fz+MfvA4v/zWl58oud3gnsosuGBNvAINjGv j7Y8dYCMGi5o4SOXq4m8sH8jbc9BuQkAxvjsMnxfJK8md0+kQUzIvHZIVLH0tIx5 2NdDAez9SWVMXREp9EqOSXWD5Ia8kT4qgeE8fUvedn9gTBFHcmpGYM1oR28bxmvo MP9ZiJ5HU5hE1fjRDdIyBpBllQabzL+hs5o4hwdUrmCS6e2eULKyLtX2Nm3EuzW2 Qy6uH8bESoBOd8F6D3LZhmKEiibdjKxSRPtB2wt/UeK742DZriMMmsUD4aksLp1O sl9HBQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46s95tptu7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 May 2025 03:49:22 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 54N3nLt2000582 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 May 2025 03:49:21 GMT Received: from [127.0.1.1] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 22 May 2025 20:49:20 -0700 From: Baochen Qiang Date: Fri, 23 May 2025 11:49:02 +0800 Subject: [PATCH ath-next 2/2] wifi: ath12k: install pairwise key first Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250523-ath12k-unicast-key-first-v1-2-f53c3880e6d8@quicinc.com> References: <20250523-ath12k-unicast-key-first-v1-0-f53c3880e6d8@quicinc.com> In-Reply-To: <20250523-ath12k-unicast-key-first-v1-0-f53c3880e6d8@quicinc.com> To: Jeff Johnson CC: , , , Baochen Qiang X-Mailer: b4 0.14.2 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=QKBoRhLL c=1 sm=1 tr=0 ts=682ff042 cx=c_pps a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=VwQbUJbxAAAA:8 a=UqCG9HQmAAAA:8 a=COk6AnOGAAAA:8 a=bwSFjXmOb-h8CDtPQtgA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: Nyt7i0q_--JRkmTrTp3ljZvmrh-Gynsc X-Proofpoint-GUID: Nyt7i0q_--JRkmTrTp3ljZvmrh-Gynsc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIzMDAzMyBTYWx0ZWRfX+bFKZHyb6VDG 5Jf9/4tBIaI4+v3BThc16X0PhRqLI/pH2oaIC6BlV64WDo016scJQlFXv+0mdvgPsX9Ywufs/B0 mnaSfN7MU3+ZTAVtUuLKfzgJ8S8RharkVHgRT8Q1BHOKThEAZGbSRWqZ5+MGMoc+IfJvkiIA9o1 b6uFvI6+euRZ8Chsj3wH4bhfjb99ilhz43ty+IJYvbHCo7kBjWUlx2Xs/mHx072HiiC3Tw72iCr oXe5OCZDkzSFzuQ1ldZ34CeK6W4n8Wc/AjFM0ke1vNdojJ8TvDaXbLF2TsiixbHITrJsy7W079L A/xg4ugYcQjAJcTPIUQp+GX9H+nxZchr88dJDcG56V/6eABn/HI5FGMvmzn0ZHZkh35mvgsRe2i xtE7G0qTKC0WswYBXqMzr01ISlxfrnppuG2+hmSLl1rU4lzvu5NMNInOsU3y05j+UclNhDOS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-23_02,2025-05-22_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505230033 As station, WCN7850 firmware requires pairwise key to be installed before group key. Currently host does not care about this, so it is up to kernel or userspace to decide which one will be installed first. In case above requirement is not met, WCN7850 firmware's EAPOL station machine is messed up, and finally connection fails [1]. Reorder key install for station interface in that case: this is done by caching group key first; Later when pairwise key arrives, both can be installed in required order. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICO= NZ-1.15378.4 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00217-QCAHKSWPL_SILICONZ-1 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=3D218733 Link: https://lore.kernel.org/all/AS8P190MB12051DDBD84CD88E71C40AD7873F2@AS= 8P190MB1205.EURP190.PROD.OUTLOOK.COM # [1] Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath12k/core.h | 4 ++ drivers/net/wireless/ath/ath12k/mac.c | 76 ++++++++++++++++++++++++++++++= ---- drivers/net/wireless/ath/ath12k/wmi.h | 1 + 3 files changed, 74 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/= ath/ath12k/core.h index 941db6e49d6eaeb03783f7714d433259d887820b..eeaaa0616e48c3cf34f2769a197= 9e2f67888ac25 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -345,6 +345,10 @@ struct ath12k_link_vif { bool is_sta_assoc_link; =20 struct ath12k_reg_tpc_power_info reg_tpc_info; + + bool group_key_valid; + struct wmi_vdev_install_key_arg group_key; + bool pairwise_key_done; }; =20 struct ath12k_vif { diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index eb3c6d10e116b098d44cd94ba8e0257a77b54af8..05a17ad2eaeea00c938b16d22fb= 8e7605dfb4007 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4731,14 +4731,13 @@ static int ath12k_install_key(struct ath12k_link_vi= f *arvif, .key_len =3D key->keylen, .key_data =3D key->key, .key_flags =3D flags, + .ieee80211_key_cipher =3D key->cipher, .macaddr =3D macaddr, }; struct ath12k_vif *ahvif =3D arvif->ahvif; =20 lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); =20 - reinit_completion(&ar->install_key_done); - if (test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags)) return 0; =20 @@ -4747,7 +4746,7 @@ static int ath12k_install_key(struct ath12k_link_vif = *arvif, /* arg.key_cipher =3D WMI_CIPHER_NONE; */ arg.key_len =3D 0; arg.key_data =3D NULL; - goto install; + goto check_order; } =20 switch (key->cipher) { @@ -4775,19 +4774,82 @@ static int ath12k_install_key(struct ath12k_link_vi= f *arvif, key->flags |=3D IEEE80211_KEY_FLAG_GENERATE_IV | IEEE80211_KEY_FLAG_RESERVE_TAILROOM; =20 +check_order: + if (ahvif->vdev_type =3D=3D WMI_VDEV_TYPE_STA && + arg.key_flags =3D=3D WMI_KEY_GROUP) { + if (cmd =3D=3D SET_KEY) { + if (arvif->pairwise_key_done) { + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "vdev %u pairwise key done, go install group key\n", + arg.vdev_id); + goto install; + } else { + /* WCN7850 firmware requires pairwise key to be installed + * before group key. In case group key comes first, cache + * it and return. Will revisit it once pairwise key gets + * installed. + */ + arvif->group_key =3D arg; + arvif->group_key_valid =3D true; + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "vdev %u group key before pairwise key, cache and skip\n", + arg.vdev_id); + + ret =3D 0; + goto out; + } + } else { + arvif->group_key_valid =3D false; + } + } + install: - ret =3D ath12k_wmi_vdev_install_key(arvif->ar, &arg); + reinit_completion(&ar->install_key_done); =20 + ret =3D ath12k_wmi_vdev_install_key(arvif->ar, &arg); if (ret) return ret; =20 if (!wait_for_completion_timeout(&ar->install_key_done, 1 * HZ)) return -ETIMEDOUT; =20 - if (ether_addr_equal(macaddr, arvif->bssid)) - ahvif->key_cipher =3D key->cipher; + if (ether_addr_equal(arg.macaddr, arvif->bssid)) + ahvif->key_cipher =3D arg.ieee80211_key_cipher; + + if (ar->install_key_status) { + ret =3D -EINVAL; + goto out; + } + + if (ahvif->vdev_type =3D=3D WMI_VDEV_TYPE_STA && + arg.key_flags =3D=3D WMI_KEY_PAIRWISE) { + if (cmd =3D=3D SET_KEY) { + arvif->pairwise_key_done =3D true; + if (arvif->group_key_valid) { + /* Install cached GTK */ + arvif->group_key_valid =3D false; + arg =3D arvif->group_key; + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "vdev %u pairwise key done, group key ready, go install\n", + arg.vdev_id); + goto install; + } + } else { + arvif->pairwise_key_done =3D false; + } + } + +out: + if (ret) { + /* In case of failure userspace may not do DISABLE_KEY + * but triggers re-connection directly, so manually reset + * status here. + */ + arvif->group_key_valid =3D false; + arvif->pairwise_key_done =3D false; + } =20 - return ar->install_key_status ? -EINVAL : 0; + return ret; } =20 static int ath12k_clear_peer_keys(struct ath12k_link_vif *arvif, diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/a= th/ath12k/wmi.h index ac18f75e04492b62594acb159e3b43b81bd6c392..63302302cf87058a87ba99c2948= 10823f714779b 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -3746,6 +3746,7 @@ struct wmi_vdev_install_key_arg { u32 key_idx; u32 key_flags; u32 key_cipher; + u32 ieee80211_key_cipher; u32 key_len; u32 key_txmic_len; u32 key_rxmic_len; --=20 2.34.1