From patchwork Tue Feb 4 10:35:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11364391 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 51C3214B4 for ; Tue, 4 Feb 2020 10:35:30 +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 3079C20674 for ; Tue, 4 Feb 2020 10:35:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FYgGDBAE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3079C20674 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=fTniyWQS3Fz8zaeWwijWLRY65V52in8RZYnLJDC2axI=; b=FYgGDBAEfWGWu1 BcKMFQMY8sXFVQO0cXMNOsTe/Sy+AJ221YF2HuDcm6LOOqPQ9qtv+NRUOZW8qt0ty69pWgoLlhwb/ Iq1F/toMTaG5titHb0axHd/Qt4e/iUoMTCHf1jdP/lFfPY/eg5ZO7lT6Ux52dARcYkVPp7E9dblvh hYsBs2KflPKZHN6xVQpj5cKM5uS9pB3Ck1TSNzm+iI3zX/rw4tS4bE1zNwfnKem09DiuiXgd6Es+Q xqSYHa9jzOEmT2fvvecSEA/qxS59Fd3JBvywsdiVLLQpyBukB0BfXjhqt3DsS6P9A1IRcjNXuRLJu 9NxArDFv4oDflvwPpf4Q==; 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 1iyvYF-0001ya-NQ; Tue, 04 Feb 2020 10:35:27 +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 1iyvYC-0001ww-J8 for ath11k@lists.infradead.org; Tue, 04 Feb 2020 10:35:26 +0000 Received: from [149.224.158.146] (helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1iyvY8-0000L5-Fo; Tue, 04 Feb 2020 11:35:20 +0100 From: John Crispin To: Johannes Berg , Kalle Valo Subject: [PATCH V2 2/3] mac80211: add support for setting fixed HE rate/gi/ltf Date: Tue, 4 Feb 2020 11:35:13 +0100 Message-Id: <20200204103514.18111-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200204103514.18111-1-john@phrozen.org> References: <20200204103514.18111-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200204_023524_812556_32983EDE X-CRM114-Status: GOOD ( 11.97 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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 a11bd1669c13..5bf5f4754241 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2900,9 +2900,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; @@ -2919,6 +2923,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 e3cf24cb4615..13868bdca772 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;