summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>2020-05-11 09:33:06 +0530
committerSunil Ravi <sunilravi@google.com>2020-05-20 14:04:25 -0700
commit3280ce7359f081628980661afc46890bd90a71c9 (patch)
treef344dfc4be76afcc75ab4fa5f4a8eef3db83671f
parent0715666c96aef01fd8d76445189446bf3b5179c3 (diff)
Add check to consider band in determining VHT capability
determineMode returning MODE_11AC capability when VHT IEs found. Thus all APs that have support for the vendor specific partial VHT support in the 2.4 GHz band were also being reported as 11AC capable. However, IEEE Std 802.11ac-2013 defines VHT STA to operate in frequency bands below 6 GHz excluding the 2.4 GHz band. Do not report MODE_11AC capability when operating channel is 2.4 GHz. Bug: 156571060 Test: Manual - Enabled verbose logging in NetworkDetail Class and verified that WifiMode is determined correctly for 2.4GHz APs supporting 11ax, 11ac and 11n. Test: atest com.android.server.wifi.util.InformationElementUtilTest Change-Id: Iae202a0d3116f99e9a672d7510bec9baf7c709d2
-rw-r--r--service/java/com/android/server/wifi/util/InformationElementUtil.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java34
2 files changed, 38 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/util/InformationElementUtil.java b/service/java/com/android/server/wifi/util/InformationElementUtil.java
index 091707a7a..0b10bf45e 100644
--- a/service/java/com/android/server/wifi/util/InformationElementUtil.java
+++ b/service/java/com/android/server/wifi/util/InformationElementUtil.java
@@ -1494,13 +1494,15 @@ public class InformationElementUtil {
boolean foundVht, boolean foundHt, boolean foundErp) {
if (foundHe) {
return MODE_11AX;
- } else if (foundVht) {
+ } else if (!ScanResult.is24GHz(frequency) && foundVht) {
+ // Do not include subset of VHT on 2.4 GHz vendor extension
+ // in consideration for reporting VHT.
return MODE_11AC;
} else if (foundHt) {
return MODE_11N;
} else if (foundErp) {
return MODE_11G;
- } else if (frequency < 3000) {
+ } else if (ScanResult.is24GHz(frequency)) {
if (maxRate < 24000000) {
return MODE_11B;
} else {
diff --git a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
index 874da7043..77c99a9d1 100644
--- a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
@@ -1706,5 +1706,39 @@ public class InformationElementUtilTest extends WifiBaseTest {
assertEquals(true, vsa.IsOceCapable);
}
+ /**
+ * verify determineMode for various combinations.
+ */
+ @Test
+ public void determineMode() throws Exception {
+ assertEquals(InformationElementUtil.WifiMode.MODE_11B,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 11000000, false, false, false, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11G,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 54000000, false, false, false, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11A,
+ InformationElementUtil.WifiMode.determineMode(
+ 5180, 54000000, false, false, false, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11G,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 54000000, false, false, false, true));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11N,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 72000000, false, false, true, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11N,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 72000000, false, true, true, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11AC,
+ InformationElementUtil.WifiMode.determineMode(
+ 5180, 866000000, false, true, true, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11AX,
+ InformationElementUtil.WifiMode.determineMode(
+ 5180, 866000000, true, true, true, false));
+ assertEquals(InformationElementUtil.WifiMode.MODE_11AX,
+ InformationElementUtil.WifiMode.determineMode(
+ 2412, 72000000, true, true, true, false));
+ }
+
// TODO: SAE, OWN, SUITE_B
}