From patchwork Tue Dec 17 16:04:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11298045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33E1A6C1 for ; Tue, 17 Dec 2019 16:05:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 113BA206B7 for ; Tue, 17 Dec 2019 16:05:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HUMr7dCG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 113BA206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n4Gb/lIyklSLSuqgx8n9G5PXZz8ll29ladq0JmtarDU=; b=HUMr7dCGQz35/H cBXLVRiu0aigHR56hBctuyKqtcL2OvvVQkvZtGB32o6gMWqVcbn+LQFkJL65vTyQ1qv8xlQ0a4+F9 RwOpEUcrEuzlVnlw8l3MeTCjYvn78x+AV6HPpXl+hCNwwjr+K8MhwSd0PFaEypgiUuT9hzkztVt4R BjzqkXsj43B5iEqg4n3/INwAAD7IF1kIin2pgtG1Felj9FhkjLxfncawBshsYehtpVVwe9cAonZpN MqEtQvDpBVs/kpjpEhXJdEroEr9aGpzSdJJwI4603PJg/U5KNevqyoVLZCWkUTfKGNmaMjKt06p+D yqqXqx4DfukoA3orqg5A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihFLU-0004KO-ID; Tue, 17 Dec 2019 16:05:12 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihFLR-0003wv-Cn for ath11k@lists.infradead.org; Tue, 17 Dec 2019 16:05:10 +0000 Received: from pd95fd66b.dip0.t-ipconnect.de ([217.95.214.107] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1ihFLM-0002Ku-9l; Tue, 17 Dec 2019 17:05:04 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH 2/3] mac80211: add support for setting fixed HE rate/gi/ltf Date: Tue, 17 Dec 2019 17:04:54 +0100 Message-Id: <20191217160455.311-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191217160455.311-1-john@phrozen.org> References: <20191217160455.311-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191217_080509_600249_FF1C6E96 X-CRM114-Status: GOOD ( 11.61 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Miles Hu , linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.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: John Crispin Signed-off-by: Miles Hu --- 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 e109b47c4219..463eef8aae3e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2905,9 +2905,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; @@ -2924,6 +2928,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 791ce58d0f09..6cc6637cec96 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -963,6 +963,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;