summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2014-10-22 12:23:00 -0700
committerJohannes Berg <johannes.berg@intel.com>2014-10-27 08:48:18 +0100
commit1998d90ad424c1ff12ea24816ce158d5262e06a5 (patch)
treead30c598208b3c85525810af268787cad5bb774d /include/net
parent8cdd9e1c37dd888894922b8209d5fc8055cfde52 (diff)
downloadop-kernel-dev-1998d90ad424c1ff12ea24816ce158d5262e06a5.zip
op-kernel-dev-1998d90ad424c1ff12ea24816ce158d5262e06a5.tar.gz
cfg80211: support creating wiphy with suggested name
Kernel will attempt to use the name if it is supplied, but if name cannot be used for some reason, the default phyX name will be used instead. Signed-off-by: Ben Greear <greearb@candelatech.com> [while at it, use wiphy_name() instead of dev_name(), fix format string issue reported by Kees Cook] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 77aa805..39d7996 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3185,6 +3185,23 @@ static inline const char *wiphy_name(const struct wiphy *wiphy)
}
/**
+ * wiphy_new_nm - create a new wiphy for use with cfg80211
+ *
+ * @ops: The configuration operations for this device
+ * @sizeof_priv: The size of the private area to allocate
+ * @requested_name: Request a particular name.
+ * NULL is valid value, and means use the default phy%d naming.
+ *
+ * Create a new wiphy and associate the given operations with it.
+ * @sizeof_priv bytes are allocated for private use.
+ *
+ * Return: A pointer to the new wiphy. This pointer must be
+ * assigned to each netdev's ieee80211_ptr for proper operation.
+ */
+struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
+ const char *requested_name);
+
+/**
* wiphy_new - create a new wiphy for use with cfg80211
*
* @ops: The configuration operations for this device
@@ -3196,7 +3213,11 @@ static inline const char *wiphy_name(const struct wiphy *wiphy)
* Return: A pointer to the new wiphy. This pointer must be
* assigned to each netdev's ieee80211_ptr for proper operation.
*/
-struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
+static inline struct wiphy *wiphy_new(const struct cfg80211_ops *ops,
+ int sizeof_priv)
+{
+ return wiphy_new_nm(ops, sizeof_priv, NULL);
+}
/**
* wiphy_register - register a wiphy with cfg80211
OpenPOWER on IntegriCloud