Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4155475pxk; Tue, 8 Sep 2020 12:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNnZ20L9l/OxwbieGKHAkuv0pv/k/fCrpfnHFneG+V3qrmeoPsJ5lDr1sdt+SRhwy+1IgJ X-Received: by 2002:aa7:d697:: with SMTP id d23mr468049edr.13.1599591952033; Tue, 08 Sep 2020 12:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599591952; cv=none; d=google.com; s=arc-20160816; b=HjN1NChNIY66dByeoJx6boMJVCNCNFDLmFe9/z0tLI9wepkSX07V+ybgawyqOParSw kECJpDfwHUmOJ+Kio2nDSMJd3gTHhBzdDbPu2VhXMydPlUnlfep76BQRhPdz+f3yMK2a 3cvBH7D+GuLzdKryoPid1Pc+/gEMKFUPxeHeCBGe11Q3SyO9Mjc12Dse/s/yWYX4Ptbi VhoUg0N6+AuLSdn24U6es/FB2z01NF+I7GbRFIJG70Omr3s3Q/euSkFdrc/jbwOe9fPl SRkekRFyImUUrlrNRI0ubFgDDTW644JcezrZjviw+kR5hz7gu7jgFnqu0IkuYVmrw/mg jjkw== 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=E7/rKj7/8dygkKc+PaMabwnxPd37FJ4W/BzBuInT2wo=; b=jUradYxBKS+6DIZbYXk+/e2TVnAr9YGBk+ZIgjfi/hYsT4xZ5A0a9Z+Ye9qHFSpbIS UhSRBMFQ2JYjWhiZtYt6JDYBnjnaa+rvt/MQxbvrmRAhikQjgSOWW+K7Xob0tf052VXK y936VOLPzEKokq7+xUR5/gx27KxtAbhQhqKhfwy0RfwdoUypLH037b/cMuVcK0Oe4K9D XHk/PMMUVwkKbsbgm4VBV6YiLXEXFwo0vFAnxS67Az7a6z9YUGGO/gBL3UWzC0uBwIPK 06SqyH+lENyvuyfoU74UCFHFAhJNgrqymB/TPGoRv/VkjWZ0D9eX20A7SYyP+CfC/qOs U+JQ== 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 b19si12194776eds.387.2020.09.08.12.05.28; Tue, 08 Sep 2020 12:05:52 -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 S1731693AbgIHTEF (ORCPT + 99 others); Tue, 8 Sep 2020 15:04:05 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:52822 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731731AbgIHTDx (ORCPT ); Tue, 8 Sep 2020 15:03:53 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id A3D304F9B0D; Tue, 8 Sep 2020 19:03:49 +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 12W6_bXWjoKp; Tue, 8 Sep 2020 19:03:45 +0000 (UTC) Received: from atlas.ibsgaard.io (c-73-223-60-234.hsd1.ca.comcast.net [73.223.60.234]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id E6F9D4F9B0B; Tue, 8 Sep 2020 19:03:24 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH v3 16/22] mac80211: handle S1G low rates Date: Tue, 8 Sep 2020 12:03:17 -0700 Message-Id: <20200908190323.15814-17-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200908190323.15814-1-thomas@adapt-ip.com> References: <20200908190323.15814-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 ec148b3e9c41..9ea743afb986 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