diff options
author | Ben Greear <greearb@candelatech.com> | 2014-10-22 12:23:01 -0700 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-10-27 08:48:31 +0100 |
commit | ad28757eef268e609677d0e3d8c0bdadde52a711 (patch) | |
tree | 984c07ef1b79cc56fd0d0628db5759cefa87b45e /include/net/mac80211.h | |
parent | 1998d90ad424c1ff12ea24816ce158d5262e06a5 (diff) | |
download | op-kernel-dev-ad28757eef268e609677d0e3d8c0bdadde52a711.zip op-kernel-dev-ad28757eef268e609677d0e3d8c0bdadde52a711.tar.gz |
mac80211: allow creating wiphy devices with suggested name
Support creating wiphy devices with an optional name.
This will be used by hwsim to have better automated control
over virtual radio creation/deletion.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 2b7426a..bb50e8b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3063,7 +3063,7 @@ struct ieee80211_ops { }; /** - * ieee80211_alloc_hw - Allocate a new hardware device + * ieee80211_alloc_hw_nm - Allocate a new hardware device * * This must be called once for each hardware device. The returned pointer * must be used to refer to this device when calling other functions. @@ -3073,11 +3073,35 @@ struct ieee80211_ops { * * @priv_data_len: length of private data * @ops: callbacks for this device + * @requested_name: Requested name for this device. + * NULL is valid value, and means use the default naming (phy%d) * * Return: A pointer to the new hardware device, or %NULL on error. */ +struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, + const struct ieee80211_ops *ops, + const char *requested_name); + +/** + * ieee80211_alloc_hw - Allocate a new hardware device + * + * This must be called once for each hardware device. The returned pointer + * must be used to refer to this device when calling other functions. + * mac80211 allocates a private data area for the driver pointed to by + * @priv in &struct ieee80211_hw, the size of this area is given as + * @priv_data_len. + * + * @priv_data_len: length of private data + * @ops: callbacks for this device + * + * Return: A pointer to the new hardware device, or %NULL on error. + */ +static inline struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, - const struct ieee80211_ops *ops); + const struct ieee80211_ops *ops) +{ + return ieee80211_alloc_hw_nm(priv_data_len, ops, NULL); +} /** * ieee80211_register_hw - Register hardware device |