diff mbox series

[v9,2/5] wifi: nl80211: make nl80211_send_chandef non-static

Message ID 20230313075326.3594869-3-jaewan@google.com
State Superseded
Headers show
Series mac80211_hwsim: Add PMSR support | expand

Commit Message

Jaewan Kim March 13, 2023, 7:53 a.m. UTC
Expose nl80211_send_chandef functionality for mac80211_hwsim or vendor
netlink can use it where needed.

Signed-off-by: Jaewan Kim <jaewan@google.com>
---
V8: Initial commit (split from other change)
---
 include/net/cfg80211.h | 9 +++++++++
 net/wireless/nl80211.c | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Michal Kubiak March 13, 2023, 4:58 p.m. UTC | #1
On Mon, Mar 13, 2023 at 07:53:23AM +0000, Jaewan Kim wrote:
> Expose nl80211_send_chandef functionality for mac80211_hwsim or vendor
> netlink can use it where needed.
> 
> Signed-off-by: Jaewan Kim <jaewan@google.com>
> ---
> V8: Initial commit (split from other change)
> ---
>  include/net/cfg80211.h | 9 +++++++++
>  net/wireless/nl80211.c | 4 ++--
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index f115b2550309..bcce8e9e2aba 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h

Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>

> @@ -938,6 +938,15 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
>  				  const struct cfg80211_chan_def *chandef,
>  				  enum nl80211_iftype iftype);
>  
> +/**
> + * nl80211_send_chandef - sends the channel definition.
> + * @msg: the msg to send channel definition
> + * @chandef: the channel definition to check
> + *
> + * Returns: 0 if sent the channel definition to msg, < 0 on error
> + **/
> +int nl80211_send_chandef(struct sk_buff *msg, const struct cfg80211_chan_def *chandef);
> +
>  /**
>   * ieee80211_chanwidth_rate_flags - return rate flags for channel width
>   * @width: the channel width of the channel
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 112b4bb009c8..1fd9e6545225 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -3756,8 +3756,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>  	return result;
>  }
>  
> -static int nl80211_send_chandef(struct sk_buff *msg,
> -				const struct cfg80211_chan_def *chandef)
> +int nl80211_send_chandef(struct sk_buff *msg, const struct cfg80211_chan_def *chandef)
>  {
>  	if (WARN_ON(!cfg80211_chandef_valid(chandef)))
>  		return -EINVAL;
> @@ -3788,6 +3787,7 @@ static int nl80211_send_chandef(struct sk_buff *msg,
>  		return -ENOBUFS;
>  	return 0;
>  }
> +EXPORT_SYMBOL(nl80211_send_chandef);
>  
>  static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,
>  			      struct cfg80211_registered_device *rdev,
> -- 
> 2.40.0.rc1.284.g88254d51c5-goog
>
diff mbox series

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f115b2550309..bcce8e9e2aba 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -938,6 +938,15 @@  int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
 				  const struct cfg80211_chan_def *chandef,
 				  enum nl80211_iftype iftype);
 
+/**
+ * nl80211_send_chandef - sends the channel definition.
+ * @msg: the msg to send channel definition
+ * @chandef: the channel definition to check
+ *
+ * Returns: 0 if sent the channel definition to msg, < 0 on error
+ **/
+int nl80211_send_chandef(struct sk_buff *msg, const struct cfg80211_chan_def *chandef);
+
 /**
  * ieee80211_chanwidth_rate_flags - return rate flags for channel width
  * @width: the channel width of the channel
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 112b4bb009c8..1fd9e6545225 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3756,8 +3756,7 @@  static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 	return result;
 }
 
-static int nl80211_send_chandef(struct sk_buff *msg,
-				const struct cfg80211_chan_def *chandef)
+int nl80211_send_chandef(struct sk_buff *msg, const struct cfg80211_chan_def *chandef)
 {
 	if (WARN_ON(!cfg80211_chandef_valid(chandef)))
 		return -EINVAL;
@@ -3788,6 +3787,7 @@  static int nl80211_send_chandef(struct sk_buff *msg,
 		return -ENOBUFS;
 	return 0;
 }
+EXPORT_SYMBOL(nl80211_send_chandef);
 
 static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,
 			      struct cfg80211_registered_device *rdev,