300-noscan.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --- a/hostapd/config_file.c
  2. +++ b/hostapd/config_file.c
  3. @@ -2953,6 +2953,10 @@ static int hostapd_config_fill(struct ho
  4. }
  5. #endif /* CONFIG_IEEE80211W */
  6. #ifdef CONFIG_IEEE80211N
  7. + } else if (os_strcmp(buf, "noscan") == 0) {
  8. + conf->noscan = atoi(pos);
  9. + } else if (os_strcmp(buf, "ht_coex") == 0) {
  10. + conf->no_ht_coex = !atoi(pos);
  11. } else if (os_strcmp(buf, "ieee80211n") == 0) {
  12. conf->ieee80211n = atoi(pos);
  13. } else if (os_strcmp(buf, "ht_capab") == 0) {
  14. --- a/src/ap/ap_config.h
  15. +++ b/src/ap/ap_config.h
  16. @@ -681,6 +681,8 @@ struct hostapd_config {
  17. int ht_op_mode_fixed;
  18. u16 ht_capab;
  19. + int noscan;
  20. + int no_ht_coex;
  21. int ieee80211n;
  22. int secondary_channel;
  23. int no_pri_sec_switch;
  24. --- a/src/ap/hw_features.c
  25. +++ b/src/ap/hw_features.c
  26. @@ -474,7 +474,8 @@ static int ieee80211n_check_40mhz(struct
  27. int ret;
  28. /* Check that HT40 is used and PRI / SEC switch is allowed */
  29. - if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch)
  30. + if (!iface->conf->secondary_channel || iface->conf->no_pri_sec_switch ||
  31. + iface->conf->noscan)
  32. return 0;
  33. hostapd_set_state(iface, HAPD_IFACE_HT_SCAN);
  34. --- a/src/ap/ieee802_11_ht.c
  35. +++ b/src/ap/ieee802_11_ht.c
  36. @@ -244,6 +244,9 @@ void hostapd_2040_coex_action(struct hos
  37. if (!(iface->conf->ht_capab & HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET))
  38. return;
  39. + if (iface->conf->noscan || iface->conf->no_ht_coex)
  40. + return;
  41. +
  42. if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie))
  43. return;
  44. @@ -368,6 +371,9 @@ void ht40_intolerant_add(struct hostapd_
  45. if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G)
  46. return;
  47. + if (iface->conf->noscan || iface->conf->no_ht_coex)
  48. + return;
  49. +
  50. wpa_printf(MSG_INFO, "HT: Forty MHz Intolerant is set by STA " MACSTR
  51. " in Association Request", MAC2STR(sta->addr));