Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp770014pxa; Thu, 27 Aug 2020 15:34:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnlHXSwiwUfd2hy2JWIsNK1zitB7yJNKdUAbZsy1WNBQwUdOvad7hzTxhd5tJUWHjrdcS1 X-Received: by 2002:a05:6402:17ab:: with SMTP id j11mr22181067edy.28.1598567695265; Thu, 27 Aug 2020 15:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598567695; cv=none; d=google.com; s=arc-20160816; b=x3+2TiBc4uoQI17J4sSlA8fXgKWzXD8gO5C/fJJXlt1DdBY42srcOqwuczsD54sQiE o3ercTdx1hIuTSpd3/kGIAOx949ctWZPW7OFw395cXt4Ll7s4xDCplWprM/jPW/mWZCp r4JsEE/DrMnzIFu6pqm1ZWORyzsqRZOnXWRl0ZsPbfYLA95jKwIK79NzNal2YXA/vUzI 5eSQkpZTIIdlGaMzOUtnDcozEhKvc6o+o9fL2mpvjO8bZrbw1prenrfRW3d0+hsP5CgF 4qHMwX5+DW44gNBuZ0dOQQ/M4ec3TKSHCi43nQSYGPh+l5cYnHXn1NE8yMjxHg0jPxeC yUeg== 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=6F8y1hc1jGSwj4us34GFrBh+Fj2GInps/Aq9tdSFt4A=; b=EM2Vc5RespikiIzyJHb6m7dMlgryQ2vfEAstPjoGbo4Dyky1QbdbdjV3T4UnKFb6dw Hv/asJw8ILk7QuA5u7EKWArOiyq5+p+qVDwt9d2aN9GaYKpubdWID/5AXzhbSjlFdEZv Kw3wfsc0xC4oLIsju39ZHWQ7ubLdEfFYEbEWjCqIWOtYEHIGoQTmJ39ihq8j0XkthosD Q3T62gz7qRvTY3IBE5G0CPrql8speLIg6LmKIyPOp0D8BBla2BCwdlGIW1kXMyjjhIJx Y01yarx1DFSsA7m01lXLlCLUlLsunjbWrpeBC4l+JlUv87++jCwax7yxSDtFg4ecE4tM 8vDQ== 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 t27si2286367ejf.672.2020.08.27.15.34.30; Thu, 27 Aug 2020 15:34:55 -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 S1728048AbgH0Wdj (ORCPT + 99 others); Thu, 27 Aug 2020 18:33:39 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:50570 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728035AbgH0Wdi (ORCPT ); Thu, 27 Aug 2020 18:33:38 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 6A28F4F81EF; Thu, 27 Aug 2020 22:33:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZaDjl4aEJ8Qb; Thu, 27 Aug 2020 22:33:34 +0000 (UTC) Received: from atlas.campbell.adapt-ip.com (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 6B8054F8204; Thu, 27 Aug 2020 22:33:12 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH 16/22] mac80211: handle S1G low rates Date: Thu, 27 Aug 2020 15:32:58 -0700 Message-Id: <20200827223304.16155-17-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200827223304.16155-1-thomas@adapt-ip.com> References: <20200827223304.16155-1-thomas@adapt-ip.com> 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 S1G doesn't have legacy (sband->bitrates) rates, only MCS. For now, just send a frame at MCS 0 if a low rate is requested. Note we also redefine (since we're out of TX flags) TX_RC_VHT_MCS as TX_RC_S1G_MCS to indicate an S1G MCS. This is probably OK as VHT MCS is not valid on S1G band and vice versa. Signed-off-by: Thomas Pedersen --- include/net/mac80211.h | 2 ++ net/mac80211/rate.c | 33 ++++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 66e2bfd165e8..a9340e673610 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -812,6 +812,8 @@ enum mac80211_tx_info_flags { #define IEEE80211_TX_CTL_STBC_SHIFT 23 +#define IEEE80211_TX_RC_S1G_MCS IEEE80211_TX_RC_VHT_MCS + /** * enum mac80211_tx_control_flags - flags to describe transmit control * diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index b051f125d3af..63266d73c252 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -266,10 +266,15 @@ void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata) if (WARN_ON(!sdata->vif.bss_conf.chandef.chan)) return; + band = sdata->vif.bss_conf.chandef.chan->band; + if (band == NL80211_BAND_S1GHZ) { + /* TODO */ + return; + } + if (WARN_ON_ONCE(!basic_rates)) return; - band = sdata->vif.bss_conf.chandef.chan->band; user_mask = sdata->rc_rateidx_mask[band]; sband = local->hw.wiphy->bands[band]; @@ -296,21 +301,29 @@ static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc) !ieee80211_is_data(fc); } -static void rc_send_low_basicrate(s8 *idx, u32 basic_rates, +static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate, + u32 basic_rates, struct ieee80211_supported_band *sband) { u8 i; + if (sband->band == NL80211_BAND_S1GHZ) { + /* TODO */ + rate->flags |= IEEE80211_TX_RC_S1G_MCS; + rate->idx = 0; + return; + } + if (basic_rates == 0) return; /* assume basic rates unknown and accept rate */ - if (*idx < 0) + if (rate->idx < 0) return; - if (basic_rates & (1 << *idx)) + if (basic_rates & (1 << rate->idx)) return; /* selected rate is a basic rate */ - for (i = *idx + 1; i <= sband->n_bitrates; i++) { + for (i = rate->idx + 1; i <= sband->n_bitrates; i++) { if (basic_rates & (1 << i)) { - *idx = i; + rate->idx = i; return; } } @@ -328,6 +341,12 @@ static void __rate_control_send_low(struct ieee80211_hw *hw, u32 rate_flags = ieee80211_chandef_rate_flags(&hw->conf.chandef); + if (sband->band == NL80211_BAND_S1GHZ) { + info->control.rates[0].flags |= IEEE80211_TX_RC_S1G_MCS; + info->control.rates[0].idx = 0; + return; + } + if ((sband->band == NL80211_BAND_2GHZ) && (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)) rate_flags |= IEEE80211_RATE_ERP_G; @@ -388,7 +407,7 @@ static bool rate_control_send_low(struct ieee80211_sta *pubsta, } if (use_basicrate) - rc_send_low_basicrate(&info->control.rates[0].idx, + rc_send_low_basicrate(&info->control.rates[0], txrc->bss_conf->basic_rates, sband); -- 2.20.1