[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230630103240.1557100-4-evan.quan@amd.com>
Date: Fri, 30 Jun 2023 18:32:34 +0800
From: Evan Quan <evan.quan@....com>
To: <rafael@...nel.org>, <lenb@...nel.org>,
<Alexander.Deucher@....com>, <Christian.Koenig@....com>,
<Xinhui.Pan@....com>, <airlied@...il.com>, <daniel@...ll.ch>,
<johannes@...solutions.net>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<Mario.Limonciello@....com>, <mdaenzer@...hat.com>,
<maarten.lankhorst@...ux.intel.com>, <tzimmermann@...e.de>,
<hdegoede@...hat.com>, <jingyuwang_vip@....com>,
<Lijo.Lazar@....com>, <jim.cromie@...il.com>,
<bellosilicio@...il.com>, <andrealmeid@...lia.com>,
<trix@...hat.com>, <jsg@....id.au>, <arnd@...db.de>
CC: <linux-kernel@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
<amd-gfx@...ts.freedesktop.org>, <dri-devel@...ts.freedesktop.org>,
<linux-wireless@...r.kernel.org>, <netdev@...r.kernel.org>,
Evan Quan <evan.quan@....com>
Subject: [PATCH V5 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 <evan.quan@....com>
---
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 9e04f69712b1..c6dc337eafce 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 &enum nl80211_chan_width
+ * Return: channel width in Mhz if the chan_width from &enum 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
Powered by blists - more mailing lists