Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3676460pxk; Mon, 21 Sep 2020 22:41:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTgOACFq8fTcJ3JZVYSErp4uwFAoiEKRrqOVCLTidj+PLWw/f77B3HVHFE7YTgXwUj4zNf X-Received: by 2002:a17:906:e103:: with SMTP id gj3mr2989490ejb.153.1600753277565; Mon, 21 Sep 2020 22:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600753277; cv=none; d=google.com; s=arc-20160816; b=iScLbD581SVKYr+0jrFicVKGy4fWMBEhAzRShMji2qGXh2GTssnCqi8Ds+4fgYSWzn oV7xXel7KlizD/ZbqAzEvm3ib1AAPc08IdzrGaefTV28A7BspEafsotsafQSAVwspXvo 3qr1Iz0fLxQCPW6Xkwh3SQMxPlcMVq55xdYP2ugQqfnuziyPHb/7O7Q4ITG/3IIROdR0 GlgkYvS3UrgwqKObJKO5buh5HobZvtDNuuNJdwrq6i0tmJSzziOoKhOy1jav4dRAojI4 b88PiFrRCCk+pvaIFmxSQsKCb0baAQhNvlOXEUF+FOw4rJROT8DHWaoB8/wX4uCXgepe kupA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=99AumgKTDpoge5q7mP06MijDydsn2WTqvQa7Rystsxs=; b=BKVPTt3JeJvobzWbVoGiNNrYLBGLipjXrf8Fuob+Cjp4ByoIXpz8lhb65IpLtGCgB0 Qo9poB/TvCZLckM4GBo8u70le66G5m1fI3E66EJRoWQpgpxf/n3LmgVXROXh7+p//Jht zdbGC3RH9DXRYbqrCLEL60WNTubojsBKXy2gWtd5YhmILdXtzvx+8dUQdbVS7xegi1X+ bxfpPCtV4kJK58AM0aucgDw8+9gu9xIydDKrzPD1YI8Uq7JFOMgIKByR8W5O9SOhemg8 MtphwnYX3s/HGMH8EtNg7vQWYsksk485edfBhNzvsC8sXqHRcoHCFUebbHdpwb98g1oB 4PzQ== 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 s24si10461087edr.379.2020.09.21.22.40.54; Mon, 21 Sep 2020 22:41:17 -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 S1728909AbgIVFhY (ORCPT + 99 others); Tue, 22 Sep 2020 01:37:24 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:33964 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728384AbgIVFhX (ORCPT ); Tue, 22 Sep 2020 01:37:23 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 26C824F9E08; Tue, 22 Sep 2020 05:37:23 +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 twGRLU2gMwvb; Tue, 22 Sep 2020 05:37:20 +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 97C704F9DF4; Tue, 22 Sep 2020 05:37:17 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH v4 02/17] mac80211: s1g: choose scanning width based on frequency Date: Mon, 21 Sep 2020 19:28:03 -0700 Message-Id: <20200922022818.15855-3-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200922022818.15855-1-thomas@adapt-ip.com> References: <20200922022818.15855-1-thomas@adapt-ip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- v4: - double space after goto (Johannes) --- net/mac80211/scan.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 5ac2785cdc7b..d2d6ff37a77b 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