aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAyala Beker <ayala.beker@intel.com>2016-09-20 10:31:16 -0400
committerJohannes Berg <johannes.berg@intel.com>2016-09-30 07:21:28 -0400
commita5a9dcf291e1e541243878eed2d73a74006fa1f1 (patch)
tree74662fbcd9476c6fc296d16247c281a310614463 /include
parenta442b761b24b6886f9a4e2ff5f8cb4824c96526b (diff)
cfg80211: allow the user space to change current NAN configuration
Some NAN configuration paramaters may change during the operation of the NAN device. For example, a user may want to update master preference value when the device gets plugged/unplugged to the power. Add API that allows to do so. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h19
-rw-r--r--include/uapi/linux/nl80211.h11
2 files changed, 28 insertions, 2 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2f35ccf6da83..8574a57e19ba 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2327,6 +2327,18 @@ struct cfg80211_nan_conf {
2327}; 2327};
2328 2328
2329/** 2329/**
2330 * enum cfg80211_nan_conf_changes - indicates changed fields in NAN
2331 * configuration
2332 *
2333 * @CFG80211_NAN_CONF_CHANGED_PREF: master preference
2334 * @CFG80211_NAN_CONF_CHANGED_DUAL: dual band operation
2335 */
2336enum cfg80211_nan_conf_changes {
2337 CFG80211_NAN_CONF_CHANGED_PREF = BIT(0),
2338 CFG80211_NAN_CONF_CHANGED_DUAL = BIT(1),
2339};
2340
2341/**
2330 * struct cfg80211_nan_func_filter - a NAN function Rx / Tx filter 2342 * struct cfg80211_nan_func_filter - a NAN function Rx / Tx filter
2331 * 2343 *
2332 * @filter: the content of the filter 2344 * @filter: the content of the filter
@@ -2691,6 +2703,9 @@ struct cfg80211_nan_func {
2691 * On success the driver should assign an instance_id in the 2703 * On success the driver should assign an instance_id in the
2692 * provided @nan_func. 2704 * provided @nan_func.
2693 * @del_nan_func: Delete a NAN function. 2705 * @del_nan_func: Delete a NAN function.
2706 * @nan_change_conf: changes NAN configuration. The changed parameters must
2707 * be specified in @changes (using &enum cfg80211_nan_conf_changes);
2708 * All other parameters must be ignored.
2694 */ 2709 */
2695struct cfg80211_ops { 2710struct cfg80211_ops {
2696 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2711 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2963,6 +2978,10 @@ struct cfg80211_ops {
2963 struct cfg80211_nan_func *nan_func); 2978 struct cfg80211_nan_func *nan_func);
2964 void (*del_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev, 2979 void (*del_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
2965 u64 cookie); 2980 u64 cookie);
2981 int (*nan_change_conf)(struct wiphy *wiphy,
2982 struct wireless_dev *wdev,
2983 struct cfg80211_nan_conf *conf,
2984 u32 changes);
2966}; 2985};
2967 2986
2968/* 2987/*
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index e4935d963061..9c9c0c352873 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -862,6 +862,10 @@
862 * the response to this command. 862 * the response to this command.
863 * Look at %NL80211_ATTR_SOCKET_OWNER as well. 863 * Look at %NL80211_ATTR_SOCKET_OWNER as well.
864 * @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie. 864 * @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie.
865 * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN
866 * must be operational (%NL80211_CMD_START_NAN was executed).
867 * It must contain at least one of the following attributes:
868 * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL.
865 * 869 *
866 * @NL80211_CMD_MAX: highest used command number 870 * @NL80211_CMD_MAX: highest used command number
867 * @__NL80211_CMD_AFTER_LAST: internal use 871 * @__NL80211_CMD_AFTER_LAST: internal use
@@ -1055,6 +1059,7 @@ enum nl80211_commands {
1055 NL80211_CMD_STOP_NAN, 1059 NL80211_CMD_STOP_NAN,
1056 NL80211_CMD_ADD_NAN_FUNCTION, 1060 NL80211_CMD_ADD_NAN_FUNCTION,
1057 NL80211_CMD_DEL_NAN_FUNCTION, 1061 NL80211_CMD_DEL_NAN_FUNCTION,
1062 NL80211_CMD_CHANGE_NAN_CONFIG,
1058 1063
1059 /* add new commands above here */ 1064 /* add new commands above here */
1060 1065
@@ -1910,12 +1915,14 @@ enum nl80211_commands {
1910 * used to pull the stored data for mesh peer in power save state. 1915 * used to pull the stored data for mesh peer in power save state.
1911 * 1916 *
1912 * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by 1917 * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
1913 * %NL80211_CMD_START_NAN. Its type is u8 and it can't be 0. 1918 * %NL80211_CMD_START_NAN and optionally with
1919 * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0.
1914 * Also, values 1 and 255 are reserved for certification purposes and 1920 * Also, values 1 and 255 are reserved for certification purposes and
1915 * should not be used during a normal device operation. 1921 * should not be used during a normal device operation.
1916 * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see 1922 * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see
1917 * &enum nl80211_nan_dual_band_conf). This attribute is used with 1923 * &enum nl80211_nan_dual_band_conf). This attribute is used with
1918 * %NL80211_CMD_START_NAN. 1924 * %NL80211_CMD_START_NAN and optionally with
1925 * %NL80211_CMD_CHANGE_NAN_CONFIG.
1919 * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See 1926 * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See
1920 * &enum nl80211_nan_func_attributes for description of this nested 1927 * &enum nl80211_nan_func_attributes for description of this nested
1921 * attribute. 1928 * attribute.