Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Cc: linux-wireless@vger.kernel.org, arien.judge@morsemicro.com
Subject: Re: [PATCH wireless] wifi: cfg80211: return center freq for 1Mhz S1G chan start/end
Date: Tue, 21 Oct 2025 14:20:45 +0200	[thread overview]
Message-ID: <ffc008eee90574ce4e1579a1222e55234818fdd3.camel@sipsolutions.net> (raw)
In-Reply-To: <20251021110725.397982-1-lachlan.hodges@morsemicro.com> (sfid-20251021_130745_094426_F5BD626F)

^^ should be MHz in the subject

On Tue, 2025-10-21 at 22:07 +1100, Lachlan Hodges wrote:
> The frequencies returned by cfg80211_s1g_get_{start/end}_freq_khz()
> for 1MHz chandefs are off by +-1000KHz. 

Hmm. I'm confused.

> +++ b/include/net/cfg80211.h
> @@ -10194,7 +10194,8 @@ cfg80211_s1g_get_start_freq_khz(const struct cfg80211_chan_def *chandef)
>  	u32 bw_mhz = cfg80211_chandef_get_width(chandef);
>  	u32 center_khz =
>  		MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset;
> -	return center_khz - bw_mhz * 500 + 500;
> +
> +	return (bw_mhz == 1) ? center_khz : center_khz - bw_mhz * 500 + 500;
>  }

I don't see how this changes anything - if "bw_mhz == 1" then

   center_freq - bw_mhz * 500 + 500
== center_freq -      1 * 500 + 500
== center_freq -          500 + 500
== center_freq

so this makes no difference?

>  
>  /**
> @@ -10209,7 +10210,8 @@ cfg80211_s1g_get_end_freq_khz(const struct cfg80211_chan_def *chandef)
>  	u32 bw_mhz = cfg80211_chandef_get_width(chandef);
>  	u32 center_khz =
>  		MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset;
> -	return center_khz + bw_mhz * 500 - 500;
> +
> +	return (bw_mhz == 1) ? center_khz : center_khz + bw_mhz * 500 - 500;

Same here with the sign inverted?

What am I missing?

johannes

  reply	other threads:[~2025-10-21 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 11:07 [PATCH wireless] wifi: cfg80211: return center freq for 1Mhz S1G chan start/end Lachlan Hodges
2025-10-21 12:20 ` Johannes Berg [this message]
2025-10-21 12:30   ` Lachlan Hodges

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=ffc008eee90574ce4e1579a1222e55234818fdd3.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arien.judge@morsemicro.com \
    --cc=lachlan.hodges@morsemicro.com \
    --cc=linux-wireless@vger.kernel.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