Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4758792pxv; Tue, 27 Jul 2021 16:01:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB8Wjvhp+UCVPgyba1+N8dSh5qBzh3KoKccZgG1pH6n4aSXgQtEXAmtjx8uFo8CUmlVq7/ X-Received: by 2002:a92:b308:: with SMTP id p8mr18262676ilh.296.1627426900994; Tue, 27 Jul 2021 16:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627426900; cv=none; d=google.com; s=arc-20160816; b=Cn08NPHhxdZiWqV1E7DDzZhlhuyLHpCt+swVpnxd94b4JXC6k9XYefNznoUt1Mx4MS zMopBNnhbDpifcuMLubRAvNXfDxfBdE7V73jlzfBDHBynoQFjh59X1+a2fQpNJjS4Btz VXQOoh2UVQYIx30Yy+7R4s0/eIe+ov/rDdP63TJkSEdAMp6a57hWkl6wmoVMorpYxRFy PFolenMMAkMo7iuUZb4xTTf4XaTJY88N1Bq98Suqv4J7gmT+vh+dBPaDa+pw+JV+4HpI pO4Zqwzl64RYZk3Vq+7sciVxeSzxsh9qGY/bNxFd3cIvoPd2TF2ri2A18GRWMhTor122 QAaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=VsZTlLzxstK8UN7dENtjydmEvm8Dj9yr5/9SMDstxxg=; b=dHMwp5L+fBQErnay+B0qcAcL9sLSZ4PI4yzQ9V0w6ABreikxDlYzUSptQkHuTIdzDD PiEStQg8/NlDNavD3l1/vtKZeriyTbA7HiO25jNGJOKdbo5SJ0jeU+cIYbes3btAVf7w ZpYP221g7rC/uyMWabM8gmBQRNXfdAl7Bim2H1f4T5SdHU1diahBvVO/qmHm5akyurd8 /FIzWHq22/sBPz6MJYHNdW/xK4+aPDN+Yj0KggT1NIJbe2BbxI6++ZSOqGQZ4Am01wEf KcffDU0lzKdrNM2kKiuWAu/t9PD7l52+dfKbhRRMz2AAzab8uNbJve9PENPiYjSiQN8B 2UIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si5143870ios.94.2021.07.27.16.01.29; Tue, 27 Jul 2021 16:01:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233529AbhG0W72 (ORCPT + 99 others); Tue, 27 Jul 2021 18:59:28 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:37948 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S233302AbhG0W7X (ORCPT ); Tue, 27 Jul 2021 18:59:23 -0400 X-UUID: 52f9af9241ba41758991c87ea8a39045-20210728 X-UUID: 52f9af9241ba41758991c87ea8a39045-20210728 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 379729850; Wed, 28 Jul 2021 06:59:19 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Jul 2021 06:59:18 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 28 Jul 2021 06:59:18 +0800 From: To: , CC: , , , , , , , , , , , , , , , Subject: [PATCH 1/2] mt76: connac: fix GTK rekey offload failure on WPA mixed mode Date: Wed, 28 Jul 2021 06:59:16 +0800 Message-ID: <1627426757-14811-1-git-send-email-sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Leon Yen Update the proper firmware programming sequence to fix GTK rekey offload failure on WPA mixed mode. In the mt76_connac_mcu_key_iter, gtk_tlv->proto should be only set up on pairwise key and gtk_tlk->group_cipher should be only set up on the group key. Otherwise, those parameters required by firmware would be set incorrectly to cause GTK rekey offload failure on WPA mixed mode and then disconnection follows. Fixes: b47e21e75c80 ("mt76: mt7615: add gtk rekey offload support") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Leon Yen --- .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index a2555dc0f003..d71393b1c5e6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -1957,19 +1957,22 @@ mt76_connac_mcu_key_iter(struct ieee80211_hw *hw, key->cipher != WLAN_CIPHER_SUITE_TKIP) return; - if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { - gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_1); + if (key->cipher == WLAN_CIPHER_SUITE_TKIP) cipher = BIT(3); - } else { - gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_2); + else cipher = BIT(4); - } /* we are assuming here to have a single pairwise key */ if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) { + if (key->cipher == WLAN_CIPHER_SUITE_TKIP) + gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_1); + else + gtk_tlv->proto = cpu_to_le32(NL80211_WPA_VERSION_2); + gtk_tlv->pairwise_cipher = cpu_to_le32(cipher); - gtk_tlv->group_cipher = cpu_to_le32(cipher); gtk_tlv->keyid = key->keyidx; + } else { + gtk_tlv->group_cipher = cpu_to_le32(cipher); } } -- 2.25.1