Section: 5.3.3.4 Reception of the RRCSetup by the UE
Content: The UE shall perform the following actions upon reception of the RRCSetup: 1> if the RRCSetup is received in response to an RRCReestablishmentRequest; or 1> if the RRCSetup is received in response to an RRCResumeRequest or RRCResumeRequest1: 2> if the UE is NCR-MT: 3> indicate to NCR-Fwd to cease forwarding; 2> if sdt-MAC-PHY-CG-Config is configured: 3> instruct the MAC entity to stop the cg-SDT-TimeAlignmentTimer, if it is running; 3> instruct the MAC entity to start the timeAlignmentTimer associated with the PTAG, if it is not running; 2> if srs-PosRRC-Inactive is configured: 3> instruct the MAC entity to stop the inactivePosSRS-TimeAlignmentTimer, if it is running; 2> if srs-PosRRC-InactiveValidityAreaConfig is configured: 3> instruct the MAC entity to stop the inactivePosSRS-ValidityAreaTAT, if it is running; 2> discard any stored UE Inactive AS context and suspendConfig; 2> discard any current AS security context including the KRRCenc key, the KRRCint key, the KUPint key and the KUPenc key; 2> release radio resources for all established RBs except SRB0 and broadcast MRBs, including release of the RLC entities, of the associated PDCP entities and of SDAP; 2> release the RRC configuration except for the default L1 parameter values, default MAC Cell Group configuration, CCCH configuration and broadcast MRBs; 2> indicate to upper layers fallback of the RRC connection; 2> for each application layer measurement configuration with configForRRC-IdleInactive absent or not set to true: 3> discard any application layer measurement reports which were not transmitted yet; 3> inform upper layers about the release of all application layer measurement configurations; 2> stop timer T380, if running; 1> perform the cell group configuration procedure in accordance with the received masterCellGroup and as specified in 5.3.5.5; 1> perform the radio bearer configuration procedure in accordance with the received radioBearerConfig and as specified in 5.3.5.6; 1> if stored, discard the cell reselection priority information provided by the cellReselectionPriorities or inherited from another RAT; 1> stop timer T300, T301, T319; 1> if T319a is running: 2> stop T319a; 2> consider SDT procedure is not ongoing; 1> if T390 is running: 2> stop timer T390 for all access categories; 2> perform the actions as specified in 5.3.14.4; 1> if T302 is running: 2> stop timer T302; 2> perform the actions as specified in 5.3.14.4; 1> stop timer T320, if running; 1> if the RRCSetup is received in response to an RRCResumeRequest, RRCResumeRequest1 or RRCSetupRequest: 2> if T331 is running: 3> stop timer T331; 3> perform the actions as specified in 5.7.8.3; 2> enter RRC_CONNECTED; 2> stop the cell re-selection procedure; 2> stop relay (re)selection procedure if any for L2 U2N Remote UE; 1> consider the current cell to be the PCell; 1> perform the L2 U2N Remote UE configuration procedure in accordance with the received sl-L2RemoteUE-Config as specified in 5.3.5.16; 1> perform the sidelink dedicated configuration procedure in accordance with the received sl-ConfigDedicatedNR as specified in 5.3.5.14; 1> if the UE has radio link failure or handover failure information available in VarRLF-Report and if the RPLMN is included in plmn-IdentityList stored in VarRLF-Report: 2> if reconnectCellId in VarRLF-Report is not set after failing to perform reestablishment and if this is the first RRCSetup received by the UE after declaring the failure: 3> if the UE supports RLF-Report for conditional handover and if choCellId in VarRLF-Report is set: 4> set timeUntilReconnection in VarRLF-Report to the time that elapsed since the radio link failure or handover failure experienced in the failedPCellId stored in VarRLF-Report; 3> else: 4> set timeUntilReconnection in VarRLF-Report to the time that elapsed since the last radio link failure or handover failure; 3> set nrReconnectCellId in reconnectCellId in VarRLF-Report to the global cell identity and the tracking area code of the PCell; 1> if the UE supports RLF report for inter-RAT MRO NR as defined in TS 36.306[ Evolved Universal Terrestrial Radio Access (E-UTRA); User Equipment (UE) radio access capabilities ]  [62], and if the UE has radio link failure or handover failure information available in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10] and if the RPLMN is included in plmn-IdentityList stored in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10]: 2> if reconnectCellId in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ] [10] is not set after failing to perform reestablishment and if this is the first RRCSetup received by the UE after declaring the failure: 3> set timeUntilReconnection in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ] [10] to the time that elapsed since the last radio link failure or handover failure in LTE; 3> set nrReconnectCellId in reconnectCellId in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ] [10] to the global cell identity and the tracking area code of the PCell; 1> set the content of RRCSetupComplete message as follows: 2> if upper layers provide a 5G-S-TMSI: 3> if the RRCSetup is received in response to an RRCSetupRequest: 4> set the ng-5G-S-TMSI-Value to ng-5G-S-TMSI-Part2; 3> else: 4> set the ng-5G-S-TMSI-Value to ng-5G-S-TMSI; 2> if upper layers selected an SNPN or a PLMN and in case of PLMN UE is either allowed or instructed to access the PLMN via a cell for which at least one CAG ID is broadcast: 3> set the selectedPLMN-Identity from the npn-IdentityInfoList; 2> else: 3> set the selectedPLMN-Identity to the PLMN selected by upper layers from the plmn-IdentityInfoList; 2> if upper layers provide the 'Registered AMF': 3> include and set the registeredAMF as follows: 4> if the PLMN identity of the 'Registered AMF' is different from the PLMN selected by the upper layers: 5> include the plmnIdentity in the registeredAMF and set it to the value of the PLMN identity in the 'Registered AMF' received from upper layers; 4> set the amf-Identifier to the value received from upper layers; 3> include and set the guami-Type to the value provided by the upper layers; 2> if upper layers provide one or more S-NSSAI (see TS 23.003[ Numbering, addressing and identification ]  [21]): 3> include the s-NSSAI-List and set the content to the values provided by the upper layers; 2> if upper layers provide onboarding request indication: 3> include the onboardingRequest; 2> set the dedicatedNAS-Message to include the information received from upper layers; 2> if connecting as an IAB-node: 3> include the iab-NodeIndication; 2> else if connecting as a mobile IAB-node: 3> include the mobileIAB-NodeIndication; 2> if connecting as an NCR-node: 3> include the ncr-NodeIndication; 2> if the SIB1 contains idleModeMeasurementsNR and the UE has NR idle/inactive measurement information concerning cells other than the PCell available in VarMeasIdleReport; or 2> if the SIB1 contains idleModeMeasurementsEUTRA and the UE has E-UTRA idle/inactive measurement information available in VarMeasIdleReport: 3> include the idleMeasAvailable; 2> if the UE has logged measurements available for NR and if the RPLMN is included in plmn-IdentityList stored in VarLogMeasReport; or 2> if the UE has logged measurements available for NR and if the current registered SNPN is included in snpn-ConfigIDList stored in VarLogMeasReport: 3> include the logMeasAvailable in the RRCSetupComplete message; 3> if Bluetooth measurement results are included in the logged measurements the UE has available for NR: 4> include the logMeasAvailableBT in the RRCSetupComplete message; 3> if WLAN measurement results are included in the logged measurements the UE has available for NR: 4> include the logMeasAvailableWLAN in the RRCSetupComplete message; 2> if the sigLoggedMeasType in VarLogMeasReport is included; or 2> if the UE is capable of reporting availability of signalling based logged MDT for inter-RAT (i.e. LTE to NR), and if the sigLoggedMeasType in VarLogMeasReport of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10] is included: 3> if T330 timer is running (associated to the logged measurement configuration for NR or for LTE): 4> set sigLogMeasConfigAvailable to true in the RRCSetupComplete message; 3> else: 4> if the UE has logged measurements: 5> set sigLogMeasConfigAvailable to false in the RRCSetupComplete message; 2> if the UE has connection establishment failure or connection resume failure information available in VarConnEstFailReport or VarConnEstFailReportList and if the RPLMN is equal to plmn-Identity stored in VarConnEstFailReport or in at least one of the entries of VarConnEstFailReportList; or 2> if the UE has connection establishment failure information or connection resume failure information available in VarConnEstFailReport or VarConnEstFailReportList and if the current registered SNPN identity is equal to snpn-identity stored in VarConnEstFailReport or any entry of VarConnEstFailReportList: 3> include connEstFailInfoAvailable in the RRCSetupComplete message; 2> if the UE has radio link failure or handover failure information available in VarRLF-Report and if the RPLMN is included in plmn-IdentityList stored in VarRLF-Report, or 2> if the UE has radio link failure or handover failure information available in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10], and if the UE is capable of cross-RAT RLF reporting and if the RPLMN is included in plmn-IdentityList stored in VarRLF-Report of TS 36.331[ Evolved Universal Terrestrial Radio Access (E-UTRA); Radio Resource Control (RRC); Protocol specification ]  [10]; or 2> if the UE has radio link failure or handover failure information available in VarRLF-Report and if the current registered SNPN is included in snpn-IdentityList stored in the VarRLF-Report: 3> include rlf-InfoAvailable in the RRCSetupComplete message; 2> if the UE has successful handover information available in VarSuccessHO-Report and if the RPLMN is included in plmn-IdentityList stored in VarSuccessHO-Report; or 2> if the UE has successful handover information available in VarSuccessHO-Report and if the current registered SNPN is included in snpn-IdentityList stored in the VarSuccessHO-Report: 3> include successHO-InfoAvailable in the RRCSetupComplete message; 2> if the UE has successful PSCell change or addition information available in VarSuccessPSCell-Report and if the RPLMN is included in plmn-IdentityList stored in VarSuccessPSCell-Report; or 2> if the UE has successful PSCell change or addition information available in VarSuccessPSCell-Report and if the current registered SNPN is included in snpn-IdentityList stored in the VarSuccessPSCell-Report: 3> include successPSCell-InfoAvailable in the RRCSetupComplete message; 2> if the UE supports storage of mobility history information and the UE has mobility history information available in VarMobilityHistoryReport: 3> include the mobilityHistoryAvail in the RRCSetupComplete message; 2> if the UE is configured with at least one application layer measurement with configForRRC-IdleInactive set to true: 3> for each application layer measurement configuration with configForRRC-IdleInactive set to true: 4> if the RPLMN is not included in plmn-IdentityList in VarAppLayerPLMN-ListConfig: 5> forward the measConfigAppLayerId and inform upper layers about the release of the application layer measurement configuration; 5> discard any application layer measurement reports which were not yet submitted to lower layers for transmission; 5> release the application layer measurement configuration in UE variables VarAppLayerIdleConfig and VarAppLayerPLMN-ListConfig; 5> consider itself not to be configured to send application layer measurement report for the measConfigAppLayerId; 3> if at least one stored application layer measurement configuration or application layer measurement report container has not been released: 4> include measConfigReportAppLayerAvailable in the RRCSetupComplete message; 2> if the UE supports uplink RRC message segmentation of UECapabilityInformation: 3> may include the ul-RRC-Segmentation in the RRCSetupComplete message; 2> if the RRCSetup is received in response to an RRCResumeRequest, RRCResumeRequest1 or RRCSetupRequest: 3> if speedStateReselectionPars is configured in the SIB2: 4> include the mobilityState in the RRCSetupComplete message and set it to the mobility state (as specified in TS 38.304[ NR; User Equipment (UE) procedures in Idle mode and in RRC Inactive state ]  [20]) of the UE just prior to entering RRC_CONNECTED state; 2> if the SIB1 contains musim-CapRestrictionAllowed and the UE capability is restricted for MUSIM operation: 3> if supported, include the musim-CapRestrictionInd in the RRCSetupComplete message upon determining it has temporary capability restriction; 2> if the UE has flight path information available: 3> include flightPathInfoAvailable; 1> submit the RRCSetupComplete message to lower layers for transmission, upon which the procedure ends.