From 34081b36072d26953b56d53ccdf4b501688ae053 Mon Sep 17 00:00:00 2001 From: Swarn Singh Date: Wed, 11 Jan 2023 12:50:09 +0530 Subject: [PATCH] wifi: Add support for QoS SCS policy feature This commit defines supplicant AIDL APIs needed for QoS SCS policy feature. Bug: 236182432 Test: atest VtsHalWifiSupplicantStaIfaceTargetTest \ VtsHalWifiSupplicantStaNetworkTargetTest \ VtsHalWifiSupplicantP2pIfaceTargetTest Change-Id: I88c79a11edc70f9c7b662ae81594c0fc66d558b8 --- .../wifi/supplicant/ISupplicantStaIface.aidl | 4 + .../ISupplicantStaIfaceCallback.aidl | 1 + .../supplicant/QosPolicyClassifierParams.aidl | 1 + .../QosPolicyClassifierParamsMask.aidl | 1 + .../wifi/supplicant/QosPolicyScsData.aidl | 25 +++++++ .../supplicant/QosPolicyScsRequestStatus.aidl | 24 ++++++ .../QosPolicyScsRequestStatusCode.aidl | 26 +++++++ .../QosPolicyScsResponseStatus.aidl | 24 ++++++ .../QosPolicyScsResponseStatusCode.aidl | 31 ++++++++ .../wifi/supplicant/SupplicantStatusCode.aidl | 1 + .../wifi/supplicant/ISupplicantStaIface.aidl | 73 +++++++++++++++++++ .../ISupplicantStaIfaceCallback.aidl | 14 ++++ .../supplicant/QosPolicyClassifierParams.aidl | 6 ++ .../QosPolicyClassifierParamsMask.aidl | 1 + .../wifi/supplicant/QosPolicyScsData.aidl | 24 ++++++ .../supplicant/QosPolicyScsRequestStatus.aidl | 13 ++++ .../QosPolicyScsRequestStatusCode.aidl | 25 +++++++ .../QosPolicyScsResponseStatus.aidl | 13 ++++ .../QosPolicyScsResponseStatusCode.aidl | 46 ++++++++++++ .../wifi/supplicant/SupplicantStatusCode.aidl | 4 + .../supplicant_sta_iface_aidl_test.cpp | 6 ++ 21 files changed, 363 insertions(+) create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl create mode 100644 wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl create mode 100644 wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 3740a10202..f617975498 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -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; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index b54f04d2df..cabe167fa0 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -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, diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl index 8bf5fd836d..156d57ac0c 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -43,4 +43,5 @@ parcelable QosPolicyClassifierParams { android.hardware.wifi.supplicant.ProtocolNextHeader protocolNextHdr; byte[] flowLabelIpv6; String domainName; + byte dscp; } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl index 280ddbe3b2..9c0c0b65fb 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -41,4 +41,5 @@ enum QosPolicyClassifierParamsMask { PROTOCOL_NEXT_HEADER = 16, FLOW_LABEL = 32, DOMAIN_NAME = 64, + DSCP = 128, } diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl new file mode 100644 index 0000000000..4e5e8ae961 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -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 -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; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl new file mode 100644 index 0000000000..d5573af593 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl @@ -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 -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; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl new file mode 100644 index 0000000000..4d815665d7 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl @@ -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 -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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl new file mode 100644 index 0000000000..2737f1a5a8 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl @@ -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 -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; +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl new file mode 100644 index 0000000000..693d3e0ac0 --- /dev/null +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl @@ -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 -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, +} diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl index 32d71a3a8c..d84ff95300 100644 --- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl +++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl @@ -45,4 +45,5 @@ enum SupplicantStatusCode { FAILURE_NETWORK_INVALID = 8, FAILURE_NETWORK_UNKNOWN = 9, FAILURE_UNSUPPORTED = 10, + FAILURE_ONGOING_REQUEST = 11, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl index 9ceb3c0fc4..e00604810a 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl @@ -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(); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl index 5001800e11..398bb36499 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl @@ -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); } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl index d95d18dd27..478b09d717 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParams.aidl @@ -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; } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl index 51bc14c25e..c15fec050b 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl @@ -29,4 +29,5 @@ enum QosPolicyClassifierParamsMask { PROTOCOL_NEXT_HEADER = 1 << 4, FLOW_LABEL = 1 << 5, DOMAIN_NAME = 1 << 6, + DSCP = 1 << 7, } diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl new file mode 100644 index 0000000000..86a4dac216 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl @@ -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; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl new file mode 100644 index 0000000000..e233f32260 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatus.aidl @@ -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; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl new file mode 100644 index 0000000000..daf1578bb4 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl @@ -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, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl new file mode 100644 index 0000000000..846a0e2da5 --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatus.aidl @@ -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; +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl new file mode 100644 index 0000000000..f4ecd2a0ba --- /dev/null +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl @@ -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, +} diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl index c7b7ffdcf1..e97d6eed21 100644 --- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl +++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl @@ -63,4 +63,8 @@ enum SupplicantStatusCode { */ FAILURE_NETWORK_UNKNOWN, FAILURE_UNSUPPORTED, + /** + * A different request is currently being processed. + */ + FAILURE_ONGOING_REQUEST, } diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp index d5366180ce..d0daf96b87 100644 --- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp +++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp @@ -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 {