0042-hostapd-prevent-channel-switch-for-5GHz.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Mon, 27 Jul 2015 20:42:50 +0200
  3. Subject: hostapd: prevent channel switch for 5GHz
  4. hostapd would switch the primary and secondary channel on 5GHz networks in
  5. certain circumstances, completely breaking the adhoc interfaces of the WLAN
  6. adapter (they would lose their configuration).
  7. As a temporary fix, disable this channel switch function.
  8. diff --git a/package/network/services/hostapd/patches/472-no_channel_switch.patch b/package/network/services/hostapd/patches/472-no_channel_switch.patch
  9. new file mode 100644
  10. index 0000000..046969b
  11. --- /dev/null
  12. +++ b/package/network/services/hostapd/patches/472-no_channel_switch.patch
  13. @@ -0,0 +1,61 @@
  14. +--- a/src/ap/hw_features.c
  15. ++++ b/src/ap/hw_features.c
  16. +@@ -339,58 +339,6 @@ static int ieee80211n_check_40mhz_5g(str
  17. + else
  18. + sec_freq = pri_freq - 20;
  19. +
  20. +- /*
  21. +- * Switch PRI/SEC channels if Beacons were detected on selected SEC
  22. +- * channel, but not on selected PRI channel.
  23. +- */
  24. +- pri_bss = sec_bss = 0;
  25. +- for (i = 0; i < scan_res->num; i++) {
  26. +- struct wpa_scan_res *bss = scan_res->res[i];
  27. +- if (bss->freq == pri_freq)
  28. +- pri_bss++;
  29. +- else if (bss->freq == sec_freq)
  30. +- sec_bss++;
  31. +- }
  32. +- if (sec_bss && !pri_bss) {
  33. +- wpa_printf(MSG_INFO, "Switch own primary and secondary "
  34. +- "channel to get secondary channel with no Beacons "
  35. +- "from other BSSes");
  36. +- ieee80211n_switch_pri_sec(iface);
  37. +- return 1;
  38. +- }
  39. +-
  40. +- /*
  41. +- * Match PRI/SEC channel with any existing HT40 BSS on the same
  42. +- * channels that we are about to use (if already mixed order in
  43. +- * existing BSSes, use own preference).
  44. +- */
  45. +- match = 0;
  46. +- for (i = 0; i < scan_res->num; i++) {
  47. +- struct wpa_scan_res *bss = scan_res->res[i];
  48. +- ieee80211n_get_pri_sec_chan(bss, &bss_pri_chan, &bss_sec_chan);
  49. +- if (pri_chan == bss_pri_chan &&
  50. +- sec_chan == bss_sec_chan) {
  51. +- match = 1;
  52. +- break;
  53. +- }
  54. +- }
  55. +- if (!match) {
  56. +- for (i = 0; i < scan_res->num; i++) {
  57. +- struct wpa_scan_res *bss = scan_res->res[i];
  58. +- ieee80211n_get_pri_sec_chan(bss, &bss_pri_chan,
  59. +- &bss_sec_chan);
  60. +- if (pri_chan == bss_sec_chan &&
  61. +- sec_chan == bss_pri_chan) {
  62. +- wpa_printf(MSG_INFO, "Switch own primary and "
  63. +- "secondary channel due to BSS "
  64. +- "overlap with " MACSTR,
  65. +- MAC2STR(bss->bssid));
  66. +- ieee80211n_switch_pri_sec(iface);
  67. +- break;
  68. +- }
  69. +- }
  70. +- }
  71. +-
  72. + return 1;
  73. + }
  74. +