Messages in this thread | | | From | "Quan, Evan" <> | Subject | RE: [PATCH V5 4/9] wifi: mac80211: Add support for ACPI WBRF | Date | Tue, 4 Jul 2023 03:12:32 +0000 |
| |
[AMD Official Use Only - General]
Hi Andrew,
> -----Original Message----- > From: Andrew Lunn <andrew@lunn.ch> > Sent: Saturday, July 1, 2023 9:02 AM > To: Quan, Evan <Evan.Quan@amd.com> > Cc: rafael@kernel.org; lenb@kernel.org; Deucher, Alexander > <Alexander.Deucher@amd.com>; Koenig, Christian > <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>; > airlied@gmail.com; daniel@ffwll.ch; johannes@sipsolutions.net; > davem@davemloft.net; edumazet@google.com; kuba@kernel.org; > pabeni@redhat.com; Limonciello, Mario <Mario.Limonciello@amd.com>; > mdaenzer@redhat.com; maarten.lankhorst@linux.intel.com; > tzimmermann@suse.de; hdegoede@redhat.com; jingyuwang_vip@163.com; > Lazar, Lijo <Lijo.Lazar@amd.com>; jim.cromie@gmail.com; > bellosilicio@gmail.com; andrealmeid@igalia.com; trix@redhat.com; > jsg@jsg.id.au; arnd@arndb.de; linux-kernel@vger.kernel.org; linux- > acpi@vger.kernel.org; amd-gfx@lists.freedesktop.org; dri- > devel@lists.freedesktop.org; linux-wireless@vger.kernel.org; > netdev@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
| |