aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-12-03 03:20:44 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-06 16:01:29 -0500
commit29cbe68c516a48a9a88b3226878570c6cbd83c02 (patch)
tree4774f8a3a244236234a521baa4d1ae5b3e1494ba /include
parentbd90fdcc5fbd99a2a778999610420cf793bd1be2 (diff)
cfg80211/mac80211: add mesh join/leave commands
Instead of tying mesh activity to interface up, add join and leave commands for mesh. Since we must be backward compatible, let cfg80211 handle joining a mesh if a mesh ID was pre-configured when the device goes up. Note that this therefore must modify mac80211 as well since mac80211 needs to lose the logic to start the mesh on interface up. We now allow querying mesh parameters before the mesh is connected, which simply returns defaults. Setting them (internally renamed to "update") is only allowed while connected. Specify them with the new mesh join command instead where needed. In mac80211, beaconing must now also follow the mesh enabled/not enabled state, which is done by testing the mesh ID. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h8
-rw-r--r--include/net/cfg80211.h38
2 files changed, 37 insertions, 9 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9e541452d80..410a06ea551 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -394,6 +394,11 @@
394 * 394 *
395 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. 395 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
396 * 396 *
397 * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
398 * mesh config parameters may be given.
399 * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
400 * network is determined by the network interface.
401 *
397 * @NL80211_CMD_MAX: highest used command number 402 * @NL80211_CMD_MAX: highest used command number
398 * @__NL80211_CMD_AFTER_LAST: internal use 403 * @__NL80211_CMD_AFTER_LAST: internal use
399 */ 404 */
@@ -500,6 +505,9 @@ enum nl80211_commands {
500 505
501 NL80211_CMD_FRAME_WAIT_CANCEL, 506 NL80211_CMD_FRAME_WAIT_CANCEL,
502 507
508 NL80211_CMD_JOIN_MESH,
509 NL80211_CMD_LEAVE_MESH,
510
503 /* add new commands above here */ 511 /* add new commands above here */
504 512
505 /* used to define NL80211_CMD_MAX below */ 513 /* used to define NL80211_CMD_MAX below */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 902895dfbd4..788c3989a9e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -258,13 +258,9 @@ struct ieee80211_supported_band {
258 258
259/** 259/**
260 * struct vif_params - describes virtual interface parameters 260 * struct vif_params - describes virtual interface parameters
261 * @mesh_id: mesh ID to use
262 * @mesh_id_len: length of the mesh ID
263 * @use_4addr: use 4-address frames 261 * @use_4addr: use 4-address frames
264 */ 262 */
265struct vif_params { 263struct vif_params {
266 u8 *mesh_id;
267 int mesh_id_len;
268 int use_4addr; 264 int use_4addr;
269}; 265};
270 266
@@ -615,6 +611,11 @@ struct bss_parameters {
615 int ap_isolate; 611 int ap_isolate;
616}; 612};
617 613
614/*
615 * struct mesh_config - 802.11s mesh configuration
616 *
617 * These parameters can be changed while the mesh is active.
618 */
618struct mesh_config { 619struct mesh_config {
619 /* Timeouts in ms */ 620 /* Timeouts in ms */
620 /* Mesh plink management parameters */ 621 /* Mesh plink management parameters */
@@ -638,6 +639,18 @@ struct mesh_config {
638}; 639};
639 640
640/** 641/**
642 * struct mesh_setup - 802.11s mesh setup configuration
643 * @mesh_id: the mesh ID
644 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
645 *
646 * These parameters are fixed when the mesh is created.
647 */
648struct mesh_setup {
649 const u8 *mesh_id;
650 u8 mesh_id_len;
651};
652
653/**
641 * struct ieee80211_txq_params - TX queue parameters 654 * struct ieee80211_txq_params - TX queue parameters
642 * @queue: TX queue identifier (NL80211_TXQ_Q_*) 655 * @queue: TX queue identifier (NL80211_TXQ_Q_*)
643 * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled 656 * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
@@ -1078,7 +1091,7 @@ struct cfg80211_pmksa {
1078 * 1091 *
1079 * @get_mesh_params: Put the current mesh parameters into *params 1092 * @get_mesh_params: Put the current mesh parameters into *params
1080 * 1093 *
1081 * @set_mesh_params: Set mesh parameters. 1094 * @update_mesh_params: Update mesh parameters on a running mesh.
1082 * The mask is a bitfield which tells us which parameters to 1095 * The mask is a bitfield which tells us which parameters to
1083 * set, and which to leave alone. 1096 * set, and which to leave alone.
1084 * 1097 *
@@ -1229,9 +1242,14 @@ struct cfg80211_ops {
1229 int (*get_mesh_params)(struct wiphy *wiphy, 1242 int (*get_mesh_params)(struct wiphy *wiphy,
1230 struct net_device *dev, 1243 struct net_device *dev,
1231 struct mesh_config *conf); 1244 struct mesh_config *conf);
1232 int (*set_mesh_params)(struct wiphy *wiphy, 1245 int (*update_mesh_params)(struct wiphy *wiphy,
1233 struct net_device *dev, 1246 struct net_device *dev, u32 mask,
1234 const struct mesh_config *nconf, u32 mask); 1247 const struct mesh_config *nconf);
1248 int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev,
1249 const struct mesh_config *conf,
1250 const struct mesh_setup *setup);
1251 int (*leave_mesh)(struct wiphy *wiphy, struct net_device *dev);
1252
1235 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 1253 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
1236 struct bss_parameters *params); 1254 struct bss_parameters *params);
1237 1255
@@ -1647,6 +1665,8 @@ struct cfg80211_cached_keys;
1647 * @bssid: (private) Used by the internal configuration code 1665 * @bssid: (private) Used by the internal configuration code
1648 * @ssid: (private) Used by the internal configuration code 1666 * @ssid: (private) Used by the internal configuration code
1649 * @ssid_len: (private) Used by the internal configuration code 1667 * @ssid_len: (private) Used by the internal configuration code
1668 * @mesh_id_len: (private) Used by the internal configuration code
1669 * @mesh_id_up_len: (private) Used by the internal configuration code
1650 * @wext: (private) Used by the internal wireless extensions compat code 1670 * @wext: (private) Used by the internal wireless extensions compat code
1651 * @use_4addr: indicates 4addr mode is used on this interface, must be 1671 * @use_4addr: indicates 4addr mode is used on this interface, must be
1652 * set by driver (if supported) on add_interface BEFORE registering the 1672 * set by driver (if supported) on add_interface BEFORE registering the
@@ -1676,7 +1696,7 @@ struct wireless_dev {
1676 1696
1677 /* currently used for IBSS and SME - might be rearranged later */ 1697 /* currently used for IBSS and SME - might be rearranged later */
1678 u8 ssid[IEEE80211_MAX_SSID_LEN]; 1698 u8 ssid[IEEE80211_MAX_SSID_LEN];
1679 u8 ssid_len; 1699 u8 ssid_len, mesh_id_len, mesh_id_up_len;
1680 enum { 1700 enum {
1681 CFG80211_SME_IDLE, 1701 CFG80211_SME_IDLE,
1682 CFG80211_SME_CONNECTING, 1702 CFG80211_SME_CONNECTING,