From patchwork Wed Mar 29 07:05:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668572 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B9ABC74A5B for ; Wed, 29 Mar 2023 07:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbjC2HGU (ORCPT ); Wed, 29 Mar 2023 03:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjC2HGN (ORCPT ); Wed, 29 Mar 2023 03:06:13 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 413AF40C9 for ; Wed, 29 Mar 2023 00:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073556; x=1711609556; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=no8izANkEYWi4aRfVAwbaC1WRf2S58nyJoM7CR+Zkco=; b=HQ04IAehgrOHlw1HnJq6YLO5fdiAmvpmB5m+KPvG9TW2A4UyI3DRNSOW /QGzqDndW673RqEOWz3DWkBLVDswfga5/6tFP/fylYEXcFTmDhYfj9j7y tOZKp4Nc8DRVMVVIF/rcQEv9qGE34E3Yu3o9juaQsGifwsqrDhi26vEHA Ry1Zy3/Ci18pDVJ5B9xYnE/RELDAXPReexCh4tB95Rzx+FXKi+snZ+fEC ZGPstB8dNsR2kPzOSCJ/AgQfQCVaBfsPD6muADeY/c+jvqMRf+6Mv3bEF K1qcbZgF51WV7LB6mlqa2OJa6MCMF0gzHsn5tglI8No1Drsa67vON7V/t A==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450684" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450684" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:05:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111115" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111115" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:05:54 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 01/34] wifi: iwlwifi: mvm: make some HW flags conditional Date: Wed, 29 Mar 2023 10:05:07 +0300 Message-Id: <20230329100039.28ec631487bf.I6eb27c3d4c0289a5ec3682f573aae3424f45619f@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg With newer MLD firmware API we no longer need beacon timing information from the host, so disable TIMING_BEACON_ONLY. If MLO is enabled (currently only for testing), then we must not have DEAUTH_NEED_MGD_TX_PREP because mac80211 doesn't support it yet, we'll have to fix that later. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index c60aff0df801..c76c6b1f0218 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -291,17 +291,28 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) ieee80211_hw_set(hw, SUPPORTS_PS); ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); ieee80211_hw_set(hw, AMPDU_AGGREGATION); - ieee80211_hw_set(hw, TIMING_BEACON_ONLY); ieee80211_hw_set(hw, CONNECTION_MONITOR); ieee80211_hw_set(hw, CHANCTX_STA_CSA); ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); ieee80211_hw_set(hw, SUPPORTS_CLONED_SKBS); ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU); ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); - ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); ieee80211_hw_set(hw, BUFF_MMPDU_TXQ); ieee80211_hw_set(hw, STA_MMPDU_TXQ); + + /* With MLD FW API, it tracks timing by itself, + * no need for any timing from the host + */ + if (!mvm->mld_api_is_used) + ieee80211_hw_set(hw, TIMING_BEACON_ONLY); + + /* We should probably have this, but mac80211 + * currently doesn't support it for MLO. + */ + if (!(hw->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)) + ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); + /* * On older devices, enabling TX A-MSDU occasionally leads to * something getting messed up, the command read from the FIFO From patchwork Wed Mar 29 07:05:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9497C74A5B for ; Wed, 29 Mar 2023 07:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229704AbjC2HGe (ORCPT ); Wed, 29 Mar 2023 03:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjC2HGc (ORCPT ); Wed, 29 Mar 2023 03:06:32 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 485D326BA for ; Wed, 29 Mar 2023 00:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073565; x=1711609565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=seXxOB7EUKqd3T5L4CqZXbXCuRQvSL2K/8Vu7CyrZEY=; b=T6FeYGgiUje7HRzmgZ6C9Uu74Bst5WDtapW+iDDKSHD9PZFbFT7+L0M8 hxuc3shYXTGyks8NxGQYRb5r6HiGSqw2CzjBLE7/2HtzKjqMxEsXpgyM6 4gtY7JS0Hh7n9PQGn5cGHFx3uSeDJE3MS4oKlGXfdebfjEVQrbj71ZnGB bHlROo40X2nSGbAa53YB3EWkDw5hyR7ywl5ZiP8vCt1FCTTXyoHjX4QpO T4OGet02feIIlqg4l7tzHiLsBMHUW6vETevbGRqwBw2Is+JojU4nys6cU M7Ilu9eHTQqTKNOMUiYAm+yi1WvTIxgDX3WgGE42AEI3KodFhqz/BZ9E9 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450704" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450704" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:05:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111148" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111148" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:05:58 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 03/34] wifi: iwlwifi: mvm: skip MEI update for MLO Date: Wed, 29 Mar 2023 10:05:09 +0300 Message-Id: <20230329100039.aeaa746b14e7.I42b084f3cdc20bb52cf867700a3c2e1f5e7b4ecb@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg For now, if using MLO, skip the MEI update. It probably needs new API for multiple channels. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 9eb95ed48d02..294e1c1de6b6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3464,7 +3464,6 @@ static void iwl_mvm_mei_host_associated(struct iwl_mvm *mvm, struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mei_conn_info conn_info = { .ssid_len = vif->cfg.ssid_len, - .channel = vif->bss_conf.chandef.chan->hw_value, }; if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) @@ -3473,6 +3472,12 @@ static void iwl_mvm_mei_host_associated(struct iwl_mvm *mvm, if (!mvm->mei_registered) return; + /* FIXME: MEI needs to be updated for MLO */ + if (!vif->bss_conf.chandef.chan) + return; + + conn_info.channel = vif->bss_conf.chandef.chan->hw_value; + switch (mvm_sta->pairwise_cipher) { case WLAN_CIPHER_SUITE_TKIP: conn_info.pairwise_cipher = IWL_MEI_CIPHER_TKIP; From patchwork Wed Mar 29 07:05:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668570 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF8F4C6FD18 for ; Wed, 29 Mar 2023 07:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbjC2HG4 (ORCPT ); Wed, 29 Mar 2023 03:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjC2HGx (ORCPT ); Wed, 29 Mar 2023 03:06:53 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9EAD30D5 for ; Wed, 29 Mar 2023 00:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073580; x=1711609580; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ryAbSO5n1GMrekzu00T55iS6/zR/2TMT9O4jYq36zr0=; b=kOGDBd6PyS7WsZ3bXr60z/HVPcFzbQgV1gFmu03GewvooS3Oh+stFIQu NOmNYg+NGrdEMRodomQ7mKZJaF3mFMGJW1Y9E28dqTzQbCwc5Alw7FzO9 0Po/Mo0WR8Fbty8aOVFGZMAUs4jiEuM+161FYjoeXKhiyj5KAv6gF46xg teFcXVr9GV7oS+TSodd7j+pEArt3bv5JdTHEwY5hIdYLFV4ZHlbcOWIBG BtIXkdYeJgLY9PwhKEdpUULHZDezG8Vz20bi9ABzzZLYd/Tdi9VwvfqF3 VaXMfQxaiyLiurevpixZ6K9M4wqOYYlOyzyT/JpwH3X9WTP8Hn/9/aKOG A==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450734" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450734" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111194" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111194" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:02 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 05/34] wifi: iwlwifi: mvm: rs-fw: don't crash on missing channel Date: Wed, 29 Mar 2023 10:05:11 +0300 Message-Id: <20230329100039.2b0d31bdb60b.I39d23c76eec16ac49f6ae3a6d5f7652041bde855@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg This is more of a workaround, with MLO we can get here with the deflink not assigned. It's not critical right now that we have this right, so WARN_ON_ONCE() and don't crash until we can fix this area of the code. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c index 778c9237fe87..ed4200d9bd04 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c @@ -506,6 +506,9 @@ u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta) const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap; const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap; + if (WARN_ON_ONCE(!mvmsta->vif->bss_conf.chandef.chan)) + return IEEE80211_MAX_MPDU_LEN_VHT_3895; + if (mvmsta->vif->bss_conf.chandef.chan->band == NL80211_BAND_6GHZ) { switch (le16_get_bits(sta->deflink.he_6ghz_capa.capa, IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN)) { From patchwork Wed Mar 29 07:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C85CAC77B61 for ; Wed, 29 Mar 2023 07:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbjC2HHL (ORCPT ); Wed, 29 Mar 2023 03:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbjC2HHH (ORCPT ); Wed, 29 Mar 2023 03:07:07 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4E63AB4 for ; Wed, 29 Mar 2023 00:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073609; x=1711609609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r8BxuyyHOqc0CyM2WILHC+Cb+nOhCeSXeLzrGlI5Jqg=; b=AO7IDhb5VCCS9wK0SpbDp9oU9ssXpPwbIfpKC+un5x/rNqozxs8E/IAE tVZmhHKdxQj5ex4fDLPGNAJVkrJJLMO5Ld9ghUAG4jq1TNUAPiB7wepDs ABYUvwQDyxnYTcuD2omFreEG5/FwOkD+srmUxccMEdRWXJQIN+LQpwD0M ctJLgWbMArh906ZDhvMYK+BZVcC9wKYIPZwY2WEGkRNTisG84oe7fg0+q WlCMnYp+SWhYZnyeoGcV1BZXfaFCSJMGxhTd8ku5X1hTEl3wk+bLfy/3q juWK98ktHPj+ZNkHv06wWyk/RmaNCz7hVrHx0oVDoa6mFyq938vkSwiz0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450763" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450763" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111232" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111232" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:07 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 07/34] wifi: iwlwifi: mvm: make a few warnings only trigger once Date: Wed, 29 Mar 2023 10:05:13 +0300 Message-Id: <20230329100039.f333741d3dcf.If063d4cfe8a583f0f980a1b0ae4e63e17ba4ddc9@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg We're hitting these while starting to enable MLO in the driver, but getting them each and every time isn't very useful one way or the other. Make these warnings trigger only once. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 294e1c1de6b6..2b2221d7582b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -5591,7 +5591,7 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, continue; /* make sure only TDLS peers or the AP are flushed */ - WARN_ON(i != mvmvif->deflink.ap_sta_id && !sta->tdls); + WARN_ON_ONCE(i != mvmvif->deflink.ap_sta_id && !sta->tdls); if (drop) { if (iwl_mvm_flush_sta(mvm, mvmsta, false)) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c index 154f145396ce..aa8b4fb9c201 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c @@ -213,8 +213,8 @@ void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm, u32 sec_key_id = WIDE_ID(DATA_PATH_GROUP, SEC_KEY_CMD); u8 sec_key_ver = iwl_fw_lookup_cmd_ver(mvm->fw, sec_key_id, 0); - if (WARN_ON(vif->type != NL80211_IFTYPE_STATION || - mvmvif->deflink.ap_sta_id == IWL_MVM_INVALID_STA)) + if (WARN_ON_ONCE(vif->type != NL80211_IFTYPE_STATION || + mvmvif->deflink.ap_sta_id == IWL_MVM_INVALID_STA)) return; if (!sec_key_ver) From patchwork Wed Mar 29 07:05:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668568 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CEEFC6FD18 for ; Wed, 29 Mar 2023 07:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbjC2HHN (ORCPT ); Wed, 29 Mar 2023 03:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjC2HHJ (ORCPT ); Wed, 29 Mar 2023 03:07:09 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E0F3C10 for ; Wed, 29 Mar 2023 00:06:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073613; x=1711609613; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wgMR7C43qgMiv9HwQ+NtlNyshs2hciIK+blsihfGr7Y=; b=VeK2WCrfBB9MUsgqmoXKCPbRz8f9IkUXc6Coh+pJHZ3woXnPn4CFyO+e ZDgQXum4WvfIPYw4rB6X3UFIqSDtoZNqjrbUfKBLEQmdVDDeRMBqMQLNE UZtdW8JHGiNVVNIaJzRvtYQgtnbBHAgpas8jmDneO+riz+CVyw8JiqlLH zG3+UUkbhrV/TVIWJsxgCjc9/Mm0WwLAmXWS3baUi/HO1dbQerjAVY+aY jF+2cODBMLM3NqzQD7ASLH/yFSROXw4IBIJ4Q91QUlf4fhfXWO300+i1w tGFsS7qL0wca+xaEIAWSvcJMqa/P/30rne2CtgI3wABqZnz6hRU0cC+NM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450783" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450783" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111259" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111259" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:10 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Gregory Greenman Subject: [PATCH 09/34] wifi: iwlwifi: mvm: adjust radar detection to MLO Date: Wed, 29 Mar 2023 10:05:15 +0300 Message-Id: <20230329100039.a61b1d3f681a.I27bb8726d8806ad725c22bc7256856b1b6636745@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Gregory Greenman Make the decision about radar detection status depending on each active MLO link. Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/power.c | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/power.c b/drivers/net/wireless/intel/iwlwifi/mvm/power.c index 45a652cce491..2033d89dc9e5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/power.c @@ -279,18 +279,24 @@ static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm, static bool iwl_mvm_power_is_radar(struct ieee80211_vif *vif) { struct ieee80211_chanctx_conf *chanctx_conf; - struct ieee80211_channel *chan; + struct ieee80211_bss_conf *link_conf; bool radar_detect = false; + unsigned int link_id; rcu_read_lock(); - chanctx_conf = rcu_dereference(vif->bss_conf.chanctx_conf); - WARN_ON(!chanctx_conf); - if (chanctx_conf) { - chan = chanctx_conf->def.chan; - radar_detect = chan->flags & IEEE80211_CHAN_RADAR; + for_each_vif_active_link(vif, link_conf, link_id) { + chanctx_conf = rcu_dereference(link_conf->chanctx_conf); + if (WARN_ON(!chanctx_conf)) + continue; + + radar_detect = !!(chanctx_conf->def.chan->flags & + IEEE80211_CHAN_RADAR); + if (radar_detect) + goto out; } - rcu_read_unlock(); +out: + rcu_read_unlock(); return radar_detect; } From patchwork Wed Mar 29 07:05:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21602C6FD18 for ; Wed, 29 Mar 2023 07:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbjC2HHX (ORCPT ); Wed, 29 Mar 2023 03:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjC2HHT (ORCPT ); Wed, 29 Mar 2023 03:07:19 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C836340DC for ; Wed, 29 Mar 2023 00:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073627; x=1711609627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n3Y+x4SDdtN7RueS3Alov5U7wwsPeMJjRdkFWNotdfE=; b=k5YiDDIaogC/cLk/5ZWaMgCNsZpM+q3XDTlWxpzIqAoWSgx2v0m1iyg5 ZGdzYlQXJYr1temywfET+YYK8WYm9hUMbiQvXSF913eJSPiJKcCYrHqNs xjYauvxjqq3EEJ2rxe3V41do20yzm/VmZC8O59X43yVJdTkFnlEusJpM/ Q4hbchFig+5rjtK1SVvaUsIprntHiWzBvennVDUjL5V3Y/AxREv7TdZOU 9c9LcwMSjDn2Y4O6bB/2AaU+xpVzc32D/60pknYOyRoDgOITiStD/JWGF UTvw5aTJwaCIgR9gmHMESvJXnJ8I3IN2sl83+DT8svbsKkqEYJme1Hsl3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450795" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450795" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111303" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111303" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:14 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Shaul Triebitz , Gregory Greenman Subject: [PATCH 11/34] wifi: iwlwifi: mvm: use the link sta address Date: Wed, 29 Mar 2023 10:05:17 +0300 Message-Id: <20230329100039.03ab287da0ae.I88fb5ab4e3ea9c886a3fac7ce09c4791469c3c8e@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Shaul Triebitz Replace the deflink.addr with the proper link address for setting the peer_link_address in the station command. For a non-MLD station, it will be the deflink. Signed-off-by: Shaul Triebitz Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index da9d2cefa509..c877c94dd1d6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -399,8 +399,7 @@ static int iwl_mvm_mld_cfg_sta(struct iwl_mvm *mvm, struct ieee80211_sta *sta, cmd.link_id = cpu_to_le32(link_info->fw_link_id); memcpy(&cmd.peer_mld_address, sta->addr, ETH_ALEN); - /* FIXME: use the correct link */ - memcpy(&cmd.peer_link_address, sta->deflink.addr, ETH_ALEN); + memcpy(&cmd.peer_link_address, link_sta->addr, ETH_ALEN); if (mvm_sta->sta_state >= IEEE80211_STA_ASSOC) cmd.assoc_id = cpu_to_le32(sta->aid); From patchwork Wed Mar 29 07:05:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91BC4C6FD18 for ; Wed, 29 Mar 2023 07:07:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229780AbjC2HH1 (ORCPT ); Wed, 29 Mar 2023 03:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjC2HHY (ORCPT ); Wed, 29 Mar 2023 03:07:24 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB37740E4 for ; Wed, 29 Mar 2023 00:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073628; x=1711609628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2Sj0XFcROK6iv2RHJAN80CCvDkUUiZZsjK/x580vuiQ=; b=SpxFAZtQ+qRzGjjnbRHYDVy0+DWk6uCZiWI/eOoRH85hXYJXAE97wFVd m3mikiJHCMDfkTrx8EhWxJu/isyEf3+iSlZ2M53+jj1q+fs9g+N8v9H2a 8qKkxcXEcJosP0sKHIIMKeWlQY7V1WPBA+6T9Lde5Tiawu66l+0htu5pT TsjRyiAolclW5Tc8uVlkcJR4r3dkI6/bvaR3drQiSRleRbnwdqBahteOr 1dFGlKy1PiSnqw8PloFDS6/diAn1UXBhOK85ivU1LomIO7Ogev/vsBkS2 HqWFfw2NiReJ+yKFaAO0YzykdeOZN7rV8GOZg9wH1hUjbm8X70dJ5c0we w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450804" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450804" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111313" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111313" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:16 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Shaul Triebitz , Gregory Greenman Subject: [PATCH 12/34] wifi: iwlwifi: mvm: implement mac80211 callback change_sta_links Date: Wed, 29 Mar 2023 10:05:18 +0300 Message-Id: <20230329100039.156d1aae5de1.I32973141be1190222169879f8caf7038c1a8f769@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Shaul Triebitz Add/removed from iwl driver and firmware station links. Update the station queues accordingly (which station links are connected to the station queues). Signed-off-by: Shaul Triebitz Signed-off-by: Gregory Greenman --- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 9 +- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 246 ++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 4 + 3 files changed, 236 insertions(+), 23 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index be9b2efa5ef5..e475d0daf512 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -953,7 +953,14 @@ iwl_mvm_mld_change_sta_links(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u16 old_links, u16 new_links) { - return 0; + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); + int ret; + + mutex_lock(&mvm->mutex); + ret = iwl_mvm_mld_update_sta_links(mvm, vif, sta, old_links, new_links); + mutex_unlock(&mvm->mutex); + + return ret; } const struct ieee80211_ops iwl_mvm_mld_hw_ops = { diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index c877c94dd1d6..9be6d858411d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -479,15 +479,53 @@ static void iwl_mvm_mld_sta_rm_all_sta_links(struct iwl_mvm *mvm, } } +static void iwl_mvm_mld_free_sta_link(struct iwl_mvm *mvm, + struct iwl_mvm_sta *mvm_sta, + struct iwl_mvm_link_sta *mvm_sta_link, + unsigned int link_id) +{ + RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta_link->sta_id], NULL); + RCU_INIT_POINTER(mvm_sta->link[link_id], NULL); + + if (mvm_sta_link != &mvm_sta->deflink) + kfree_rcu(mvm_sta_link, rcu_head); +} + +static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + unsigned int link_id) +{ + struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_link_sta *link; + u32 sta_id = iwl_mvm_find_free_sta_id(mvm, + ieee80211_vif_type_p2p(vif)); + + if (sta_id == IWL_MVM_INVALID_STA) + return -ENOSPC; + + if (rcu_access_pointer(sta->link[link_id]) == &sta->deflink) { + link = &mvm_sta->deflink; + } else { + link = kzalloc(sizeof(*link), GFP_KERNEL); + if (!link) + return -ENOMEM; + } + + link->sta_id = sta_id; + rcu_assign_pointer(mvm_sta->link[link_id], link); + rcu_assign_pointer(mvm->fw_id_to_mac_id[link->sta_id], sta); + + return 0; +} + /* allocate all the links of a sta, called when the station is first added */ static int iwl_mvm_mld_alloc_sta_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); - struct iwl_mvm_link_sta *link; unsigned int link_id; - u32 sta_id; int ret; lockdep_assert_held(&mvm->mutex); @@ -497,27 +535,9 @@ static int iwl_mvm_mld_alloc_sta_links(struct iwl_mvm *mvm, mvm_sta->link[link_id]) continue; - sta_id = iwl_mvm_find_free_sta_id(mvm, - ieee80211_vif_type_p2p(vif)); - - if (sta_id == IWL_MVM_INVALID_STA) { - ret = -ENOSPC; + ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, link_id); + if (ret) goto err; - } - - if (rcu_access_pointer(sta->link[link_id]) == &sta->deflink) { - link = &mvm_sta->deflink; - } else { - link = kzalloc(sizeof(*link), GFP_KERNEL); - if (!link) { - ret = -ENOMEM; - goto err; - } - } - - link->sta_id = sta_id; - rcu_assign_pointer(mvm_sta->link[link_id], link); - rcu_assign_pointer(mvm->fw_id_to_mac_id[link->sta_id], sta); } return 0; @@ -846,3 +866,185 @@ void iwl_mvm_mld_modify_all_sta_disable_tx(struct iwl_mvm *mvm, rcu_read_unlock(); } + +static int iwl_mvm_mld_update_sta_queue(struct iwl_mvm *mvm, + struct iwl_mvm_sta *mvm_sta, + u32 old_sta_mask, + u32 new_sta_mask) +{ + struct iwl_scd_queue_cfg_cmd cmd = { + .operation = cpu_to_le32(IWL_SCD_QUEUE_MODIFY), + .u.modify.old_sta_mask = cpu_to_le32(old_sta_mask), + .u.modify.new_sta_mask = cpu_to_le32(new_sta_mask), + }; + struct iwl_host_cmd hcmd = { + .id = WIDE_ID(DATA_PATH_GROUP, SCD_QUEUE_CONFIG_CMD), + .len[0] = sizeof(cmd), + .data[0] = &cmd + }; + int tid; + int ret; + + lockdep_assert_held(&mvm->mutex); + + for (tid = 0; tid <= IWL_MAX_TID_COUNT; tid++) { + struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[tid]; + int txq_id = tid_data->txq_id; + + if (txq_id == IWL_MVM_INVALID_QUEUE) + continue; + + if (tid == IWL_MAX_TID_COUNT) + cmd.u.modify.tid = cpu_to_le32(IWL_MGMT_TID); + else + cmd.u.modify.tid = cpu_to_le32(tid); + + ret = iwl_mvm_send_cmd(mvm, &hcmd); + if (ret) + return ret; + } + + return 0; +} + +int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + u16 old_links, u16 new_links) +{ + struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_vif *mvm_vif = iwl_mvm_vif_from_mac80211(vif); + struct iwl_mvm_link_sta *mvm_sta_link; + struct iwl_mvm_vif_link_info *mvm_vif_link; + unsigned long links_to_add = ~old_links & new_links; + unsigned long links_to_rem = old_links & ~new_links; + unsigned long old_links_long = old_links; + u32 current_sta_mask = 0, sta_mask_added = 0, sta_mask_to_rem = 0; + unsigned long link_sta_added_to_fw = 0, link_sta_allocated = 0; + unsigned int link_id; + int ret; + + lockdep_assert_held(&mvm->mutex); + + for_each_set_bit(link_id, &old_links_long, + IEEE80211_MLD_MAX_NUM_LINKS) { + mvm_sta_link = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + + if (WARN_ON(!mvm_sta_link)) { + ret = -EINVAL; + goto err; + } + + current_sta_mask |= BIT(mvm_sta_link->sta_id); + if (links_to_rem & BIT(link_id)) + sta_mask_to_rem |= BIT(mvm_sta_link->sta_id); + } + + if (sta_mask_to_rem) { + ret = iwl_mvm_mld_update_sta_queue(mvm, mvm_sta, + current_sta_mask, + current_sta_mask & ~sta_mask_to_rem); + if (WARN_ON(ret)) + goto err; + + current_sta_mask &= ~sta_mask_to_rem; + } + + for_each_set_bit(link_id, &links_to_rem, IEEE80211_MLD_MAX_NUM_LINKS) { + mvm_sta_link = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + mvm_vif_link = mvm_vif->link[link_id]; + + if (WARN_ON(!mvm_sta_link || !mvm_vif_link)) { + ret = -EINVAL; + goto err; + } + + ret = iwl_mvm_mld_rm_sta_from_fw(mvm, mvm_sta_link->sta_id); + if (WARN_ON(ret)) + goto err; + + if (vif->type == NL80211_IFTYPE_STATION) + mvm_vif_link->ap_sta_id = IWL_MVM_INVALID_STA; + + iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id); + } + + for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) { + struct ieee80211_bss_conf *link_conf = + rcu_dereference_protected(vif->link_conf[link_id], 1); + struct ieee80211_link_sta *link_sta = + rcu_dereference_protected(sta->link[link_id], 1); + mvm_vif_link = mvm_vif->link[link_id]; + + if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta || + mvm_sta->link[link_id])) { + ret = -EINVAL; + goto err; + } + + ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, link_id); + if (WARN_ON(ret)) + goto err; + + mvm_sta_link = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + + if (WARN_ON(!mvm_sta_link)) { + ret = -EINVAL; + goto err; + } + + if (vif->type == NL80211_IFTYPE_STATION) + iwl_mvm_mld_set_ap_sta_id(sta, mvm_vif_link, + mvm_sta_link); + + link_sta_allocated |= BIT(link_id); + + sta_mask_added |= BIT(mvm_sta_link->sta_id); + + ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, link_conf, + mvm_sta_link); + if (WARN_ON(ret)) + goto err; + + link_sta_added_to_fw |= BIT(link_id); + } + + if (sta_mask_added) { + ret = iwl_mvm_mld_update_sta_queue(mvm, mvm_sta, + current_sta_mask, + current_sta_mask | sta_mask_added); + if (WARN_ON(ret)) + goto err; + } + + return 0; + +err: + /* remove all already allocated stations in FW */ + for_each_set_bit(link_id, &link_sta_added_to_fw, + IEEE80211_MLD_MAX_NUM_LINKS) { + mvm_sta_link = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + + iwl_mvm_mld_rm_sta_from_fw(mvm, mvm_sta_link->sta_id); + } + + /* remove all already allocated station links in driver */ + for_each_set_bit(link_id, &link_sta_allocated, + IEEE80211_MLD_MAX_NUM_LINKS) { + mvm_sta_link = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + + iwl_mvm_mld_free_sta_link(mvm, mvm_sta, mvm_sta_link, link_id); + } + + return ret; +} diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h index 6d4db666368b..2402b41bc0bb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h @@ -641,6 +641,10 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta); int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u8 sta_id); +int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + u16 old_links, u16 new_links); /* Queues */ void iwl_mvm_mld_modify_all_sta_disable_tx(struct iwl_mvm *mvm, From patchwork Wed Mar 29 07:05:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB0B7C74A5B for ; Wed, 29 Mar 2023 07:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbjC2HHl (ORCPT ); Wed, 29 Mar 2023 03:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbjC2HHk (ORCPT ); Wed, 29 Mar 2023 03:07:40 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844523C11 for ; Wed, 29 Mar 2023 00:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073639; x=1711609639; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OWts48a1O+Eif3t3a5EZyB2TTWRZ1U2ncPDJWGPqUeg=; b=GHVJFsn7awi4LtpF1lGsWLtD9PBqA4kBDbujrdrKb//sT9lu1UUWIJXf KmbQV+sybcsZmDjRaR+Z1Ej8KRZAoie0knaQylDl0i4l+FcUI+beyBWpX 6XDDucOpZAE539xlQvVSKDOQF0PiRFZORFuX8PPFnnzLJoPuE2uGrsfCH 9Ue4kF/wMsOPj9UVuU54D4k3vgaukQAuRmcOI/GnQgwRvLhyKWtKOheT6 YcE6NZ/he/SRLz0MxR3LDze71hC4MEdIpbY+wBpKnwig9ykE1TmZwYego vzb6NaEBXYH3ueZqwlS3dQXCKPUMvWRWo44lU8cw+AAZ8s1hOMHSILWZM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450831" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450831" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111324" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111324" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:22 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 15/34] wifi: iwlwifi: mvm: rxmq: report link ID to mac80211 Date: Wed, 29 Mar 2023 10:05:21 +0300 Message-Id: <20230329100039.c7dd3ec18077.I12ef9eb4a5b8b5c2b9d6bcaa1fda73b59eba39d8@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Add a fw_id_to_link_sta array in mvm to track the link STA for each firmware station ID, and then use that to report the link a frame was received on (since we know the station ID from firmware). Notably, this fixes beacon tracking for the correct link since mac80211 now queues and processes those on the one link identified by the link ID only. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++-- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 8 ++++++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 + drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 28 ++++++++++++++----- 5 files changed, 39 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index d302d98b7631..7fe733dcc748 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1570,8 +1570,10 @@ int iwl_mvm_up(struct iwl_mvm *mvm) } /* init the fw <-> mac80211 STA mapping */ - for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) + for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[i], NULL); + } memset(&mvm->fw_link_ids_map, 0, sizeof(mvm->fw_link_ids_map)); @@ -1757,8 +1759,10 @@ int iwl_mvm_load_d3_fw(struct iwl_mvm *mvm) goto error; /* init the fw <-> mac80211 STA mapping */ - for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) + for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) { RCU_INIT_POINTER(mvm->fw_id_to_mac_id[i], NULL); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[i], NULL); + } if (iwl_fw_lookup_cmd_ver(mvm->fw, ADD_STA, 0) < 12) { /* diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 4c8ab1db1f19..568f0eaeb0fb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3319,9 +3319,11 @@ void iwl_mvm_sta_pre_rcu_remove(struct ieee80211_hw *hw, link_sta = rcu_dereference_protected(mvm_sta->link[link_id], lockdep_is_held(&mvm->mutex)); sta_id = link_sta->sta_id; - if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[sta_id])) + if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[sta_id])) { rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], ERR_PTR(-ENOENT)); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL); + } } mutex_unlock(&mvm->mutex); } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 9be6d858411d..a713b8a10781 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -472,6 +472,7 @@ static void iwl_mvm_mld_sta_rm_all_sta_links(struct iwl_mvm *mvm, continue; RCU_INIT_POINTER(mvm->fw_id_to_mac_id[link->sta_id], NULL); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[link->sta_id], NULL); RCU_INIT_POINTER(mvm_sta->link[link_id], NULL); if (link != &mvm_sta->deflink) @@ -485,6 +486,7 @@ static void iwl_mvm_mld_free_sta_link(struct iwl_mvm *mvm, unsigned int link_id) { RCU_INIT_POINTER(mvm->fw_id_to_mac_id[mvm_sta_link->sta_id], NULL); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[mvm_sta_link->sta_id], NULL); RCU_INIT_POINTER(mvm_sta->link[link_id], NULL); if (mvm_sta_link != &mvm_sta->deflink) @@ -496,6 +498,8 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, struct ieee80211_sta *sta, unsigned int link_id) { + struct ieee80211_link_sta *link_sta = + rcu_dereference_protected(sta->link[link_id], 1); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_link_sta *link; u32 sta_id = iwl_mvm_find_free_sta_id(mvm, @@ -515,6 +519,8 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, link->sta_id = sta_id; rcu_assign_pointer(mvm_sta->link[link_id], link); rcu_assign_pointer(mvm->fw_id_to_mac_id[link->sta_id], sta); + rcu_assign_pointer(mvm->fw_id_to_link_sta[link->sta_id], + link_sta); return 0; } @@ -604,6 +610,7 @@ static int iwl_mvm_alloc_sta_after_restart(struct iwl_mvm *mvm, return ret; rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta); + rcu_assign_pointer(mvm->fw_id_to_link_sta[sta_id], link_sta); iwl_mvm_realloc_queues_after_restart(mvm, sta); /* since we need only one station, no need to continue */ @@ -800,6 +807,7 @@ int iwl_mvm_mld_rm_sta_id(struct iwl_mvm *mvm, struct ieee80211_vif *vif, lockdep_assert_held(&mvm->mutex); RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id], NULL); + RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL); return ret; } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 6421edd53404..a7a7018edd2b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -905,6 +905,7 @@ struct iwl_mvm { /* data related to data path */ struct iwl_rx_phy_info last_phy_info; struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT_MAX]; + struct ieee80211_link_sta __rcu *fw_id_to_link_sta[IWL_MVM_STATION_COUNT_MAX]; unsigned long fw_link_ids_map; u8 rx_ba_sessions; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index b160ae137c4a..5d803e537b00 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -253,12 +253,22 @@ static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, struct napi_struct *napi, struct sk_buff *skb, int queue, - struct ieee80211_sta *sta) + struct ieee80211_sta *sta, + struct ieee80211_link_sta *link_sta) { - if (iwl_mvm_check_pn(mvm, skb, queue, sta)) + if (unlikely(iwl_mvm_check_pn(mvm, skb, queue, sta))) { kfree_skb(skb); - else - ieee80211_rx_napi(mvm->hw, sta, skb, napi); + return; + } + + if (sta && sta->valid_links && link_sta) { + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); + + rx_status->link_valid = 1; + rx_status->link_id = link_sta->link_id; + } + + ieee80211_rx_napi(mvm->hw, sta, skb, napi); } static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm, @@ -631,7 +641,7 @@ static void iwl_mvm_release_frames(struct iwl_mvm *mvm, while ((skb = __skb_dequeue(skb_list))) { iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, reorder_buf->queue, - sta); + sta, NULL /* FIXME */); reorder_buf->num_stored--; } } @@ -2298,6 +2308,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, u32 len; u32 pkt_len = iwl_rx_packet_payload_len(pkt); struct ieee80211_sta *sta = NULL; + struct ieee80211_link_sta *link_sta = NULL; struct sk_buff *skb; u8 crypt_len = 0; size_t desc_size; @@ -2454,6 +2465,7 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, sta = rcu_dereference(mvm->fw_id_to_mac_id[id]); if (IS_ERR(sta)) sta = NULL; + link_sta = rcu_dereference(mvm->fw_id_to_link_sta[id]); } } else if (!is_multicast_ether_addr(hdr->addr2)) { /* @@ -2588,8 +2600,10 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, } if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc) && - (likely(!iwl_mvm_time_sync_frame(mvm, skb, hdr->addr2)))) - iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); + likely(!iwl_mvm_time_sync_frame(mvm, skb, hdr->addr2))) + iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, + link_sta); + out: rcu_read_unlock(); } From patchwork Wed Mar 29 07:05:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668564 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D1C3C6FD18 for ; Wed, 29 Mar 2023 07:07:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229765AbjC2HHx (ORCPT ); Wed, 29 Mar 2023 03:07:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229808AbjC2HHu (ORCPT ); Wed, 29 Mar 2023 03:07:50 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8483240C6 for ; Wed, 29 Mar 2023 00:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073648; x=1711609648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sUjdFdCl5qf3MAWcHUwaOOIbP66mqANCdUz7N82PUEY=; b=U20hzOwqWlQ0JS+rQBFowjw3TPxN9q+CKn97RInnnff+iIHstvGblCuu nBGmZ+Rq3KCvUusn8/6mpJWqQa3tA9FPfmGXkDcBj7IiSQ+/ZlIiSJFx2 hpuoTpxUJkr1new8/WEon7Fpb6bafqJ/6eyP70o9Hd/D/zaK1jrM4oO3a U3gzuZYVVKQtb1oTY9m6uvygF2OyGNY9DSqR0/7/rrQH8yqec/OWI558U VPAvSsPD9kKVu4j6OirgCTiQQOlkn2FxrQazlNjH7Y/BTQgWRMIFXBhqX +TtR9T7Vpv1TwlVLrLfmAOiK0D1JU/oG3ZnPx+j0imfx5iNAuaGRE6vEn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450837" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450837" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111331" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111331" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:24 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern , Gregory Greenman Subject: [PATCH 16/34] wifi: iwlwifi: mvm: adjust iwl_mvm_scan_respect_p2p_go_iter() for MLO Date: Wed, 29 Mar 2023 10:05:22 +0300 Message-Id: <20230329100039.4eb25d5655d0.Ie69f7313e4337f78c262a835aea3f707273a4209@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Avraham Stern When looking for a GO on for setting the scan parameters, iterate over all the available links. Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 975edc02e637..07045092c717 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -2677,11 +2677,23 @@ static void iwl_mvm_scan_respect_p2p_go_iter(void *_data, u8 *mac, if (vif == data->current_vif) return; - if (vif->type == NL80211_IFTYPE_AP && vif->p2p && - mvmvif->deflink.phy_ctxt->id < NUM_PHY_CTX && - (data->band == NUM_NL80211_BANDS || - mvmvif->deflink.phy_ctxt->channel->band == data->band)) - data->p2p_go = true; + if (vif->type == NL80211_IFTYPE_AP && vif->p2p) { + u32 link_id; + + for (link_id = 0; + link_id < ARRAY_SIZE(mvmvif->link); + link_id++) { + struct iwl_mvm_vif_link_info *link = + mvmvif->link[link_id]; + + if (link && link->phy_ctxt->id < NUM_PHY_CTX && + (data->band == NUM_NL80211_BANDS || + link->phy_ctxt->channel->band == data->band)) { + data->p2p_go = true; + break; + } + } + } } static bool _iwl_mvm_get_respect_p2p_go(struct iwl_mvm *mvm, From patchwork Wed Mar 29 07:05:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E45AFC6FD18 for ; Wed, 29 Mar 2023 07:08:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjC2HID (ORCPT ); Wed, 29 Mar 2023 03:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjC2HIC (ORCPT ); Wed, 29 Mar 2023 03:08:02 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A30013AB9 for ; Wed, 29 Mar 2023 00:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073660; x=1711609660; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0hfbqrct4a7ne7TEeTA9t/ef6xqr+O8ClV+eZSS5LBI=; b=mtw0Z/++tbAVJnSTrBZgLkE07C70n23aagwxFCWD0y7H5KYOI+V/bUk0 VdUZKgXiG0FFUzGvjY76lgdDPmLAa01+e4xisgQoZv+sGjtekiYgkRL4c oZptsYyF2MOZPWwICDKfo8I9KNPiVp8BpUpZ+fQ3uf5AVe5vlL2YdrvoA g7FJPLuxW/2A7+OIPPVx3Yckdr/aaWcBTcUF4aBJZWNDvJp3c9ELXCQ6G iuB6I5EGWyFxlCS3/PueYLO4gRNF40w4MgGydmcfLpwqbzyQLT/PDNQ6J G+QuLbOxrAjPvGVBZLTVwjFgToCkzLSj7v+4Kr0AvuZKAYLpwq3MwFma5 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450852" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450852" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111345" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111345" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:28 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 18/34] wifi: iwlwifi: mvm: remove only link-specific AP keys Date: Wed, 29 Mar 2023 10:05:24 +0300 Message-Id: <20230329100039.e724878f502e.I66870d4629244b4b309be79e11cbbd384bdf93be@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg When we remove the AP station, we iterate over the links and remove all the keys, however, the key iteration will return all keys for all links, so skip the ones that we don't need based on the link ID. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c | 9 +++++++-- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 1fd7e5bf594d..98c940271648 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -2722,7 +2722,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, &mvm->status)) { /* first remove remaining keys */ iwl_mvm_sec_key_remove_ap(mvm, vif, - &mvmvif->deflink); + &mvmvif->deflink, 0); /* * Remove AP station now that diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c index 44206e3e1a87..f4785c0a0b84 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c @@ -195,6 +195,7 @@ static void iwl_mvm_sec_key_remove_ap_iter(struct ieee80211_hw *hw, void *data) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); + unsigned int link_id = (uintptr_t)data; if (key->hw_key_idx == STA_KEY_IDX_INVALID) return; @@ -202,13 +203,17 @@ static void iwl_mvm_sec_key_remove_ap_iter(struct ieee80211_hw *hw, if (sta) return; + if (key->link_id >= 0 && key->link_id != link_id) + return; + _iwl_mvm_sec_key_del(mvm, vif, NULL, key, CMD_ASYNC); key->hw_key_idx = STA_KEY_IDX_INVALID; } void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct iwl_mvm_vif_link_info *link) + struct iwl_mvm_vif_link_info *link, + unsigned int link_id) { u32 sec_key_id = WIDE_ID(DATA_PATH_GROUP, SEC_KEY_CMD); u8 sec_key_ver = iwl_fw_lookup_cmd_ver(mvm->fw, sec_key_id, 0); @@ -222,5 +227,5 @@ void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm, ieee80211_iter_keys_rcu(mvm->hw, vif, iwl_mvm_sec_key_remove_ap_iter, - NULL); + (void *)(uintptr_t)link_id); } diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index e475d0daf512..1a97bf925817 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -544,7 +544,7 @@ static void iwl_mvm_mld_vif_delete_all_stas(struct iwl_mvm *mvm, if (!link) continue; - iwl_mvm_sec_key_remove_ap(mvm, vif, link); + iwl_mvm_sec_key_remove_ap(mvm, vif, link, i); ret = iwl_mvm_mld_rm_sta_id(mvm, vif, link->ap_sta_id); if (ret) IWL_ERR(mvm, "failed to remove AP station\n"); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index a7a7018edd2b..23d797247915 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -2328,7 +2328,8 @@ int iwl_mvm_sec_key_del(struct iwl_mvm *mvm, struct ieee80211_key_conf *keyconf); void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct iwl_mvm_vif_link_info *link); + struct iwl_mvm_vif_link_info *link, + unsigned int link_id); int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_table); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index f9f512a85ef1..9a3a7eabded8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -2022,7 +2022,7 @@ bool iwl_mvm_sta_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif, return true; /* first remove remaining keys */ - iwl_mvm_sec_key_remove_ap(mvm, vif, &mvmvif->deflink); + iwl_mvm_sec_key_remove_ap(mvm, vif, &mvmvif->deflink, 0); /* unassoc - go ahead - remove the AP STA now */ mvmvif->deflink.ap_sta_id = IWL_MVM_INVALID_STA; From patchwork Wed Mar 29 07:05:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9A1AC761AF for ; Wed, 29 Mar 2023 07:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbjC2HIK (ORCPT ); Wed, 29 Mar 2023 03:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjC2HIH (ORCPT ); Wed, 29 Mar 2023 03:08:07 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2864F30D8 for ; Wed, 29 Mar 2023 00:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073670; x=1711609670; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f3HDR4aVm0JWez9hfBt7bKAt/ojbwpayn5VmYY7nOvs=; b=et5ioPSlGyZukfA9TpaGAmXMwBd1U2ZoVDvMXwVz3MUc/eCsoCL0D6BX H379bR/4BPKrLP2AkpfYD/c8py/Io/JEm0HXsngmfcR2+qKCf5VWH9PEG 8i91AAdvmXnLbK6i6LIigLKWbw82OnFJrlDi+QAASgqE63cwIEP5BMz9b jDuqu1qK2xjVFkj4XFJMD3nEjnHdZQ3egObRO78Nl5kECMCLYPw4kLVFM UkeAMxTWX+28bKZIbgjgUb5eKue5FLES9YjE9ku8olR67WaQryAUIea1x 3T/Z24gRHi5odasQSKyBvKKFftUAL8/VRcUE75SznEpUf1xnuNpZeV3Ve w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450872" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450872" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111368" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111368" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:34 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 21/34] wifi: iwlwifi: mvm: use the new lockdep-checking macros Date: Wed, 29 Mar 2023 10:05:27 +0300 Message-Id: <20230329100039.112df5c8dec2.I1a1008f5566e509953d988f254d15c9e58630418@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Use the new macros from mac80211 that do lockdep checking on the RCU dereferences, instead of hard-coding 1 as the argument to rcu_dereference_protected(). Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 14 +++++++------- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 4 +--- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 10 +++++----- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 98c940271648..7fb00220e6cc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3591,9 +3591,9 @@ static void iwl_mvm_rs_rate_init_all_links(struct iwl_mvm *mvm, for_each_mvm_vif_valid_link(mvmvif, link_id) { struct ieee80211_bss_conf *conf = - rcu_dereference_protected(vif->link_conf[link_id], 1); + link_conf_dereference_protected(vif, link_id); struct ieee80211_link_sta *link_sta = - rcu_dereference_protected(sta->link[link_id], 1); + link_sta_dereference_protected(sta, link_id); if (!conf || !link_sta || !mvmvif->link[link_id]->phy_ctxt) continue; @@ -3622,9 +3622,9 @@ static bool iwl_mvm_vif_conf_from_sta(struct iwl_mvm *mvm, for_each_set_bit(i, (unsigned long *)&sta->valid_links, IEEE80211_MLD_MAX_NUM_LINKS) { struct ieee80211_link_sta *link_sta = - rcu_dereference_protected(sta->link[i], 1); + link_sta_dereference_protected(sta, i); struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[i], 1); + link_conf_dereference_protected(vif, i); if (!link_conf || !link_sta) continue; @@ -3653,9 +3653,9 @@ static void iwl_mvm_vif_set_he_support(struct ieee80211_hw *hw, for_each_set_bit(i, (unsigned long *)&sta->valid_links, IEEE80211_MLD_MAX_NUM_LINKS) { struct ieee80211_link_sta *link_sta = - rcu_dereference_protected(sta->link[i], 1); + link_sta_dereference_protected(sta, i); struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[i], 1); + link_conf_dereference_protected(vif, i); if (!link_conf || !link_sta || !mvmvif->link[i]) continue; @@ -3753,7 +3753,7 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw, for_each_set_bit(i, (unsigned long *)&sta->valid_links, IEEE80211_MLD_MAX_NUM_LINKS) { struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[i], 1); + link_conf_dereference_protected(vif, i); if (WARN_ON(!link_conf)) return -EINVAL; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 8ed76fc83702..ddc09012549b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -921,9 +921,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, if (added & BIT(i)) { struct ieee80211_bss_conf *link_conf; - /* FIXME: allow use of sdata_dereference()? */ - link_conf = rcu_dereference_protected(vif->link_conf[i], - 1); + link_conf = link_conf_dereference_protected(vif, i); if (WARN_ON(!link_conf)) continue; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index a713b8a10781..34b85a9a27af 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -499,7 +499,7 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm, unsigned int link_id) { struct ieee80211_link_sta *link_sta = - rcu_dereference_protected(sta->link[link_id], 1); + link_sta_dereference_protected(sta, link_id); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_link_sta *link; u32 sta_id = iwl_mvm_find_free_sta_id(mvm, @@ -654,7 +654,7 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, for_each_sta_active_link(vif, sta, link_sta, link_id) { struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[link_id], 1); + link_conf_dereference_protected(vif, link_id); struct iwl_mvm_link_sta *mvm_link_sta = rcu_dereference_protected(mvm_sta->link[link_id], lockdep_is_held(&mvm->mutex)); @@ -704,7 +704,7 @@ int iwl_mvm_mld_update_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, for_each_sta_active_link(vif, sta, link_sta, link_id) { struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[link_id], 1); + link_conf_dereference_protected(vif, link_id); struct iwl_mvm_link_sta *mvm_link_sta = rcu_dereference_protected(mvm_sta->link[link_id], lockdep_is_held(&mvm->mutex)); @@ -983,9 +983,9 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) { struct ieee80211_bss_conf *link_conf = - rcu_dereference_protected(vif->link_conf[link_id], 1); + link_conf_dereference_protected(vif, link_id); struct ieee80211_link_sta *link_sta = - rcu_dereference_protected(sta->link[link_id], 1); + link_sta_dereference_protected(sta, link_id); mvm_vif_link = mvm_vif->link[link_id]; if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta || From patchwork Wed Mar 29 07:05:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8889C6FD18 for ; Wed, 29 Mar 2023 07:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbjC2HIU (ORCPT ); Wed, 29 Mar 2023 03:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjC2HIT (ORCPT ); Wed, 29 Mar 2023 03:08:19 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7D0213A for ; Wed, 29 Mar 2023 00:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073682; x=1711609682; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yJ+ywQx4b92MwxtvKvAOsg3h/Qf1952rBdS2hX00baM=; b=He+NcAkIrMgbXXR7EaTBxErkLSSjvN4MDeI2gBQGpQVhQpOaKCMZVJH7 Z50mAAaytdb8xTW5ktTNgCftdOfxPCHF6WkZZWVtKDsyptuIpwwPFwDX9 urbvTSLCik29Brhrcp4rV+OJeehjgh1guhZ6PBDzw3rPfY8p07j/LJVbi 8XcGEsm5/sUZY1EqoP0B9BoYnqFIQyORUALFAW/Ug+kewzG1AbOOMFdXh fLtBWpIQ8s+nMEvYsehN2GeAQAk64B7F1WYBJdTMsEhYAZ7XoITQmHIXX SVPSQFLdmiHqfftwksOhI3/AtGzMZdrVR2VX4V1+NkYuLUK67v06JolA7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450910" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450910" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111389" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111389" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:38 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Gregory Greenman Subject: [PATCH 23/34] wifi: iwlwifi: mvm: initialize max_rc_amsdu_len per-link Date: Wed, 29 Mar 2023 10:05:29 +0300 Message-Id: <20230329100039.5bf521fe58b8.I73fe585f0ff75d41b5afd32077e3d6e48c90db2a@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Benjamin Berg Initialize max_rc_amsdu_len per-link both on state change and when a new link is added. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 34b85a9a27af..5e382981bfa2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -998,6 +998,9 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, if (WARN_ON(ret)) goto err; + link_sta->agg.max_rc_amsdu_len = 1; + ieee80211_sta_recalc_aggregates(sta); + mvm_sta_link = rcu_dereference_protected(mvm_sta->link[link_id], lockdep_is_held(&mvm->mutex)); From patchwork Wed Mar 29 07:05:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C18FFC6FD18 for ; Wed, 29 Mar 2023 07:08:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbjC2HIa (ORCPT ); Wed, 29 Mar 2023 03:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjC2HI0 (ORCPT ); Wed, 29 Mar 2023 03:08:26 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2A12D55 for ; Wed, 29 Mar 2023 00:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073687; x=1711609687; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xh9xp0WnvQR60DF5DQbDh+WIsRecYyDSZMoR45IdGa4=; b=LQ8JdUeZu9giOv/Fitt2t/rFqFCk5NxR0hMFWriAy/VQQchGjODf9A0r bkSZghT7GlNvMbq7JmMc0jKSNv6uUg9EaeLS1LTjuIVBPJJXeOdaRleSd tErppL+eq8KgqK7ezEMLozNp/47ypkPCJ78NcC4Z4TkOdRO4M7bt7Tkl+ TSuVOJXCg/yq7+9yis2wM+GLaJszMng0eMmsZFLTrFOlkQIIjdJACJULT EhJXU8PDbF8I+Vk7SerOhg56M+P2/bn7OFWt5lbmNBrDUAhyUk5sPPXPx Ot4gwlncZnLuAUQ2znmATF0RbxVmR77P2lg6F9PEwfdzZ2jTsYpuzbec7 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450952" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450952" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111421" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111421" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:42 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 25/34] wifi: iwlwifi: mvm: clean up mac_id vs. link_id in MLD sta Date: Wed, 29 Mar 2023 10:05:31 +0300 Message-Id: <20230329100040.3def62de34b5.I10c9cf5dbfd1fc1e9c9c7d6d4cefcf0c08f1f2da@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Here we always have a link ID, not MAC ID, so clean up the naming. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index b3377b4d7924..4d713c78b508 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -21,8 +21,7 @@ static int iwl_mvm_mld_send_sta_cmd(struct iwl_mvm *mvm, */ static int iwl_mvm_mld_add_int_sta_to_fw(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta, - const u8 *addr, - u16 mac_id) + const u8 *addr, int link_id) { struct iwl_mvm_sta_cfg_cmd cmd; @@ -31,7 +30,7 @@ static int iwl_mvm_mld_add_int_sta_to_fw(struct iwl_mvm *mvm, memset(&cmd, 0, sizeof(cmd)); cmd.sta_id = cpu_to_le32((u8)sta->sta_id); - cmd.link_id = cpu_to_le32(mac_id); + cmd.link_id = cpu_to_le32(link_id); cmd.station_type = cpu_to_le32(sta->type); @@ -94,7 +93,7 @@ static int iwl_mvm_add_aux_sta_to_fw(struct iwl_mvm *mvm, */ static int iwl_mvm_mld_add_int_sta_with_queue(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *sta, - const u8 *addr, int mac_id, + const u8 *addr, int link_id, u16 *queue, u8 tid, unsigned int *_wdg_timeout) { @@ -106,9 +105,9 @@ static int iwl_mvm_mld_add_int_sta_with_queue(struct iwl_mvm *mvm, return -ENOSPC; if (sta->type == STATION_TYPE_AUX) - ret = iwl_mvm_add_aux_sta_to_fw(mvm, sta, mac_id); + ret = iwl_mvm_add_aux_sta_to_fw(mvm, sta, link_id); else - ret = iwl_mvm_mld_add_int_sta_to_fw(mvm, sta, addr, mac_id); + ret = iwl_mvm_mld_add_int_sta_to_fw(mvm, sta, addr, link_id); if (ret) return ret; @@ -135,7 +134,7 @@ static int iwl_mvm_mld_add_int_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *int_sta, u16 *queue, enum nl80211_iftype iftype, enum iwl_fw_sta_type sta_type, - int mac_id, const u8 *addr, u8 tid, + int link_id, const u8 *addr, u8 tid, unsigned int *wdg_timeout) { int ret; @@ -148,7 +147,7 @@ static int iwl_mvm_mld_add_int_sta(struct iwl_mvm *mvm, if (ret) return ret; - ret = iwl_mvm_mld_add_int_sta_with_queue(mvm, int_sta, addr, mac_id, + ret = iwl_mvm_mld_add_int_sta_with_queue(mvm, int_sta, addr, link_id, queue, tid, wdg_timeout); if (ret) { iwl_mvm_dealloc_int_sta(mvm, int_sta); @@ -254,8 +253,8 @@ int iwl_mvm_mld_add_aux_sta(struct iwl_mvm *mvm, u32 lmac_id) { lockdep_assert_held(&mvm->mutex); - /* In CDB NICs we need to specify which lmac to use for aux activity - * using the mac_id argument place to send lmac_id to the function + /* In CDB NICs we need to specify which lmac to use for aux activity; + * use the link_id argument place to send lmac_id to the function. */ return iwl_mvm_mld_add_int_sta(mvm, &mvm->aux_sta, &mvm->aux_queue, NL80211_IFTYPE_UNSPECIFIED, From patchwork Wed Mar 29 07:05:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF86C74A5B for ; Wed, 29 Mar 2023 07:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbjC2HIh (ORCPT ); Wed, 29 Mar 2023 03:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbjC2HIf (ORCPT ); Wed, 29 Mar 2023 03:08:35 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1908830ED for ; Wed, 29 Mar 2023 00:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073699; x=1711609699; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VoUaCKJz1zPDVqUDp1cNNOyUZJBcbbcqVnm+2sOP6UQ=; b=KC6TrO2MCnV1k0mFquIvpZDvEwFnqw4mdO1EKAlTUrIbe5hBjMdA9Mm8 MMeJArFoU8NAL6JA8y2U44N+fybRiW2YLSAvvtqMhqgPJeXemMK0YzDmS zNuNWhhPkXRl+ZiEiRPtXzW5ZTkTvZHnVQAQdZjOeLy5XDmEmONKPyJRk aPSIrIFO4kKaTP5aV60PwxLWwv0rByW6hX3xVdYOAL2ukpDoyYVRrb3Q0 GfR7Ucp8wMyMQA3df3To3nEbLRgxoM1/O2U879q3v7aVg5jVXu3WFSRoP 8vfyiUs6mgTdCC9oQaVE9mRayiK2mxy3GXjIig+RwTT+HFUJjWskPRq8g Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320450972" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320450972" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111439" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111439" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:46 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Gregory Greenman Subject: [PATCH 27/34] wifi: iwlwifi: mvm: update mac config when assigning chanctx Date: Wed, 29 Mar 2023 10:05:33 +0300 Message-Id: <20230329100040.d7882a0d6e04.Ie38cd854a237c46cf85fd7143dc757326f30da6e@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Gregory Greenman Some mac parameters, such as HE support, can change at this stage. Update mac config before updating links. Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index beef706d0598..4d56b2fc5f33 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -231,6 +231,18 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, if (WARN_ON_ONCE(!mvmvif->link[link_id])) return -EINVAL; + /* mac parameters such as HE support can change at this stage + * For sta, need first to configure correct state from drv_sta_state + * and only after that update mac config. + */ + if (vif->type == NL80211_IFTYPE_AP) { + ret = iwl_mvm_mld_mac_ctxt_changed(mvm, vif, false); + if (ret) { + IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); + return -EINVAL; + } + } + mvmvif->link[link_id]->phy_ctxt = phy_ctxt; if (switching_chanctx) { From patchwork Wed Mar 29 07:05:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED00BC761AF for ; Wed, 29 Mar 2023 07:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbjC2HIo (ORCPT ); Wed, 29 Mar 2023 03:08:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbjC2HIm (ORCPT ); Wed, 29 Mar 2023 03:08:42 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF5535B6 for ; Wed, 29 Mar 2023 00:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073706; x=1711609706; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LOIK2LYOwsmrqLfCpdHjNxGfzJyQIijwX+x8hznW1dY=; b=SC08UHvZ+YFteRr7H++jaqXgbBEqru0QYDIoAZd0ckK5e308wmlPpZtC VerNo2yvCMfb6wYPvbJkJqzEgLwDGHdtZLhs5+NfFqNdOfAaLCOUz2+hQ 9ArRE5ubnrrDoX0oaMPyL9yA1mBjHPqzOJHeu6guEZK2Vg3rbQS8YP3KW FnluWgUPcYYDFO1/yjuiAJE6QN2E1nWNCx8gDySWNvcZD+2IYC+SdLhVA fUP99phC1qqUsNM1HwgdRjJdaNkkZmFHbwKR+uVTsoyrk0Kd7XRueVExB NojwKn7mQeTZgugcvMr1RGO2FSE4YUk2uNu3R7H0THve04QWdpgUAaBfn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320451006" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320451006" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111488" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111488" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:50 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 29/34] wifi: iwlwifi: mvm: send full STA during HW restart Date: Wed, 29 Mar 2023 10:05:35 +0300 Message-Id: <20230329100040.62d5371bb3c7.Ie25b62125a3a022f76a36bae5fed9796c18698aa@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg By using the internal station add the station is installed in firmware with zeroed MAC addresses, which is wrong. Use the full installation function instead, to fill all data. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 4d713c78b508..26686cc7ff4c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -572,10 +572,9 @@ static int iwl_mvm_alloc_sta_after_restart(struct iwl_mvm *mvm, struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct ieee80211_link_sta *link_sta; unsigned int link_id; - struct iwl_mvm_int_sta tmp_sta = { - .type = mvm_sta->sta_type, - }; - int sta_id, ret; + /* no active link found */ + int ret = -EINVAL; + int sta_id; /* First add an empty station since allocating a queue requires * a valid station. Since we need a link_id to allocate a station, @@ -598,23 +597,19 @@ static int iwl_mvm_alloc_sta_after_restart(struct iwl_mvm *mvm, continue; sta_id = mvm_link_sta->sta_id; - tmp_sta.sta_id = sta_id; - ret = iwl_mvm_mld_add_int_sta_to_fw(mvm, &tmp_sta, - vif->bss_conf.bssid, - mvm_link->fw_link_id); + ret = iwl_mvm_mld_cfg_sta(mvm, sta, vif, link_sta, + link_conf, mvm_link_sta); if (ret) return ret; rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta); rcu_assign_pointer(mvm->fw_id_to_link_sta[sta_id], link_sta); - iwl_mvm_realloc_queues_after_restart(mvm, sta); - - /* since we need only one station, no need to continue */ - return 0; + ret = 0; } - /* no active link found */ - return -EINVAL; + iwl_mvm_realloc_queues_after_restart(mvm, sta); + + return ret; } int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, From patchwork Wed Mar 29 07:05:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9070C6FD18 for ; Wed, 29 Mar 2023 07:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbjC2HIr (ORCPT ); Wed, 29 Mar 2023 03:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjC2HIq (ORCPT ); Wed, 29 Mar 2023 03:08:46 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA753C04 for ; Wed, 29 Mar 2023 00:08:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073715; x=1711609715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9GM8fjsufvrwqk9e/aZ2P5bDrM8KOIoPCiO88wD+hn0=; b=br4yRQ9iaMTXGMOVH+y27Hi1gJtiTE5WiQyclEVn0gsz/cq/yzgzsqpM M2ElEvSYM5WqE0wi0kj327L4FXxi12S2VOZ2JlgAzmxUr95ekz5IK7fsi h2rluBqqQbWDWojzf22AgU6fz17JTH0blLHwlk5QShWm7pvJ/ZgolAFQH PSVqMT0GgttaN1lOqVULPWHj5A5R+mVVvLR6TGYThWiiPRCxBn1eIHFH8 agcuwnpE27XDQW81fQp3LlPjAfwUFTLSMdWrxnupwD/qqOrIdpZDfUpY3 R4jwndba553bR8VO8JwUABxUBeMo3xzHskscCbotFRtX/D6/Uxv35Gl6j g==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320451019" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320451019" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111519" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111519" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:54 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Gregory Greenman Subject: [PATCH 31/34] wifi: iwlwifi: bump FW API to 75 for AX devices Date: Wed, 29 Mar 2023 10:05:37 +0300 Message-Id: <20230329100040.f08a27944fc6.Iafe3a2db2b91072a559038b85eca7b6b322be3ff@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Gregory Greenman Start supporting API version 75 for AX devices. Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c index e649daaf842c..0b10b34a77a8 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c @@ -10,7 +10,7 @@ #include "fw/api/txq.h" /* Highest firmware API version supported */ -#define IWL_22000_UCODE_API_MAX 74 +#define IWL_22000_UCODE_API_MAX 75 /* Lowest firmware API version supported */ #define IWL_22000_UCODE_API_MIN 39 From patchwork Wed Mar 29 07:05:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 668556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D52DEC74A5B for ; Wed, 29 Mar 2023 07:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbjC2HIw (ORCPT ); Wed, 29 Mar 2023 03:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjC2HIv (ORCPT ); Wed, 29 Mar 2023 03:08:51 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 366C626BA for ; Wed, 29 Mar 2023 00:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680073722; x=1711609722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=43GwylzguhU8bQtxUExyD+qSftXtahsm6WT/w1TMdeQ=; b=kKEVbOi1VjJjjHx9Xiw1L8C2pvXSAI59R5NaJ6w/KxiIVMe8dXhnBeVi Ig3CO+wVeDer+EP8UTgfvQTo6YNDT13nD9oSKhF9Ob/OyL7r/JmI0E/mF cUQ8kj44Y6eOtRSUjM15+J+4IrBCO4H5r4/UhFaBiRrCAsyhtVTX46LZW +lyfOEtVPEEslCQjeFix5UKIxKwkHZkScqxo8s/xiSJ2ZeXkhDZg3UUU3 GbCIo0JJUhPvXMFjpRUZXoEIv0aOguesS6gQu6gRNaUr3PwhRMtVCLijH i5iN15ZYpjZF67NrpCCq4PiMpDCf2ignafuB0KtY0f189NadnZVmcWfis A==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="320451035" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="320451035" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795111531" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795111531" Received: from sfrank1-mobl1.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.228.42]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 00:06:58 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 33/34] wifi: iwlwifi: separate AP link management queues Date: Wed, 29 Mar 2023 10:05:39 +0300 Message-Id: <20230329100040.0671fa976832.Id5aa9856fd5984e447f247e6d0c3979d9794a21a@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230329070540.2739372-1-gregory.greenman@intel.com> References: <20230329070540.2739372-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg The link management queues associated with the broadcast stations were forgotten and so the same queue was used with both broadcast stations. This leads to lost frames and warnings on cleanup and HW restart. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 ++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 16 ++++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 4 ++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 26686cc7ff4c..ca788a427fa6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -181,7 +181,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) { - queue = &mvm->probe_queue; + queue = &mvm_link->mgmt_queue; } else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { queue = &mvm->p2p_dev_queue; } else { @@ -327,7 +327,7 @@ int iwl_mvm_mld_rm_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, switch (vif->type) { case NL80211_IFTYPE_AP: case NL80211_IFTYPE_ADHOC: - queueptr = &mvm->probe_queue; + queueptr = &link->mgmt_queue; break; case NL80211_IFTYPE_P2P_DEVICE: queueptr = &mvm->p2p_dev_queue; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 022f7bd64a5d..707c930a278f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -299,6 +299,7 @@ struct iwl_probe_resp_data { * data to be inserted into probe response. * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked * @queue_params: QoS params for this MAC + * @mgmt_queue: queue number for unbufferable management frames */ struct iwl_mvm_vif_link_info { u8 bssid[ETH_ALEN]; @@ -329,6 +330,8 @@ struct iwl_mvm_vif_link_info { * to have the data for the MAC context */ struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS]; + + u16 mgmt_queue; }; /** diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index db6a3419bd31..a57de37f6e02 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -2348,10 +2348,18 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) } if (vif->type == NL80211_IFTYPE_AP || - vif->type == NL80211_IFTYPE_ADHOC) + vif->type == NL80211_IFTYPE_ADHOC) { + /* for queue management */ mvm->probe_queue = queue; - else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) + /* for use in TX */ + mvmvif->deflink.mgmt_queue = queue; + } else if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { mvm->p2p_dev_queue = queue; + } + } else if (vif->type == NL80211_IFTYPE_AP || + vif->type == NL80211_IFTYPE_ADHOC) { + /* set it for use in TX */ + mvmvif->deflink.mgmt_queue = mvm->probe_queue; } return 0; @@ -2384,6 +2392,10 @@ void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm, queue = *queueptr; iwl_mvm_disable_txq(mvm, NULL, mvmvif->deflink.bcast_sta.sta_id, queueptr, IWL_MAX_TID_COUNT); + + if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) + mvmvif->deflink.mgmt_queue = mvm->probe_queue; + if (iwl_mvm_has_new_tx_api(mvm)) return; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index f5b92d99f39d..2c842938656d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -626,7 +626,7 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, if (ieee80211_is_mgmt(fc) && (!ieee80211_is_bufferable_mmpdu(fc) || ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) - return mvm->probe_queue; + return link->mgmt_queue; if (!ieee80211_has_order(fc) && !ieee80211_is_probe_req(fc) && is_multicast_ether_addr(hdr->addr1)) @@ -634,7 +634,7 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, WARN_ONCE(info->control.vif->type != NL80211_IFTYPE_ADHOC, "fc=0x%02x", le16_to_cpu(fc)); - return mvm->probe_queue; + return link->mgmt_queue; case NL80211_IFTYPE_P2P_DEVICE: if (ieee80211_is_mgmt(fc)) return mvm->p2p_dev_queue;