From b1ea8dbc195bf2163e4276334727f50cd138ff54 Mon Sep 17 00:00:00 2001 From: Hongbo Zeng Date: Tue, 2 Feb 2021 23:01:12 +0800 Subject: [PATCH] Support SlicingConfig for 5G Slicing Configuration - add new HAL APIs getSlicingConfig() and getSlicingConfigResponse() - create structs SlicingConfig, UrspRule, RouteSelectionDescriptor, RouteSelectionDescriptorParams, Nssais, and RejectedSliceInfo - add SliceRejectionCause Bug: 178075054 Test: run "atest VtsHalRadioV1_6TargetTest" and check the result for getSlicingConfig is PASSED [3/13] PerInstance/RadioHidlTest_v1_6#getSlicingConfig/0_slot1: PASSED (15ms) Change-Id: I5dc97d3c49d0bf4726975a5558360ebf9c09224b Merged-In: I5dc97d3c49d0bf4726975a5558360ebf9c09224b --- radio/1.6/IRadio.hal | 13 ++ radio/1.6/IRadioResponse.hal | 14 ++ radio/1.6/types.hal | 144 ++++++++++++++++++ .../1.6/vts/functional/radio_hidl_hal_api.cpp | 12 ++ .../functional/radio_hidl_hal_utils_v1_6.h | 4 + radio/1.6/vts/functional/radio_response.cpp | 8 + 6 files changed, 195 insertions(+) diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal index aa9297548e..e7267ef8a9 100644 --- a/radio/1.6/IRadio.hal +++ b/radio/1.6/IRadio.hal @@ -510,6 +510,19 @@ interface IRadio extends @1.5::IRadio { */ oneway getCurrentCalls_1_6(int32_t serial); + /** + * Request to get the current slicing configuration including URSP rules and + * NSSAIs (configured, allowed and rejected). + * URSP stands for UE route selection policy and is defined in 3GPP TS 24.526 + * Section 4.2. + * An NSSAI is a collection of network slices. Each network slice is identified by + * an S-NSSAI and is represented by the struct SliceInfo. NSSAI and S-NSSAI + * are defined in 3GPP TS 24.501. + * + * Response function is IRadioResponse.getSlicingConfigResponse() + */ + oneway getSlicingConfig(int32_t serial); + /** * Provide Carrier specific information to the modem that must be used to * encrypt the IMSI and IMPI. Sent by the framework during boot, carrier diff --git a/radio/1.6/IRadioResponse.hal b/radio/1.6/IRadioResponse.hal index a1ad20726c..a4744e16de 100644 --- a/radio/1.6/IRadioResponse.hal +++ b/radio/1.6/IRadioResponse.hal @@ -26,6 +26,7 @@ import @1.6::RegStateResult; import @1.6::RadioResponseInfo; import @1.6::SetupDataCallResult; import @1.6::SignalStrength; +import @1.6::SlicingConfig; /** * Interface declaring response functions to solicited radio requests. @@ -417,4 +418,17 @@ interface IRadioResponse extends @1.5::IRadioResponse { * RadioError:CANCELLED */ oneway getCurrentCallsResponse_1_6(RadioResponseInfo info, vec calls); + + /** + * @param info Response info struct containing response type, serial no. and error + * @param slicingConfig Current slicing configuration + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + * RadioError:MODEM_ERR + */ + oneway getSlicingConfigResponse(RadioResponseInfo info, + SlicingConfig slicingConfig); }; diff --git a/radio/1.6/types.hal b/radio/1.6/types.hal index 28c9fa87be..c171701dfb 100644 --- a/radio/1.6/types.hal +++ b/radio/1.6/types.hal @@ -971,6 +971,150 @@ struct OSAppId { vec osAppId; }; +/** + * This struct represents the current slicing configuration. + */ +struct SlicingConfig { + /** + * This vector contains the current URSP rules. Empty vector represents that no + * rules are configured. + */ + vec urspRules; + /** + * Struct containing all NSSAIs (list of slice info). + */ + Nssais nssais; +}; + +/** + * This struct represents a single URSP rule as defined in 3GPP TS 24.526. + */ +struct UrspRule { + /** + * Precedence value in the range of 0 to 255. Higher value has lower + * precedence. + */ + uint8_t precedence; + /** + * Used as a matcher for network requests. + */ + vec trafficDescriptors; + /** + * List of routes (connection parameters) that must be used for requests + * matching a trafficDescriptor. + */ + vec routeSelectionDescriptor; +}; + + +/** + * This struct represents a single route selection descriptor as defined in + * 3GPP TS 24.526. + */ +struct RouteSelectionDescriptor { + /** + * Precedence value in the range of 0 to 255. Higher value has lower + * precedence. + */ + uint8_t precedence; + /** + * Parameters defining this RouteSelectionDescriptor. The length of the vector + * must be >= 1. + */ + vec routeSelectionDescriptorParams; +}; + +/** + * This struct represents a route selection descriptor. A valid struct must have + * at least one of the vectors non-empty. + */ +struct RouteSelectionDescriptorParams { + /** + * Valid values are IP, IPV6 and IPV4V6. + */ + OptionalPdpProtocolType sessionType; + OptionalSscMode sscMode; + /** + * There can be 0 or more SliceInfo specified in a route descriptor. + */ + vec sliceInfo; + /** + * DNN stands for Data Network Name and represents an APN as defined in + * 3GPP TS 23.003. There can be 0 or more DNNs specified in a route + * descriptor. + */ + vec dnn; +}; + +/** + * This safe_union represents an optional PdpProtocolType. + */ +safe_union OptionalPdpProtocolType { + Monostate noinit; + PdpProtocolType value; +}; + +/** + * This safe_union represents an optional SscMode. + */ +safe_union OptionalSscMode { + Monostate noinit; + SscMode value; +}; + +/** + * This struct contains all NSSAIs (lists of slices). + */ +struct Nssais { + /** + * These are all the slices configured by the network. This includes allowed + * and rejected slices, as well as slices that are neither allowed nor rejected + * yet. Empty vector indicates that no slices are configured, and in that case + * allowed and rejected vectors must be empty as well. + */ + vec configured; + /** + * These are all the slices that the UE is allowed to use. All these slices + * must be configured as well. Empty vector indicates that no slices are + * allowed yet. + */ + vec allowed; + /** + * These are all the slices that the UE is not allowed to use. All these slices + * must be configured as well. Empty vector indicates that no slices are + * rejected yet. + */ + vec rejected; + /** + * Default configured NSSAI + */ + vec defaultConfigured; +}; + +/** + * This struct represents a network slice rejected by the network. It contains a + * rejectionCause corresponding to a rejected network slice. + */ +struct RejectedSliceInfo { + SliceInfo sliceInfo; + SliceRejectionCause rejectionCause; +}; + +enum SliceRejectionCause : int32_t { + NOT_AVAILABLE_IN_PLMN, + NOT_AVAILABLE_IN_REG_AREA, +}; + +/** + * Enum representing session and service continuity mode as defined in + * 3GPP TS 23.501. + */ +enum SscMode : int32_t { + MODE_1 = 1, + MODE_2 = 2, + MODE_3 = 3, +}; + /** * Public key type from carrier certificate. */ diff --git a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp index a460c727a8..fb50990a28 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp @@ -163,6 +163,18 @@ TEST_P(RadioHidlTest_v1_6, setupDataCall_1_6_osAppId) { } } +/* + * Test IRadio.getSlicingConfig() for the response returned. + */ +TEST_P(RadioHidlTest_v1_6, getSlicingConfig) { + serial = GetRandomSerialNumber(); + radio_v1_6->getSlicingConfig(serial); + EXPECT_EQ(std::cv_status::no_timeout, wait()); + EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type); + EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial); + EXPECT_EQ(::android::hardware::radio::V1_6::RadioError::NONE, radioRsp_v1_6->rspInfo.error); +} + /* * Test IRadio_1_6.sendSms() for the response returned. */ diff --git a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h index 7f64ba2f10..f3eaed6be3 100644 --- a/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h +++ b/radio/1.6/vts/functional/radio_hidl_hal_utils_v1_6.h @@ -828,6 +828,10 @@ class RadioResponse_v1_6 : public ::android::hardware::radio::V1_6::IRadioRespon Return getCurrentCallsResponse_1_6( const ::android::hardware::radio::V1_6::RadioResponseInfo& info, const ::android::hardware::hidl_vec<::android::hardware::radio::V1_6::Call>& calls); + + Return getSlicingConfigResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& info, + const ::android::hardware::radio::V1_6::SlicingConfig& slicingConfig); }; /* Callback class for radio indication */ diff --git a/radio/1.6/vts/functional/radio_response.cpp b/radio/1.6/vts/functional/radio_response.cpp index 3c611f9f54..23d57afc2a 100644 --- a/radio/1.6/vts/functional/radio_response.cpp +++ b/radio/1.6/vts/functional/radio_response.cpp @@ -1221,3 +1221,11 @@ Return RadioResponse_v1_6::getCurrentCallsResponse_1_6( parent_v1_6.notify(info.serial); return Void(); } + +Return RadioResponse_v1_6::getSlicingConfigResponse( + const ::android::hardware::radio::V1_6::RadioResponseInfo& info, + const ::android::hardware::radio::V1_6::SlicingConfig& /*slicingConfig*/) { + rspInfo = info; + parent_v1_6.notify(info.serial); + return Void(); +}