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
diff --git a/radio/1.6/IRadio.hal b/radio/1.6/IRadio.hal
index aa92975..e7267ef 100644
--- a/radio/1.6/IRadio.hal
+++ b/radio/1.6/IRadio.hal
@@ -511,6 +511,19 @@
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
* switch and everytime the framework receives a new certificate.
diff --git a/radio/1.6/IRadioResponse.hal b/radio/1.6/IRadioResponse.hal
index a1ad207..a4744e1 100644
--- a/radio/1.6/IRadioResponse.hal
+++ b/radio/1.6/IRadioResponse.hal
@@ -26,6 +26,7 @@
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 @@
* RadioError:CANCELLED
*/
oneway getCurrentCallsResponse_1_6(RadioResponseInfo info, vec<Call> 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 28c9fa8..c171701 100644
--- a/radio/1.6/types.hal
+++ b/radio/1.6/types.hal
@@ -972,6 +972,150 @@
};
/**
+ * 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<UrspRule> 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<TrafficDescriptor> trafficDescriptors;
+ /**
+ * List of routes (connection parameters) that must be used for requests
+ * matching a trafficDescriptor.
+ */
+ vec<RouteSelectionDescriptor> 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> 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> 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<string> 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<SliceInfo> 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<SliceInfo> 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<RejectedSliceInfo> rejected;
+ /**
+ * Default configured NSSAI
+ */
+ vec<SliceInfo> 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.
*/
enum PublicKeyType : int32_t {
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 a460c72..fb50990 100644
--- a/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.6/vts/functional/radio_hidl_hal_api.cpp
@@ -164,6 +164,18 @@
}
/*
+ * 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.
*/
TEST_P(RadioHidlTest_v1_6, sendSms_1_6) {
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 7f64ba2..f3eaed6 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 @@
Return<void> getCurrentCallsResponse_1_6(
const ::android::hardware::radio::V1_6::RadioResponseInfo& info,
const ::android::hardware::hidl_vec<::android::hardware::radio::V1_6::Call>& calls);
+
+ Return<void> 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 3c611f9..23d57af 100644
--- a/radio/1.6/vts/functional/radio_response.cpp
+++ b/radio/1.6/vts/functional/radio_response.cpp
@@ -1221,3 +1221,11 @@
parent_v1_6.notify(info.serial);
return Void();
}
+
+Return<void> 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();
+}