Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1306772pxk; Mon, 31 Aug 2020 15:56:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc/ujUSdnq+iBh4WAUFgE9dJkJ8zDL6hvCstc5gxE2iM7IMVUmSbreNGiM9RHwUq6pvVVK X-Received: by 2002:a05:6402:1b02:: with SMTP id by2mr3079745edb.95.1598914573937; Mon, 31 Aug 2020 15:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598914573; cv=none; d=google.com; s=arc-20160816; b=MPRz5Tz+jEd1ufHCklkYfnh+LEDY28p/kaiuxn9rKoWruxLgJE8gPfILOWFOIbLKfi 8tCPUS9aV3LJ6moHb3Mryf/AlPSkrw0BCSwMHyeshkzHa9pyLxT4JGyMWWTDiVqyo4OB K9qgiudkUBBg9v6ljCiUbhef/q/zUUy6KT3TD5bs2tSoMkK4J/52mVkI9aFZqJ0iBujY bKfZzE498ZVn1z5meHN3WgzxGHigS7FY8uIFhB/cejNkIbcTFDGp/cvT1V8bt20vnLpJ Kg8E10L1Ib890qJP6c7FCSHlT7EFlASrFYwabu8F7D4Gzj3I5JewajTZZTedEMgMBVHi sI0A== 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=k7RWuMzp6BnCSqMiVulFTWHEzpEJ5XL1sk2b8s2q8sERu6HzeYowHR482djH+V8Gbk wNv9idFJwztq9803CLtbR/6Hh3FyG8j6rssanCBde1E4MaYzBBGcHgH/YWlME4B0qc7Z 0C2B75wkSbXn+D90odc2rqCURiScNFEDmij/q32q232evMTNH0tg2nWoLO7F/XaHnFlu rkldxM4o6p6UwnRlb0+X/s5r6mRRz9aoQgNJFfhA8MSF+1UozuhsPlGQucd4P4yTehX0 UmA0vNrSu7B1y4qLplCRiFlh4jnmXjawchUTlav/CvrbiRcENjqFGwX3oRJr405joEFL HRkA== 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 qx7si1814462ejb.438.2020.08.31.15.55.50; Mon, 31 Aug 2020 15:56:13 -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 S1730168AbgHaU4m (ORCPT + 99 others); Mon, 31 Aug 2020 16:56:42 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:52370 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729586AbgHaU4k (ORCPT ); Mon, 31 Aug 2020 16:56:40 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 347834F8E7F; Mon, 31 Aug 2020 20:56:39 +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 i16V-pMaBwnx; Mon, 31 Aug 2020 20:56:36 +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 4DB504F8E9B; Mon, 31 Aug 2020 20:56:12 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH v2 16/22] mac80211: handle S1G low rates Date: Mon, 31 Aug 2020 13:55:54 -0700 Message-Id: <20200831205600.21058-17-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200831205600.21058-1-thomas@adapt-ip.com> References: <20200831205600.21058-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