1 From 8a4ebbb6bbbc1460c1d584d1a710bf1361797ffd Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Thu, 12 Apr 2018 02:49:01 -0700
4 Subject: [PATCH 04/15] mesh: use setup completion callback to complete mesh
7 mesh join function is the last function to be called during
8 mesh join process, but it's been called a bit earlier than
9 it's supposed to be, so that some mesh parameter values
10 such as VHT capabilities not applied correct when mesh join
11 is in process. Moreover current design of mesh join that is called
12 directly after mesh initialization is not suitable for DFS channels
13 to use, since mesh join process should be paused until DFS CAC is
14 done and resumed once it's done.
15 Using setup completion callback is how AP mode is using for DFS channels
16 and mesh can use the same way.
17 The callback will be called by hostapd_setup_interface_complete_sync.
19 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
21 wpa_supplicant/mesh.c | 7 +++++--
22 wpa_supplicant/mesh.h | 2 +-
23 2 files changed, 6 insertions(+), 3 deletions(-)
25 --- a/wpa_supplicant/mesh.c
26 +++ b/wpa_supplicant/mesh.c
27 @@ -215,6 +215,7 @@ static int wpa_supplicant_mesh_init(stru
31 + ifmsh->owner = wpa_s;
32 ifmsh->drv_flags = wpa_s->drv_flags;
34 ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
35 @@ -231,6 +232,8 @@ static int wpa_supplicant_mesh_init(stru
36 bss->drv_priv = wpa_s->drv_priv;
38 bss->mesh_sta_free_cb = mesh_mpm_free_sta;
39 + bss->setup_complete_cb = wpas_mesh_complete_cb;
40 + bss->setup_complete_cb_ctx = wpa_s;
41 frequency = ssid->frequency;
42 if (frequency != freq->freq &&
43 frequency == freq->freq + freq->sec_channel_offset * 20) {
44 @@ -372,8 +375,9 @@ void wpa_supplicant_mesh_add_scan_ie(str
48 -void wpas_join_mesh(struct wpa_supplicant *wpa_s)
49 +void wpas_mesh_complete_cb(void *ctx)
51 + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)ctx;
52 struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
53 struct wpa_ssid *ssid = wpa_s->current_ssid;
55 @@ -495,7 +499,6 @@ int wpa_supplicant_join_mesh(struct wpa_
59 - wpas_join_mesh(wpa_s);
63 --- a/wpa_supplicant/mesh.h
64 +++ b/wpa_supplicant/mesh.h
65 @@ -21,7 +21,7 @@ int wpas_mesh_add_interface(struct wpa_s
66 int wpas_mesh_peer_remove(struct wpa_supplicant *wpa_s, const u8 *addr);
67 int wpas_mesh_peer_add(struct wpa_supplicant *wpa_s, const u8 *addr,
69 -void wpas_join_mesh(struct wpa_supplicant *wpa_s);
70 +void wpas_mesh_complete_cb(void *ctx);
71 int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s);