461-driver_nl80211-use-new-parameters-during-ibss-join.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001
  2. From: Antonio Quartulli <ordex@autistici.org>
  3. Date: Sun, 3 Jun 2012 18:42:25 +0200
  4. Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join
  5. Signed-hostap: Antonio Quartulli <ordex@autistici.org>
  6. ---
  7. src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++-
  8. 1 file changed, 32 insertions(+), 1 deletion(-)
  9. --- a/src/drivers/driver_nl80211.c
  10. +++ b/src/drivers/driver_nl80211.c
  11. @@ -4962,7 +4962,7 @@ static int wpa_driver_nl80211_ibss(struc
  12. struct wpa_driver_associate_params *params)
  13. {
  14. struct nl_msg *msg;
  15. - int ret = -1;
  16. + int ret = -1, i;
  17. int count = 0;
  18. wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
  19. @@ -4989,6 +4989,37 @@ retry:
  20. nl80211_put_beacon_int(msg, params->beacon_int))
  21. goto fail;
  22. + if (params->fixed_freq) {
  23. + wpa_printf(MSG_DEBUG, " * fixed_freq");
  24. + nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED);
  25. + }
  26. +
  27. + if (params->beacon_int > 0) {
  28. + wpa_printf(MSG_DEBUG, " * beacon_int=%d",
  29. + params->beacon_int);
  30. + nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL,
  31. + params->beacon_int);
  32. + }
  33. +
  34. + if (params->rates[0] > 0) {
  35. + wpa_printf(MSG_DEBUG, " * basic_rates:");
  36. + i = 0;
  37. + while (i < NL80211_MAX_SUPP_RATES &&
  38. + params->rates[i] > 0) {
  39. + wpa_printf(MSG_DEBUG, " %.1f",
  40. + (double)params->rates[i] / 2);
  41. + i++;
  42. + }
  43. + nla_put(msg, NL80211_ATTR_BSS_BASIC_RATES, i,
  44. + params->rates);
  45. + }
  46. +
  47. + if (params->mcast_rate > 0) {
  48. + wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f",
  49. + (double)params->mcast_rate / 10);
  50. + nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
  51. + }
  52. +
  53. ret = nl80211_set_conn_keys(params, msg);
  54. if (ret)
  55. goto fail;