463-add-mcast_rate-to-11s.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From: Sven Eckelmann <sven.eckelmann@openmesh.com>
  2. Date: Thu, 11 May 2017 08:21:45 +0200
  3. Subject: [PATCH] set mcast_rate in mesh mode
  4. The wpa_supplicant code for IBSS allows to set the mcast rate. It is
  5. recommended to increase this value from 1 or 6 Mbit/s to something higher
  6. when using a mesh protocol on top which uses the multicast packet loss as
  7. indicator for the link quality.
  8. This setting was unfortunately not applied for mesh mode. But it would be
  9. beneficial when wpa_supplicant would behave similar to IBSS mode and set
  10. this argument during mesh join like authsae already does. At least it is
  11. helpful for companies/projects which are currently switching to 802.11s
  12. (without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS
  13. because newer drivers seem to support 802.11s but not IBSS anymore.
  14. Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
  15. Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
  16. --- a/src/drivers/driver.h
  17. +++ b/src/drivers/driver.h
  18. @@ -1426,6 +1426,7 @@ struct wpa_driver_mesh_join_params {
  19. #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004
  20. #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008
  21. unsigned int flags;
  22. + int mcast_rate;
  23. };
  24. /**
  25. --- a/src/drivers/driver_nl80211.c
  26. +++ b/src/drivers/driver_nl80211.c
  27. @@ -8997,6 +8997,18 @@ static int nl80211_put_mesh_id(struct nl
  28. }
  29. +static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate)
  30. +{
  31. + if (mcast_rate > 0) {
  32. + wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
  33. + (double)mcast_rate / 10);
  34. + return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate);
  35. + }
  36. +
  37. + return 0;
  38. +}
  39. +
  40. +
  41. static int nl80211_put_mesh_config(struct nl_msg *msg,
  42. struct wpa_driver_mesh_bss_params *params)
  43. {
  44. @@ -9055,6 +9067,7 @@ static int nl80211_join_mesh(struct i802
  45. nl80211_put_basic_rates(msg, params->basic_rates) ||
  46. nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
  47. nl80211_put_beacon_int(msg, params->beacon_int) ||
  48. + nl80211_put_mcast_rate(msg, params->mcast_rate) ||
  49. nl80211_put_dtim_period(msg, params->dtim_period))
  50. goto fail;
  51. --- a/wpa_supplicant/mesh.c
  52. +++ b/wpa_supplicant/mesh.c
  53. @@ -379,6 +379,7 @@ int wpa_supplicant_join_mesh(struct wpa_
  54. os_memset(&params, 0, sizeof(params));
  55. params.meshid = ssid->ssid;
  56. params.meshid_len = ssid->ssid_len;
  57. + params.mcast_rate = ssid->mcast_rate;
  58. ibss_mesh_setup_freq(wpa_s, ssid, &params.freq);
  59. wpa_s->mesh_ht_enabled = !!params.freq.ht_enabled;
  60. wpa_s->mesh_vht_enabled = !!params.freq.vht_enabled;