From c1151e47d58832e87ed0bf9c2d211b12d5cd550f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 25 Feb 2014 13:52:26 +0200 Subject: [PATCH] Force OFDM/HT/VHT to be disabled on channel 14 The regulatory rules in Japan do not allow OFDM to be used on channel 14. While this was to some extend assumed to be enforced by drivers (many of which apparently don't), it is safer to make hostapd enforce this by disabling any OFDM-related functionality. This tries to avoid backwards compatibility issues by downgrading the mode rather than rejecting the invalid configuration. Signed-off-by: Jouni Malinen --- src/ap/hw_features.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index 4e6637957..7d36790c7 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -943,6 +943,15 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface) if (iface->num_hw_features < 1) return -1; + if ((iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211G || + iface->conf->ieee80211n || iface->conf->ieee80211ac) && + iface->conf->channel == 14) { + wpa_printf(MSG_INFO, "Disable OFDM/HT/VHT on channel 14"); + iface->conf->hw_mode = HOSTAPD_MODE_IEEE80211B; + iface->conf->ieee80211n = 0; + iface->conf->ieee80211ac = 0; + } + iface->current_mode = NULL; for (i = 0; i < iface->num_hw_features; i++) { struct hostapd_hw_modes *mode = &iface->hw_features[i];