Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4156561pxk; Tue, 8 Sep 2020 12:07:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5/cYfd9BJTVsJYDDypX3wRUO81j8yLY/nkoLEpMiJ/Q1Y6t0jvjUU04hSFYFk7EyI3YWi X-Received: by 2002:a05:6402:1805:: with SMTP id g5mr438198edy.135.1599592041914; Tue, 08 Sep 2020 12:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599592041; cv=none; d=google.com; s=arc-20160816; b=FzaPh+jyvumiUtVOPMIKRFawkGXa0BJM5u96zM4ASucnMEyPRuOzYevnlIE9oQO6nZ sMj3eK6e9/duw84pXoj2Pibtt/vCWyqL594VrXnmIaTWIJNsVEb/SGZd/HiqHO7OMR2P gSkGhlslP7nAfWtxP5H331HUGBCj6cr73S4+hlTE8MDd5Vsv9wTl4xWVxPTXG9cgK3m4 RsirmDi46Em12EX932hHRfyv/NaurEGjCTZiSkk+H7gAHVe5waDu7R5RZajvePHyDR88 5j/PvChyeA7wFD4RBtjj+Rxo/gVd2fKJtFtfiI19lDaOJgQMfgNqZPX+yuHmLIQfHyTf DowQ== 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=pXl+wSKMyOT5A4OkTMquWdsFfaIPZNmIMP1pYXxPik4=; b=pUEa+jUSk+dNv4aQxZkVq4JZQFNv4/2GdXB2vkjhrM47WOMVbrBd0uIpykGKULnfvu tJarJ+yIyO7gpiA0iKpEv2fT5HKAU6MNHphuUxHq15JWOBCNBDGDyzDlNSPDu8YqU2hI I2gbx5sqAi32KLitrqkKtIDgcfs/c4CbCUV5RSjcICYMHHlxDpdeCTuE+P7dQJBVYSJD OGAn0u4/AuJDt0n1m9u7olAORlhI8iGbeccUW8myGkdV0HvMHF4Fu6Qkz8db28mJy1oo 60DZu7Z3lRoy3O4BBtxFb6UYUuWHtno2wdOqBEV/LTkD3VxUnk8yJSRZciVJExFT3lcg BQGA== 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 dn25si36859edb.268.2020.09.08.12.06.58; Tue, 08 Sep 2020 12:07:21 -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 S1731531AbgIHTEh (ORCPT + 99 others); Tue, 8 Sep 2020 15:04:37 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:52724 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731704AbgIHTDj (ORCPT ); Tue, 8 Sep 2020 15:03:39 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 0E8DD4F9AFC; Tue, 8 Sep 2020 19:03:34 +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 yaDXb8JiQvk1; Tue, 8 Sep 2020 19:03:31 +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 289044F9ACB; Tue, 8 Sep 2020 19:03:22 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH v3 07/22] mac80211: s1g: choose scanning width based on frequency Date: Tue, 8 Sep 2020 12:03:08 -0700 Message-Id: <20200908190323.15814-8-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 An S1G BSS can beacon at either 1 or 2 MHz and the channel width is unique to a given frequency. Ignore scan channel width for now and use the allowed channel width. Signed-off-by: Thomas Pedersen --- net/mac80211/scan.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 5ac2785cdc7b..5002791fe165 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -905,6 +905,17 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, local->scan_chandef.center_freq1 = chan->center_freq; local->scan_chandef.freq1_offset = chan->freq_offset; local->scan_chandef.center_freq2 = 0; + + /* For scanning on the S1G band, ignore scan_width (which is constant + * across all channels) for now since channel width is specific to each + * channel. Detect the required channel width here and likely revisit + * later. Maybe scan_width could be used to build the channel scan list? + */ + if (chan->band == NL80211_BAND_S1GHZ) { + local->scan_chandef.width = ieee80211_s1g_channel_width(chan); + goto set_channel; + } + switch (scan_req->scan_width) { case NL80211_BSS_CHAN_WIDTH_5: local->scan_chandef.width = NL80211_CHAN_WIDTH_5; @@ -925,8 +936,14 @@ static void ieee80211_scan_state_set_channel(struct ieee80211_local *local, else local->scan_chandef.width = NL80211_CHAN_WIDTH_20_NOHT; break; + case NL80211_BSS_CHAN_WIDTH_1: + case NL80211_BSS_CHAN_WIDTH_2: + /* shouldn't get here, S1G handled above */ + WARN_ON(1); + break; } +set_channel: if (ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL)) skip = 1; -- 2.20.1