From: Johannes Berg <johannes@sipsolutions.net>
To: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>,
ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 1/9] cfg80211: Add helper function to identify 6GHz PSC channel
Date: Thu, 28 May 2020 09:08:06 +0200 [thread overview]
Message-ID: <643b2e386881de3051f35eaf64d36344cb2df9f6.camel@sipsolutions.net> (raw)
In-Reply-To: <20200526224217.11119-2-pradeepc@codeaurora.org> (sfid-20200527_004804_951011_BE3F0562)
On Tue, 2020-05-26 at 15:42 -0700, Pradeep Kumar Chitrapu wrote:
Hi,
Just checked what we had here, and it was the following:
> +/**
> + * ieee80211_is_channel_psc - is 6ghz channel a Preferred Scanning Channel (PSC)
> + *
> + * @chan: struct ieee80211_channel to determine
> + * Return: True if 6ghz channel is a PSC channel. False for the rest.
> + */
> +static inline bool ieee80211_is_channel_psc(struct ieee80211_channel *chan)
> +{
> + if (chan->band != NL80211_BAND_6GHZ)
> + return false;
> +
> + /*
> + * From IEEE P802.11ax/D6.1: The set of 20 MHz channels in the 6 GHz
> + * band, with channel center frequency, ch_a = Channel starting
> + * frequency – 55 80 × n (MHz) are referred to as preferred scanning
> + * channels (PSCs). Channel starting frequency is defined in 27.3.23.2
> + * (Channel allocation in the 6 GHz band), and n = 1, …, 15.
> + */
> + if (!(((chan->center_freq - 5950 + 55) >> 4) % 5))
> + return true;
> +
> + return false;
> +}
static inline bool cfg80211_is_psc(struct ieee80211_channel *chan)
{
int chan_num =
ieee80211_frequency_to_channel(chan->center_freq);
return chan->band == NL80211_BAND_6GHZ && chan_num % 16 == 5;
}
Apart from the naming, where I guess I prefer actually
cfg80211_channel_is_psc()
or so, does that seem reasonable to you? I'd prefer not to hardcode
frequencies everywhere, so in that regard I like our version better.
Maybe bail out earlier if band != 6 ghz:
static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
{
if (chan->band != NL80211_BAND_6GHZ)
return false;
return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
}
johannes
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2020-05-28 7:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 22:42 [PATCH v3 0/9] add 6GHz radio support in ath11k driver Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 1/9] cfg80211: Add helper function to identify 6GHz PSC channel Pradeep Kumar Chitrapu
2020-05-28 7:08 ` Johannes Berg [this message]
2020-05-28 7:41 ` Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 2/9] ath11k: add 6G frequency list supported by driver Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 3/9] ath11k: add support for 6GHz radio in driver Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 4/9] ath11k: Use freq instead of channel number in rx path Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 5/9] ath11k: extend peer_assoc_cmd for 6GHz band Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 6/9] ath11k: set psc channel flag when sending channel list to firmware Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 7/9] ath11k: Add 6G scan dwell time parameter in scan request command Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 8/9] ath11k: Send multiple scan_chan_list messages if required Pradeep Kumar Chitrapu
2020-05-26 22:42 ` [PATCH v3 9/9] ath11k: Add support for 6g scan hint Pradeep Kumar Chitrapu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=643b2e386881de3051f35eaf64d36344cb2df9f6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pradeepc@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox