Skip to content

Commit

Permalink
wifi: add basic support for 60GHz band
Browse files Browse the repository at this point in the history
Add ScanResult.is60GHz() helper function which returns true if the frequency
belongs to the 60GHz band.

Add scans60GHz for additional scan info shown when Wifi verbose logging is
enabled.

Add definition of AP_BAND_60GHZ that is used for 60GHz SoftAP.

Change-Id: Ie616bb815a27c053bec0c1056616be6123822be6
CRs-Fixed: 2492485
  • Loading branch information
Maya Erez authored and Dedy Lansky committed Oct 10, 2019
1 parent ef95607 commit d8a16b1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ public class AccessPoint implements Comparable<AccessPoint> {
*/
public static final int HIGHER_FREQ_5GHZ = 5900;

/**
* Lower bound on the 60 GHz (802.11ad) WIGIG channels
*/
public static final int LOWER_FREQ_60GHZ = 58320;

/**
* Upper bound on the 60 GHz (802.11ad) WIGIG channels
*/
public static final int HIGHER_FREQ_60GHZ = 70200;

/** The key which identifies this AccessPoint grouping. */
private String mKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static String getVisibilityStatus(AccessPoint accessPoint) {
StringBuilder visibility = new StringBuilder();
StringBuilder scans24GHz = new StringBuilder();
StringBuilder scans5GHz = new StringBuilder();
StringBuilder scans60GHz = new StringBuilder();
String bssid = null;

if (accessPoint.isActive() && info != null) {
Expand All @@ -107,9 +108,11 @@ static String getVisibilityStatus(AccessPoint accessPoint) {

int maxRssi5 = WifiConfiguration.INVALID_RSSI;
int maxRssi24 = WifiConfiguration.INVALID_RSSI;
int maxRssi60 = WifiConfiguration.INVALID_RSSI;
final int maxDisplayedScans = 4;
int num5 = 0; // number of scanned BSSID on 5GHz band
int num24 = 0; // number of scanned BSSID on 2.4Ghz band
int num60 = 0; // number of scanned BSSID on 60Ghz band
int numBlackListed = 0;

// TODO: sort list by RSSI or age
Expand Down Expand Up @@ -144,6 +147,19 @@ static String getVisibilityStatus(AccessPoint accessPoint) {
verboseScanResultSummary(accessPoint, result, bssid,
nowMs));
}
} else if (result.frequency >= AccessPoint.LOWER_FREQ_60GHZ
&& result.frequency <= AccessPoint.HIGHER_FREQ_60GHZ) {
// Strictly speaking: [60000, 61000]
num60++;

if (result.level > maxRssi60) {
maxRssi60 = result.level;
}
if (num60 <= maxDisplayedScans) {
scans60GHz.append(
verboseScanResultSummary(accessPoint, result, bssid,
nowMs));
}
}
}
visibility.append(" [");
Expand All @@ -162,6 +178,14 @@ static String getVisibilityStatus(AccessPoint accessPoint) {
}
visibility.append(scans5GHz.toString());
}
visibility.append(";");
if (num60 > 0) {
visibility.append("(").append(num60).append(")");
if (num60 > maxDisplayedScans) {
visibility.append("max=").append(maxRssi60).append(",");
}
visibility.append(scans60GHz.toString());
}
if (numBlackListed > 0) {
visibility.append("!").append(numBlackListed);
}
Expand Down
15 changes: 15 additions & 0 deletions wifi/java/android/net/wifi/ScanResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,21 @@ public static boolean is5GHz(int freq) {
return freq > 4900 && freq < 5900;
}

/**
* @hide
*/
public boolean is60GHz() {
return ScanResult.is60GHz(frequency);
}

/**
* @hide
* TODO: makes real freq boundaries
*/
public static boolean is60GHz(int freq) {
return freq >= 58320 && freq <= 70200;
}

/**
* @hide
* anqp lines from supplicant BSS response
Expand Down
6 changes: 6 additions & 0 deletions wifi/java/android/net/wifi/WifiConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ public void setSecurityParams(@SecurityType int securityType) {
*/
public static final int AP_BAND_DUAL = 2;

/**
* 60GHz band
* @hide
*/
public static final int AP_BAND_60GHZ = 3;

/**
* Device is allowed to choose the optimal band (2Ghz or 5Ghz) based on device capability,
* operating country code and current radio conditions.
Expand Down

0 comments on commit d8a16b1

Please sign in to comment.