[PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF

Quan, Evan Evan.Quan at amd.com
Tue Jul 4 03:12:32 UTC 2023


[AMD Official Use Only - General]

Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Saturday, July 1, 2023 9:02 AM
> To: Quan, Evan <Evan.Quan at amd.com>
> Cc: rafael at kernel.org; lenb at kernel.org; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Pan, Xinhui <Xinhui.Pan at amd.com>;
> airlied at gmail.com; daniel at ffwll.ch; johannes at sipsolutions.net;
> davem at davemloft.net; edumazet at google.com; kuba at kernel.org;
> pabeni at redhat.com; Limonciello, Mario <Mario.Limonciello at amd.com>;
> mdaenzer at redhat.com; maarten.lankhorst at linux.intel.com;
> tzimmermann at suse.de; hdegoede at redhat.com; jingyuwang_vip at 163.com;
> Lazar, Lijo <Lijo.Lazar at amd.com>; jim.cromie at gmail.com;
> bellosilicio at gmail.com; andrealmeid at igalia.com; trix at redhat.com;
> jsg at jsg.id.au; arnd at arndb.de; linux-kernel at vger.kernel.org; linux-
> acpi at vger.kernel.org; amd-gfx at lists.freedesktop.org; dri-
> devel at lists.freedesktop.org; linux-wireless at vger.kernel.org;
> netdev at vger.kernel.org
> Subject: Re: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF
>
> > +static void get_chan_freq_boundary(u32 center_freq,
> > +                              u32 bandwidth,
> > +                              u64 *start,
> > +                              u64 *end)
> > +{
> > +   bandwidth = MHZ_TO_KHZ(bandwidth);
> > +   center_freq = MHZ_TO_KHZ(center_freq);
> > +
> > +   *start = center_freq - bandwidth / 2;
> > +   *end = center_freq + bandwidth / 2;
> > +
> > +   /* Frequency in HZ is expected */
> > +   *start = KHZ_TO_HZ(*start);
> > +   *end = KHZ_TO_HZ(*end);
> > +}
>
> This seems pretty generic, so maybe it should be moved into the shared code?
> It can then become a NOP when the functionality if disabled.
The shared code you mean is some place around mac80211?
Actually, there are two similar variants existed already: cfg80211_get_start_freq and cfg80211_get_end_freq.
The outputs of them are really what most mac80211 logics care.
The new API here is unlikely to be shared by other mac80211 part.
So, I suppose placing it here(only in wbrf.c) seems proper.
How do you think?

Evan
>
>       Andrew



More information about the amd-gfx mailing list