Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp703823ybz; Wed, 29 Apr 2020 07:58:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLxnDkq+68njOXPvQTME4IWRnkmaSOipqGald+OxO5rwGDAoeQRji4atQQjQ7e60eMv5mBR X-Received: by 2002:a05:6402:14ce:: with SMTP id f14mr2831153edx.244.1588172296302; Wed, 29 Apr 2020 07:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588172296; cv=none; d=google.com; s=arc-20160816; b=HUUT3COUpOD2Bqhk9BHSn8SVKqf3ejdILCku80vxrB9Xrqo0lajtsTdvoHNIY5D5ll nnEMCDEYR1Gq3ibJ3erWQzfi7iotjXJg4hm3hij5hUTF2S8x+gjUExh9y2E4RO72hYM0 2z3EgLF+4Ajg8nkAxyC+tUsv2Ev8VKRrrRzkxqRJ7XHl9iHM9ufQ/xVTKFNo0w7SOqRN PGK194eD6F8SdqT89+kAq8ThMkvXLn7hlxp/Y0R87neyL9jPjPBy+sS5sHNRdtD2jcKh rrF9EKvTFPbSSS4tokPfkWRPzZDxkvm06FhGIxlR+BBhOjiTXS/xAfGSV3zQoRAFWSEY sjYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=51M2dgcYQY1CWT5Kcc3lwaSMi3fsQnTksS+qOZobOfk=; b=KuNNiEXcdaPiN2p8zmvsW2V++ndVfECvrvFrNGxLo5AjVEGtUiYf4M64H/Omyf8EMJ lhVeVUEpPz65+eosOP6gCt+udCWiO5u5TCusYDeRkSg4C2X6/fvqkgquvXZBFgToAssv 8RFnQzzoMMzCJoKrl1ccE7xLTs0PwQD9hcLeAjZoKhrzZqS0QouD59cqUpfyZwQ0SZ+P X8+cGbgITwELwXx57q8XGwRV8i5EXJv3NKOOGGIamzPGe5x8/4gwmaztHhQfRzMyjulf 2OFslabOh0/S3CHUCfU9hOLorGNXwdJEwslb9kRkEyySDsti/1L0Fm62XkBiHy/U1ZRY WvxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si3277685edi.111.2020.04.29.07.57.38; Wed, 29 Apr 2020 07:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbgD2O51 (ORCPT + 99 others); Wed, 29 Apr 2020 10:57:27 -0400 Received: from nbd.name ([46.4.11.11]:60146 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgD2O50 (ORCPT ); Wed, 29 Apr 2020 10:57:26 -0400 Received: from [81.25.161.111] (helo=bertha8.datto.lan) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1jTo9K-0002aB-I9; Wed, 29 Apr 2020 16:57:22 +0200 From: John Crispin To: Johannes Berg , Kalle Valo Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, Miles Hu , John Crispin Subject: [PATCH V3 2/3] mac80211: add support for setting fixed HE rate/gi/ltf Date: Wed, 29 Apr 2020 16:57:07 +0200 Message-Id: <20200429145708.25992-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200429145708.25992-1-john@phrozen.org> References: <20200429145708.25992-1-john@phrozen.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Miles Hu With nl80211 now able to receive fixed HE rate/gi/ltf settings we want to propagate these further down the stack into the mac80211 drivers. This patch copies the values into the sdata struct. Signed-off-by: Miles Hu Signed-off-by: John Crispin --- net/mac80211/cfg.c | 11 +++++++++++ net/mac80211/ieee80211_i.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0f72813fed53..ea3791a930e8 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2829,9 +2829,13 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, memcpy(sdata->rc_rateidx_vht_mcs_mask[i], mask->control[i].vht_mcs, sizeof(mask->control[i].vht_mcs)); + memcpy(sdata->rc_rateidx_he_mcs_mask[i], + mask->control[i].he_mcs, + sizeof(mask->control[i].he_mcs)); sdata->rc_has_mcs_mask[i] = false; sdata->rc_has_vht_mcs_mask[i] = false; + sdata->rc_has_he_mcs_mask[i] = false; if (!sband) continue; @@ -2848,6 +2852,13 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, break; } } + + for (j = 0; j < NL80211_HE_NSS_MAX; j++) { + if (~sdata->rc_rateidx_he_mcs_mask[i][j]) { + sdata->rc_has_he_mcs_mask[i] = true; + break; + } + } } return 0; diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index f8ed4f621f7f..2502726d0a58 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -964,6 +964,9 @@ struct ieee80211_sub_if_data { bool rc_has_vht_mcs_mask[NUM_NL80211_BANDS]; u16 rc_rateidx_vht_mcs_mask[NUM_NL80211_BANDS][NL80211_VHT_NSS_MAX]; + bool rc_has_he_mcs_mask[NUM_NL80211_BANDS]; + u16 rc_rateidx_he_mcs_mask[NUM_NL80211_BANDS][NL80211_HE_NSS_MAX]; + union { struct ieee80211_if_ap ap; struct ieee80211_if_wds wds; -- 2.20.1