RE: [PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
[AMD Official Use Only - General] > -Original Message- > From: Jeff Johnson > Sent: Thursday, August 10, 2023 10:06 PM > To: Quan, Evan ; raf...@kernel.org; l...@kernel.org; > Deucher, Alexander ; Koenig, Christian > ; Pan, Xinhui ; > airl...@gmail.com; dan...@ffwll.ch; johan...@sipsolutions.net; > da...@davemloft.net; eduma...@google.com; k...@kernel.org; > pab...@redhat.com; Limonciello, Mario ; > mdaen...@redhat.com; maarten.lankho...@linux.intel.com; > tzimmerm...@suse.de; hdego...@redhat.com; jingyuwang_...@163.com; > Lazar, Lijo ; jim.cro...@gmail.com; > bellosili...@gmail.com; andrealm...@igalia.com; t...@redhat.com; > j...@jsg.id.au; a...@arndb.de; and...@lunn.ch > Cc: linux-ker...@vger.kernel.org; linux-a...@vger.kernel.org; amd- > g...@lists.freedesktop.org; dri-de...@lists.freedesktop.org; linux- > wirel...@vger.kernel.org; net...@vger.kernel.org > Subject: Re: [PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz > for wide sharing > > On 8/10/2023 12:37 AM, Evan Quan wrote: > > The newly added WBRF feature needs this interface for channel width > > calculation. > > > > Signed-off-by: Evan Quan > > --- > > include/net/cfg80211.h | 8 > > net/wireless/chan.c| 3 ++- > > 2 files changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index > > 7c7d03aa9d06..f50508e295db 100644 > > --- a/include/net/cfg80211.h > > +++ b/include/net/cfg80211.h > > @@ -920,6 +920,14 @@ const struct cfg80211_chan_def * > > cfg80211_chandef_compatible(const struct cfg80211_chan_def > *chandef1, > > const struct cfg80211_chan_def *chandef2); > > > > +/** > > + * nl80211_chan_width_to_mhz - get the channel width in Mhz > > + * @chan_width: the channel width from nl80211_chan_width > > + * Return: channel width in Mhz if the chan_width from > > +nl80211_chan_width > > + * is valid. -1 otherwise. > > SI nit: s/Mhz/MHz/ in both places Thanks, will update them accordingly. Evan > > > + */ > > +int nl80211_chan_width_to_mhz(enum nl80211_chan_width > chan_width); > > + > > /** > >* cfg80211_chandef_valid - check if a channel definition is valid > >* @chandef: the channel definition to check diff --git > > a/net/wireless/chan.c b/net/wireless/chan.c index > > 0b7e81db383d..227db04eac42 100644 > > --- a/net/wireless/chan.c > > +++ b/net/wireless/chan.c > > @@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const > struct cfg80211_chan_def *chandef) > > return true; > > } > > > > -static int nl80211_chan_width_to_mhz(enum nl80211_chan_width > > chan_width) > > +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) > > { > > int mhz; > > > > @@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum > nl80211_chan_width chan_width) > > } > > return mhz; > > } > > +EXPORT_SYMBOL(nl80211_chan_width_to_mhz); > > > > static int cfg80211_chandef_get_width(const struct cfg80211_chan_def > *c) > > {
Re: [PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
On 8/10/2023 12:37 AM, Evan Quan wrote: The newly added WBRF feature needs this interface for channel width calculation. Signed-off-by: Evan Quan --- include/net/cfg80211.h | 8 net/wireless/chan.c| 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7c7d03aa9d06..f50508e295db 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -920,6 +920,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, const struct cfg80211_chan_def *chandef2); +/** + * nl80211_chan_width_to_mhz - get the channel width in Mhz + * @chan_width: the channel width from nl80211_chan_width + * Return: channel width in Mhz if the chan_width from nl80211_chan_width + * is valid. -1 otherwise. SI nit: s/Mhz/MHz/ in both places + */ +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width); + /** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 0b7e81db383d..227db04eac42 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const struct cfg80211_chan_def *chandef) return true; } -static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) { int mhz; @@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) } return mhz; } +EXPORT_SYMBOL(nl80211_chan_width_to_mhz); static int cfg80211_chandef_get_width(const struct cfg80211_chan_def *c) {
[PATCH V8 3/9] cfg80211: expose nl80211_chan_width_to_mhz for wide sharing
The newly added WBRF feature needs this interface for channel width calculation. Signed-off-by: Evan Quan --- include/net/cfg80211.h | 8 net/wireless/chan.c| 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7c7d03aa9d06..f50508e295db 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -920,6 +920,14 @@ const struct cfg80211_chan_def * cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, const struct cfg80211_chan_def *chandef2); +/** + * nl80211_chan_width_to_mhz - get the channel width in Mhz + * @chan_width: the channel width from nl80211_chan_width + * Return: channel width in Mhz if the chan_width from nl80211_chan_width + * is valid. -1 otherwise. + */ +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width); + /** * cfg80211_chandef_valid - check if a channel definition is valid * @chandef: the channel definition to check diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 0b7e81db383d..227db04eac42 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -141,7 +141,7 @@ static bool cfg80211_edmg_chandef_valid(const struct cfg80211_chan_def *chandef) return true; } -static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) +int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) { int mhz; @@ -190,6 +190,7 @@ static int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width) } return mhz; } +EXPORT_SYMBOL(nl80211_chan_width_to_mhz); static int cfg80211_chandef_get_width(const struct cfg80211_chan_def *c) { -- 2.34.1