From 13456a8af13c92077954aae52df3133de6764af5 Mon Sep 17 00:00:00 2001 From: Thijs Withaar Date: Sat, 8 Jun 2019 08:35:18 +0200 Subject: [PATCH] wifi_regd: regulations are handled by crda, so don't do that here. --- Makefile | 9 +++++++++ os_dep/linux/wifi_regd.c | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a30af07..d42515d 100755 --- a/Makefile +++ b/Makefile @@ -74,6 +74,11 @@ CONFIG_REDUCE_TX_CPU_LOADING = n CONFIG_BR_EXT = y CONFIG_TDLS = n CONFIG_WIFI_MONITOR = y +# If you are setting up AP (e.g. by hostapd) in 802.11ac mode, you may have to choose 'y' below. +# Otherwise some channels may be flagged 'NO-IR' (i.e. Passive scanning) by the driver. +# Please check your country's regulatory domain first, +# to see whether active scanning is permitted by law/regulations on the desired channels. +CONFIG_DISABLE_REGD_C=y CONFIG_MCC_MODE = n CONFIG_APPEND_VENDOR_IE_ENABLE = n CONFIG_RTW_NAPI = y @@ -181,6 +186,10 @@ CONFIG_DRVEXT_MODULE = n export TopDIR ?= $(shell pwd) ########### COMMON ################################# +ifeq ($(CONFIG_DISABLE_REGD_C), y) +EXTRA_CFLAGS += -DCONFIG_DISABLE_REGD_C +endif + ifeq ($(CONFIG_GSPI_HCI), y) HCI_NAME = gspi endif diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 9f9c925..a7216c6 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -44,7 +44,7 @@ static struct country_code_to_enum_rd allCountries[] = { /* 2G chan 12 - chan 13, PASSIV SCAN */ #define RTW_2GHZ_CH12_13 \ REG_RULE(2467-10, 2472+10, 40, 0, 20, \ - NL80211_RRF_PASSIVE_SCAN) + 0) /* 2G chan 14, PASSIVS SCAN, NO OFDM (B only) */ #define RTW_2GHZ_CH14 \ @@ -69,7 +69,7 @@ static struct country_code_to_enum_rd allCountries[] = { /* 5G chan 36 - chan 165 */ #define RTW_5GHZ_5150_5850 \ REG_RULE(5150-10, 5850+10, 40, 0, 30, \ - NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) + 0) static const struct ieee80211_regdomain rtw_regdom_rd = { .n_reg_rules = 3, @@ -104,11 +104,15 @@ void rtw_regd_apply_flags(struct wiphy *wiphy) ch = &sband->channels[j]; if (ch) +#ifndef CONFIG_DISABLE_REGD_C ch->flags = IEEE80211_CHAN_DISABLED; +#else + ch->flags = 0; +#endif } } } - +#ifndef CONFIG_DISABLE_REGD_C /* channels apply by channel plans. */ for (i = 0; i < max_chan_nums; i++) { channel = channel_set[i].ChannelNum; @@ -146,6 +150,7 @@ void rtw_regd_apply_flags(struct wiphy *wiphy) } #endif /* CONFIG_DFS */ } +#endif } static const struct ieee80211_regdomain *_rtw_regdomain_select(struct