Commit 3491707a070c1183c709516b2f876f798c7a9a84
Committed by
John W. Linville
1 parent
ac9d1a7bef
Exists in
master
and in
7 other branches
mac80211: update meshconf IE
This updates the Mesh Configuration IE according to the latest draft (3.03). Notable changes include the simplified protocol IDs. Signed-off-by: Rui Paulo <rpaulo@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Reviewed-by: Andrey Yurovsky <andrey@cozybit.com> Tested-by: Brian Cavagnolo <brian@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 3 changed files with 35 additions and 46 deletions Side-by-side Diff
include/linux/ieee80211.h
... | ... | @@ -115,7 +115,7 @@ |
115 | 115 | #define IEEE80211_MAX_SSID_LEN 32 |
116 | 116 | |
117 | 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
118 | -#define IEEE80211_MESH_CONFIG_LEN 24 | |
118 | +#define IEEE80211_MESH_CONFIG_LEN 7 | |
119 | 119 | |
120 | 120 | #define IEEE80211_QOS_CTL_LEN 2 |
121 | 121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
net/mac80211/ieee80211_i.h
... | ... | @@ -361,15 +361,15 @@ |
361 | 361 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; |
362 | 362 | size_t mesh_id_len; |
363 | 363 | /* Active Path Selection Protocol Identifier */ |
364 | - u8 mesh_pp_id[4]; | |
364 | + u8 mesh_pp_id; | |
365 | 365 | /* Active Path Selection Metric Identifier */ |
366 | - u8 mesh_pm_id[4]; | |
366 | + u8 mesh_pm_id; | |
367 | 367 | /* Congestion Control Mode Identifier */ |
368 | - u8 mesh_cc_id[4]; | |
368 | + u8 mesh_cc_id; | |
369 | 369 | /* Synchronization Protocol Identifier */ |
370 | - u8 mesh_sp_id[4]; | |
370 | + u8 mesh_sp_id; | |
371 | 371 | /* Authentication Protocol Identifier */ |
372 | - u8 mesh_auth_id[4]; | |
372 | + u8 mesh_auth_id; | |
373 | 373 | /* Local mesh Destination Sequence Number */ |
374 | 374 | u32 dsn; |
375 | 375 | /* Last used PREQ ID */ |
net/mac80211/mesh.c
... | ... | @@ -15,14 +15,14 @@ |
15 | 15 | #define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ) |
16 | 16 | #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) |
17 | 17 | |
18 | -#define PP_OFFSET 1 /* Path Selection Protocol */ | |
19 | -#define PM_OFFSET 5 /* Path Selection Metric */ | |
20 | -#define CC_OFFSET 9 /* Congestion Control Mode */ | |
21 | -#define SP_OFFSET 13 /* Synchronization Protocol */ | |
22 | -#define AUTH_OFFSET 17 /* Authentication Protocol */ | |
23 | -#define CAPAB_OFFSET 22 | |
24 | -#define CAPAB_ACCEPT_PLINKS 0x80 | |
25 | -#define CAPAB_FORWARDING 0x10 | |
18 | +#define MESHCONF_PP_OFFSET 0 /* Path Selection Protocol */ | |
19 | +#define MESHCONF_PM_OFFSET 1 /* Path Selection Metric */ | |
20 | +#define MESHCONF_CC_OFFSET 2 /* Congestion Control Mode */ | |
21 | +#define MESHCONF_SP_OFFSET 3 /* Synchronization Protocol */ | |
22 | +#define MESHCONF_AUTH_OFFSET 4 /* Authentication Protocol */ | |
23 | +#define MESHCONF_CAPAB_OFFSET 6 | |
24 | +#define MESHCONF_CAPAB_ACCEPT_PLINKS 0x01 | |
25 | +#define MESHCONF_CAPAB_FORWARDING 0x08 | |
26 | 26 | |
27 | 27 | #define TMR_RUNNING_HK 0 |
28 | 28 | #define TMR_RUNNING_MP 1 |
... | ... | @@ -85,11 +85,12 @@ |
85 | 85 | */ |
86 | 86 | if (ifmsh->mesh_id_len == ie->mesh_id_len && |
87 | 87 | memcmp(ifmsh->mesh_id, ie->mesh_id, ie->mesh_id_len) == 0 && |
88 | - memcmp(ifmsh->mesh_pp_id, ie->mesh_config + PP_OFFSET, 4) == 0 && | |
89 | - memcmp(ifmsh->mesh_pm_id, ie->mesh_config + PM_OFFSET, 4) == 0 && | |
90 | - memcmp(ifmsh->mesh_cc_id, ie->mesh_config + CC_OFFSET, 4) == 0 && | |
91 | - memcmp(ifmsh->mesh_sp_id, ie->mesh_config + SP_OFFSET, 4) == 0 && | |
92 | - memcmp(ifmsh->mesh_auth_id, ie->mesh_config + AUTH_OFFSET, 4) == 0) | |
88 | + (ifmsh->mesh_pp_id == *(ie->mesh_config + MESHCONF_PP_OFFSET))&& | |
89 | + (ifmsh->mesh_pm_id == *(ie->mesh_config + MESHCONF_PM_OFFSET))&& | |
90 | + (ifmsh->mesh_cc_id == *(ie->mesh_config + MESHCONF_CC_OFFSET))&& | |
91 | + (ifmsh->mesh_sp_id == *(ie->mesh_config + MESHCONF_SP_OFFSET))&& | |
92 | + (ifmsh->mesh_auth_id == *(ie->mesh_config + | |
93 | + MESHCONF_AUTH_OFFSET))) | |
93 | 94 | return true; |
94 | 95 | |
95 | 96 | return false; |
... | ... | @@ -102,7 +103,8 @@ |
102 | 103 | */ |
103 | 104 | bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie) |
104 | 105 | { |
105 | - return (*(ie->mesh_config + CAPAB_OFFSET) & CAPAB_ACCEPT_PLINKS) != 0; | |
106 | + return (*(ie->mesh_config + MESHCONF_CAPAB_OFFSET) & | |
107 | + MESHCONF_CAPAB_ACCEPT_PLINKS) != 0; | |
106 | 108 | } |
107 | 109 | |
108 | 110 | /** |
... | ... | @@ -128,18 +130,11 @@ |
128 | 130 | |
129 | 131 | void mesh_ids_set_default(struct ieee80211_if_mesh *sta) |
130 | 132 | { |
131 | - u8 oui[3] = {0x00, 0x0F, 0xAC}; | |
132 | - | |
133 | - memcpy(sta->mesh_pp_id, oui, sizeof(oui)); | |
134 | - memcpy(sta->mesh_pm_id, oui, sizeof(oui)); | |
135 | - memcpy(sta->mesh_cc_id, oui, sizeof(oui)); | |
136 | - memcpy(sta->mesh_sp_id, oui, sizeof(oui)); | |
137 | - memcpy(sta->mesh_auth_id, oui, sizeof(oui)); | |
138 | - sta->mesh_pp_id[sizeof(oui)] = 0; | |
139 | - sta->mesh_pm_id[sizeof(oui)] = 0; | |
140 | - sta->mesh_cc_id[sizeof(oui)] = 0xff; | |
141 | - sta->mesh_sp_id[sizeof(oui)] = 0xff; | |
142 | - sta->mesh_auth_id[sizeof(oui)] = 0x0; | |
133 | + sta->mesh_pp_id = 0; /* HWMP */ | |
134 | + sta->mesh_pm_id = 0; /* Airtime */ | |
135 | + sta->mesh_cc_id = 0; /* Disabled */ | |
136 | + sta->mesh_sp_id = 0; /* Neighbor Offset */ | |
137 | + sta->mesh_auth_id = 0; /* Disabled */ | |
143 | 138 | } |
144 | 139 | |
145 | 140 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata) |
146 | 141 | |
147 | 142 | |
148 | 143 | |
149 | 144 | |
150 | 145 | |
... | ... | @@ -260,28 +255,21 @@ |
260 | 255 | pos = skb_put(skb, 2 + IEEE80211_MESH_CONFIG_LEN); |
261 | 256 | *pos++ = WLAN_EID_MESH_CONFIG; |
262 | 257 | *pos++ = IEEE80211_MESH_CONFIG_LEN; |
263 | - /* Version */ | |
264 | - *pos++ = 1; | |
265 | 258 | |
266 | 259 | /* Active path selection protocol ID */ |
267 | - memcpy(pos, sdata->u.mesh.mesh_pp_id, 4); | |
268 | - pos += 4; | |
260 | + *pos++ = sdata->u.mesh.mesh_pp_id; | |
269 | 261 | |
270 | 262 | /* Active path selection metric ID */ |
271 | - memcpy(pos, sdata->u.mesh.mesh_pm_id, 4); | |
272 | - pos += 4; | |
263 | + *pos++ = sdata->u.mesh.mesh_pm_id; | |
273 | 264 | |
274 | 265 | /* Congestion control mode identifier */ |
275 | - memcpy(pos, sdata->u.mesh.mesh_cc_id, 4); | |
276 | - pos += 4; | |
266 | + *pos++ = sdata->u.mesh.mesh_cc_id; | |
277 | 267 | |
278 | 268 | /* Synchronization protocol identifier */ |
279 | - memcpy(pos, sdata->u.mesh.mesh_sp_id, 4); | |
280 | - pos += 4; | |
269 | + *pos++ = sdata->u.mesh.mesh_sp_id; | |
281 | 270 | |
282 | 271 | /* Authentication Protocol identifier */ |
283 | - memcpy(pos, sdata->u.mesh.mesh_auth_id, 4); | |
284 | - pos += 4; | |
272 | + *pos++ = sdata->u.mesh.mesh_auth_id; | |
285 | 273 | |
286 | 274 | /* Mesh Formation Info */ |
287 | 275 | memset(pos, 0x00, 1); |
... | ... | @@ -289,8 +277,9 @@ |
289 | 277 | |
290 | 278 | /* Mesh capability */ |
291 | 279 | sdata->u.mesh.accepting_plinks = mesh_plink_availables(sdata); |
292 | - *pos = CAPAB_FORWARDING; | |
293 | - *pos++ |= sdata->u.mesh.accepting_plinks ? CAPAB_ACCEPT_PLINKS : 0x00; | |
280 | + *pos = MESHCONF_CAPAB_FORWARDING; | |
281 | + *pos++ |= sdata->u.mesh.accepting_plinks ? | |
282 | + MESHCONF_CAPAB_ACCEPT_PLINKS : 0x00; | |
294 | 283 | *pos++ = 0x00; |
295 | 284 | |
296 | 285 | return; |