Merge "wifi: Add support for QoS SCS policy feature"

This commit is contained in:
TreeHugger Robot
2023-01-13 17:15:28 +00:00
committed by Android (Google) Code Review
21 changed files with 363 additions and 0 deletions

View File

@@ -96,4 +96,8 @@ interface ISupplicantStaIface {
void stopDppResponder(in int ownBootstrapId);
void stopRxFilter();
android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults();
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData);
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeAllQosPoliciesForScs();
const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
}

View File

@@ -74,6 +74,7 @@ interface ISupplicantStaIfaceCallback {
oneway void onDppConnectionStatusResultSent(in android.hardware.wifi.supplicant.DppStatusErrorCode code);
oneway void onBssFrequencyChanged(in int frequencyMhz);
oneway void onSupplicantStateChanged(in android.hardware.wifi.supplicant.SupplicantStateChangeData stateChangeData);
oneway void onQosPolicyResponseForScs(in android.hardware.wifi.supplicant.QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus);
@Backing(type="int") @VintfStability
enum MloLinkInfoChangeReason {
TID_TO_LINK_MAP = 0,

View File

@@ -43,4 +43,5 @@ parcelable QosPolicyClassifierParams {
android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr;
byte[] flowLabelIpv6;
String domainName;
byte dscp;
}

View File

@@ -41,4 +41,5 @@ enum QosPolicyClassifierParamsMask {
PROTOCOL_NEXT_HEADER = 16,
FLOW_LABEL = 32,
DOMAIN_NAME = 64,
DSCP = 128,
}

View File

@@ -0,0 +1,25 @@
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.wifi.supplicant;
@VintfStability
parcelable QosPolicyScsData {
byte policyId;
byte userPriority;
android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams;
}

View File

@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.wifi.supplicant;
@VintfStability
parcelable QosPolicyScsRequestStatus {
byte policyId;
android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode;
}

View File

@@ -0,0 +1,26 @@
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsRequestStatusCode {
SENT = 0,
ALREADY_ACTIVE = 1,
NOT_EXIST = 2,
INVALID = 3,
}

View File

@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.wifi.supplicant;
@VintfStability
parcelable QosPolicyScsResponseStatus {
byte policyId;
android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode;
}

View File

@@ -0,0 +1,31 @@
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsResponseStatusCode {
SUCCESS = 0,
TCLAS_REQUEST_DECLINED = 1,
TCLAS_NOT_SUPPORTED_BY_AP = 2,
TCLAS_INSUFFICIENT_RESOURCES = 3,
TCLAS_RESOURCES_EXHAUSTED = 4,
TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS = 5,
TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT = 6,
TCLAS_PROCESSING_TERMINATED = 7,
TIMEOUT = 8,
}

View File

@@ -45,4 +45,5 @@ enum SupplicantStatusCode {
FAILURE_NETWORK_INVALID = 8,
FAILURE_NETWORK_UNKNOWN = 9,
FAILURE_UNSUPPORTED = 10,
FAILURE_ONGOING_REQUEST = 11,
}

View File

@@ -29,6 +29,8 @@ import android.hardware.wifi.supplicant.ISupplicantStaNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.KeyMgmtMask;
import android.hardware.wifi.supplicant.MloLinksInfo;
import android.hardware.wifi.supplicant.QosPolicyScsData;
import android.hardware.wifi.supplicant.QosPolicyScsRequestStatus;
import android.hardware.wifi.supplicant.QosPolicyStatus;
import android.hardware.wifi.supplicant.RxFilterType;
import android.hardware.wifi.supplicant.SignalPollResult;
@@ -793,4 +795,75 @@ interface ISupplicantStaIface {
* |SupplicantStatusCode.FAILURE_UNSUPPORTED|
*/
SignalPollResult[] getSignalPollResults();
/**
* Maximum number of policies that can be included in a QoS SCS add/remove request.
*/
const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
/**
* Send a set of QoS SCS policy add requests to the AP.
*
* This is a request to the AP (if it supports the feature) to apply the QoS policies
* on traffic in the downlink.
*
* Synchronous response will indicate which policies were sent to the AP, and which
* were rejected immediately by supplicant. Caller will also receive an asynchronous
* response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating
* the response from the AP for each policy that was sent.
*
* @param qosPolicyScsData QoS policies info provided by STA.
* @return QosPolicyScsRequestStatus[] synchronously corresponding to all
* the scs policies. Size of the result array will be the same as
* the size of the input array.
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the
* request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST|
*
* |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
* the feature.
*
* |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
* being processed. Supplicant will only handle one request at a time.
*/
QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in QosPolicyScsData[] qosPolicyData);
/**
* Request the removal of specific QoS policies for SCS configured by the STA.
*
* Synchronous response will indicate which policies were sent to the AP, and which
* were rejected immediately by supplicant. Caller will also receive an asynchronous
* response in |ISupplicantStaIfaceCallback.onQosPolicyResponseForScs| indicating
* the response from the AP for each policy that was sent.
*
* @param scsPolicyIds policy id's to be removed.
* @return QosPolicyScsRequestStatus[] synchronously corresponding to all
* the scs policies.
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN| if the number of policies in the
* request is greater than |MAX_POLICIES_PER_QOS_SCS_REQUEST|
*
* |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
* the feature.
*
* |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
* being processed. Supplicant will only handle one request at a time.
*/
QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
/**
* Request the removal of all QoS policies for SCS configured by the STA.
*
* @return QosPolicyScsRequestStatus[] synchronously corresponding to all
* the scs policies.
* @throws ServiceSpecificException with one of the following values:
* |SupplicantStatusCode.FAILURE_UNKNOWN| if there are no policies to remove.
*
* |SupplicantStatusCode.FAILURE_UNSUPPORTED| if the AP does not support
* the feature.
*
* |SupplicantStatusCode.FAILURE_ONGOING_REQUEST| if a request is currently
* being processed. Supplicant will only handle one request at a time.
*/
QosPolicyScsRequestStatus[] removeAllQosPoliciesForScs();
}

View File

@@ -31,6 +31,7 @@ import android.hardware.wifi.supplicant.DppStatusErrorCode;
import android.hardware.wifi.supplicant.Hs20AnqpData;
import android.hardware.wifi.supplicant.OsuMethod;
import android.hardware.wifi.supplicant.QosPolicyData;
import android.hardware.wifi.supplicant.QosPolicyScsResponseStatus;
import android.hardware.wifi.supplicant.StaIfaceCallbackState;
import android.hardware.wifi.supplicant.StaIfaceReasonCode;
import android.hardware.wifi.supplicant.SupplicantStateChangeData;
@@ -378,4 +379,17 @@ oneway interface ISupplicantStaIfaceCallback {
* @param stateChangeData Supplicant state change related information.
*/
void onSupplicantStateChanged(in SupplicantStateChangeData stateChangeData);
/**
* Indicates an SCS response from the AP.
*
* If the AP does not send a response within the timeout period (1 sec),
* supplicant will call this API with the TIMEOUT status for each policy.
*
* The AP can trigger an unsolicited scs response to indicate the removal of
* previously requested policies.
*
* @param qosPolicyScsResponseStatus[] status for each SCS id.
*/
void onQosPolicyResponseForScs(in QosPolicyScsResponseStatus[] qosPolicyScsResponseStatus);
}

View File

@@ -62,4 +62,10 @@ parcelable QosPolicyClassifierParams {
* "reg-name" in RFC 3986.
*/
String domainName;
/**
* Differentiated Services Code Point (DSCP) value.
* Used by AP for mapping the data streams to apply the user priority.
*/
byte dscp;
}

View File

@@ -29,4 +29,5 @@ enum QosPolicyClassifierParamsMask {
PROTOCOL_NEXT_HEADER = 1 << 4,
FLOW_LABEL = 1 << 5,
DOMAIN_NAME = 1 << 6,
DSCP = 1 << 7,
}

View File

@@ -0,0 +1,24 @@
package android.hardware.wifi.supplicant;
import android.hardware.wifi.supplicant.QosPolicyClassifierParams;
/**
* QoS policy information in SCS request.
* TCLAS Processing element is always set to 0.
*/
@VintfStability
parcelable QosPolicyScsData {
/** SCS QoS Policy identifier. */
byte policyId;
/**
* User Priority (UP) which the AP should apply to streams that match
* the classifier parameters.
*/
byte userPriority;
/**
* QoS policy SCS classifier type information.
*/
QosPolicyClassifierParams classifierParams;
}

View File

@@ -0,0 +1,13 @@
package android.hardware.wifi.supplicant;
import android.hardware.wifi.supplicant.QosPolicyScsRequestStatusCode;
/**
* QoS policy status info per scsId. Returned immediately by supplicant
* upon SCS request.
*/
@VintfStability
parcelable QosPolicyScsRequestStatus {
byte policyId;
QosPolicyScsRequestStatusCode qosPolicyScsRequestStatusCode;
}

View File

@@ -0,0 +1,25 @@
package android.hardware.wifi.supplicant;
/**
* Enum values for QoS policy request status.
*/
@VintfStability
@Backing(type="int")
enum QosPolicyScsRequestStatusCode {
/**
* SCS request was sent to the AP.
*/
SENT,
/**
* Add request conflicts with an existing policy ID.
*/
ALREADY_ACTIVE,
/**
* Remove request is for a policy ID that does not exist.
*/
NOT_EXIST,
/**
* QoS policy params are invalid.
*/
INVALID,
}

View File

@@ -0,0 +1,13 @@
package android.hardware.wifi.supplicant;
import android.hardware.wifi.supplicant.QosPolicyScsResponseStatusCode;
/**
* QoS policy status info per scsId. Returned in a callback once replies are
* received from the AP.
*/
@VintfStability
parcelable QosPolicyScsResponseStatus {
byte policyId;
QosPolicyScsResponseStatusCode qosPolicyScsResponseStatusCode;
}

View File

@@ -0,0 +1,46 @@
package android.hardware.wifi.supplicant;
/**
* Enum values for QoS policy response status.
*/
@VintfStability
@Backing(type="int")
enum QosPolicyScsResponseStatusCode {
SUCCESS,
/**
* Network policy does not permit the stream to be assigned the requested
* user priority (UP), but the AP might accept another request from the STA
* with the same TCLAS classifier(s) but a different user priority (UP).
*/
TCLAS_REQUEST_DECLINED,
/**
* Requested TCLAS processing is not supported by the AP.
*/
TCLAS_NOT_SUPPORTED_BY_AP,
/**
* The AP has insufficient TCLAS processing resources to satisfy the request
* (i.e. to classify and process the traffic).
*/
TCLAS_INSUFFICIENT_RESOURCES,
/**
* Sufficient TCLAS processing resources were available when the SCS
* stream was created, but are no longer available.
*/
TCLAS_RESOURCES_EXHAUSTED,
/**
* Insufficient capacity to sustain the current QoS treatment.
*/
TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS,
/**
* Conflict with a (new or dynamic) network policy.
*/
TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT,
/**
* Other reason for decline.
*/
TCLAS_PROCESSING_TERMINATED,
/**
* AP did not send a response within the timeout period (1 sec).
*/
TIMEOUT,
}

View File

@@ -63,4 +63,8 @@ enum SupplicantStatusCode {
*/
FAILURE_NETWORK_UNKNOWN,
FAILURE_UNSUPPORTED,
/**
* A different request is currently being processed.
*/
FAILURE_ONGOING_REQUEST,
}

View File

@@ -228,6 +228,12 @@ class SupplicantStaIfaceCallback : public BnSupplicantStaIfaceCallback {
::ndk::ScopedAStatus onBssFrequencyChanged(int32_t /* frequencyMhz */) override {
return ndk::ScopedAStatus::ok();
}
::ndk::ScopedAStatus onQosPolicyResponseForScs(
const std::vector<::aidl::android::hardware::wifi::supplicant::
QosPolicyScsResponseStatus>& /* qosPolicyScsResponseStatus */)
override {
return ndk::ScopedAStatus::ok();
}
};
class SupplicantStaIfaceAidlTest : public testing::TestWithParam<std::string> {