summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d2c675)
raw | patch | inline | side by side (parent: 7d2c675)
hostapd: add support for ACS whitelist and blacklist (INTERNAL) R5.xx_Build-195 R5.xx_Build-196 R5.xx_Build-197 R5.xx_Build-198 R5.xx_Build-199 R5.xx_Build-200 R5.xx_Build-201 R5.xx_Build-202 R5.xx_Build-203 R5.xx_Build-204 R8.xx_Build-205 R8.xx_Build-206 R8.xx_Build-207 R8.xx_Build-208 R8.xx_Build-209 R8.xx_Build-210 R8.xx_Build-211 R8.xx_Build-212 R8.xx_Build-213 R8.xx_Build-214 R8.xx_Build-215 R8.xx_Build-216 R8.xx_Build-217 R8.xx_Build-218 ol_r8.a5.10 ol_r8.a5.11
author | Arik Nemtsov <arik@wizery.com> | |
Thu, 27 Dec 2012 20:16:55 +0000 (22:16 +0200) | ||
committer | Igal Chernobelsky <igalc@ti.com> | |
Mon, 7 Jan 2013 11:14:36 +0000 (13:14 +0200) |
Allow certain channels to be marked as forbidden for automatic channel
selection (ACS) via a blacklist. Also allow channels to be preferred
exclusively via a whitelist.
Both blacklist and whitelist can be configured via the hostapd.conf
file. Document these options in the sample hostapd.conf file given.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Conflicts:
src/ap/ap_config.h
selection (ACS) via a blacklist. Also allow channels to be preferred
exclusively via a whitelist.
Both blacklist and whitelist can be configured via the hostapd.conf
file. Document these options in the sample hostapd.conf file given.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Conflicts:
src/ap/ap_config.h
hostapd/config_file.c | patch | blob | history | |
hostapd/hostapd.conf | patch | blob | history | |
src/ap/ap_config.h | patch | blob | history | |
src/ap/hw_features.c | patch | blob | history |
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 41dd2426889b038780a76d4a7bce264f16912236..93998604083faf8b66de32cb3ec6a03758c10d3d 100644 (file)
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
"list", line);
errors++;
}
+ } else if (os_strcmp(buf, "acs_blacklist") == 0) {
+ /* these are not rates but the same function will do */
+ if (hostapd_parse_rates(&conf->acs_blacklist, pos)) {
+ wpa_printf(MSG_ERROR, "Line %d: invalid acs "
+ "black list", line);
+ errors++;
+ }
+ } else if (os_strcmp(buf, "acs_whitelist") == 0) {
+ /* these are not rates but the same function will do */
+ if (hostapd_parse_rates(&conf->acs_whitelist, pos)) {
+ wpa_printf(MSG_ERROR, "Line %d: invalid acs "
+ "white list", line);
+ errors++;
+ }
} else if (os_strcmp(buf, "preamble") == 0) {
if (atoi(pos))
conf->preamble = SHORT_PREAMBLE;
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index f62610e80815599de7bdcc19b85ef1451d8331df..f71a881350878225dae89cb74962149e9aa4ce92 100644 (file)
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
# will be selected from the desired hw_mode.
channel=1
+# Automatic channel selection (ACS) whitelist
+# (default: not set)
+# Allow only these channels in automatic channel selection
+# acs_whitelist=1 2 3 4 5 6 7 8 9 10 11
+
+# Automatic channel selection (ACS) blacklist
+# (default: not set)
+# Don't allow these channels in automatic channel selection
+# acs_blacklist=1 2 3 4 5 6 7 8 9 10 11
+
# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535)
beacon_int=100
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index d6b67fe41645a528a1bbde7250fed444b1e213ce..95f2787c913a02d008dcb8ba7fbd705f0e87f6fe 100644 (file)
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
u32 vht_capab;
int ieee80211ac;
u8 vht_oper_chwidth;
+
+ int *acs_blacklist;
+ int *acs_whitelist;
};
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 43e9d0f1647aa94c534b3adc4bf3d9dbaa62ee31..eb0f0a8bfd4ad83967377b4d987814ec04c89c46 100644 (file)
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
{
int j;
struct hostapd_channel_data *c;
+ int *list;
/* don't allow AP on channel 14 - only JP 11b rates */
if (chan == 14)
return 0;
+ /* don't allow channels on the the ACS blacklist */
+ if (iface->conf->acs_blacklist) {
+ list = iface->conf->acs_blacklist;
+ for (j = 0; list[j] >= 0; j++)
+ if (chan == list[j])
+ return 0;
+ }
+
+ /* only allow channels from the ACS whitelist */
+ if (iface->conf->acs_whitelist) {
+ list = iface->conf->acs_whitelist;
+ for (j = 0; list[j] >= 0; j++)
+ if (chan == list[j])
+ break;
+
+ /* channel not found */
+ if (list[j] != chan)
+ return 0;
+ }
+
for (j = 0; j < iface->current_mode->num_channels; j++) {
c = &iface->current_mode->channels[j];
if (c->chan == chan)