Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3683543rwe; Mon, 17 Apr 2023 01:45:44 -0700 (PDT) X-Google-Smtp-Source: AKy350anOVJa++/cCzM3AOr+Glb+PAp7yxX1KnvETgbfABkQATt2ruvTXggVITLFxSPW6gtJnrFs X-Received: by 2002:aa7:8882:0:b0:63b:7954:987c with SMTP id z2-20020aa78882000000b0063b7954987cmr12174079pfe.13.1681721144260; Mon, 17 Apr 2023 01:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681721144; cv=none; d=google.com; s=arc-20160816; b=vdDOF7Me6+yNSWy6xF7aDFNrcTpInvJ04FJssYSc00A9ZMyNufTAS6TdJGUPwz7WwF D/QIt+2fHRxpk8pJRNCVvpPJYK6X6lp4cZh/c8cTsYjzIC3l9lkRtECyvDqZWJorKgQn zH9EG45oMkX+C2mbqt3HERfeB1ob2IgFTFb+I8GkuF4EtPDtkvUmVqeT8LCwVVUlKfT8 M3liAOI4i+RZGCvjPNdtzrHrpJNFhvsgUr/dinccFcQLmb60HNjMU+vXhhAnXi+LktMf twV0+XiOuBlHfsAcNgIxVUVYRacVOiOYNRLvgQp42jkEQawr7hXG7R5PQCR3nHcTLFCl eSoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=G3NuVV3+cX+eXZebo+3c42P5ym5aUongEXU5U9QCuAU=; b=mgmZ1GNWXnsu/vEirUH7nUw1QAN/5fm6PJ3QWSdK/Fo7r6WIxtphZzcuXZ2BeTd5M0 yq5b8QLP212FBcH1BxHP3K14P7DTpc6ACytw5dz3M2dFeqfrHD+Pi2mhvUXbpFQjpt21 KO+m/acVNBMJjwK8XyRMMEAaIEcJpnbYOjskjKJl+4hFkONGD0IljfJikesGQzxB2cFw CVBgzGQ7okUhtTQMbZvI4mJgD/LXghYAq1lbjivxpbDg7vAYW0CC7OKVfLTa0iLuoKJi vCOipyY7IXlxFeUvBbaa9ZtrA6kdo4fhPsQqCgpENEXTS2K6dh7tiV1lKZGX+6zQZ0n5 eMGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d9nKF10o; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020a63ef48000000b0050c0e269719si10676769pgk.513.2023.04.17.01.45.35; Mon, 17 Apr 2023 01:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d9nKF10o; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbjDQImV (ORCPT + 63 others); Mon, 17 Apr 2023 04:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjDQImU (ORCPT ); Mon, 17 Apr 2023 04:42:20 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D59E5267 for ; Mon, 17 Apr 2023 01:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681720937; x=1713256937; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F1WrcDEnFeu8L1Xqix/ktc5byVbreTBRYP314cTt0ow=; b=d9nKF10ozidufyROVfXJ7spF5z2qfdEMR7Rv1eI5b+onit3O82c52gN/ chWOjtEG41lXZ7H0LdD6SbDHxIgE7w08T7AxCcoC3CfFij4rdvMJamcMb tbkm+BBMP24792etDIrVRkEMCzBhc02OKPH4Q6B3wjV5eOCMp0lFfU8ji G8McYAwDhCzIKq8gH7q+QUHsU2u3NEi9GfQ0ggyxcI6tsHX1BiLNIL0lU hUb2WKUd8HMYirB2nMqXP+ADwQ1gHWYSVxq+K2emQdOCfrkyYzPtB+G1e CO+rx2ip1vLoI0aXXGSWmrpJusDS8MQwpmWHcJ3eRF2pNslFqYLC8oKTC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333634436" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333634436" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:42:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="693173891" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="693173891" Received: from odotan1x-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.202.32]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:42:15 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 12/15] wifi: iwlwifi: mvm: configure TLC on link activation Date: Mon, 17 Apr 2023 11:41:31 +0300 Message-Id: <20230417113648.1a93de9b7c1f.I42022f24bbe3572f5a082da8c99794ae14281875@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230417084134.1338976-1-gregory.greenman@intel.com> References: <20230417084134.1338976-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg If the AP station already exists on link activation (which means we're during link switch), configure the TLC in FW so we can immediately transmit once the link is activated. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 99ef12c530ea..fbc2d5ed1006 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -256,6 +256,30 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, if (ret) goto out; + /* Initialize rate control for the AP station, since we might be + * doing a link switch here - we cannot initialize it before since + * this needs the phy context assigned (and in FW?), and we cannot + * do it later because it needs to be initialized as soon as we're + * able to TX on the link, i.e. when active. + * + * Firmware restart isn't quite correct yet for MLO, but we don't + * need to do it in that case anyway since it will happen from the + * normal station state callback. + */ + if (mvmvif->ap_sta && + !test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { + struct ieee80211_link_sta *link_sta; + + rcu_read_lock(); + link_sta = rcu_dereference(mvmvif->ap_sta->link[link_id]); + + if (!WARN_ON_ONCE(!link_sta)) + iwl_mvm_rs_rate_init(mvm, vif, mvmvif->ap_sta, + link_conf, link_sta, + phy_ctxt->channel->band); + rcu_read_unlock(); + } + /* then activate */ ret = iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE | -- 2.38.1