From b113a171ac6b744fc67a6935b58780f507eafda8 Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Thu, 9 May 2013 20:14:53 +0300 Subject: [PATCH] DFS: Add ieee80211h hostapd configuration parameter This patch is based on the original work by Boris Presman and Victor Goldenshtein. Channel Switch Announcement support has been removed and event handling as well as channel set handling was changed, among various other changes. Cc: Boris Presman Cc: Victor Goldenshtein Signed-hostap: Simon Wunderlich --- hostapd/config_file.c | 8 ++++++++ hostapd/hostapd.conf | 6 ++++++ src/ap/ap_config.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 62136cabf..3394f0013 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -1223,6 +1223,12 @@ static int hostapd_config_check(struct hostapd_config *conf) return -1; } + if (conf->ieee80211h && !conf->ieee80211d) { + wpa_printf(MSG_ERROR, "Cannot enable IEEE 802.11h without " + "IEEE 802.11d enabled"); + return -1; + } + for (i = 0; i < conf->num_bss; i++) { if (hostapd_config_check_bss(&conf->bss[i], conf)) return -1; @@ -1784,6 +1790,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->country[2] = ' '; } else if (os_strcmp(buf, "ieee80211d") == 0) { conf->ieee80211d = atoi(pos); + } else if (os_strcmp(buf, "ieee80211h") == 0) { + conf->ieee80211h = atoi(pos); } else if (os_strcmp(buf, "ieee8021x") == 0) { bss->ieee802_1x = atoi(pos); } else if (os_strcmp(buf, "eapol_version") == 0) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 86015bf19..be15b860f 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -105,6 +105,12 @@ ssid=test # (default: 0 = disabled) #ieee80211d=1 +# Enable IEEE 802.11h. This enables radar detection and DFS support if +# available. DFS support is required on outdoor 5 GHz channels in most countries +# of the world. This can be used only with ieee80211d=1. +# (default: 0 = disabled) +#ieee80211h=1 + # Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g, # ad = IEEE 802.11ad (60 GHz); a/g options are used with IEEE 802.11n, too, to # specify band) diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 16134da97..7c9ea9074 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -498,6 +498,8 @@ struct hostapd_config { int ieee80211d; + int ieee80211h; /* DFS */ + struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES]; /*