Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1153089lqe; Sun, 7 Apr 2024 23:15:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW45UkSvuqGTBN8lJ3viIecuGzHjy/CxdK6QUSkaeNVAZsKYc6kceRY17K8XVLrnyMMoOd9v5sfFramZAVK64LJQKLVq4YJAKz2TMNahw== X-Google-Smtp-Source: AGHT+IEuZ5dL5/kiuEXPnCRUCgwo/oBAAQEyv1RspNVc6slOssxecRuwtZ6ocCv/dqpYDbqs9QTb X-Received: by 2002:a17:90a:f309:b0:2a2:dcfe:bd69 with SMTP id ca9-20020a17090af30900b002a2dcfebd69mr11997572pjb.13.1712556921554; Sun, 07 Apr 2024 23:15:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712556921; cv=pass; d=google.com; s=arc-20160816; b=pl9XRi7ybNETw61q44mu597AN84GawtmYk6UyK0/m8qp/9VUl7owqLoVRG4wPkHnaY 8ft3AOcILdxNhuO1xfJN4kGhb6FT3KE5FZ+jlYfs7258p4cFW29XrJxkCckQ3hz8g+Sc ed6HAHbFgLcQXrzYLW8b3cPC7sOJaA3fM7GiGO3WwxpOKemP1iCVastpMJaM1GpOcKNs TLjKxUjAlGFxdBMSipIIlYUwUbEBW2W12MeNH1WJ6FapvIKCqfJAdI2zUfIXuxc224UW BAYVvPeacbqtCgYfo6vAayMQgdIBHjQlNEPLoSMkh/nF7qmNYnj3kYzoMuWAPuEKUzxD tKMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=ee6ScaF8NDqFt1x4FzTWri7fuE/3zdB6eCOnjp0D+Cw=; fh=SG1oEB4Nc++FJWODHfkEeUx4gObajVmqV3UMrb+XXAs=; b=nzKe5MNMZFeUfsSNQqlvjpe+WtraUBJ0CuZxWMecwmi73jFl7UrL3HlMQihyzd+0wv GOdexJUpnP+9B9b29Y3eCEibvrV2fL7cLzjvaCAfGiY9Kl2xjXNJ3L3slcM4zyqYWpP9 yrq4VhVREu4q3/Oux/bIvqCWJk2F68lcZb2ufOWU5GNYY+cOdcs6erjLjTR5ZZ6iMYrm aQvU3LroWgPLbDtn+OTVL1VVabtjQQVXSD0zZXmuSD+Fm+yYcym50RCmpQelBm8nX8t7 LWtXh7FB1cyZdAyRJxmeb/02EN4N2LSTBKgpwGOfvmyzJbS3hicb6uN6CXDbT+gGv0c7 3p7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="gpb/ph8f"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-wireless+bounces-5968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c24-20020a63ef58000000b005f3c84f05easi5509821pgk.133.2024.04.07.23.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 23:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="gpb/ph8f"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-wireless+bounces-5968-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D62C2B21215 for ; Mon, 8 Apr 2024 06:15:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2699510976; Mon, 8 Apr 2024 06:15:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="gpb/ph8f" X-Original-To: linux-wireless@vger.kernel.org Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 6649D10942 for ; Mon, 8 Apr 2024 06:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712556913; cv=none; b=a8QU1yctEchx7PghHZh2f/Y0AqYJJ3Q+Epz0j+9cCvj/f9srSkJvNsWEjP32KhN2DeBixwKbYRLIkWc9PanWHUGClQLBRzcrnn2pRVhqCurOwct9EqBX4J380pliglmNw+xCgImU0NTQZX/WaABDd/xmHv1beH9LeIfSo4IIIv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712556913; c=relaxed/simple; bh=QnPyomYcpTEHKqkuI4QsUTTIaecwOg2KT1/dwcYjWYE=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=etZ/ZIWSS7NmBA8+ElIUthX2nZ0UIm3Jil+rwLe+J8SD0eIjqnk/J4d8x5va2O6vnJ2uiTwEajXuang/SAyXZ3ZqNXTkHMWdZbEDoHIjkVHt/oGF/5d7bTWEgH3xkfMwcdkPdftBnMUHExS+d09mlHHHqt6xslkT5+Api0MitqA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=gpb/ph8f; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 579e5ecef56f11eeb8927bc1f75efef4-20240408 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=ee6ScaF8NDqFt1x4FzTWri7fuE/3zdB6eCOnjp0D+Cw=; b=gpb/ph8fma/Vr7S2u69Av3c5+KTOtoLQ6O3hRxbwu41RD1ojZEyguC/4iraYXQv4NdaXDJrvGLS2sz+JmWK89odMm7anW1GMs4dXgmccIypGsiJN/dLVxn+5L5m0aGdypLZtdzXHsrTFH1cgIWVykcOoJcajskgSBzNv1U8ppy4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:56f7ffbe-4fc9-4943-920a-81a1389fd685,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6f543d0,CLOUDID:88bce885-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 579e5ecef56f11eeb8927bc1f75efef4-20240408 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1075619960; Mon, 08 Apr 2024 14:15:05 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 8 Apr 2024 14:15:03 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 8 Apr 2024 14:15:03 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek , Michael-CY Lee , Shayne Chen Subject: [PATCH v2] wifi: mt76: mt7996: let upper layer handle MGMT frame protection Date: Mon, 8 Apr 2024 14:14:21 +0800 Message-ID: <20240408061421.10287-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N From: Michael-CY Lee The firmware support for management frame protection has limitations: - do not support cipher BIP-GMAC-128 and BIP-GMAC-256 - support cipher BIP-CMAC-128 and BIP-CMAC-256, except action frame with action type 'not robust'. Therefore, to simplify the logic, do not set the IGTK to firmware and let the encryption of management frames be handled by upper layer. Signed-off-by: Michael-CY Lee Signed-off-by: Shayne Chen --- v2: add back missing line --- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index 338ff10b121d..c4a068d52c35 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -352,10 +352,6 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, /* fall back to sw encryption for unsupported ciphers */ switch (key->cipher) { - case WLAN_CIPHER_SUITE_AES_CMAC: - wcid_keyidx = &wcid->hw_key_idx2; - key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE; - break; case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_CCMP_256: @@ -363,6 +359,11 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, case WLAN_CIPHER_SUITE_GCMP_256: case WLAN_CIPHER_SUITE_SMS4: break; + case WLAN_CIPHER_SUITE_AES_CMAC: + wcid_keyidx = &wcid->hw_key_idx2; + key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE; + fallthrough; + case WLAN_CIPHER_SUITE_BIP_CMAC_256: case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: if (key->keyidx == 6 || key->keyidx == 7) -- 2.39.2