Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1726180rdh; Tue, 26 Sep 2023 01:19:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRO7xmAnIFnw9Llwmx/a257DOASsnKtp+0Q/5oCTf92/A9QyJLHZOHCgZ8WlwNsi7aRTHd X-Received: by 2002:a17:903:120a:b0:1bb:c64f:9a5e with SMTP id l10-20020a170903120a00b001bbc64f9a5emr7674438plh.5.1695716387744; Tue, 26 Sep 2023 01:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695716387; cv=none; d=google.com; s=arc-20160816; b=RLiL7CtW4WvrmZBjlQ7F/2aB53oD0bIVjPPSHzpzJu/BQywizl2s/NMCmPdOxXTpL9 ZbMBOMKJawLAR0GaGC5qYANYkJKxk07avEDoq9Rg9aChCX6NOzjNmnVcrRV3l/s9g0hV ljfpNG0xdm408O770aEMctoeAYEHodLOdnatDTwPI/suQWn3yRyMLmYOV0yvfLAubgx5 OpkBlL9fhQ40TdyleDhTiXyvk2uBGzF2K278+R5jT77LQY25JZFd8g+4l12hqxa2B9Xk 4FAX6cnBnc8rHNb+cmkA6WjjJHSMOzCcJ0Skdh9Eifgoi2XFgvXsi2mIGAtEBonM+jum uEpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cc1iX0moooJDiUUofWlSdjoI0ZkBvq6r0yTS5oksbDI=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=cW9MO+XmhaorKFrSWw4TPPlxm0mq0JUmFfTA3lvLiNPLjK0Cdl9qKvyTJtSAXNe4de BFBQapQhKUu5lFzTLzbFxRdDaacqgmmM3WlvcWM04b+qQiMc9zsrnGsGEwKkqaYocfy2 M7w+rB4XsfBV6/kGPzddsAAlGDa5eXWCzYlzdBrJSHjosfXIz7I1enmClbMOrCX7oREi 8L3DdBLiZUWob4UI5m2ChyKaCHlQB/6eXlFwM4EPhCpkjkBEc582x5HWn0zZ1IiXNdgl XHj0m8zEGk1cDE7QYzk29i/O6ir6/DV++BbO09VAOSJouhncSRuKIhj3cHy+ifr2hsuh nBHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YXI8FS2P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id o1-20020a170902d4c100b001c6178a6b7asi5252881plg.639.2023.09.26.01.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 01:19:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YXI8FS2P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3F44B80743CB; Tue, 26 Sep 2023 01:07:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbjIZIIA (ORCPT + 56 others); Tue, 26 Sep 2023 04:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233844AbjIZIH6 (ORCPT ); Tue, 26 Sep 2023 04:07:58 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7557210C for ; Tue, 26 Sep 2023 01:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695715671; x=1727251671; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7FAmHchlOBSa7LDqMVxlZ+YguQ7gFX3zExrEw967Er4=; b=YXI8FS2PuNZc0YUg+2SiXO/Lbb7cmv/T71LLGsg0T35FFZm9AaPZERju vsqpNNUA+T0vQmiygh8br4xdcQPkvP6OrvTYbxi33wTn4lkCVtSbWUMd2 idwxvYEEDARRJtshIPiohFOs9jzuFF+bK6/nlkI06gJbC2aNmDm0AUb06 GoOdeA6ZklISNxx+KdKftVOqtdg/T/w3SoInRIvFxGCpTiMtaWGQpU9yk AbDWTL21rqHhnKfkFR2IWXPi9fq6oCTYFET4YzVxDYzANEszFq39m0kjt 0BiqW+I7XJiQeknij/gF+Ci56aldBBNghQXugxTwqvlFy9LABXbkG72KP Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="467797279" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="467797279" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:07:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="698369322" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="698369322" Received: from nbenitzh-mobl2.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.251.178.250]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:07:49 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 7/9] wifi: iwlwifi: mvm: offload IGTK in AP if BIGTK is supported Date: Tue, 26 Sep 2023 11:07:19 +0300 Message-Id: <20230926110319.425ebc1ce484.If485ec962636c23d463b678e7da86e11b6fa86c9@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230926080721.876640-1-gregory.greenman@intel.com> References: <20230926080721.876640-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:07:58 -0700 (PDT) From: Johannes Berg We can't really know easily if a BIGTK will be used, but in case firmware supports BIGTK it also supports the very easy IGTK use (nothing to do on the host), and requires that we program both IGTK and BIGTK to be able to use the BIGTK. Thus, change the condition here to set the keys in firmware (both IGTK/BIGTK) if BIGTK is supported. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index f9a4168e3e1a..d342a53a8c46 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -4185,12 +4185,21 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw, * GTK on AP interface is a TX-only key, return 0; * on IBSS they're per-station and because we're lazy * we don't support them for RX, so do the same. - * CMAC/GMAC in AP/IBSS modes must be done in software. + * CMAC/GMAC in AP/IBSS modes must be done in software + * on older NICs. * * Except, of course, beacon protection - it must be - * offloaded since we just set a beacon template. + * offloaded since we just set a beacon template, and + * then we must also offload the IGTK (not just BIGTK) + * for firmware reasons. + * + * So just check for beacon protection - if we don't + * have it we cannot get here with keyidx >= 6, and + * if we do have it we need to send the key to FW in + * all cases (CMAC/GMAC). */ - if (keyidx < 6 && + if (!wiphy_ext_feature_isset(hw->wiphy, + NL80211_EXT_FEATURE_BEACON_PROTECTION) && (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)) { -- 2.38.1