016-mesh-fix-channel-switch-error-during-CAC.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From fa9d565fe8841b288f29137c23a7ab2584dd9510 Mon Sep 17 00:00:00 2001
  2. From: Peter Oh <[email protected]>
  3. Date: Tue, 29 May 2018 14:39:20 -0700
  4. Subject: [PATCH 16/18] mesh: fix channel switch error during CAC
  5. Mesh interface has used its channel parameters that configured
  6. during its initialization even after channel switched due to
  7. DFS radar detection during CAC which caused channel switch error.
  8. This change fixes the error by updating its channel parameters
  9. when channel's been changed from initial one.
  10. Signed-off-by: Peter Oh <[email protected]>
  11. Signed-off-by: Daniel Golle <[email protected]>
  12. [[email protected]: added hw_features_common.h include]
  13. ---
  14. wpa_supplicant/mesh.c | 25 +++++++++++++++++++++++++
  15. 1 file changed, 25 insertions(+)
  16. --- a/wpa_supplicant/mesh.c
  17. +++ b/wpa_supplicant/mesh.c
  18. @@ -11,6 +11,7 @@
  19. #include "utils/common.h"
  20. #include "utils/eloop.h"
  21. #include "utils/uuid.h"
  22. +#include "common/hw_features_common.h"
  23. #include "common/ieee802_11_defs.h"
  24. #include "common/wpa_ctrl.h"
  25. #include "ap/sta_info.h"
  26. @@ -394,10 +395,35 @@ void wpa_supplicant_mesh_add_scan_ie(str
  27. void wpas_mesh_complete_cb(void *ctx)
  28. {
  29. struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)ctx;
  30. + struct hostapd_iface *ifmsh = wpa_s->ifmsh;
  31. struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
  32. struct wpa_ssid *ssid = wpa_s->current_ssid;
  33. int ret = 0;
  34. + /*
  35. + * inspect if channel's been changed since initialized.
  36. + * i.e. DFS radar detection
  37. + */
  38. + if (ifmsh->freq != params->freq.freq) {
  39. + wpa_s->assoc_freq = ifmsh->freq;
  40. + ssid->frequency = ifmsh->freq;
  41. + if (hostapd_set_freq_params(&params->freq,
  42. + ifmsh->conf->hw_mode,
  43. + ifmsh->freq,
  44. + ifmsh->conf->channel,
  45. + ifmsh->conf->ieee80211n,
  46. + ifmsh->conf->ieee80211ac,
  47. + ifmsh->conf->secondary_channel,
  48. + ifmsh->conf->vht_oper_chwidth,
  49. + ifmsh->conf->vht_oper_centr_freq_seg0_idx,
  50. + ifmsh->conf->vht_oper_centr_freq_seg1_idx,
  51. + ifmsh->conf->vht_capab)) {
  52. + wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
  53. + wpa_supplicant_mesh_deinit(wpa_s);
  54. + return;
  55. + }
  56. + }
  57. +
  58. if (wpas_mesh_init_rsn(wpa_s)) {
  59. wpa_printf(MSG_ERROR, "Init RSN failed. Deinit mesh...");
  60. wpa_supplicant_mesh_deinit(wpa_s);