315-mac80211-fix-ibss-scan-parameters.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From: Sara Sharon <sara.sharon@intel.com>
  2. Date: Mon, 25 Jan 2016 15:46:35 +0200
  3. Subject: [PATCH] mac80211: fix ibss scan parameters
  4. When joining IBSS a full scan should be initiated in order to search
  5. for existing cell, unless the fixed_channel parameter was set.
  6. A default channel to create the IBSS on if no cell was found is
  7. provided as well.
  8. However - a scan is initiated only on the default channel provided
  9. regardless of whether ifibss->fixed_channel is set or not, with the
  10. obvious result of the cell not joining existing IBSS cell that is
  11. on another channel.
  12. Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request")
  13. Signed-off-by: Sara Sharon <sara.sharon@intel.com>
  14. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  15. ---
  16. --- a/net/mac80211/ibss.c
  17. +++ b/net/mac80211/ibss.c
  18. @@ -7,6 +7,7 @@
  19. * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  20. * Copyright 2009, Johannes Berg <johannes@sipsolutions.net>
  21. * Copyright 2013-2014 Intel Mobile Communications GmbH
  22. + * Copyright(c) 2016 Intel Deutschland GmbH
  23. *
  24. * This program is free software; you can redistribute it and/or modify
  25. * it under the terms of the GNU General Public License version 2 as
  26. @@ -1483,14 +1484,21 @@ static void ieee80211_sta_find_ibss(stru
  27. sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
  28. - num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy,
  29. - &ifibss->chandef,
  30. - channels,
  31. - ARRAY_SIZE(channels));
  32. scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef);
  33. - ieee80211_request_ibss_scan(sdata, ifibss->ssid,
  34. - ifibss->ssid_len, channels, num,
  35. - scan_width);
  36. +
  37. + if (ifibss->fixed_channel) {
  38. + num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy,
  39. + &ifibss->chandef,
  40. + channels,
  41. + ARRAY_SIZE(channels));
  42. + ieee80211_request_ibss_scan(sdata, ifibss->ssid,
  43. + ifibss->ssid_len, channels,
  44. + num, scan_width);
  45. + } else {
  46. + ieee80211_request_ibss_scan(sdata, ifibss->ssid,
  47. + ifibss->ssid_len, NULL,
  48. + 0, scan_width);
  49. + }
  50. } else {
  51. int interval = IEEE80211_SCAN_INTERVAL;