470-survey_data_fallback.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --- a/src/ap/acs.c
  2. +++ b/src/ap/acs.c
  3. @@ -292,18 +292,12 @@ static void acs_fail(struct hostapd_ifac
  4. static long double
  5. acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
  6. {
  7. - long double factor, busy, total;
  8. + long double factor, busy = 0, total;
  9. if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
  10. busy = survey->channel_time_busy;
  11. else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
  12. busy = survey->channel_time_rx;
  13. - else {
  14. - /* This shouldn't really happen as survey data is checked in
  15. - * acs_sanity_check() */
  16. - wpa_printf(MSG_ERROR, "ACS: Survey data missing");
  17. - return 0;
  18. - }
  19. total = survey->channel_time;
  20. @@ -395,20 +389,19 @@ static int acs_usable_vht80_chan(struct
  21. static int acs_survey_is_sufficient(struct freq_survey *survey)
  22. {
  23. if (!(survey->filled & SURVEY_HAS_NF)) {
  24. + survey->nf = -95;
  25. wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
  26. - return 0;
  27. }
  28. if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
  29. + survey->channel_time = 0;
  30. wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
  31. - return 0;
  32. }
  33. if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
  34. !(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
  35. wpa_printf(MSG_INFO,
  36. "ACS: Survey is missing RX and busy time (at least one is required)");
  37. - return 0;
  38. }
  39. return 1;