aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2018-08-24 19:01:28 (GMT)
committerJouni Malinen <j@w1.fi>2019-01-07 22:20:04 (GMT)
commitb06d60a9029f92921f0c4479bbe1551830edce00 (patch)
tree96edf8c5ce2982674948e6fd7577724ec0a92179
parentcb828507f5f1ce911248315033c0dfde55ff7e92 (diff)
downloadhostap-b06d60a9029f92921f0c4479bbe1551830edce00.zip
hostap-b06d60a9029f92921f0c4479bbe1551830edce00.tar.gz
hostap-b06d60a9029f92921f0c4479bbe1551830edce00.tar.bz2
Use freq_list to constrain supported operating class information
If a station is configured to allow only a subset of frequencies for an association, the supported operating classes may need to be more limited than what the hardware supports. Signed-off-by: Ben Greear <greearb@candelatech.com>
-rw-r--r--wpa_supplicant/op_classes.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/wpa_supplicant/op_classes.c b/wpa_supplicant/op_classes.c
index 277f270..947917b 100644
--- a/wpa_supplicant/op_classes.c
+++ b/wpa_supplicant/op_classes.c
@@ -215,11 +215,38 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
size_t i;
struct hostapd_hw_modes *mode;
int found;
+ int z;
+ int freq2 = 0;
+ int freq5 = 0;
mode = get_mode(wpa_s->hw.modes, wpa_s->hw.num_modes, op_class->mode);
if (!mode)
return 0;
+ /* If we are configured to disable certain things, take that into
+ * account here. */
+ if (ssid->freq_list && ssid->freq_list[0]) {
+ for (z = 0; ; z++) {
+ int f = ssid->freq_list[z];
+
+ if (f == 0)
+ break; /* end of list */
+ if (f > 4000 && f < 6000)
+ freq5 = 1;
+ else if (f > 2400 && f < 2500)
+ freq2 = 1;
+ }
+ } else {
+ /* No frequencies specified, can use anything hardware supports.
+ */
+ freq2 = freq5 = 1;
+ }
+
+ if (op_class->op_class >= 115 && op_class->op_class <= 130 && !freq5)
+ return 0;
+ if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2)
+ return 0;
+
#ifdef CONFIG_HT_OVERRIDES
if (ssid->disable_ht) {
switch (op_class->op_class) {