aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_common.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-12 14:02:23 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-12 14:02:23 (GMT)
commit3eafc494d8cef27fbcadf59620b83da5a5126289 (patch)
treea1d79d987f19e3f017c995581dcca49f2d0eaf07 /src/drivers/driver_common.c
parentcd3153a9832272fbe6f48cb965401c9d9867e8f8 (diff)
downloadhostap-3eafc494d8cef27fbcadf59620b83da5a5126289.zip
hostap-3eafc494d8cef27fbcadf59620b83da5a5126289.tar.gz
hostap-3eafc494d8cef27fbcadf59620b83da5a5126289.tar.bz2
Fix CONFIG_NO_SCAN_PROCESSING=y build
ht_supported() was used but not defined in such a case. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/drivers/driver_common.c')
-rw-r--r--src/drivers/driver_common.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index 77e6905..c53b889 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -105,3 +105,39 @@ const char * channel_width_to_string(enum chan_width width)
return "unknown";
}
}
+
+
+int ht_supported(const struct hostapd_hw_modes *mode)
+{
+ if (!(mode->flags & HOSTAPD_MODE_FLAG_HT_INFO_KNOWN)) {
+ /*
+ * The driver did not indicate whether it supports HT. Assume
+ * it does to avoid connection issues.
+ */
+ return 1;
+ }
+
+ /*
+ * IEEE Std 802.11n-2009 20.1.1:
+ * An HT non-AP STA shall support all EQM rates for one spatial stream.
+ */
+ return mode->mcs_set[0] == 0xff;
+}
+
+
+int vht_supported(const struct hostapd_hw_modes *mode)
+{
+ if (!(mode->flags & HOSTAPD_MODE_FLAG_VHT_INFO_KNOWN)) {
+ /*
+ * The driver did not indicate whether it supports VHT. Assume
+ * it does to avoid connection issues.
+ */
+ return 1;
+ }
+
+ /*
+ * A VHT non-AP STA shall support MCS 0-7 for one spatial stream.
+ * TODO: Verify if this complies with the standard
+ */
+ return (mode->vht_mcs_set[0] & 0x3) != 3;
+}