public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Mingyen Hsieh <mingyen.hsieh@mediatek.com>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"lorenzo@kernel.org" <lorenzo@kernel.org>
Cc: "deren.wu@mediatek.com" <deren.wu@mediatek.com>,
	"Sean.Wang@mediatek.com" <Sean.Wang@mediatek.com>,
	"Leon.Yen@mediatek.com" <Leon.Yen@mediatek.com>,
	"Michael.Lo@mediatek.com" <Michael.Lo@mediatek.com>,
	"allan.wang@mediatek.com" <allan.wang@mediatek.com>,
	"Eric-SY.Chang@mediatek.com" <Eric-SY.Chang@mediatek.com>,
	"km.lin@mediatek.com" <km.lin@mediatek.com>,
	"Quan.Zhou@mediatek.com" <Quan.Zhou@mediatek.com>,
	"Ryder.Lee@mediatek.com" <Ryder.Lee@mediatek.com>,
	"Shayne.Chen@mediatek.com" <Shayne.Chen@mediatek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: RE: [PATCH v2 3/6] wifi: mt76: mt7925: update the channel usage when the regd domain changed
Date: Tue, 4 Mar 2025 09:13:44 +0000	[thread overview]
Message-ID: <96503735cafd4e1eaafccb3e0479e9fc@realtek.com> (raw)
In-Reply-To: <20250304062854.829194-3-mingyen.hsieh@mediatek.com>

Mingyen Hsieh <mingyen.hsieh@mediatek.com> wrote:

[...]

> +static void
> +mt7925_regd_channel_update(struct wiphy *wiphy, struct mt792x_dev *dev)
> +{
> +#define IS_UNII_INVALID(idx, sfreq, efreq) \
> +       (!(dev->phy.clc_chan_conf & BIT(idx)) && (cfreq) >= (sfreq) && (cfreq) <= (efreq))

Implicitly using 'cfreq' would be missing something by reviewers.
How about adding it as an argument of macro?

> +       struct ieee80211_supported_band *sband;
> +       struct mt76_dev *mdev = &dev->mt76;
> +       struct ieee80211_channel *ch;
> +       int i, cfreq;
> +
> +       sband = wiphy->bands[NL80211_BAND_5GHZ];
> +       if (!sband)
> +               return;
> +
> +       for (i = 0; i < sband->n_channels; i++) {
> +               ch = &sband->channels[i];
> +               cfreq = ch->center_freq;
> +
> +               /* UNII-4 */
> +               if (IS_UNII_INVALID(0, 5845, 5925))
> +                       ch->flags |= IEEE80211_CHAN_DISABLED;
> +       }
> +
> +       sband = wiphy->bands[NL80211_BAND_6GHZ];
> +       if (!sband)
> +               return;
> +
> +       for (i = 0; i < sband->n_channels; i++) {
> +               ch = &sband->channels[i];
> +               cfreq = ch->center_freq;
> +
> +               /* UNII-5/6/7/8 */
> +               if (IS_UNII_INVALID(1, 5925, 6425) ||
> +                   IS_UNII_INVALID(2, 6425, 6525) ||
> +                   IS_UNII_INVALID(3, 6525, 6875) ||
> +                   IS_UNII_INVALID(4, 6875, 7125))
> +                       ch->flags |= IEEE80211_CHAN_DISABLED;
> +       }
> +}
> +

[...]


  reply	other threads:[~2025-03-04  9:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04  6:28 [PATCH v2 1/6] wifi: mt76: mt7925: load the appropriate CLC data based on hardware type Mingyen Hsieh
2025-03-04  6:28 ` [PATCH v2 2/6] wifi: mt76: mt7925: add EHT control support based on the CLC data Mingyen Hsieh
2025-03-04  9:10   ` Ping-Ke Shih
2025-03-04  9:34     ` Mingyen Hsieh (謝明諺)
2025-03-05  1:21       ` Ping-Ke Shih
2025-03-05  9:32         ` Mingyen Hsieh (謝明諺)
2025-03-06  0:41           ` Ping-Ke Shih
2025-03-04  6:28 ` [PATCH v2 3/6] wifi: mt76: mt7925: update the channel usage when the regd domain changed Mingyen Hsieh
2025-03-04  9:13   ` Ping-Ke Shih [this message]
2025-03-04  6:28 ` [PATCH v2 4/6] wifi: mt76: mt7925: remove unused acpi function for clc Mingyen Hsieh
2025-03-04  6:28 ` [PATCH v2 5/6] wifi: mt76: mt792x: extend MTCL of APCI to version3 for EHT control Mingyen Hsieh
2025-03-04  6:28 ` [PATCH v2 6/6] wifi: mt76: mt7925: add MTCL support to enhance the reulatory compliance Mingyen Hsieh
2025-03-04  9:06 ` [PATCH v2 1/6] wifi: mt76: mt7925: load the appropriate CLC data based on hardware type Ping-Ke Shih
2025-03-04  9:37   ` Mingyen Hsieh (謝明諺)
2025-03-05  1:00     ` Ping-Ke Shih

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=96503735cafd4e1eaafccb3e0479e9fc@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Michael.Lo@mediatek.com \
    --cc=Quan.Zhou@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=Shayne.Chen@mediatek.com \
    --cc=allan.wang@mediatek.com \
    --cc=deren.wu@mediatek.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=mingyen.hsieh@mediatek.com \
    --cc=nbd@nbd.name \
    /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