diff mbox

[1/2] wireless: expose set-wiphy-name method to other modules.

Message ID 1411689584-16136-1-git-send-email-greearb@candelatech.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ben Greear Sept. 25, 2014, 11:59 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

This will let hw-sim create wiphy objects with a specific
name.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 include/net/cfg80211.h | 6 ++++++
 net/wireless/core.c    | 9 +++++++++
 2 files changed, 15 insertions(+)

Comments

Ben Greear Sept. 26, 2014, 9:32 p.m. UTC | #1
On 09/25/2014 04:59 PM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> This will let hw-sim create wiphy objects with a specific
> name.

This has an added whitespace that should not have been included,
and next patch does not take rtnl before doing the rename.

Will test some more and re-send.

Thanks,
Ben
diff mbox

Patch

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3a13aab..68aabfa 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4854,6 +4854,11 @@  int cfg80211_iter_combinations(struct wiphy *wiphy,
 void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
 			 gfp_t gfp);
 
+/*
+ * Attempt to rename a device.  Acquire RTNL before calling.
+ */
+int cfg80211_dev_rename_wiphy(struct wiphy* wiphy, char *newname);
+
 /**
  * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy
  * @wiphy: the wiphy to shut down
@@ -4869,6 +4874,7 @@  void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
 void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
 
 
+
 /* ethtool helper */
 void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
 
diff --git a/net/wireless/core.c b/net/wireless/core.c
index f52a4cd..03e4715 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -86,6 +86,15 @@  struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx)
 	return &rdev->wiphy;
 }
 
+int cfg80211_dev_rename_wiphy(struct wiphy* wiphy, char *newname)
+{
+	struct cfg80211_registered_device *rdev;
+
+	rdev = wiphy_to_rdev(wiphy);
+	return cfg80211_dev_rename(rdev, newname);
+}
+EXPORT_SYMBOL_GPL(cfg80211_dev_rename_wiphy);
+
 int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
 			char *newname)
 {