aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-14 17:27:01 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 10:35:37 -0500
commitf8bacc210408f7a2a182f184a9fa1475b8a67440 (patch)
tree714bcf6b0240c622f9affb6ff7df61b4f9dc87a9 /include
parentc0f3a317f2f0e51ad2f8809c83b137958b385c7f (diff)
cfg80211: clean up mesh plink station change API
Make the ability to leave the plink_state unchanged not use a magic -1 variable that isn't in the enum, but an explicit change flag; reject invalid plink states or actions and move the needed constants for plink actions to the right header file. Also reject plink_state changes for non-mesh interfaces. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h15
-rw-r--r--include/uapi/linux/nl80211.h20
2 files changed, 21 insertions, 14 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d581c6de5d64..9b54574c3df9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -611,22 +611,10 @@ struct cfg80211_ap_settings {
611}; 611};
612 612
613/** 613/**
614 * enum plink_action - actions to perform in mesh peers
615 *
616 * @PLINK_ACTION_INVALID: action 0 is reserved
617 * @PLINK_ACTION_OPEN: start mesh peer link establishment
618 * @PLINK_ACTION_BLOCK: block traffic from this mesh peer
619 */
620enum plink_actions {
621 PLINK_ACTION_INVALID,
622 PLINK_ACTION_OPEN,
623 PLINK_ACTION_BLOCK,
624};
625
626/**
627 * enum station_parameters_apply_mask - station parameter values to apply 614 * enum station_parameters_apply_mask - station parameter values to apply
628 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 615 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
629 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 616 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
617 * @STATION_PARAM_APPLY_PLINK_STATE: apply new plink state
630 * 618 *
631 * Not all station parameters have in-band "no change" signalling, 619 * Not all station parameters have in-band "no change" signalling,
632 * for those that don't these flags will are used. 620 * for those that don't these flags will are used.
@@ -634,6 +622,7 @@ enum plink_actions {
634enum station_parameters_apply_mask { 622enum station_parameters_apply_mask {
635 STATION_PARAM_APPLY_UAPSD = BIT(0), 623 STATION_PARAM_APPLY_UAPSD = BIT(0),
636 STATION_PARAM_APPLY_CAPABILITY = BIT(1), 624 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
625 STATION_PARAM_APPLY_PLINK_STATE = BIT(2),
637}; 626};
638 627
639/** 628/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c46bb016f4e4..7dcc69f73d2c 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -884,7 +884,8 @@ enum nl80211_commands {
884 * consisting of a nested array. 884 * consisting of a nested array.
885 * 885 *
886 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). 886 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
887 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. 887 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
888 * (see &enum nl80211_plink_action).
888 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. 889 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
889 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path 890 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
890 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at 891 * info given for %NL80211_CMD_GET_MPATH, nested attribute described at
@@ -3307,6 +3308,23 @@ enum nl80211_plink_state {
3307 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 3308 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
3308}; 3309};
3309 3310
3311/**
3312 * enum nl80211_plink_action - actions to perform in mesh peers
3313 *
3314 * @NL80211_PLINK_ACTION_NO_ACTION: perform no action
3315 * @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
3316 * @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
3317 * @NUM_NL80211_PLINK_ACTIONS: number of possible actions
3318 */
3319enum plink_actions {
3320 NL80211_PLINK_ACTION_NO_ACTION,
3321 NL80211_PLINK_ACTION_OPEN,
3322 NL80211_PLINK_ACTION_BLOCK,
3323
3324 NUM_NL80211_PLINK_ACTIONS,
3325};
3326
3327
3310#define NL80211_KCK_LEN 16 3328#define NL80211_KCK_LEN 16
3311#define NL80211_KEK_LEN 16 3329#define NL80211_KEK_LEN 16
3312#define NL80211_REPLAY_CTR_LEN 8 3330#define NL80211_REPLAY_CTR_LEN 8