Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4306844rwd; Sun, 4 Jun 2023 02:19:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ53UwUsXwS6EWgclSCaxxd1tnLQHBh24kXY3mDUToCbGtvbo8J5yA2gxmOWC4yC0Of3XvkW X-Received: by 2002:a92:d0cd:0:b0:33c:b80e:4599 with SMTP id y13-20020a92d0cd000000b0033cb80e4599mr15004809ila.9.1685870360302; Sun, 04 Jun 2023 02:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685870360; cv=none; d=google.com; s=arc-20160816; b=KQuTWZQ8M8lN5Y/vv6vzZbHQK2kQ91nxNlzEDLVPPmGxLM8GXPWRwFumNl4Kuc3syf ZjeyN+JacE1LuyumkHiMxDvfaegki+0Sdo6I0cyzNmvZvU1kx/BpkhZX4Ixk+Mlf9nXM GR8c2ZkgSpLLhj8i1S0q2LtrGBsxKA6WMJuunaydlQOOUnZIjh1/lJuYAjC2DInbDn1L WXjxS+lyc7nnBcGOR7H3l4WbAYDX5SihxNBxFKlm3XKCNgkRjf/BB70lb36LPcpixB1I gpDN6IW6soxvu4HmFHVTNWFGa3HQshssaZtBqkxOZwqqpGY2VzaDT7TsahUjaavv8kgK +Hbg== 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=kzFNyAb2r132EFv2c5OF3t5WdX2WJP7Hk9ltmkX0AAA=; b=iyz8XWqjjI7SzWpWgnvfDNmtVzo8yxH9QM+wm15FttQc322Dcc8ZA1Y7WVyfg94LjK Vu7/5WYDXt/7l3k5tZOpLoRSm8l/EI6MQTYc+zFAKVIH7Z3VXaxvUUGBjXChFClK/v1S a8K261uUJphhPWrDkdm+5sjGV66ccuVovS5oVaej0/Sk3HxjhfPdLtZ5ZHBdRR2YVNJZ EMe2uDftDB2QXrFj9fZqanEqv+tHg32r/NsEvOxfHcJSnkKkAW05t1bqA9hEopWMlon1 sXxUbYGMppwxsuXAMZE0jXrvod5pVwlK1jNsTIpyAY18BG5RKmhvNO++73OmYLSwhQ20 ONJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CfEqZfGM; 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 z29-20020aa7991d000000b0063b77381764si2527075pff.49.2023.06.04.02.19.11; Sun, 04 Jun 2023 02:19:20 -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=CfEqZfGM; 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 S230385AbjFDJMU (ORCPT + 63 others); Sun, 4 Jun 2023 05:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231150AbjFDJMT (ORCPT ); Sun, 4 Jun 2023 05:12:19 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23C1E3 for ; Sun, 4 Jun 2023 02:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685869929; x=1717405929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lpqJmrzIVlFvFjKMIRKmBBmUMkdDwXLsnt+ZcTM4y1g=; b=CfEqZfGM601MVRmp83JbDZmmy6Trq+PzfRMBLYw5wcwLFx2YamJD6dl8 N4Qt0IstNyQhjMmfntqAyyGhO1ABJ/jK9KxbPsuKjDWctRi1v3jZvSyR6 Id0SnXw86cjp2hOWFYveiLhhQV2x6s8o6YbPcm00W5hXZXXpKUUDVxzcI YVrXFOx29q7WGZP9mSn1aatBlEJbwzuEyMZEkYD1JIHmNbPwy2DQ6nnwK wjuBPQ13mTqcrdwAVR3TXjmH8d0ngAUD2CKjhr6MXjwTi2cr8oXoD8oYU j0LbbF2Jso28zG5IfY1EcAX/IraSA1cpdd8VKF8KQa2AVARXRo6CK2pAi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="336526535" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="336526535" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:12:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10730"; a="820804738" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="820804738" Received: from yfruchte-mobl3.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.219.60]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2023 02:12:08 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 11/16] wifi: mac80211: use correct iftype HE cap Date: Sun, 4 Jun 2023 12:11:23 +0300 Message-Id: <20230604120651.0e908e5c5fdd.Iac142549a6144ac949ebd116b921a59ae5282735@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230604091128.609335-1-gregory.greenman@intel.com> References: <20230604091128.609335-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 We already check that the right iftype capa exists, but then don't use it. Assign it to a variable so we can actually use it, and then do that. Fixes: bac2fd3d7534 ("mac80211: remove use of ieee80211_get_he_sta_cap()") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- net/mac80211/he.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/net/mac80211/he.c b/net/mac80211/he.c index 729f261520c7..0322abae0825 100644 --- a/net/mac80211/he.c +++ b/net/mac80211/he.c @@ -3,7 +3,7 @@ * HE handling * * Copyright(c) 2017 Intel Deutschland GmbH - * Copyright(c) 2019 - 2022 Intel Corporation + * Copyright(c) 2019 - 2023 Intel Corporation */ #include "ieee80211_i.h" @@ -114,6 +114,7 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, struct link_sta_info *link_sta) { struct ieee80211_sta_he_cap *he_cap = &link_sta->pub->he_cap; + const struct ieee80211_sta_he_cap *own_he_cap_ptr; struct ieee80211_sta_he_cap own_he_cap; struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie; u8 he_ppe_size; @@ -123,12 +124,16 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata, memset(he_cap, 0, sizeof(*he_cap)); - if (!he_cap_ie || - !ieee80211_get_he_iftype_cap(sband, - ieee80211_vif_type_p2p(&sdata->vif))) + if (!he_cap_ie) return; - own_he_cap = sband->iftype_data->he_cap; + own_he_cap_ptr = + ieee80211_get_he_iftype_cap(sband, + ieee80211_vif_type_p2p(&sdata->vif)); + if (!own_he_cap_ptr) + return; + + own_he_cap = *own_he_cap_ptr; /* Make sure size is OK */ mcs_nss_size = ieee80211_he_mcs_nss_size(he_cap_ie_elem); -- 2.38.1