Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp272665rdb; Mon, 18 Sep 2023 14:53:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFD1UHRV9v4LaLwqi8+uVvvkNjzGERc44ovgIIXgLWAsmUlZFKwb6dLI3IjM3tAUigsc2Hs X-Received: by 2002:a17:903:11c9:b0:1bf:193a:70b6 with SMTP id q9-20020a17090311c900b001bf193a70b6mr1085686plh.5.1695074002465; Mon, 18 Sep 2023 14:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695074002; cv=none; d=google.com; s=arc-20160816; b=NElze99TeBH1cZrQsqbdFyiDDwvt21QMDn9kh/vVE4p3venT4xBju9uu8xV20eddHG Td/YHBRmPfwWVDKD3ZfqXLPNcpIfzwYziyZRrBVyjTf2pVT+C2GgcKnqf/DF8ia30N1V QOIPRtgzbSy2u5WX4l1fpTBy6WbrayI9w7n4CIq5jcly/2ZuwaxxRV3ReTJbsghAUOgz pifB7SqI/79yFAQL5lYPZETLeyEzzzmU2SunvaPbq6JZqn3wuMwcKi5zLI2htQBuPQJR WC2AcQl6c8CTxHHvsoZC/i3ltlfBknjaXcNtBWlXtJrawe2aeUr5uIPgN2YD+dXCVc9o hXuw== 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=keqh/ZM5v2Fu8vbPVfSFP7Ew5B7XN8LIBy/rCBhBtVQ=; fh=T6y/oS++RIYqEuqxIx2phDO2xU+34wOH47oi8kJGCZk=; b=W/GV2jXHFnALnBbvQW52XhE5mf6Y3CYE2Oib0g/g0BWoWV27K//EqG7qb5MqsN+Dti hyDTESmIz/1HdRitG0ekEJcvZSSpDVwmH9mocv8ku+jTRLm+MGF1iaqwk6ik/8UWsSfg 9QO3UkBsHNWxlPi3L+7CjqkTQpL5gGTsNdnQQa665B/iV00k8pychtncguyoXHYnjKWY ptqobNSm2e9huG6M2OrgDpJgXNuyAzuhxj2KSplaLc5PRzmcRI462RC4eCRjeIXW0ZJ6 3uzvEpgt9HvXDzOkWtdO4x1EAasmF1cobycIQe/AuAwuYJXhdV7oC/WEEfZnk0T/fblw W8WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XEHahJo0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l9-20020a170903120900b001bc2c086880si8922349plh.306.2023.09.18.14.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 14:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XEHahJo0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3B9A28096591; Mon, 18 Sep 2023 04:12:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239751AbjIRLLq (ORCPT + 57 others); Mon, 18 Sep 2023 07:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241525AbjIRLLe (ORCPT ); Mon, 18 Sep 2023 07:11:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA22399 for ; Mon, 18 Sep 2023 04:11: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=1695035488; x=1726571488; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J1bBLce+jGNc+E6bmMNdLb8a/41nDF9Tww7XllDfufM=; b=XEHahJo0/b6/8LZ5eFko+lOZ5rxhrdNtbN7HrBGJRuYFwaC444rTUI+H A34HR4OofZW8IYN+g3vY+PHnEWcQCFi/PjezsEAY38VT21JfTRBK0l/6D LVA/pugjmZyMcFlm2Xqyni47bKikIZ1IQXHrFtBYDrMGuOolLqv5DL3Mu msNBSS+eFK81dSbk+m2pm/eJUtcY/cDDOc1NQpJqPedDvDvtG9I9Bm/UG irFeT3gNOejSzkkV/umVQ6oz7yvJNI78JePPWsf74BdL3FVQglRu2KxLu SBketZeM2ig4GM/euwcs9T15EPgFzsfl3Ym7tfMXaJ6VZhuRsHo02NYwK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="378535700" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="378535700" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 04:11:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10836"; a="861025235" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="861025235" Received: from guyarad-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.215.14]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 04:11:20 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach , Gregory Greenman Subject: [PATCH 02/18] wifi: mac80211: update the rx_chains after set_antenna() Date: Mon, 18 Sep 2023 14:10:47 +0300 Message-Id: <20230918140607.d7373054dc25.I904223c868c77cf2ba132a3088fe6506fcbb443b@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230918111103.435195-1-gregory.greenman@intel.com> References: <20230918111103.435195-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 04:12:23 -0700 (PDT) From: Emmanuel Grumbach rx_chains was set only upon registration and it we rely on it for the active chains upon SMPS configuration after association. When we use the set_antenna() API to limit the rx_chains from 2 to 1, this caused issues with iwlwifi since we still had 2 active_chains requested. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman --- net/mac80211/cfg.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e751d4eba8f5..6b3ccb55aae5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4044,11 +4044,17 @@ ieee80211_update_mgmt_frame_registrations(struct wiphy *wiphy, static int ieee80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant) { struct ieee80211_local *local = wiphy_priv(wiphy); + int ret; if (local->started) return -EOPNOTSUPP; - return drv_set_antenna(local, tx_ant, rx_ant); + ret = drv_set_antenna(local, tx_ant, rx_ant); + if (ret) + return ret; + + local->rx_chains = hweight8(rx_ant); + return 0; } static int ieee80211_get_antenna(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant) -- 2.38.1