004-mesh-use-setup-completion-callback-to-complete-mesh-.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 32044a7bb26858bedaf147c77f49f5cef1133de3 Mon Sep 17 00:00:00 2001
  2. From: Peter Oh <[email protected]>
  3. Date: Tue, 17 Apr 2018 21:55:01 -0700
  4. Subject: [PATCH 04/16] mesh: use setup completion callback to complete mesh
  5. join
  6. mesh join function is the last function to be called during
  7. mesh join process, but it's been called a bit earlier than
  8. it's supposed to be, so that some mesh parameter values
  9. such as VHT capabilities not applied correct when mesh join
  10. is in process. Moreover current design of mesh join that is called
  11. directly after mesh initialization is not suitable for DFS channels
  12. to use, since mesh join process should be paused until DFS CAC is
  13. done and resumed once it's done.
  14. Using setup completion callback is how AP mode is using for DFS channels
  15. and mesh can use the same way.
  16. The callback will be called by hostapd_setup_interface_complete_sync.
  17. Signed-off-by: Peter Oh <[email protected]>
  18. ---
  19. wpa_supplicant/mesh.c | 7 +++++--
  20. wpa_supplicant/mesh.h | 2 +-
  21. 2 files changed, 6 insertions(+), 3 deletions(-)
  22. --- a/wpa_supplicant/mesh.c
  23. +++ b/wpa_supplicant/mesh.c
  24. @@ -217,6 +217,7 @@ static int wpa_supplicant_mesh_init(stru
  25. if (!ifmsh)
  26. return -ENOMEM;
  27. + ifmsh->owner = wpa_s;
  28. ifmsh->drv_flags = wpa_s->drv_flags;
  29. ifmsh->num_bss = 1;
  30. ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss,
  31. @@ -233,6 +234,8 @@ static int wpa_supplicant_mesh_init(stru
  32. bss->drv_priv = wpa_s->drv_priv;
  33. bss->iface = ifmsh;
  34. bss->mesh_sta_free_cb = mesh_mpm_free_sta;
  35. + bss->setup_complete_cb = wpas_mesh_complete_cb;
  36. + bss->setup_complete_cb_ctx = wpa_s;
  37. frequency = ssid->frequency;
  38. if (frequency != freq->freq &&
  39. frequency == freq->freq + freq->sec_channel_offset * 20) {
  40. @@ -374,8 +377,9 @@ void wpa_supplicant_mesh_add_scan_ie(str
  41. }
  42. -void wpas_join_mesh(struct wpa_supplicant *wpa_s)
  43. +void wpas_mesh_complete_cb(void *ctx)
  44. {
  45. + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)ctx;
  46. struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
  47. struct wpa_ssid *ssid = wpa_s->current_ssid;
  48. int ret = 0;
  49. @@ -497,7 +501,6 @@ int wpa_supplicant_join_mesh(struct wpa_
  50. goto out;
  51. }
  52. - wpas_join_mesh(wpa_s);
  53. out:
  54. return ret;
  55. }
  56. --- a/wpa_supplicant/mesh.h
  57. +++ b/wpa_supplicant/mesh.h
  58. @@ -21,7 +21,7 @@ int wpas_mesh_add_interface(struct wpa_s
  59. int wpas_mesh_peer_remove(struct wpa_supplicant *wpa_s, const u8 *addr);
  60. int wpas_mesh_peer_add(struct wpa_supplicant *wpa_s, const u8 *addr,
  61. int duration);
  62. -void wpas_join_mesh(struct wpa_supplicant *wpa_s);
  63. +void wpas_mesh_complete_cb(void *ctx);
  64. int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s);
  65. #ifdef CONFIG_MESH