diff options
author | Javier Cardona <javier@cozybit.com> | 2010-12-16 20:37:49 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-20 14:46:57 -0500 |
commit | c80d545da3f7c0e534ccd4a780f322f80a92cff1 (patch) | |
tree | edd5c51676b4677fc1a0b2fc692ffe97df863f25 /net/wireless/mesh.c | |
parent | 24bdd9f4c9af75b33b438d60381a67626de0128d (diff) |
mac80211: Let userspace enable and configure vendor specific path selection.
Userspace will now be allowed to toggle between the default path
selection algorithm (HWMP, implemented in the kernel), and a vendor
specific alternative. Also in the same patch, allow userspace to add
information elements to mesh beacons. This is accordance with the
Extensible Path Selection Framework specified in version 7.0 of the
802.11s draft.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/mesh.c')
-rw-r--r-- | net/wireless/mesh.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index e0b9747fe50a..73e39c171ffb 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -50,17 +50,19 @@ const struct mesh_config default_mesh_config = { | |||
50 | .min_discovery_timeout = MESH_MIN_DISCOVERY_TIMEOUT, | 50 | .min_discovery_timeout = MESH_MIN_DISCOVERY_TIMEOUT, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | const struct mesh_setup default_mesh_setup = { | ||
54 | .path_sel_proto = IEEE80211_PATH_PROTOCOL_HWMP, | ||
55 | .path_metric = IEEE80211_PATH_METRIC_AIRTIME, | ||
56 | .vendor_ie = NULL, | ||
57 | .vendor_ie_len = 0, | ||
58 | }; | ||
53 | 59 | ||
54 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | 60 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, |
55 | struct net_device *dev, | 61 | struct net_device *dev, |
56 | const u8 *mesh_id, u8 mesh_id_len, | 62 | const struct mesh_setup *setup, |
57 | const struct mesh_config *conf) | 63 | const struct mesh_config *conf) |
58 | { | 64 | { |
59 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 65 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
60 | struct mesh_setup setup = { | ||
61 | .mesh_id = mesh_id, | ||
62 | .mesh_id_len = mesh_id_len, | ||
63 | }; | ||
64 | int err; | 66 | int err; |
65 | 67 | ||
66 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); | 68 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); |
@@ -73,16 +75,16 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
73 | if (wdev->mesh_id_len) | 75 | if (wdev->mesh_id_len) |
74 | return -EALREADY; | 76 | return -EALREADY; |
75 | 77 | ||
76 | if (!mesh_id_len) | 78 | if (!setup->mesh_id_len) |
77 | return -EINVAL; | 79 | return -EINVAL; |
78 | 80 | ||
79 | if (!rdev->ops->join_mesh) | 81 | if (!rdev->ops->join_mesh) |
80 | return -EOPNOTSUPP; | 82 | return -EOPNOTSUPP; |
81 | 83 | ||
82 | err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, &setup); | 84 | err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); |
83 | if (!err) { | 85 | if (!err) { |
84 | memcpy(wdev->ssid, mesh_id, mesh_id_len); | 86 | memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len); |
85 | wdev->mesh_id_len = mesh_id_len; | 87 | wdev->mesh_id_len = setup->mesh_id_len; |
86 | } | 88 | } |
87 | 89 | ||
88 | return err; | 90 | return err; |
@@ -90,14 +92,14 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
90 | 92 | ||
91 | int cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | 93 | int cfg80211_join_mesh(struct cfg80211_registered_device *rdev, |
92 | struct net_device *dev, | 94 | struct net_device *dev, |
93 | const u8 *mesh_id, u8 mesh_id_len, | 95 | const struct mesh_setup *setup, |
94 | const struct mesh_config *conf) | 96 | const struct mesh_config *conf) |
95 | { | 97 | { |
96 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 98 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
97 | int err; | 99 | int err; |
98 | 100 | ||
99 | wdev_lock(wdev); | 101 | wdev_lock(wdev); |
100 | err = __cfg80211_join_mesh(rdev, dev, mesh_id, mesh_id_len, conf); | 102 | err = __cfg80211_join_mesh(rdev, dev, setup, conf); |
101 | wdev_unlock(wdev); | 103 | wdev_unlock(wdev); |
102 | 104 | ||
103 | return err; | 105 | return err; |