Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1435173lqt; Wed, 20 Mar 2024 04:10:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTGY/T7kQCbOTV0DdCHUu60MKapRs7XNooA6u2F9r+l5SkKnfOskvVBpYheFSAy1cZ8xg+nPsVgxEvbwh4G5FtqrPIc8hC7g8ZpoT1Tg== X-Google-Smtp-Source: AGHT+IGqlykT5A+9Drw9qXzQRL2u9U7jDJb8bMQH8yjab3DeOzO/wzs6eAAgPFo6f1SRTViZLl10 X-Received: by 2002:a17:906:2452:b0:a44:e5ed:3d5d with SMTP id a18-20020a170906245200b00a44e5ed3d5dmr1806646ejb.9.1710933004176; Wed, 20 Mar 2024 04:10:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710933004; cv=pass; d=google.com; s=arc-20160816; b=HCIThVSlrvEeEnA0kGE3nVm2Hs2SfVU+zLeZc+47mV4PIv1SG4u+3m6TyyzQwFpzkJ F9MW153EO6nR4O7WvX8itCPU46H+IDm2h0Eaxbr/ZC77GXKYjS9pVsRKKkzA2cAXEatb iNYPjSGYh8S+T5tnN2r+NHZeOEme7GLrFkqbcgZy+1tLvLRPn5QJUT+ZfhpW3Z65CSvI nOLqjVoPossz2t0ijodcnHy6veIqnYmrEi8M+o4cOPZPANmjWSJKCZE0O/RYc+LUmriW rradPYGVZOqnwz059+30twwujS1DZ3BCoj5MP8O01bHMyZeC8Fnm96KQIrhOWLAT/a7Q y58g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zyhFQAKnySbRXD6mjYJunCjjO4/F3Ayos6o2jXmDw9o=; fh=SG1oEB4Nc++FJWODHfkEeUx4gObajVmqV3UMrb+XXAs=; b=QL4u7c2x+5Z7iN/ywxT7UdLoK7v2CA5uPE1q7LbIq4y/up+xER1Z3uAf55oCxR2r2s JCwHCnCHXYoTfuaqBCmlP8FXZVm0pBskVtaV07xeUOn7+dwlwRhazw0ihGm4u7GoKbd1 RSugDWVW/I31bWoiEsHXdLxELRw9xlXw3EH6vJOou24f57MZXRvK8yNEI+R6Ck/KV7i6 FaQ1nqqsmiVRLCz4bo0vQcyO3zFMtcNN2WeVil6sFhnyAIPLCJSzNLpf2DUOyNA1BW2f E48csNu7Jaj8Gdh0TGNU7R9TfRel93OV9YOBsN8QXm14mwUSyqgYbP5TBe9t0eOrBx96 U+sw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=md44iAOz; 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-4976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4976-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b12-20020a170906490c00b00a46fbbc2f56si272589ejq.460.2024.03.20.04.10.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 04:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=md44iAOz; 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-4976-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4976-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E3B021F238EF for ; Wed, 20 Mar 2024 11:10:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AED6E3FB3D; Wed, 20 Mar 2024 11:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="md44iAOz" 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 C0C023D986 for ; Wed, 20 Mar 2024 11:09:34 +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=1710932976; cv=none; b=C+kuuTAQVdIY/99xBeJElrZoSMcElbjN1gpFyjRtmSS5Nl9PSfLSM8M3NtLD2ET3FAqMa1oOSs+wreyOHMAnqfQy7aTGpvqnNPXsVF1UcyUGPD26h5qJmOXScGQNfnQ7pmx+tgqTqM/vZAz4Le8stpUYF+1Mv73pUDS1iy+t3TI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710932976; c=relaxed/simple; bh=Y84rYUy5QNPicJl/7SHJHaQzf/Bs60mpcR7yxb5lOWU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BNX126AGVW1JhPJvpx776qzjFcT1fvIMFFUO8I+JHBFiqnSH6y7Egtd7RGo8tDol/mJWyzoDgq6CODdCStErOpFqSh0A5Dopm4TWikFOxAykJsbfE8WmhnBe0NsBhA0ufdlNVFtGPgxb+eWFU1P4r15X7sMQ2aHCTsWTf7n0Ads= 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=md44iAOz; 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: 4fbeff16e6aa11eeb8927bc1f75efef4-20240320 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=zyhFQAKnySbRXD6mjYJunCjjO4/F3Ayos6o2jXmDw9o=; b=md44iAOzWfDMml/U9I+WmuVEB+++1ORI/XhKAHc23u9T7yfARkT9zvPer/KVBExB6UGjv2QLdMS9LVLD2s3Mwyjdp84C5qEbQLf4uKKSh/ho7E0yeOl8JzZVx2qzgsTJDw0qLIVyctfHZBU5o1jNrL+BPTBgPnLGuaifzwfy2Z0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:f698d4cb-4dbe-4ccf-919a-aee8e1e6bfc2,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:a4d81d00-c26b-4159-a099-3b9d0558e447,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: 4fbeff16e6aa11eeb8927bc1f75efef4-20240320 Received: from mtkmbs14n1.mediatek.inc [(172.21.101.75)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 920252651; Wed, 20 Mar 2024 19:09:25 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 20 Mar 2024 19:09:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 20 Mar 2024 19:09:24 +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 09/10] wifi: mt76: mt7996: let upper layer handle MGMT frame protection Date: Wed, 20 Mar 2024 19:09:17 +0800 Message-ID: <20240320110918.3488-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240320110918.3488-1-shayne.chen@mediatek.com> References: <20240320110918.3488-1-shayne.chen@mediatek.com> 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-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--5.805400-8.000000 X-TMASE-MatchedRID: udTajMTn5cCPfIU6nDBTAy97pb4g5HCtQBnqdxuJ5SAbZGMpAXstDvlY oV6p/cSxrKWVhE5vxYZ+QtlfTC0TseF/B1jEjV+6BtdMuQdWhdV9LQinZ4QefCP/VFuTOXUTC5M umjkcRzX3FLeZXNZS4EZLVcXaUbdi/Ef44D9SohVlpVNGOJm8BV8dd/UeRj0HTpZ5lw6YKmmeqD 9WtJkSIw== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.805400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 79063AB354112B396A51E2163246A5C7592BD77BDEA60325FE89C744806194D52000:8 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 --- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 8 ++++---- 1 file changed, 4 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..4ab4d2bcbedc 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,10 @@ 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: + 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