Merge remote-tracking branch 'origin/develop' into threading-rk
This commit is contained in:
@@ -331,7 +331,9 @@ typedef struct nas_establish_req_s {
|
||||
* fill me
|
||||
*/
|
||||
typedef struct nas_deregistration_req_s {
|
||||
// fill me
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} nas_deregistration_req_t;
|
||||
|
||||
/*
|
||||
@@ -469,7 +471,11 @@ typedef ul_info_transfer_ind_t dl_info_transfer_ind_t;
|
||||
*/
|
||||
|
||||
/* TODO: Quality of Service parameters */
|
||||
typedef struct {} as_qos_t;
|
||||
typedef struct {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} as_qos_t;
|
||||
|
||||
/*
|
||||
* NAS->AS - Radio access bearer establishment request
|
||||
|
||||
@@ -73,7 +73,9 @@ typedef struct f1ap_net_ip_address_s {
|
||||
} f1ap_net_ip_address_t;
|
||||
|
||||
typedef struct f1ap_cu_setup_req_s {
|
||||
//
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} f1ap_cu_setup_req_t;
|
||||
|
||||
typedef struct cellIDs_s {
|
||||
|
||||
@@ -90,7 +90,9 @@ typedef struct m2ap_net_ip_address_s {
|
||||
} m2ap_net_ip_address_t;
|
||||
|
||||
typedef struct m2ap_enb_setup_req_s {
|
||||
//
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_enb_setup_req_t;
|
||||
|
||||
|
||||
@@ -449,6 +451,9 @@ typedef struct m2ap_register_enb_req_s {
|
||||
|
||||
typedef struct m2ap_subframe_process_s {
|
||||
/* nothing, we simply use the module ID in the header */
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_subframe_process_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
@@ -533,48 +538,114 @@ typedef struct m2ap_enb_sctp_req_s {
|
||||
|
||||
|
||||
typedef struct m2ap_mbms_scheduling_information_resp_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_scheduling_information_resp_t;
|
||||
typedef struct m2ap_session_start_req_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_session_start_req_t;
|
||||
typedef struct m2ap_session_start_resp_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_session_start_resp_t;
|
||||
typedef struct m2ap_session_start_failure_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_session_start_failure_t;
|
||||
typedef struct m2ap_session_stop_req_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_session_stop_req_t;
|
||||
typedef struct m2ap_session_stop_resp_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_session_stop_resp_t;
|
||||
typedef struct m2ap_reset_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_reset_t;
|
||||
typedef struct m2ap_enb_configuration_update_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_enb_configuration_update_t;
|
||||
typedef struct m2ap_enb_configuration_update_ack_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_enb_configuration_update_ack_t;
|
||||
typedef struct m2ap_enb_configuration_update_failure_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_enb_configuration_update_failure_t;
|
||||
typedef struct m2ap_mce_configuration_update_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mce_configuration_update_t;
|
||||
typedef struct m2ap_mce_configuration_update_ack_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mce_configuration_update_ack_t;
|
||||
typedef struct m2ap_mce_configuration_update_failure_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mce_configuration_update_failure_t;
|
||||
typedef struct m2ap_error_indication_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m2ap_error_indication_t;
|
||||
typedef struct m2ap_mbms_session_update_req_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_session_update_req_t;
|
||||
typedef struct m2ap_mbms_session_update_resp_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_session_update_resp_t;
|
||||
typedef struct m2ap_mbms_session_update_failure_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_session_update_failure_t;
|
||||
typedef struct m2ap_mbms_service_counting_report_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_service_counting_report_t;
|
||||
typedef struct m2ap_mbms_overload_notification_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_overload_notification_t;
|
||||
typedef struct m2ap_mbms_service_counting_req_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_service_counting_req_t;
|
||||
typedef struct m2ap_mbms_service_counting_resp_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_service_counting_resp_t;
|
||||
typedef struct m2ap_mbms_service_counting_failure_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m2ap_mbms_service_counting_failure_t;
|
||||
|
||||
|
||||
|
||||
@@ -160,6 +160,9 @@ typedef struct m3ap_register_mce_req_s {
|
||||
|
||||
typedef struct m3ap_subframe_process_s {
|
||||
/* nothing, we simply use the module ID in the header */
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} m3ap_subframe_process_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
@@ -270,28 +273,64 @@ typedef struct m3ap_mme_sctp_req_s {
|
||||
|
||||
|
||||
typedef struct m3ap_session_start_req_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_start_req_t;
|
||||
typedef struct m3ap_session_start_resp_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_start_resp_t;
|
||||
typedef struct m3ap_session_start_failure_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_start_failure_t;
|
||||
typedef struct m3ap_session_stop_req_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_stop_req_t;
|
||||
typedef struct m3ap_session_stop_resp_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_stop_resp_t;
|
||||
typedef struct m3ap_session_stop_failure_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_session_stop_failure_t;
|
||||
typedef struct m3ap_error_indication_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_error_indication_t;
|
||||
typedef struct m3ap_reset_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_reset_t;
|
||||
typedef struct m3ap_reset_ack_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_reset_ack_t;
|
||||
typedef struct m3ap_mbms_session_update_req_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mbms_session_update_req_t;
|
||||
typedef struct m3ap_mbms_session_update_resp_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mbms_session_update_resp_t;
|
||||
typedef struct m3ap_mbms_session_update_failure_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mbms_session_update_failure_t;
|
||||
typedef struct m3ap_setup_req_s{
|
||||
/* Connexion id used between SCTP/M3AP */
|
||||
@@ -306,14 +345,29 @@ typedef struct m3ap_setup_req_s{
|
||||
uint16_t default_sctp_stream_id;
|
||||
}m3ap_setup_req_t;
|
||||
typedef struct m3ap_setup_resp_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_setup_resp_t;
|
||||
typedef struct m3ap_setup_failure_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_setup_failure_t;
|
||||
typedef struct m3ap_mce_configuration_update_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mce_configuration_update_t;
|
||||
typedef struct m3ap_mce_configuration_update_ack_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mce_configuration_update_ack_t;
|
||||
typedef struct m3ap_mce_configuration_update_failure_s{
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
}m3ap_mce_configuration_update_failure_t;
|
||||
|
||||
|
||||
|
||||
@@ -82,6 +82,9 @@ typedef struct PhyConfigurationReq_s {
|
||||
|
||||
// UE: RRC -> PHY messages
|
||||
typedef struct PhyDeactivateReq_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} PhyDeactivateReq;
|
||||
|
||||
typedef struct PhyFindCellReq_s {
|
||||
@@ -93,9 +96,15 @@ typedef struct PhyFindCellReq_s {
|
||||
} PhyFindCellReq;
|
||||
|
||||
typedef struct PhyFindNextCellReq_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} PhyFindNextCellReq;
|
||||
|
||||
typedef struct PhyMeasThresholdReq_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
# if ENABLE_RAL
|
||||
ral_transaction_id_t transaction_id;
|
||||
ral_link_cfg_param_t cfg_param;
|
||||
@@ -103,6 +112,9 @@ typedef struct PhyMeasThresholdReq_s {
|
||||
} PhyMeasThresholdReq;
|
||||
|
||||
typedef struct PhyMeasReportInd_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
# if ENABLE_RAL
|
||||
ral_threshold_t threshold;
|
||||
ral_link_param_t link_param;
|
||||
@@ -119,6 +131,9 @@ typedef struct PhyFindCellInd_s {
|
||||
} PhyFindCellInd;
|
||||
|
||||
typedef struct PhyMeasThresholdConf_s {
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
# if ENABLE_RAL
|
||||
ral_transaction_id_t transaction_id;
|
||||
ral_status_t status;
|
||||
|
||||
@@ -174,6 +174,9 @@ typedef struct x2ap_register_enb_req_s {
|
||||
|
||||
typedef struct x2ap_subframe_process_s {
|
||||
/* nothing, we simply use the module ID in the header */
|
||||
// This dummy element is to avoid CLANG warning: empty struct has size 0 in C, size 1 in C++
|
||||
// To be removed if the structure is filled
|
||||
uint32_t dummy;
|
||||
} x2ap_subframe_process_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
#define MME_CONFIG_STRING_MME_M3 "enable_mme_m3"
|
||||
|
||||
#define MMEPARAMS_DESC {\
|
||||
{MME_CONFIG_STRING_MME_ID, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
{MME_CONFIG_STRING_MME_NAME, NULL, 0, strptr:NULL, defstrval:"OAIMME", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_M3, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_ID, NULL, 0, .uptr=NULL, .defintval=0, TYPE_UINT, 0}, \
|
||||
{MME_CONFIG_STRING_MME_NAME, NULL, 0, .strptr=NULL, .defstrval="OAIMME", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_M3, NULL, 0, .strptr=NULL, .defstrval="no", TYPE_STRING, 0}, \
|
||||
}
|
||||
|
||||
#define MME_MME_ID_IDX 0
|
||||
@@ -75,9 +75,9 @@
|
||||
|
||||
|
||||
#define MME_NETPARAMS_DESC { \
|
||||
{MME_CONFIG_STRING_MME_INTERFACE_NAME_FOR_M3_MCE, NULL, 0, strptr:&mme_interface_name_for_m3_mce, defstrval:"lo", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_IPV4_ADDRESS_FOR_M3C, NULL, 0, strptr:&mme_ipv4_address_for_m3c, defstrval:"127.0.0.18/24", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_PORT_FOR_M3C, NULL, 0, uptr:&mme_port_for_m3c, defintval:36444L, TYPE_UINT, 0}, \
|
||||
{MME_CONFIG_STRING_MME_INTERFACE_NAME_FOR_M3_MCE, NULL, 0, .strptr=&mme_interface_name_for_m3_mce, .defstrval="lo", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_IPV4_ADDRESS_FOR_M3C, NULL, 0, .strptr=&mme_ipv4_address_for_m3c, .defstrval="127.0.0.18/24", TYPE_STRING, 0}, \
|
||||
{MME_CONFIG_STRING_MME_PORT_FOR_M3C, NULL, 0, .uptr=&mme_port_for_m3c, .defintval=36444L, TYPE_UINT, 0}, \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -691,7 +691,7 @@ void RCconfig_nr_prs(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E(PHY,"No " CONFIG_STRING_PRS_CONFIG " configuration found..!!\n");
|
||||
LOG_I(PHY,"No " CONFIG_STRING_PRS_CONFIG " configuration found..!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1899,8 +1899,12 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
|
||||
|
||||
f1Setup->measurement_timing_information[k] = "0";
|
||||
f1Setup->ranac[k] = 0;
|
||||
f1Setup->mib[k] = rrc->carrier.MIB;
|
||||
f1Setup->mib_length[k] = rrc->carrier.sizeof_MIB;
|
||||
DevAssert(rrc->carrier.mib != NULL);
|
||||
int buf_len = 3; // this is what we assume in monolithic
|
||||
f1Setup->mib[k] = calloc(buf_len, sizeof(*f1Setup->mib[k]));
|
||||
DevAssert(f1Setup->mib[k] != NULL);
|
||||
f1Setup->mib_length[k] = encode_MIB_NR(rrc->carrier.mib, 0, f1Setup->mib[k], buf_len);
|
||||
DevAssert(f1Setup->mib_length[k] == buf_len);
|
||||
|
||||
NR_BCCH_DL_SCH_Message_t *bcch_message = NULL;
|
||||
asn_codec_ctx_t st={100*1000};
|
||||
|
||||
@@ -707,7 +707,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
uint16_t msi_control_element[29], *msi_ptr;
|
||||
// MSI buffer pointer
|
||||
char *buffer_pointer=NULL;
|
||||
if (msi_flag == 1 && cc->mbms_SessionList) {
|
||||
if (msi_flag == 1 && cc->mbms_SessionList[mbms_mch_i]) {
|
||||
// Create MSI here
|
||||
msi_ptr = &msi_control_element[0];
|
||||
|
||||
@@ -867,7 +867,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
|
||||
// there is MTCHs, loop if there are more than 1
|
||||
// BAd race condition: all this struct is filled by another thread, no mutex or any code to make it coherent
|
||||
if (mtch_flag == 1 && cc->mbms_SessionList && cc->mbms_SessionList[0] && cc->mbms_SessionList[0]->list.array[0]) {
|
||||
if (mtch_flag == 1 && cc->mbms_SessionList[0] && cc->mbms_SessionList[0]->list.array[0]) {
|
||||
// Calculate TBS
|
||||
// get MTCH data from RLC (like for DTCH)
|
||||
LOG_D(MAC, "[eNB %d] CC_id %d Frame %d subframeP %d: Schedule MTCH (area %d, sfAlloc %d)\n", module_idP, CC_id, frameP, subframeP, i, j);
|
||||
|
||||
@@ -4651,29 +4651,32 @@ void find_period_offset_SR(const NR_SchedulingRequestResourceConfig_t *Schedulin
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl) {
|
||||
|
||||
uint16_t O_crc;
|
||||
|
||||
if (O_tot<12)
|
||||
O_crc = 0;
|
||||
int compute_pucch_crc_size(int O_uci)
|
||||
{
|
||||
if (O_uci < 12)
|
||||
return 0;
|
||||
else{
|
||||
if (O_tot<20)
|
||||
O_crc = 6;
|
||||
if (O_uci < 20)
|
||||
return 6;
|
||||
else {
|
||||
if (O_tot<360)
|
||||
O_crc = 11;
|
||||
if (O_uci < 360)
|
||||
return 11;
|
||||
else
|
||||
AssertFatal(1==0,"Case for segmented PUCCH not yet implemented");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_uci,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
uint8_t n_re_ctrl)
|
||||
{
|
||||
int O_crc = compute_pucch_crc_size(O_uci);
|
||||
int O_tot = O_uci + O_crc;
|
||||
|
||||
int rtimes100;
|
||||
switch(*maxCodeRate){
|
||||
@@ -4704,25 +4707,27 @@ uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
|
||||
float r = (float)rtimes100/100;
|
||||
|
||||
if (O_csi == O_tot) {
|
||||
if ((O_tot+O_csi)>(nr_prbs*n_re_ctrl*n_symb*Qm*r))
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
}
|
||||
AssertFatal(O_tot <= (nr_prbs * n_re_ctrl * n_symb * Qm * r),
|
||||
"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with %d PRBs",
|
||||
r,
|
||||
O_tot,
|
||||
O_crc,
|
||||
nr_prbs);
|
||||
|
||||
if (format==2){
|
||||
// TODO fix this for multiple CSI reports
|
||||
for (int i=1; i<=nr_prbs; i++){
|
||||
if((O_tot+O_crc)<=(i*n_symb*Qm*n_re_ctrl*r) &&
|
||||
(O_tot+O_crc)>((i-1)*n_symb*Qm*n_re_ctrl*r))
|
||||
for (int i = nr_prbs; i > 0; i--) {
|
||||
// compute code rate factor for next prb value
|
||||
int next_prb_factor = (i - 1) * n_symb * Qm * n_re_ctrl * r;
|
||||
// if it does not sa
|
||||
if (O_tot > next_prb_factor)
|
||||
return i;
|
||||
}
|
||||
AssertFatal(1==0,"MaxCodeRate %.2f can't support %d UCI bits and %d CRC bits with at most %d PRBs",
|
||||
r,O_tot,O_crc,nr_prbs);
|
||||
}
|
||||
else{
|
||||
AssertFatal(1==0,"Not yet implemented");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_dlbw_tbslbrm(int scc_bwpsize,
|
||||
|
||||
@@ -171,7 +171,7 @@ int64_t *get_prach_config_info(frequency_range_t freq_range,
|
||||
uint8_t unpaired);
|
||||
|
||||
uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
|
||||
|
||||
int compute_pucch_crc_size(int O_uci);
|
||||
uint8_t get_l0_ul(uint8_t mapping_type, uint8_t dmrs_typeA_position);
|
||||
int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmrs_AdditionalPosition_t additional_pos, pusch_maxLength_t pusch_maxLength, uint8_t start_symbolt, uint8_t dmrs_typeA_position);
|
||||
|
||||
@@ -238,8 +238,7 @@ uint8_t get_pusch_nb_antenna_ports(NR_PUSCH_Config_t *pusch_Config,
|
||||
|
||||
uint16_t compute_pucch_prb_size(uint8_t format,
|
||||
uint8_t nr_prbs,
|
||||
uint16_t O_tot,
|
||||
uint16_t O_csi,
|
||||
uint16_t O_uci,
|
||||
NR_PUCCH_MaxCodeRate_t *maxCodeRate,
|
||||
uint8_t Qm,
|
||||
uint8_t n_symb,
|
||||
|
||||
@@ -174,7 +174,6 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
}
|
||||
|
||||
mac->nr_band = *scc->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||
mac->frame_type = get_frame_type(mac->nr_band, get_softmodem_params()->numerology);
|
||||
// cell config
|
||||
|
||||
@@ -261,8 +260,8 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
|
||||
|
||||
void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
module_id_t module_id,
|
||||
int cc_idP) {
|
||||
|
||||
int cc_idP)
|
||||
{
|
||||
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
int i;
|
||||
@@ -717,7 +716,7 @@ int nr_rrc_mac_config_req_ue(module_id_t module_id,
|
||||
if (sccP != NULL) {
|
||||
|
||||
mac->scc_SIB = sccP;
|
||||
LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__);
|
||||
mac->nr_band = *sccP->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||
config_common_ue_sa(mac, module_id, cc_idP);
|
||||
configure_current_BWP(mac, sccP, NULL);
|
||||
|
||||
@@ -758,6 +757,7 @@ int nr_rrc_mac_config_req_ue(module_id_t module_id,
|
||||
ra->rach_ConfigDedicated = scell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
}
|
||||
mac->scc = scell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
mac->nr_band = *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
mac->physCellId = *mac->scc->physCellId;
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = scell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
@@ -793,6 +793,7 @@ int nr_rrc_mac_config_req_ue(module_id_t module_id,
|
||||
ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink;
|
||||
}
|
||||
mac->scc = cell_group_config->spCellConfig->reconfigurationWithSync->spCellConfigCommon;
|
||||
mac->nr_band = *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
if (mac->scc_SIB) {
|
||||
free(mac->scc_SIB);
|
||||
mac->scc_SIB = NULL;
|
||||
|
||||
@@ -336,7 +336,6 @@ typedef struct {
|
||||
bool ack_received;
|
||||
uint8_t pucch_resource_indicator;
|
||||
uint16_t feedback_to_ul;
|
||||
int is_common;
|
||||
frame_t dl_frame;
|
||||
int dl_slot;
|
||||
uint8_t ack;
|
||||
@@ -356,19 +355,18 @@ typedef struct {
|
||||
} RAR_grant_t;
|
||||
|
||||
typedef struct {
|
||||
int n_HARQ_ACK;
|
||||
NR_PUCCH_Resource_t *pucch_resource;
|
||||
uint32_t ack_payload;
|
||||
uint8_t sr_payload;
|
||||
uint32_t csi_part1_payload;
|
||||
uint32_t csi_part2_payload;
|
||||
int resource_indicator;
|
||||
int resource_set_id;
|
||||
int is_common;
|
||||
int initial_pucch_id;
|
||||
NR_PUCCH_Resource_t *pucch_resource;
|
||||
int n_sr;
|
||||
int n_csi;
|
||||
int n_harq;
|
||||
int n_CCE;
|
||||
int N_CCE;
|
||||
int8_t delta_pucch;
|
||||
int delta_pucch;
|
||||
int initial_pucch_id;
|
||||
} PUCCH_sched_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -197,10 +197,7 @@ bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
uint8_t nr_get_csi_measurements(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
int slot,
|
||||
PUCCH_sched_t *pucch);
|
||||
int nr_get_csi_measurements(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sched_t *pucch);
|
||||
|
||||
uint8_t get_ssb_rsrp_payload(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch,
|
||||
@@ -276,49 +273,41 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
uint8_t dai,
|
||||
int n_CCE,
|
||||
int N_CCE,
|
||||
int is_common,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
frame_t frame,
|
||||
int slot,
|
||||
PUCCH_sched_t *pucch);
|
||||
bool get_downlink_ack(NR_UE_MAC_INST_t *mac, frame_t frame, int slot, PUCCH_sched_t *pucch);
|
||||
|
||||
int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size);
|
||||
|
||||
void select_pucch_resource(NR_UE_MAC_INST_t *mac,
|
||||
PUCCH_sched_t *pucch);
|
||||
void multiplex_pucch_resource(NR_UE_MAC_INST_t *mac, PUCCH_sched_t *pucch, int num_res);
|
||||
|
||||
int16_t get_pucch_tx_power_ue(NR_UE_MAC_INST_t *mac,
|
||||
int scs,
|
||||
NR_PUCCH_Config_t *pucch_Config,
|
||||
PUCCH_sched_t *pucch,
|
||||
int delta_pucch,
|
||||
uint8_t format_type,
|
||||
uint16_t nb_of_prbs,
|
||||
uint8_t freq_hop_flag,
|
||||
uint8_t add_dmrs_flag,
|
||||
uint8_t freq_hop_flag,
|
||||
uint8_t add_dmrs_flag,
|
||||
uint8_t N_symb_PUCCH,
|
||||
int subframe_number,
|
||||
int O_ACK, int O_SR,
|
||||
int O_CSI, int O_CRC);
|
||||
int O_uci);
|
||||
|
||||
int get_deltatf(uint16_t nb_of_prbs,
|
||||
uint8_t N_symb_PUCCH,
|
||||
uint8_t freq_hop_flag,
|
||||
uint8_t add_dmrs_flag,
|
||||
int N_sc_ctrl_RB,
|
||||
int n_HARQ_ACK,
|
||||
int O_ACK, int O_SR,
|
||||
int O_CSI, int O_CRC);
|
||||
int O_UCI);
|
||||
|
||||
void nr_ue_configure_pucch(NR_UE_MAC_INST_t *mac,
|
||||
int slot,
|
||||
uint16_t rnti,
|
||||
PUCCH_sched_t *pucch,
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu,
|
||||
int O_SR, int O_ACK, int O_CSI);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu);
|
||||
|
||||
int nr_get_Pcmax(NR_UE_MAC_INST_t *mac, int Qm, bool powerBoostPi2BPSK, int scs, int N_RB_UL, bool is_transform_precoding, int n_prbs, int start_prb);
|
||||
|
||||
/* Random Access */
|
||||
|
||||
|
||||
@@ -35,10 +35,11 @@
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
//#undef MALLOC
|
||||
#include "assertions.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include <pthread.h>
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
@@ -66,9 +67,22 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,NULL,rrc_inst->scell_group_config);
|
||||
AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
// get default noS1 configuration
|
||||
NR_RadioBearerConfig_t *rbconfig = NULL;
|
||||
NR_RLC_BearerConfig_t *rlc_rbconfig = NULL;
|
||||
fill_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList rlc_bearer_list = {
|
||||
.list = { .array = &rlc_rbconfig, .count = 1, .size = 1, }
|
||||
};
|
||||
|
||||
// set up PDCP, RLC, MAC
|
||||
nr_pdcp_layer_init();
|
||||
nr_DRB_preconfiguration(nr_ue_mac_inst->crnti);
|
||||
nr_pdcp_add_drbs(ENB_FLAG_NO, nr_ue_mac_inst->crnti, 0, rbconfig->drb_ToAddModList, 0, NULL, NULL, &rlc_bearer_list);
|
||||
nr_rlc_add_drb(nr_ue_mac_inst->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
|
||||
nr_ue_mac_inst->logicalChannelBearer_exist[0] = true;
|
||||
|
||||
// free memory
|
||||
free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
|
||||
}
|
||||
// Allocate memory for ul_config_request in the mac instance. This is now a pointer and will
|
||||
// point to a list of structures (one for each UL slot) to store PUSCH scheduling parameters
|
||||
|
||||
@@ -40,93 +40,13 @@
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
// Implementation of 6.2.4 Configured ransmitted power
|
||||
// 3GPP TS 38.101-1 version 16.5.0 Release 16
|
||||
// -
|
||||
// The UE is allowed to set its configured maximum output power PCMAX,f,c for carrier f of serving cell c in each slot.
|
||||
// The configured maximum output power PCMAX,f,c is set within the following bounds: PCMAX_L,f,c <= PCMAX,f,c <= PCMAX_H,f,c
|
||||
// -
|
||||
// Measurement units:
|
||||
// - p_max: dBm
|
||||
// - delta_TC_c: dB
|
||||
// - P_powerclass: dBm
|
||||
// - delta_P_powerclass: dB
|
||||
// - MPR_c: dB
|
||||
// - delta_MPR_c: dB
|
||||
// - delta_T_IB_c dB
|
||||
// - delta_rx_SRS dB
|
||||
// note:
|
||||
// - Assuming:
|
||||
// -- Powerclass 3 capable UE (which is default power class unless otherwise stated)
|
||||
// -- Maximum power reduction (MPR_c) for power class 3, QPSK, inner RB allocations
|
||||
// -- no additional MPR (A_MPR_c)
|
||||
// todo:
|
||||
// - in current implementation delta_P_powerclass is not handling power classes different from 3
|
||||
long nr_get_Pcmax(module_id_t mod_id){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
uint32_t band = (mac->scc!=NULL) ? *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] :
|
||||
*mac->scc_SIB->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list.array[0]->freqBandIndicatorNR;
|
||||
NR_P_Max_t p_max = 0;
|
||||
uint8_t P_powerclass = 23;
|
||||
uint8_t delta_P_powerclass = 0;
|
||||
uint8_t MPR_c = 1;
|
||||
uint8_t delta_MPR_c = 0;
|
||||
uint8_t A_MPR_c = 0;
|
||||
uint8_t delta_T_IB_c = 0;
|
||||
uint8_t delta_TC_c = 0;
|
||||
uint8_t delta_rx_SRS = 0;
|
||||
uint8_t P_MPR_c = 0;
|
||||
long P_cmax_l = 0;
|
||||
long P_cmax_h = 0;
|
||||
long P_cmax = 0;
|
||||
|
||||
if (band == 28 && mac->phy_config.config_req.carrier_config.uplink_bandwidth == 30){
|
||||
delta_MPR_c = 1;
|
||||
}
|
||||
|
||||
if (mac->cg && mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1){
|
||||
if (*mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->ext1->powerBoostPi2BPSK == 1){
|
||||
// TbD: assuming power class 3 capable UE operating in TDD bands n40, n41, n77, n78, and n79 with Pi/2 BPSK modulation
|
||||
delta_P_powerclass = -3;
|
||||
p_max += 3;
|
||||
}
|
||||
}
|
||||
|
||||
NR_P_Max_t *p_Max = (mac->scc!=NULL) ? mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max : mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.p_Max;
|
||||
if (p_Max){
|
||||
|
||||
p_max += *p_Max;
|
||||
|
||||
LOG_D(MAC, "In %s maximum UL transmission power p_max is %ld dBm \n", __FUNCTION__, p_max);
|
||||
|
||||
P_cmax_l = min(p_max - delta_TC_c, (P_powerclass - delta_P_powerclass) - max(max(MPR_c + delta_MPR_c, A_MPR_c) + delta_T_IB_c + delta_TC_c + delta_rx_SRS, P_MPR_c));
|
||||
|
||||
P_cmax_h = min(p_max, P_powerclass - delta_P_powerclass);
|
||||
|
||||
} else {
|
||||
|
||||
P_cmax_l = (P_powerclass - delta_P_powerclass) - max(max(MPR_c + delta_MPR_c, A_MPR_c) + delta_T_IB_c + delta_TC_c + delta_rx_SRS, P_MPR_c);
|
||||
|
||||
P_cmax_h = P_powerclass - delta_P_powerclass;
|
||||
|
||||
}
|
||||
|
||||
P_cmax = (P_cmax_h + P_cmax_l) / 2;
|
||||
|
||||
LOG_D(MAC, "In %s configured maximum output power: %ld dBm <= PCMAX %ld dBm <= %ld dBm \n", __FUNCTION__, P_cmax_l, P_cmax, P_cmax_h);
|
||||
|
||||
return P_cmax;
|
||||
|
||||
}
|
||||
|
||||
int16_t get_prach_tx_power(module_id_t mod_id) {
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
RA_config_t *ra = &mac->ra;
|
||||
int16_t pathloss = compute_nr_SSB_PL(mac, mac->ssb_measurements.ssb_rsrp_dBm);
|
||||
int16_t ra_preamble_rx_power = (int16_t)(ra->prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER - pathloss + 30);
|
||||
return min(nr_get_Pcmax(mod_id), ra_preamble_rx_power);
|
||||
return min(ra->prach_resources.RA_PCMAX, ra_preamble_rx_power);
|
||||
|
||||
}
|
||||
|
||||
@@ -153,7 +73,13 @@ void init_RA(module_id_t mod_id,
|
||||
ra->RA_backoff_cnt = 0;
|
||||
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = 0;
|
||||
prach_resources->RA_PCMAX = nr_get_Pcmax(mod_id);
|
||||
NR_SubcarrierSpacing_t prach_scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
|
||||
int n_prbs = get_N_RA_RB (prach_scs, mac->current_UL_BWP.scs);
|
||||
int start_prb = rach_ConfigGeneric->msg1_FrequencyStart + mac->current_UL_BWP.BWPStart;
|
||||
int carrier_bandwidth = mac->scc_SIB ? mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->carrierBandwidth :
|
||||
mac->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
// PRACH shall be as specified for QPSK modulated DFT-s-OFDM of equivalent RB allocation (38.101-1)
|
||||
prach_resources->RA_PCMAX = nr_get_Pcmax(mac, 2, false, prach_scs, carrier_bandwidth, true, n_prbs, start_prb);
|
||||
prach_resources->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_COUNTER = 1;
|
||||
prach_resources->POWER_OFFSET_2STEP_RA = 0;
|
||||
@@ -488,7 +414,8 @@ void ra_preambles_config(NR_PRACH_RESOURCES_t *prach_resources, NR_UE_MAC_INST_t
|
||||
// Overwrite seed with non-random seed for IQ player/recorder
|
||||
seed = 1;
|
||||
} else {
|
||||
seed=(unsigned int) (rdtsc_oai() && ~0);
|
||||
// & to truncate the int64_t and keep only the LSB bits, up to sizeof(int)
|
||||
seed = (unsigned int) (rdtsc_oai() & ~0);
|
||||
}
|
||||
|
||||
RA_config_t *ra = &mac->ra;
|
||||
@@ -813,7 +740,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
|
||||
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
||||
int TBS_bytes = 848;
|
||||
int mac_ce_len = 0;
|
||||
int header_length_total=0;
|
||||
unsigned short post_padding = 1;
|
||||
|
||||
// fill ulsch_buffer with random data
|
||||
@@ -823,7 +749,6 @@ uint8_t nr_ue_get_rach(module_id_t mod_id,
|
||||
//Sending SDUs with size 1
|
||||
//Initialize elements of sdu_lengths
|
||||
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
|
||||
header_length_total += 2 + (sdu_lengths[0] >= 128);
|
||||
size_sdu += sdu_lengths[0];
|
||||
|
||||
if (size_sdu > 0) {
|
||||
@@ -1040,7 +965,8 @@ void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_res
|
||||
// Overwrite seed with non-random seed for IQ player/recorder
|
||||
seed = 1;
|
||||
} else {
|
||||
seed=(unsigned int) (rdtsc_oai() && ~0);
|
||||
// & to truncate the int64_t and keep only the LSB bits, up to sizeof(int)
|
||||
seed = (unsigned int) (rdtsc_oai() & ~0);
|
||||
}
|
||||
|
||||
ra->first_Msg3 = 1;
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file ra_procedures.c
|
||||
* \brief Routines for UE MAC-layer power control procedures
|
||||
* \author Francesco Mani
|
||||
* \date 2023
|
||||
* \version 0.1
|
||||
* \email: email@francescomani.it
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
// Implementation of 6.2.4 Configured ransmitted power
|
||||
// 3GPP TS 38.101-1 version 16.5.0 Release 16
|
||||
// -
|
||||
// The UE is allowed to set its configured maximum output power PCMAX,f,c for carrier f of serving cell c in each slot.
|
||||
// The configured maximum output power PCMAX,f,c is set within the following bounds: PCMAX_L,f,c <= PCMAX,f,c <= PCMAX_H,f,c
|
||||
// -
|
||||
// Measurement units:
|
||||
// - p_max: dBm
|
||||
// - delta_TC_c: dB
|
||||
// - P_powerclass: dBm
|
||||
// - delta_P_powerclass: dB
|
||||
// - MPR_c: dB
|
||||
// - delta_MPR_c: dB
|
||||
// - delta_T_IB_c dB
|
||||
// - delta_rx_SRS dB
|
||||
// note:
|
||||
// - Assuming:
|
||||
// -- Powerclass 3 capable UE (which is default power class unless otherwise stated)
|
||||
// -- Maximum power reduction (MPR_c) for power class 3
|
||||
// -- no additional MPR (A_MPR_c)
|
||||
int nr_get_Pcmax(NR_UE_MAC_INST_t *mac, int Qm, bool powerBoostPi2BPSK, int scs, int N_RB_UL, bool is_transform_precoding, int n_prbs, int start_prb)
|
||||
{
|
||||
int nr_band = mac->nr_band;
|
||||
if(mac->frequency_range == FR1) {
|
||||
|
||||
//TODO configure P-MAX from the upper layers according to 38.331
|
||||
long *p_emax = (mac->scc!=NULL) ? mac->scc->uplinkConfigCommon->frequencyInfoUL->p_Max : mac->scc_SIB->uplinkConfigCommon->frequencyInfoUL.p_Max;
|
||||
int p_powerclass = 23; // dBm assuming poweclass 3 UE
|
||||
|
||||
int delta_P_powerclass = 0; // for powerclass 2 needs to be changed
|
||||
if(p_emax && Qm == 1 && powerBoostPi2BPSK && (nr_band == 40 || nr_band == 41 || nr_band == 77 || nr_band == 78 || nr_band == 79)) {
|
||||
*p_emax += 3;
|
||||
delta_P_powerclass -= 3;
|
||||
}
|
||||
|
||||
// TODO to be set for CA and DC
|
||||
int delta_T_IB = 0;
|
||||
|
||||
// TODO in case of band 41 and PRB allocation within 4MHz of the upper or lower limit of the band -> delta_TC = 1.5
|
||||
if(nr_band == 41)
|
||||
LOG_E(NR_MAC, "Need to implement delta_TC for band 41\n");
|
||||
int delta_TC = 0;
|
||||
|
||||
float MPR = 0;
|
||||
frame_type_t frame_type = get_frame_type(nr_band, scs);
|
||||
if(compare_relative_ul_channel_bw(nr_band, scs, N_RB_UL, frame_type)) {
|
||||
int rb_low = (n_prbs / 2) > 1 ? (n_prbs / 2) : 1;
|
||||
int rb_high = N_RB_UL - rb_low - n_prbs;
|
||||
bool is_inner_rb = start_prb >= rb_low && start_prb <= rb_high && n_prbs <= ((N_RB_UL / 2) + (N_RB_UL & 1));
|
||||
// Table 6.2.2-1 in 38.101
|
||||
switch (Qm) {
|
||||
case 1 :
|
||||
AssertFatal(false, "MPR for Pi/2 BPSK not implemented yet\n");
|
||||
break;
|
||||
case 2 :
|
||||
if (is_transform_precoding) {
|
||||
if(!is_inner_rb)
|
||||
MPR = 1;
|
||||
}
|
||||
else {
|
||||
if(is_inner_rb)
|
||||
MPR = 1.5;
|
||||
else
|
||||
MPR = 3;
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
if (is_transform_precoding) {
|
||||
if(is_inner_rb)
|
||||
MPR = 1;
|
||||
else
|
||||
MPR = 2;
|
||||
}
|
||||
else {
|
||||
if(is_inner_rb)
|
||||
MPR = 2;
|
||||
else
|
||||
MPR = 3;
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
if (is_transform_precoding)
|
||||
MPR = 2.5;
|
||||
else
|
||||
MPR = 3.5;
|
||||
break;
|
||||
case 8 :
|
||||
if (is_transform_precoding)
|
||||
MPR = 4.5;
|
||||
else
|
||||
MPR = 6.5;
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(false, "Invalid Qm %d\n", Qm);
|
||||
}
|
||||
}
|
||||
|
||||
int A_MPR = 0; // TODO too complicated to implement for now (see 6.2.3 in 38.101-1)
|
||||
int delta_rx_SRS = 0; // TODO for SRS
|
||||
int P_MPR = 0; // to ensure compliance with applicable electromagnetic energy absorption requirements
|
||||
|
||||
float total_reduction = (MPR > A_MPR ? MPR : A_MPR) + delta_T_IB + delta_TC + delta_rx_SRS;
|
||||
if (P_MPR > total_reduction)
|
||||
total_reduction = P_MPR;
|
||||
int pcmax_high, pcmax_low;
|
||||
if(p_emax) {
|
||||
pcmax_high = *p_emax < (p_powerclass - delta_P_powerclass) ? *p_emax : (p_powerclass - delta_P_powerclass);
|
||||
pcmax_low = (*p_emax - delta_TC) < (p_powerclass - delta_P_powerclass - total_reduction) ?
|
||||
(*p_emax - delta_TC) : (p_powerclass - delta_P_powerclass - total_reduction);
|
||||
}
|
||||
else {
|
||||
pcmax_high = p_powerclass - delta_P_powerclass;
|
||||
pcmax_low = p_powerclass - delta_P_powerclass - total_reduction;
|
||||
}
|
||||
// TODO we need a strategy to select a value between minimum and maximum allowed PC_max
|
||||
int pcmax = (pcmax_low + pcmax_high) / 2;
|
||||
LOG_D(MAC, "Configured maximum output power: %d dBm <= PCMAX %d dBm <= %d dBm \n", pcmax_low, pcmax, pcmax_high);
|
||||
return pcmax;
|
||||
}
|
||||
else {
|
||||
// FR2 TODO it is even more complex because it is radiated power
|
||||
return 23;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2197,87 +2197,80 @@ void build_ssb_to_ro_map(NR_UE_MAC_INST_t *mac) {
|
||||
LOG_D(NR_MAC,"Map SSB to RO done\n");
|
||||
}
|
||||
|
||||
|
||||
void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, void *phy_data) {
|
||||
|
||||
void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, void *phy_data)
|
||||
{
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||
int O_SR = 0;
|
||||
int O_ACK = 0;
|
||||
int O_CSI = 0;
|
||||
int N_UCI = 0;
|
||||
PUCCH_sched_t pucch[3] = {0}; // TODO the size might change in the future in case of multiple SR or multiple CSI in a slot
|
||||
|
||||
PUCCH_sched_t pucch = {
|
||||
.resource_indicator = -1,
|
||||
.initial_pucch_id = -1
|
||||
};
|
||||
uint16_t rnti = mac->crnti; //FIXME not sure this is valid for all pucch instances
|
||||
mac->nr_ue_emul_l1.num_srs = 0;
|
||||
mac->nr_ue_emul_l1.num_harqs = 0;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = 0;
|
||||
int num_res = 0;
|
||||
|
||||
// SR
|
||||
if (mac->state == UE_CONNECTED && trigger_periodic_scheduling_request(mac, &pucch, frameP, slotP)) {
|
||||
O_SR = 1;
|
||||
if (mac->state == UE_CONNECTED && trigger_periodic_scheduling_request(mac, &pucch[0], frameP, slotP)) {
|
||||
num_res++;
|
||||
/* sr_payload = 1 means that this is a positive SR, sr_payload = 0 means that it is a negative SR */
|
||||
pucch.sr_payload = nr_ue_get_SR(module_idP,
|
||||
frameP,
|
||||
slotP);
|
||||
pucch[0].sr_payload = nr_ue_get_SR(module_idP, frameP, slotP);
|
||||
}
|
||||
|
||||
// CSI
|
||||
int csi_res = 0;
|
||||
if (mac->state == UE_CONNECTED)
|
||||
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, &pucch);
|
||||
csi_res = nr_get_csi_measurements(mac, frameP, slotP, &pucch[num_res]);
|
||||
if (csi_res > 0) {
|
||||
num_res += csi_res;
|
||||
}
|
||||
|
||||
// ACKNACK
|
||||
O_ACK = get_downlink_ack(mac, frameP, slotP, &pucch);
|
||||
|
||||
NR_PUCCH_Config_t *pucch_Config = mac->current_UL_BWP.pucch_Config;
|
||||
|
||||
// if multiplexing of HARQ and CSI is not possible, transmit only HARQ bits
|
||||
if ((O_ACK != 0) && (O_CSI != 0) &&
|
||||
pucch_Config &&
|
||||
pucch_Config->format2 &&
|
||||
(pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) {
|
||||
O_CSI = 0;
|
||||
pucch.csi_part1_payload = 0;
|
||||
pucch.csi_part2_payload = 0;
|
||||
}
|
||||
|
||||
N_UCI = O_SR + O_ACK + O_CSI;
|
||||
mac->nr_ue_emul_l1.num_srs = O_SR;
|
||||
mac->nr_ue_emul_l1.num_harqs = O_ACK;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = O_CSI;
|
||||
bool any_harq = get_downlink_ack(mac, frameP, slotP, &pucch[num_res]);
|
||||
if (any_harq)
|
||||
num_res++;
|
||||
|
||||
if (num_res == 0)
|
||||
return;
|
||||
// do no transmit pucch if only SR scheduled and it is negative
|
||||
if ((O_ACK + O_CSI) == 0 && pucch.sr_payload == 0)
|
||||
if (num_res == 1 && pucch[0].n_sr > 0 && pucch[0].sr_payload == 0)
|
||||
return;
|
||||
|
||||
if (N_UCI > 0) {
|
||||
LOG_D(NR_MAC,"%d.%d configure pucch, O_SR %d, O_ACK %d, O_CSI %d\n",frameP,slotP,O_SR,O_ACK,O_CSI);
|
||||
pucch.resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI);
|
||||
select_pucch_resource(mac, &pucch);
|
||||
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
mac->nr_ue_emul_l1.active_uci_sfn_slot = NFAPI_SFNSLOT2HEX(frameP, slotP);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
nr_ue_configure_pucch(mac,
|
||||
slotP,
|
||||
rnti,
|
||||
&pucch,
|
||||
pucch_pdu,
|
||||
O_SR, O_ACK, O_CSI);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, phy_data);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
if(mac->state == UE_WAIT_TX_ACK_MSG4)
|
||||
mac->state = UE_CONNECTED;
|
||||
if (num_res > 1)
|
||||
multiplex_pucch_resource(mac, pucch, num_res);
|
||||
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
for (int j = 0; j < num_res; j++) {
|
||||
if (pucch[j].n_harq + pucch[j].n_sr + pucch[j].n_csi != 0) {
|
||||
LOG_D(NR_MAC,
|
||||
"%d.%d configure pucch, O_ACK %d, O_SR %d, O_CSI %d\n",
|
||||
frameP,
|
||||
slotP,
|
||||
pucch[j].n_harq,
|
||||
pucch[j].n_sr,
|
||||
pucch[j].n_csi);
|
||||
mac->nr_ue_emul_l1.num_srs = pucch[j].n_sr;
|
||||
mac->nr_ue_emul_l1.num_harqs = pucch[j].n_harq;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = pucch[j].n_csi;
|
||||
AssertFatal(ul_config->number_pdus < FAPI_NR_UL_CONFIG_LIST_NUM,
|
||||
"ul_config->number_pdus %d out of bounds\n",
|
||||
ul_config->number_pdus);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu;
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
mac->nr_ue_emul_l1.active_uci_sfn_slot = NFAPI_SFNSLOT2HEX(frameP, slotP);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
nr_ue_configure_pucch(mac,
|
||||
slotP,
|
||||
mac->crnti, // FIXME not sure this is valid for all pucch instances
|
||||
&pucch[j],
|
||||
pucch_pdu);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, phy_data);
|
||||
if (mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
if (mac->state == UE_WAIT_TX_ACK_MSG4)
|
||||
mac->state = UE_CONNECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
|
||||
|
||||
NR_UE_UL_BWP_t *current_UL_BWP = &mac->current_UL_BWP;
|
||||
|
||||
@@ -54,10 +54,10 @@ extern RAN_CONTEXT_t RC;
|
||||
//extern int l2_init_gNB(void);
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list,
|
||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
static void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list,
|
||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl)
|
||||
{
|
||||
if (rlc_bearer2release_list) {
|
||||
for (int i = 0; i < rlc_bearer2release_list->list.count; i++) {
|
||||
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) {
|
||||
@@ -97,8 +97,9 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *
|
||||
|
||||
}
|
||||
|
||||
static void process_drx_Config(NR_UE_sched_ctrl_t *sched_ctrl, NR_SetupRelease_DRX_Config_t *drx_Config)
|
||||
{
|
||||
|
||||
void process_drx_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_DRX_Config_t *drx_Config) {
|
||||
if (!drx_Config) return;
|
||||
AssertFatal(drx_Config->present != NR_SetupRelease_DRX_Config_PR_NOTHING, "Cannot have NR_SetupRelease_DRX_Config_PR_NOTHING\n");
|
||||
|
||||
@@ -110,23 +111,27 @@ void process_drx_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_DRX_Confi
|
||||
}
|
||||
}
|
||||
|
||||
void process_schedulingRequestConfig(NR_UE_sched_ctrl_t *sched_ctrl,NR_SchedulingRequestConfig_t *schedulingRequestConfig) {
|
||||
static void process_schedulingRequestConfig(NR_UE_sched_ctrl_t *sched_ctrl, NR_SchedulingRequestConfig_t *schedulingRequestConfig)
|
||||
{
|
||||
if (!schedulingRequestConfig) return;
|
||||
|
||||
LOG_I(NR_MAC,"Adding SchedulingRequestconfig\n");
|
||||
}
|
||||
|
||||
void process_bsrConfig(NR_UE_sched_ctrl_t *sched_ctrl,NR_BSR_Config_t *bsr_Config) {
|
||||
static void process_bsrConfig(NR_UE_sched_ctrl_t *sched_ctrl, NR_BSR_Config_t *bsr_Config)
|
||||
{
|
||||
if (!bsr_Config) return;
|
||||
LOG_I(NR_MAC,"Adding BSR config\n");
|
||||
}
|
||||
|
||||
void process_tag_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_TAG_Config_t *tag_Config) {
|
||||
static void process_tag_Config(NR_UE_sched_ctrl_t *sched_ctrl, NR_TAG_Config_t *tag_Config)
|
||||
{
|
||||
if (!tag_Config) return;
|
||||
LOG_I(NR_MAC,"Adding TAG config\n");
|
||||
}
|
||||
|
||||
void process_phr_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_PHR_Config_t *phr_Config) {
|
||||
static void process_phr_Config(NR_UE_sched_ctrl_t *sched_ctrl, NR_SetupRelease_PHR_Config_t *phr_Config)
|
||||
{
|
||||
if (!phr_Config) return;
|
||||
AssertFatal(phr_Config->present != NR_SetupRelease_PHR_Config_PR_NOTHING, "Cannot have NR_SetupRelease_PHR_Config_PR_NOTHING\n");
|
||||
|
||||
@@ -138,8 +143,8 @@ void process_phr_Config(NR_UE_sched_ctrl_t *sched_ctrl,NR_SetupRelease_PHR_Confi
|
||||
}
|
||||
}
|
||||
|
||||
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl)
|
||||
{
|
||||
AssertFatal(CellGroup, "CellGroup is null\n");
|
||||
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = CellGroup->mac_CellGroupConfig;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "RRC/NR/nr_rrc_extern.h"
|
||||
#include "RRC/NR/nr_rrc_config.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP,
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
NR_COMMON_channels_t *cc;
|
||||
nfapi_nr_dl_tti_request_body_t *dl_req;
|
||||
NR_MIB_t *mib = RC.nrrrc[module_idP]->carrier.mib.message.choice.mib;
|
||||
NR_MIB_t *mib = RC.nrrrc[module_idP]->carrier.mib->message.choice.mib;
|
||||
uint8_t num_tdd_period,num_ssb;
|
||||
int mib_sdu_length;
|
||||
int CC_id;
|
||||
|
||||
@@ -1275,7 +1275,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
header->LCID = DL_SCH_LCID_PADDING;
|
||||
buf += sizeof(NR_MAC_SUBHEADER_LONG);
|
||||
header->L = htons(bufEnd-buf);
|
||||
dlsch_total_bytes += bufEnd-buf;
|
||||
|
||||
for (; ((intptr_t)buf) % 4; buf++)
|
||||
*buf = lrand48() & 0xff;
|
||||
@@ -1306,6 +1305,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
UE->mac_stats.dl.total_rbs += sched_pdsch->rbSize;
|
||||
UE->mac_stats.dl.num_mac_sdu += sdus;
|
||||
UE->mac_stats.dl.current_rbs = sched_pdsch->rbSize;
|
||||
UE->mac_stats.dl.total_sdu_bytes += dlsch_total_bytes;
|
||||
|
||||
/* save retransmission information */
|
||||
harq->sched_pdsch = *sched_pdsch;
|
||||
|
||||
@@ -968,9 +968,13 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
pucch_pdu->start_symbol_index = pucchres->format.choice.format2->startingSymbolIndex;
|
||||
pucch_pdu->data_scrambling_id = pusch_id!= NULL ? *pusch_id : *scc->physCellId;
|
||||
pucch_pdu->dmrs_scrambling_id = id0!= NULL ? *id0 : *scc->physCellId;
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(2,pucchres->format.choice.format2->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format2->choice.setup->maxCodeRate,
|
||||
2,pucchres->format.choice.format2->nrofSymbols,8);
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(2,
|
||||
pucchres->format.choice.format2->nrofPRBs,
|
||||
O_uci + O_sr,
|
||||
pucch_Config->format2->choice.setup->maxCodeRate,
|
||||
2,
|
||||
pucchres->format.choice.format2->nrofSymbols,
|
||||
8);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format3 :
|
||||
@@ -996,9 +1000,13 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
else
|
||||
f3_dmrs_symbols = 2<<pucch_pdu->add_dmrs_flag;
|
||||
}
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(3,pucchres->format.choice.format3->nrofPRBs,
|
||||
O_uci+O_sr,O_csi,pucch_Config->format3->choice.setup->maxCodeRate,
|
||||
2-pucch_pdu->pi_2bpsk,pucchres->format.choice.format3->nrofSymbols-f3_dmrs_symbols,12);
|
||||
pucch_pdu->prb_size = compute_pucch_prb_size(3,
|
||||
pucchres->format.choice.format3->nrofPRBs,
|
||||
O_uci + O_sr,
|
||||
pucch_Config->format3->choice.setup->maxCodeRate,
|
||||
2 - pucch_pdu->pi_2bpsk,
|
||||
pucchres->format.choice.format3->nrofSymbols - f3_dmrs_symbols,
|
||||
12);
|
||||
pucch_pdu->bit_len_csi_part1 = O_csi;
|
||||
break;
|
||||
case NR_PUCCH_Resource__format_PR_format4 :
|
||||
@@ -2483,8 +2491,6 @@ void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti)
|
||||
{
|
||||
nr_rlc_remove_ue(rnti);
|
||||
|
||||
NR_UEs_t *UE_info = &nr_mac->UE_info;
|
||||
pthread_mutex_lock(&UE_info->mutex);
|
||||
UE_iterator(UE_info->list, UE) {
|
||||
@@ -2886,24 +2892,16 @@ void send_initial_ul_rrc_message(gNB_MAC_INST *mac, int rnti, const uint8_t *sdu
|
||||
|
||||
NR_UE_info_t *UE = (NR_UE_info_t *)rawUE;
|
||||
|
||||
uint8_t du2cu_rrc_container[1024];
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
UE->CellGroup,
|
||||
du2cu_rrc_container,
|
||||
sizeof(du2cu_rrc_container));
|
||||
AssertFatal(enc_rval.encoded > 0,
|
||||
"Could not encode cellGroupConfig for UE %04x, failed element %s\n",
|
||||
rnti,
|
||||
enc_rval.failed_type->name);
|
||||
uint8_t du2cu[1024];
|
||||
int encoded = encode_cellGroupConfig(UE->CellGroup, du2cu, sizeof(du2cu));
|
||||
|
||||
const f1ap_initial_ul_rrc_message_t ul_rrc_msg = {
|
||||
/* TODO: add mcc, mnc, cell_id, ..., is not available at MAC yet */
|
||||
.crnti = rnti,
|
||||
.rrc_container = (uint8_t *) sdu,
|
||||
.rrc_container_length = sdu_len,
|
||||
.du2cu_rrc_container = (uint8_t *) du2cu_rrc_container,
|
||||
.du2cu_rrc_container_length = (enc_rval.encoded + 7) / 8
|
||||
.du2cu_rrc_container = (uint8_t *) du2cu,
|
||||
.du2cu_rrc_container_length = encoded
|
||||
};
|
||||
mac->mac_rrc.initial_ul_rrc_message_transfer(0, &ul_rrc_msg);
|
||||
}
|
||||
@@ -2917,20 +2915,7 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[mod_id];
|
||||
const NR_ServingCellConfigCommon_t *scc = rrc->carrier.servingcellconfigcommon;
|
||||
const NR_ServingCellConfig_t *sccd = rrc->configuration.scd;
|
||||
NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(*cellGroupConfig));
|
||||
AssertFatal(cellGroupConfig != NULL, "out of memory\n");
|
||||
fill_initial_cellGroupConfig(UE->uid, cellGroupConfig, scc, sccd, &rrc->configuration);
|
||||
|
||||
uint8_t du2cu_rrc_container[1024];
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
cellGroupConfig,
|
||||
du2cu_rrc_container,
|
||||
sizeof(du2cu_rrc_container));
|
||||
AssertFatal(enc_rval.encoded > 0,
|
||||
"Could not encode cellGroupConfig for UE %04x, failed element %s\n",
|
||||
UE->rnti,
|
||||
enc_rval.failed_type->name);
|
||||
NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &rrc->configuration);
|
||||
|
||||
UE->CellGroup = cellGroupConfig;
|
||||
nr_mac_update_cellgroup(mac, UE->rnti, cellGroupConfig);
|
||||
|
||||
@@ -325,6 +325,7 @@ int nr_process_mac_pdu(instance_t module_idP,
|
||||
|
||||
if (UE_idx->CellGroup) {
|
||||
LOG_D(NR_MAC, "Frame %d : ULSCH -> UL-DCCH %d (gNB %ld, %d bytes), rnti: 0x%04x \n", frameP, rx_lcid, module_idP, mac_len, crnti);
|
||||
UE->mac_stats.ul.total_sdu_bytes += mac_len;
|
||||
mac_rlc_data_ind(module_idP,
|
||||
crnti,
|
||||
module_idP,
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
@@ -251,8 +253,30 @@ void mac_top_init_gNB(ngran_node_t node_type)
|
||||
// These should be out of here later
|
||||
if (get_softmodem_params()->usim_test == 0 ) nr_pdcp_layer_init();
|
||||
|
||||
if(IS_SOFTMODEM_NOS1 && get_softmodem_params()->phy_test)
|
||||
nr_DRB_preconfiguration(0x1234);
|
||||
if(IS_SOFTMODEM_NOS1 && get_softmodem_params()->phy_test) {
|
||||
// get default noS1 configuration
|
||||
NR_RadioBearerConfig_t *rbconfig = NULL;
|
||||
NR_RLC_BearerConfig_t *rlc_rbconfig = NULL;
|
||||
fill_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
|
||||
NR_RLC_BearerConfig_t *rlc_rbconfig_list[1] = {rlc_rbconfig};
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList rlc_bearer_list = {
|
||||
.list = { .array = rlc_rbconfig_list, .count = 1, .size = 1, }
|
||||
};
|
||||
|
||||
/* Note! previously, in nr_DRB_preconfiguration(), we passed ENB_FLAG_NO
|
||||
* if ENB_NAS_USE_TUN was *not* set. It seems to me that we could not set
|
||||
* this flag anywhere in the code, hence we would always configure PDCP
|
||||
* with ENB_FLAG_NO in nr_DRB_preconfiguration(). This makes sense for
|
||||
* noS1, because the result of passing ENB_FLAG_NO to PDCP is that PDCP
|
||||
* will output the packets at a local interface, which is in line with
|
||||
* the noS1 mode. Hence, below, we simply hardcode ENB_FLAG_NO */
|
||||
// setup PDCP, RLC
|
||||
nr_pdcp_add_drbs(ENB_FLAG_NO, 0x1234, 0, rbconfig->drb_ToAddModList, 0, NULL, NULL, &rlc_bearer_list);
|
||||
nr_rlc_add_drb(0x1234, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
|
||||
|
||||
// free memory
|
||||
free_nr_noS1_bearer_config(&rbconfig, &rlc_rbconfig);
|
||||
}
|
||||
|
||||
} else {
|
||||
RC.nrmac = NULL;
|
||||
|
||||
@@ -614,6 +614,7 @@ typedef struct NR_mac_dir_stats {
|
||||
uint64_t errors;
|
||||
uint64_t total_bytes;
|
||||
uint32_t current_bytes;
|
||||
uint64_t total_sdu_bytes;
|
||||
uint32_t total_rbs;
|
||||
uint32_t total_rbs_retx;
|
||||
uint32_t num_mac_sdu;
|
||||
|
||||
@@ -647,7 +647,6 @@ pdcp_data_ind(
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//uint8_t dc = pdcp_get_dc_filed((unsigned char*)sdu_buffer_pP->data);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -34,27 +34,6 @@
|
||||
|
||||
extern bool util_mark_nth_bit_of_octet(uint8_t* octet, uint8_t index);
|
||||
|
||||
/*
|
||||
* Parses data/control field out of buffer of User Plane PDCP Data PDU with
|
||||
* long PDCP SN (12-bit)
|
||||
*
|
||||
* @param pdu_buffer PDCP PDU buffer
|
||||
* @return 1 bit dc
|
||||
*/
|
||||
uint8_t pdcp_get_dc_filed(unsigned char* pdu_buffer)
|
||||
{
|
||||
uint8_t dc = 0x00;
|
||||
|
||||
if (pdu_buffer == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dc = (uint8_t)pdu_buffer[0] & 0xF0; // Reset D/C field
|
||||
dc >>= 8; // FIXME this is broken!!! returns 0 all the time
|
||||
|
||||
return dc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses sequence number out of buffer of User Plane PDCP Data PDU with
|
||||
* long PDCP SN (12-bit)
|
||||
|
||||
@@ -101,16 +101,6 @@ typedef struct {
|
||||
*/
|
||||
#define PDCP_CONTROL_PDU_STATUS_REPORT_HEADER_SIZE 2
|
||||
|
||||
/*
|
||||
* Parses data/control field out of buffer of User Plane PDCP Data PDU with
|
||||
* long PDCP SN (12-bit)
|
||||
*
|
||||
* @param pdu_buffer PDCP PDU buffer
|
||||
* @return 1 bit dc
|
||||
*/
|
||||
|
||||
uint8_t pdcp_get_dc_filed(unsigned char* pdu_buffer);
|
||||
|
||||
/*
|
||||
* Parses sequence number out of buffer of User Plane PDCP Data PDU with
|
||||
* long PDCP SN (12-bit)
|
||||
|
||||
@@ -26,6 +26,5 @@
|
||||
#define _NR_PDCP_H_
|
||||
|
||||
void nr_pdcp_layer_init_ue(void);
|
||||
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
|
||||
|
||||
#endif /* _NR_PDCP_H_ */
|
||||
|
||||
@@ -187,6 +187,4 @@ nr_pdcp_entity_t *new_nr_pdcp_entity(
|
||||
unsigned char *ciphering_key,
|
||||
unsigned char *integrity_key);
|
||||
|
||||
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
|
||||
|
||||
#endif /* _NR_PDCP_ENTITY_H_ */
|
||||
|
||||
@@ -962,78 +962,6 @@ bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid)
|
||||
{
|
||||
|
||||
NR_RadioBearerConfig_t *rbconfig = NULL;
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *Rlc_Bearer_ToAdd_list = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
//fill_default_rbconfig(rb_config, 5, 1);
|
||||
rbconfig = calloc(1, sizeof(*rbconfig));
|
||||
|
||||
rbconfig->srb_ToAddModList = NULL;
|
||||
rbconfig->srb3_ToRelease = NULL;
|
||||
rbconfig->drb_ToAddModList = calloc(1,sizeof(*rbconfig->drb_ToAddModList));
|
||||
NR_DRB_ToAddMod_t *drb_ToAddMod = calloc(1,sizeof(*drb_ToAddMod));
|
||||
drb_ToAddMod->cnAssociation = calloc(1,sizeof(*drb_ToAddMod->cnAssociation));
|
||||
drb_ToAddMod->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity;
|
||||
drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity= 10;
|
||||
drb_ToAddMod->drb_Identity = 1;
|
||||
drb_ToAddMod->reestablishPDCP = NULL;
|
||||
drb_ToAddMod->recoverPDCP = NULL;
|
||||
drb_ToAddMod->pdcp_Config = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config));
|
||||
asn1cCalloc(drb_ToAddMod->pdcp_Config->drb, drb);
|
||||
asn1cCallocOne(drb->discardTimer, NR_PDCP_Config__drb__discardTimer_infinity);
|
||||
asn1cCallocOne(drb->pdcp_SN_SizeUL, NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits);
|
||||
asn1cCallocOne(drb->pdcp_SN_SizeDL, NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits);
|
||||
drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
|
||||
drb->headerCompression.choice.notUsed = 0;
|
||||
|
||||
drb->integrityProtection = NULL;
|
||||
drb->statusReportRequired = NULL;
|
||||
drb->outOfOrderDelivery = NULL;
|
||||
drb_ToAddMod->pdcp_Config->moreThanOneRLC = NULL;
|
||||
|
||||
asn1cCallocOne(drb_ToAddMod->pdcp_Config->t_Reordering, NR_PDCP_Config__t_Reordering_ms0);
|
||||
drb_ToAddMod->pdcp_Config->ext1 = NULL;
|
||||
|
||||
asn1cSeqAdd(&rbconfig->drb_ToAddModList->list,drb_ToAddMod);
|
||||
|
||||
rbconfig->drb_ToReleaseList = NULL;
|
||||
|
||||
asn1cCalloc(rbconfig->securityConfig, secConf);
|
||||
asn1cCalloc(secConf->securityAlgorithmConfig, secConfAlgo);
|
||||
secConfAlgo->cipheringAlgorithm = NR_CipheringAlgorithm_nea0;
|
||||
secConfAlgo->integrityProtAlgorithm = NULL;
|
||||
asn1cCallocOne(secConf->keyToUse, NR_SecurityConfig__keyToUse_master);
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
|
||||
}
|
||||
|
||||
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
|
||||
nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
|
||||
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
|
||||
//nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
|
||||
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
|
||||
|
||||
Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list));
|
||||
asn1cSeqAdd(&Rlc_Bearer_ToAdd_list->list, RLC_BearerConfig);
|
||||
|
||||
if (ENB_NAS_USE_TUN){
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_YES, crntiMaybeUEid, 0, 0, 0);
|
||||
}
|
||||
else{
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, crntiMaybeUEid, 0, 0, 0);
|
||||
}
|
||||
|
||||
nr_pdcp_add_drbs(ctxt.enb_flag, ctxt.rntiMaybeUEid, 0, rbconfig->drb_ToAddModList, 0, NULL, NULL, Rlc_Bearer_ToAdd_list);
|
||||
|
||||
nr_rlc_add_drb(ctxt.rntiMaybeUEid, drb_ToAddMod->drb_Identity, RLC_BearerConfig);
|
||||
|
||||
LOG_D(PDCP, "%s:%d: done RRC PDCP/RLC ASN1 request for UE ID/RNTI %ld\n", __FUNCTION__, __LINE__, ctxt.rntiMaybeUEid);
|
||||
}
|
||||
|
||||
uint64_t get_pdcp_optmask(void)
|
||||
{
|
||||
return pdcp_optmask;
|
||||
|
||||
@@ -54,84 +54,6 @@ static int nr_rlc_current_time_last_frame;
|
||||
static int nr_rlc_current_time_last_subframe;
|
||||
|
||||
|
||||
void nr_rlc_bearer_init(NR_RLC_BearerConfig_t *RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR rb_type){
|
||||
|
||||
RLC_BearerConfig->servedRadioBearer = calloc(1, sizeof(*RLC_BearerConfig->servedRadioBearer));
|
||||
RLC_BearerConfig->reestablishRLC = calloc(1, sizeof(*RLC_BearerConfig->reestablishRLC));
|
||||
RLC_BearerConfig->rlc_Config = calloc(1, sizeof(*RLC_BearerConfig->rlc_Config));
|
||||
RLC_BearerConfig->mac_LogicalChannelConfig = calloc(1, sizeof(*RLC_BearerConfig->mac_LogicalChannelConfig));
|
||||
|
||||
*RLC_BearerConfig->reestablishRLC = NR_RLC_BearerConfig__reestablishRLC_true;
|
||||
if(rb_type == NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity){
|
||||
RLC_BearerConfig->logicalChannelIdentity = 4;
|
||||
RLC_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity;
|
||||
RLC_BearerConfig->servedRadioBearer->choice.drb_Identity = 1;
|
||||
}
|
||||
else{
|
||||
RLC_BearerConfig->logicalChannelIdentity = 1;
|
||||
RLC_BearerConfig->servedRadioBearer->present = NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity;
|
||||
RLC_BearerConfig->servedRadioBearer->choice.srb_Identity = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig){
|
||||
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters = calloc(1, sizeof(*mac_LogicalChannelConfig->ul_SpecificParameters));
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->priority = 1;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->prioritisedBitRate = NR_LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->bucketSizeDuration = NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->allowedServingCells = NULL;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->allowedSCS_List = NULL;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->maxPUSCH_Duration = NULL;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->configuredGrantType1Allowed = NULL;
|
||||
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = calloc(1,sizeof(*mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup));
|
||||
*mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelGroup = 1;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->schedulingRequestID = calloc(1,sizeof(*mac_LogicalChannelConfig->ul_SpecificParameters->schedulingRequestID));
|
||||
*mac_LogicalChannelConfig->ul_SpecificParameters->schedulingRequestID = 0;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelSR_Mask = false;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->logicalChannelSR_DelayTimerApplied = false;
|
||||
mac_LogicalChannelConfig->ul_SpecificParameters->bitRateQueryProhibitTimer = NULL;
|
||||
|
||||
}
|
||||
|
||||
void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr){
|
||||
|
||||
switch (rlc_config_pr){
|
||||
case NR_RLC_Config_PR_um_Bi_Directional:
|
||||
// RLC UM Bi-directional Bearer configuration
|
||||
LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n");
|
||||
rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional));
|
||||
rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
|
||||
rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
|
||||
rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.t_Reassembly = NR_T_Reassembly_ms15;
|
||||
break;
|
||||
case NR_RLC_Config_PR_am:
|
||||
// RLC AM Bearer configuration
|
||||
rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am));
|
||||
rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18;
|
||||
rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45;
|
||||
rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64;
|
||||
rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB500;
|
||||
rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t32;
|
||||
rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18;
|
||||
rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms15;
|
||||
rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0, "RLC config type %d not handled\n", rlc_config_pr);
|
||||
break;
|
||||
}
|
||||
|
||||
rlc_Config->present = rlc_config_pr;
|
||||
|
||||
}
|
||||
|
||||
void mac_rlc_data_ind (
|
||||
const module_id_t module_idP,
|
||||
const rnti_t rntiP,
|
||||
|
||||
@@ -39,12 +39,6 @@
|
||||
struct NR_RLC_Config;
|
||||
struct NR_LogicalChannelConfig;
|
||||
|
||||
void nr_rlc_bearer_init(NR_RLC_BearerConfig_t *RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR rb_type);
|
||||
|
||||
void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr);
|
||||
|
||||
void nr_rlc_bearer_init_ul_spec(struct NR_LogicalChannelConfig *mac_LogicalChannelConfig);
|
||||
|
||||
void nr_rlc_add_srb(int rnti, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
|
||||
void nr_rlc_add_drb(int rnti, int drb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
|
||||
|
||||
|
||||
@@ -1245,7 +1245,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&mac_IF_mutex);
|
||||
return 0;
|
||||
return ret_mask;
|
||||
}
|
||||
|
||||
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){
|
||||
|
||||
@@ -1499,7 +1499,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
//memset((*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310, 0, sizeof(BCCH_Config_v1310_t));
|
||||
//(*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310->modificationPeriodCoeff_v1310 = BCCH_Config_v1310__modificationPeriodCoeff_v1310_n64;
|
||||
|
||||
if (configuration->pcch_config_v1310) {
|
||||
if (configuration->pcch_config_v1310[CC_id] == true) {
|
||||
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = CALLOC(1, sizeof(LTE_PCCH_Config_v1310_t));
|
||||
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->paging_narrowBands_r13 = configuration->paging_narrowbands_r13[CC_id];
|
||||
(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->mpdcch_NumRepetition_Paging_r13 = configuration->mpdcch_numrepetition_paging_r13[CC_id];
|
||||
|
||||
@@ -696,7 +696,6 @@ typedef struct {
|
||||
uint32_t N_RB_DL;
|
||||
uint32_t pbch_repetition;
|
||||
LTE_BCCH_BCH_Message_t mib;
|
||||
LTE_BCCH_BCH_Message_t *mib_DU;
|
||||
LTE_BCCH_DL_SCH_Message_t siblock1;
|
||||
LTE_BCCH_DL_SCH_Message_t siblock1_BR;
|
||||
LTE_BCCH_DL_SCH_Message_t *siblock1_DU;
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#include "common/ran_context.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
@@ -47,12 +50,17 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
void nr_rrc_mac_remove_ue(rnti_t rntiMaybeUEid)
|
||||
{
|
||||
nr_rlc_remove_ue(rntiMaybeUEid);
|
||||
|
||||
int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP){
|
||||
// todo
|
||||
return 0;
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[0];
|
||||
mac_remove_nr_ue(nrmac, rntiMaybeUEid);
|
||||
}
|
||||
|
||||
void nr_rrc_mac_update_cellgroup(rnti_t rntiMaybeUEid, NR_CellGroupConfig_t *cgc)
|
||||
{
|
||||
nr_mac_update_cellgroup(RC.nrmac[0], rntiMaybeUEid, cgc);
|
||||
}
|
||||
|
||||
uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
@@ -69,30 +77,15 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
// MIBCH
|
||||
if ((Srb_id & RAB_OFFSET) == MIBCH) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
uint8_t sfn_msb = (uint8_t)((frameP>>4)&0x3f);
|
||||
int encode_size = 3;
|
||||
rrc_gNB_carrier_data_t *carrier = &RC.nrrrc[Mod_idP]->carrier;
|
||||
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
|
||||
|
||||
mib->message.choice.mib->systemFrameNumber.buf[0] = sfn_msb << 2;
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message,
|
||||
NULL,
|
||||
(void *) mib,
|
||||
carrier->MIB,
|
||||
24);
|
||||
LOG_D(NR_RRC, "Encoded MIB for frame %d sfn_msb %d (%p), bits %lu\n", frameP, sfn_msb, carrier->MIB,
|
||||
enc_rval.encoded);
|
||||
buffer_pP[0] = carrier->MIB[0];
|
||||
buffer_pP[1] = carrier->MIB[1];
|
||||
buffer_pP[2] = carrier->MIB[2];
|
||||
int encoded = encode_MIB_NR(carrier->mib, frameP, buffer_pP, encode_size);
|
||||
DevAssert(encoded == encode_size);
|
||||
LOG_D(NR_RRC, "MIB PDU buffer_pP[0]=%x , buffer_pP[1]=%x, buffer_pP[2]=%x\n", buffer_pP[0], buffer_pP[1],
|
||||
buffer_pP[2]);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
return 3;
|
||||
return encode_size;
|
||||
}
|
||||
|
||||
// TODO BCCH SIB1 SIBs
|
||||
if ((Srb_id & RAB_OFFSET) == BCCH) {
|
||||
memcpy(&buffer_pP[0], RC.nrrrc[Mod_idP]->carrier.SIB1, RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1);
|
||||
return RC.nrrrc[Mod_idP]->carrier.sizeof_SIB1;
|
||||
|
||||
+106
-828
@@ -194,401 +194,6 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
rrc_gNB_carrier_data_t *carrier = &rrc->carrier;
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib = &carrier->mib;
|
||||
NR_ServingCellConfigCommon_t *scc = carrier->servingcellconfigcommon;
|
||||
|
||||
memset(mib,0,sizeof(NR_BCCH_BCH_Message_t));
|
||||
mib->message.present = NR_BCCH_BCH_MessageType_PR_mib;
|
||||
mib->message.choice.mib = CALLOC(1,sizeof(struct NR_MIB));
|
||||
memset(mib->message.choice.mib,0,sizeof(struct NR_MIB));
|
||||
//36.331 SFN BIT STRING (SIZE (8) , 38.331 SFN BIT STRING (SIZE (6))
|
||||
uint8_t sfn_msb = (uint8_t)((frame>>4)&0x3f);
|
||||
mib->message.choice.mib->systemFrameNumber.buf = CALLOC(1,sizeof(uint8_t));
|
||||
mib->message.choice.mib->systemFrameNumber.buf[0] = sfn_msb << 2;
|
||||
mib->message.choice.mib->systemFrameNumber.size = 1;
|
||||
mib->message.choice.mib->systemFrameNumber.bits_unused=2;
|
||||
//38.331 spare BIT STRING (SIZE (1))
|
||||
uint16_t *spare= CALLOC(1, sizeof(uint16_t));
|
||||
|
||||
if (spare == NULL) abort();
|
||||
|
||||
mib->message.choice.mib->spare.buf = (uint8_t *)spare;
|
||||
mib->message.choice.mib->spare.size = 1;
|
||||
mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits
|
||||
|
||||
AssertFatal(scc->ssbSubcarrierSpacing != NULL, "scc->ssbSubcarrierSpacing is null\n");
|
||||
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
frequency_range_t frequency_range = band < 100 ? FR1 : FR2;
|
||||
int ssb_subcarrier_offset = 31; // default value for NSA
|
||||
if (get_softmodem_params()->sa) {
|
||||
uint32_t absolute_diff = (*scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB - scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
int scs_scaling = scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000 ? 3 : 1;
|
||||
ssb_subcarrier_offset = (absolute_diff/scs_scaling) % 24;
|
||||
if(frequency_range == FR2)
|
||||
ssb_subcarrier_offset >>= 1; // this assumes 120kHz SCS for SSB and subCarrierSpacingCommon (only option supported by OAI for now)
|
||||
}
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset = ssb_subcarrier_offset & 15;
|
||||
|
||||
/*
|
||||
* The SIB1 will be sent in this allocation (Type0-PDCCH) : 38.213, 13-4 Table and 38.213 13-11 to 13-14 tables
|
||||
* the reverse allocation is in nr_ue_decode_mib()
|
||||
*/
|
||||
const NR_PDCCH_ConfigCommon_t *pdcch_cc = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup;
|
||||
long cset0 = pdcch_cc->controlResourceSetZero ? *pdcch_cc->controlResourceSetZero : 0;
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero = cset0;
|
||||
long ss0 = pdcch_cc->searchSpaceZero ? *pdcch_cc->searchSpaceZero : 0;
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = ss0;
|
||||
|
||||
switch (*scc->ssbSubcarrierSpacing) {
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz30:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz60:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz120:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs30or120;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz240:
|
||||
AssertFatal(1==0,"Unknown subCarrierSpacingCommon %d\n",(int)*scc->ssbSubcarrierSpacing);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Unknown subCarrierSpacingCommon %d\n",(int)*scc->ssbSubcarrierSpacing);
|
||||
}
|
||||
|
||||
switch (scc->dmrs_TypeA_Position) {
|
||||
case NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos2:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos2;
|
||||
break;
|
||||
|
||||
case NR_ServingCellConfigCommon__dmrs_TypeA_Position_pos3:
|
||||
mib->message.choice.mib->dmrs_TypeA_Position = NR_MIB__dmrs_TypeA_Position_pos3;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Unknown dmrs_TypeA_Position %d\n",(int)scc->dmrs_TypeA_Position);
|
||||
}
|
||||
|
||||
// assign_enum
|
||||
mib->message.choice.mib->cellBarred = NR_MIB__cellBarred_notBarred;
|
||||
// assign_enum
|
||||
mib->message.choice.mib->intraFreqReselection = NR_MIB__intraFreqReselection_notAllowed;
|
||||
//encode MIB to data
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_BCH_Message,
|
||||
NULL,
|
||||
(void *)mib,
|
||||
carrier->MIB,
|
||||
24);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
gNB_RrcConfigurationReq *configuration) {
|
||||
|
||||
asn_enc_rval_t enc_rval;
|
||||
NR_BCCH_DL_SCH_Message_t *sib1_message = CALLOC(1,sizeof(NR_BCCH_DL_SCH_Message_t));
|
||||
carrier->siblock1 = sib1_message;
|
||||
sib1_message->message.present = NR_BCCH_DL_SCH_MessageType_PR_c1;
|
||||
sib1_message->message.choice.c1 = CALLOC(1,sizeof(struct NR_BCCH_DL_SCH_MessageType__c1));
|
||||
sib1_message->message.choice.c1->present = NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1;
|
||||
sib1_message->message.choice.c1->choice.systemInformationBlockType1 = CALLOC(1,sizeof(struct NR_SIB1));
|
||||
|
||||
struct NR_SIB1 *sib1 = sib1_message->message.choice.c1->choice.systemInformationBlockType1;
|
||||
|
||||
// cellSelectionInfo
|
||||
sib1->cellSelectionInfo = CALLOC(1,sizeof(struct NR_SIB1__cellSelectionInfo));
|
||||
// Fixme: should be in config file
|
||||
//The IE Q-RxLevMin is used to indicate for cell selection/ re-selection the required minimum received RSRP level in the (NR) cell.
|
||||
//Corresponds to parameter Qrxlevmin in TS38.304.
|
||||
//Actual value Qrxlevmin = field value * 2 [dBm].
|
||||
sib1->cellSelectionInfo->q_RxLevMin = -65;
|
||||
|
||||
// cellAccessRelatedInfo
|
||||
// TODO : Add support for more than one PLMN
|
||||
int num_plmn = 1; // int num_plmn = configuration->num_plmn;
|
||||
asn1cSequenceAdd(sib1->cellAccessRelatedInfo.plmn_IdentityInfoList.list, struct NR_PLMN_IdentityInfo, nr_plmn_info);
|
||||
for (int i = 0; i < num_plmn; ++i) {
|
||||
asn1cSequenceAdd(nr_plmn_info->plmn_IdentityList.list, struct NR_PLMN_Identity, nr_plmn);
|
||||
asn1cCalloc(nr_plmn->mcc, mcc);
|
||||
int confMcc=configuration->mcc[i];
|
||||
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc0);
|
||||
*mcc0=(confMcc/100)%10;
|
||||
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc1);
|
||||
*mcc1=(confMcc/10)%10;
|
||||
asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc2);
|
||||
*mcc2=confMcc%10;
|
||||
int mnc=configuration->mnc[i];
|
||||
if(configuration->mnc_digit_length[i] == 3) {
|
||||
asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc0);
|
||||
*mnc0=(configuration->mnc[i]/100)%10;
|
||||
}
|
||||
asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc1);
|
||||
*mnc1=(mnc/10)%10;
|
||||
asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc2);
|
||||
*mnc2=(mnc)%10;
|
||||
}//end plmn loop
|
||||
|
||||
nr_plmn_info->cellIdentity.buf = CALLOC(1,5);
|
||||
nr_plmn_info->cellIdentity.size= 5;
|
||||
nr_plmn_info->cellIdentity.bits_unused= 4;
|
||||
uint64_t tmp=htobe64(configuration->cell_identity)<<4;
|
||||
memcpy(nr_plmn_info->cellIdentity.buf, ((char*)&tmp)+3, 5);
|
||||
nr_plmn_info->cellReservedForOperatorUse = NR_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
|
||||
|
||||
nr_plmn_info->trackingAreaCode = CALLOC(1,sizeof(NR_TrackingAreaCode_t));
|
||||
uint32_t tmp2=htobe32(configuration->tac);
|
||||
nr_plmn_info->trackingAreaCode->buf = CALLOC(1,3);
|
||||
memcpy(nr_plmn_info->trackingAreaCode->buf, ((char*) &tmp2)+1, 3);
|
||||
nr_plmn_info->trackingAreaCode->size = 3;
|
||||
nr_plmn_info->trackingAreaCode->bits_unused = 0;
|
||||
|
||||
// connEstFailureControl
|
||||
// TODO: add connEstFailureControl
|
||||
|
||||
//si-SchedulingInfo
|
||||
/*sib1->si_SchedulingInfo = CALLOC(1,sizeof(struct NR_SI_SchedulingInfo));
|
||||
asn_set_empty(&sib1->si_SchedulingInfo->schedulingInfoList.list);
|
||||
sib1->si_SchedulingInfo->si_WindowLength = NR_SI_SchedulingInfo__si_WindowLength_s40;
|
||||
struct NR_SchedulingInfo *schedulingInfo = CALLOC(1,sizeof(struct NR_SchedulingInfo));
|
||||
schedulingInfo->si_BroadcastStatus = NR_SchedulingInfo__si_BroadcastStatus_broadcasting;
|
||||
schedulingInfo->si_Periodicity = NR_SchedulingInfo__si_Periodicity_rf8;
|
||||
asn_set_empty(&schedulingInfo->sib_MappingInfo.list);
|
||||
|
||||
NR_SIB_TypeInfo_t *sib_type3 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type));
|
||||
sib_type3->type = NR_SIB_TypeInfo__type_sibType3;
|
||||
sib_type3->valueTag = CALLOC(1,sizeof(sib_type3->valueTag));
|
||||
asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type3);
|
||||
|
||||
NR_SIB_TypeInfo_t *sib_type5 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type));
|
||||
sib_type5->type = NR_SIB_TypeInfo__type_sibType5;
|
||||
sib_type5->valueTag = CALLOC(1,sizeof(sib_type5->valueTag));
|
||||
asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type5);
|
||||
|
||||
NR_SIB_TypeInfo_t *sib_type4 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type));
|
||||
sib_type4->type = NR_SIB_TypeInfo__type_sibType4;
|
||||
sib_type4->valueTag = CALLOC(1,sizeof(sib_type4->valueTag));
|
||||
asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type4);
|
||||
|
||||
NR_SIB_TypeInfo_t *sib_type2 = CALLOC(1,sizeof(e_NR_SIB_TypeInfo__type));
|
||||
sib_type2->type = NR_SIB_TypeInfo__type_sibType2;
|
||||
sib_type2->valueTag = CALLOC(1,sizeof(sib_type2->valueTag));
|
||||
asn1cSeqAdd(&schedulingInfo->sib_MappingInfo.list,sib_type2);
|
||||
|
||||
asn1cSeqAdd(&sib1->si_SchedulingInfo->schedulingInfoList.list,schedulingInfo);*/
|
||||
|
||||
// servingCellConfigCommon
|
||||
asn1cCalloc(sib1->servingCellConfigCommon, ServCellCom);
|
||||
NR_BWP_DownlinkCommon_t *initialDownlinkBWP=&ServCellCom->downlinkConfigCommon.initialDownlinkBWP;
|
||||
initialDownlinkBWP->genericParameters=
|
||||
configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
|
||||
|
||||
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.count; i++) {
|
||||
asn1cSequenceAdd(ServCellCom->downlinkConfigCommon.frequencyInfoDL.frequencyBandList.list,
|
||||
struct NR_NR_MultiBandInfo, nrMultiBandInfo);
|
||||
nrMultiBandInfo->freqBandIndicatorNR = configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[i];
|
||||
}
|
||||
|
||||
int scs_scaling0 = 1<<(configuration->scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing);
|
||||
int scs_scaling = scs_scaling0;
|
||||
int scs_scaling2 = scs_scaling0;
|
||||
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA < 600000) {
|
||||
scs_scaling = scs_scaling0*3;
|
||||
}
|
||||
if (configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA > 2016666) {
|
||||
scs_scaling = scs_scaling0>>2;
|
||||
scs_scaling2 = scs_scaling0>>2;
|
||||
}
|
||||
uint32_t absolute_diff = (*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB -
|
||||
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
|
||||
sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA = scs_scaling2 * (absolute_diff/(12*scs_scaling) - 10);
|
||||
|
||||
LOG_I(NR_RRC,"SIB1 freq: absoluteFrequencySSB %ld, absoluteFrequencyPointA %ld\n",
|
||||
*configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB,
|
||||
configuration->scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA);
|
||||
LOG_I(NR_RRC,"SIB1 freq: absolute_diff %d, %d*(absolute_diff/(12*%d) - 10) %d\n",
|
||||
absolute_diff,scs_scaling2,scs_scaling,(int)sib1->servingCellConfigCommon->downlinkConfigCommon.frequencyInfoDL.offsetToPointA);
|
||||
|
||||
for(int i = 0; i< configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.count; i++) {
|
||||
asn1cSeqAdd(&ServCellCom->downlinkConfigCommon.frequencyInfoDL.scs_SpecificCarrierList.list,
|
||||
configuration->scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[i]);
|
||||
}
|
||||
|
||||
initialDownlinkBWP->pdcch_ConfigCommon =
|
||||
configuration->scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon;
|
||||
initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList =
|
||||
CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList));
|
||||
|
||||
NR_SearchSpace_t *ss1 = rrc_searchspace_config(true, 1, 0);
|
||||
asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss1);
|
||||
|
||||
NR_SearchSpace_t *ss2 = rrc_searchspace_config(true, 2, 0);
|
||||
asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss2);
|
||||
|
||||
NR_SearchSpace_t *ss3 = rrc_searchspace_config(true, 3, 0);
|
||||
asn1cSeqAdd(&initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list, ss3);
|
||||
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1, 0);
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation, 3);
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace, 2);
|
||||
asn1cCallocOne(initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->ra_SearchSpace, 1);
|
||||
|
||||
initialDownlinkBWP->pdsch_ConfigCommon = configuration->scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon;
|
||||
ServCellCom->downlinkConfigCommon.bcch_Config.modificationPeriodCoeff = NR_BCCH_Config__modificationPeriodCoeff_n2;
|
||||
ServCellCom->downlinkConfigCommon.pcch_Config.defaultPagingCycle = NR_PagingCycle_rf256;
|
||||
ServCellCom->downlinkConfigCommon.pcch_Config.nAndPagingFrameOffset.present = NR_PCCH_Config__nAndPagingFrameOffset_PR_quarterT;
|
||||
ServCellCom->downlinkConfigCommon.pcch_Config.nAndPagingFrameOffset.choice.quarterT = 1;
|
||||
ServCellCom->downlinkConfigCommon.pcch_Config.ns = NR_PCCH_Config__ns_one;
|
||||
|
||||
asn1cCalloc(ServCellCom->downlinkConfigCommon.pcch_Config.firstPDCCH_MonitoringOccasionOfPO,
|
||||
P0);
|
||||
P0->present = NR_PCCH_Config__firstPDCCH_MonitoringOccasionOfPO_PR_sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT;
|
||||
|
||||
asn1cCalloc(P0->choice.sCS120KHZoneT_SCS60KHZhalfT_SCS30KHZquarterT_SCS15KHZoneEighthT,
|
||||
Z8);
|
||||
asn1cSequenceAdd(Z8->list,
|
||||
long,
|
||||
ZoneEight);
|
||||
asn1cCallocOne(ZoneEight, 0);
|
||||
|
||||
asn1cCalloc(ServCellCom->uplinkConfigCommon, UL);
|
||||
asn_set_empty(&UL->frequencyInfoUL.scs_SpecificCarrierList.list);
|
||||
for(int i = 0; i< configuration->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.count; i++) {
|
||||
asn1cSeqAdd(&UL->frequencyInfoUL.scs_SpecificCarrierList.list,
|
||||
configuration->scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[i]);
|
||||
}
|
||||
|
||||
asn1cCallocOne(UL->frequencyInfoUL.p_Max, *configuration->scc->uplinkConfigCommon->frequencyInfoUL->p_Max);
|
||||
|
||||
UL->initialUplinkBWP.genericParameters = configuration->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
|
||||
UL->initialUplinkBWP.rach_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon;
|
||||
UL->initialUplinkBWP.pusch_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
|
||||
UL->initialUplinkBWP.pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = NULL;
|
||||
|
||||
UL->initialUplinkBWP.pucch_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon;
|
||||
|
||||
UL->timeAlignmentTimerCommon = NR_TimeAlignmentTimer_infinity;
|
||||
|
||||
ServCellCom->n_TimingAdvanceOffset = configuration->scc->n_TimingAdvanceOffset;
|
||||
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup.buf = calloc(1, sizeof(uint8_t));
|
||||
uint8_t bitmap8,temp_bitmap=0;
|
||||
switch (configuration->scc->ssb_PositionsInBurst->present) {
|
||||
case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_shortBitmap:
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup = configuration->scc->ssb_PositionsInBurst->choice.shortBitmap;
|
||||
break;
|
||||
case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap:
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup = configuration->scc->ssb_PositionsInBurst->choice.mediumBitmap;
|
||||
break;
|
||||
/*
|
||||
groupPresence: This field is present when maximum number of SS/PBCH blocks per half frame equals to 64 as defined in TS 38.213 [13], clause 4.1.
|
||||
The first/leftmost bit corresponds to the SS/PBCH index 0-7, the second bit corresponds to SS/PBCH block 8-15, and so on.
|
||||
Value 0 in the bitmap indicates that the SSBs according to inOneGroup are absent. Value 1 indicates that the SS/PBCH blocks are transmitted in accordance with inOneGroup.
|
||||
inOneGroup: When maximum number of SS/PBCH blocks per half frame equals to 64 as defined in TS 38.213 [13], clause 4.1, all 8 bit are valid;
|
||||
The first/ leftmost bit corresponds to the first SS/PBCH block index in the group (i.e., to SSB index 0, 8, and so on); the second bit corresponds to the second SS/PBCH block index in the group
|
||||
(i.e., to SSB index 1, 9, and so on), and so on. Value 0 in the bitmap indicates that the corresponding SS/PBCH block is not transmitted while value 1 indicates that the corresponding SS/PBCH block is transmitted.
|
||||
*/
|
||||
case NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_longBitmap:
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup.size = 1;
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup.bits_unused = 0;
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence = calloc(1, sizeof(BIT_STRING_t));
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence->size = 1;
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence->bits_unused = 0;
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence->buf = calloc(1, sizeof(uint8_t));
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence->buf[0] = 0;
|
||||
for (int i=0; i<8; i++){
|
||||
bitmap8 = configuration->scc->ssb_PositionsInBurst->choice.longBitmap.buf[i];
|
||||
if (bitmap8!=0){
|
||||
if(temp_bitmap==0)
|
||||
temp_bitmap = bitmap8;
|
||||
else
|
||||
AssertFatal(temp_bitmap==bitmap8,"For longBitmap the groups of 8 SSBs containing at least 1 transmitted SSB should be all the same\n");
|
||||
|
||||
ServCellCom->ssb_PositionsInBurst.inOneGroup.buf[0] = bitmap8;
|
||||
ServCellCom->ssb_PositionsInBurst.groupPresence->buf[0] |= 1<<(7-i);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(false,"ssb_PositionsInBurst not present\n");
|
||||
break;
|
||||
}
|
||||
|
||||
ServCellCom->ssb_PeriodicityServingCell = *configuration->scc->ssb_periodicityServingCell;
|
||||
if (configuration->scc->tdd_UL_DL_ConfigurationCommon) {
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon = CALLOC(1,sizeof(struct NR_TDD_UL_DL_ConfigCommon));
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing = configuration->scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing;
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern1 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern1;
|
||||
ServCellCom->tdd_UL_DL_ConfigurationCommon->pattern2 = configuration->scc->tdd_UL_DL_ConfigurationCommon->pattern2;
|
||||
}
|
||||
ServCellCom->ss_PBCH_BlockPower = configuration->scc->ss_PBCH_BlockPower;
|
||||
|
||||
// ims-EmergencySupport
|
||||
// TODO: add ims-EmergencySupport
|
||||
|
||||
// eCallOverIMS-Support
|
||||
// TODO: add eCallOverIMS-Support
|
||||
|
||||
// ue-TimersAndConstants
|
||||
sib1->ue_TimersAndConstants = CALLOC(1,sizeof(struct NR_UE_TimersAndConstants));
|
||||
sib1->ue_TimersAndConstants->t300 = NR_UE_TimersAndConstants__t300_ms400;
|
||||
sib1->ue_TimersAndConstants->t301 = NR_UE_TimersAndConstants__t301_ms400;
|
||||
sib1->ue_TimersAndConstants->t310 = NR_UE_TimersAndConstants__t310_ms2000;
|
||||
sib1->ue_TimersAndConstants->n310 = NR_UE_TimersAndConstants__n310_n10;
|
||||
sib1->ue_TimersAndConstants->t311 = NR_UE_TimersAndConstants__t311_ms3000;
|
||||
sib1->ue_TimersAndConstants->n311 = NR_UE_TimersAndConstants__n311_n1;
|
||||
sib1->ue_TimersAndConstants->t319 = NR_UE_TimersAndConstants__t319_ms400;
|
||||
|
||||
// uac-BarringInfo
|
||||
/*sib1->uac_BarringInfo = CALLOC(1, sizeof(struct NR_SIB1__uac_BarringInfo));
|
||||
NR_UAC_BarringInfoSet_t *nr_uac_BarringInfoSet = CALLOC(1, sizeof(NR_UAC_BarringInfoSet_t));
|
||||
asn_set_empty(&sib1->uac_BarringInfo->uac_BarringInfoSetList);
|
||||
nr_uac_BarringInfoSet->uac_BarringFactor = NR_UAC_BarringInfoSet__uac_BarringFactor_p95;
|
||||
nr_uac_BarringInfoSet->uac_BarringTime = NR_UAC_BarringInfoSet__uac_BarringTime_s4;
|
||||
nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.buf = CALLOC(1, 1);
|
||||
nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.size = 1;
|
||||
nr_uac_BarringInfoSet->uac_BarringForAccessIdentity.bits_unused = 1;
|
||||
asn1cSeqAdd(&sib1->uac_BarringInfo->uac_BarringInfoSetList, nr_uac_BarringInfoSet);*/
|
||||
|
||||
// useFullResumeID
|
||||
// TODO: add useFullResumeID
|
||||
|
||||
// lateNonCriticalExtension
|
||||
// TODO: add lateNonCriticalExtension
|
||||
|
||||
// nonCriticalExtension
|
||||
// TODO: add nonCriticalExtension
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_SIB1, (const void*)sib1_message->message.choice.c1->choice.systemInformationBlockType1);
|
||||
|
||||
if(carrier->SIB1 == NULL) carrier->SIB1=(uint8_t *) malloc16(NR_MAX_SIB_LENGTH/8);
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
NULL,
|
||||
(void *)sib1_message,
|
||||
carrier->SIB1,
|
||||
NR_MAX_SIB_LENGTH/8);
|
||||
AssertFatal(enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
AssertFatal(enc_rval.encoded <= NR_MAX_SIB_LENGTH, "ASN1 encoded length %zd bits. 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.\n", enc_rval.encoded);
|
||||
|
||||
return((enc_rval.encoded+7)/8);
|
||||
}
|
||||
|
||||
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
gNB_RrcConfigurationReq *configuration) {
|
||||
asn_enc_rval_t enc_rval;
|
||||
@@ -687,240 +292,6 @@ int do_RRCReject(uint8_t Mod_id,
|
||||
return (enc_rval.encoded + 7) / 8;
|
||||
}
|
||||
|
||||
void fill_initial_SpCellConfig(int uid,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration) {
|
||||
|
||||
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
|
||||
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
|
||||
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
|
||||
AssertFatal(uid>=0 && uid<30, "gNB cannot allocate the SRS resources\n");
|
||||
|
||||
const int pdsch_AntennaPorts = configuration->pdsch_AntennaPorts.N1 * configuration->pdsch_AntennaPorts.N2 * configuration->pdsch_AntennaPorts.XP;
|
||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
SpCellConfig->servCellIndex = NULL;
|
||||
SpCellConfig->reconfigurationWithSync = NULL;
|
||||
SpCellConfig->rlmInSyncOutOfSyncThreshold = NULL;
|
||||
SpCellConfig->rlf_TimersAndConstants = NULL;
|
||||
|
||||
SpCellConfig->spCellConfigDedicated = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated));
|
||||
SpCellConfig->spCellConfigDedicated->uplinkConfig = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->uplinkConfig));
|
||||
NR_UplinkConfig_t *uplinkConfig = SpCellConfig->spCellConfigDedicated->uplinkConfig;
|
||||
|
||||
NR_BWP_UplinkDedicated_t *initialUplinkBWP = calloc(1,sizeof(*initialUplinkBWP));
|
||||
uplinkConfig->initialUplinkBWP = initialUplinkBWP;
|
||||
initialUplinkBWP->pucch_Config = calloc(1,sizeof(*initialUplinkBWP->pucch_Config));
|
||||
initialUplinkBWP->pucch_Config->present = NR_SetupRelease_PUCCH_Config_PR_setup;
|
||||
NR_PUCCH_Config_t *pucch_Config = calloc(1,sizeof(*pucch_Config));
|
||||
initialUplinkBWP->pucch_Config->choice.setup=pucch_Config;
|
||||
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
|
||||
pucch_Config->resourceSetToReleaseList = NULL;
|
||||
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
|
||||
pucch_Config->resourceToReleaseList = NULL;
|
||||
config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
|
||||
config_pucch_resset1(pucch_Config, NULL);
|
||||
set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
|
||||
|
||||
initialUplinkBWP->pusch_Config = config_pusch(NULL);
|
||||
|
||||
long maxMIMO_Layers = uplinkConfig &&
|
||||
uplinkConfig->pusch_ServingCellConfig &&
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
|
||||
*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
|
||||
|
||||
// We are using do_srs = 0 here because the periodic SRS will only be enabled in update_cellGroupConfig() if do_srs == 1
|
||||
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
|
||||
config_srs(scc, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, 0);
|
||||
|
||||
scheduling_request_config(scc, pucch_Config, scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing);
|
||||
|
||||
set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME, scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing);
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
bwp_Dedicated->pdcch_Config=calloc(1,sizeof(*bwp_Dedicated->pdcch_Config));
|
||||
bwp_Dedicated->pdcch_Config->present = NR_SetupRelease_PDCCH_Config_PR_setup;
|
||||
bwp_Dedicated->pdcch_Config->choice.setup = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup));
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList));
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList));
|
||||
|
||||
NR_ControlResourceSet_t *coreset = calloc(1,sizeof(*coreset));
|
||||
|
||||
uint64_t bitmap = get_ssb_bitmap(scc);
|
||||
rrc_coreset_config(coreset, 0, curr_bwp, bitmap);
|
||||
|
||||
asn1cSeqAdd(&bwp_Dedicated->pdcch_Config->choice.setup->controlResourceSetToAddModList->list,
|
||||
coreset);
|
||||
|
||||
bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList = calloc(1,sizeof(*bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList));
|
||||
|
||||
NR_SearchSpace_t *ss2 = rrc_searchspace_config(false, 5, coreset->controlResourceSetId);
|
||||
asn1cSeqAdd(&bwp_Dedicated->pdcch_Config->choice.setup->searchSpacesToAddModList->list, ss2);
|
||||
|
||||
bwp_Dedicated->pdsch_Config = config_pdsch(bitmap, 0, pdsch_AntennaPorts);
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->tag_Id=0;
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig));
|
||||
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = calloc(1,sizeof(*pdsch_servingcellconfig));
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
||||
SpCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
||||
|
||||
// Downlink BWPs
|
||||
int n_dl_bwp = 0;
|
||||
if (servingcellconfigdedicated &&
|
||||
servingcellconfigdedicated->downlinkBWP_ToAddModList &&
|
||||
servingcellconfigdedicated->downlinkBWP_ToAddModList->list.count > 0) {
|
||||
n_dl_bwp = servingcellconfigdedicated->downlinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if(n_dl_bwp>0){
|
||||
SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) {
|
||||
NR_BWP_Downlink_t *bwp = calloc(1, sizeof(*bwp));
|
||||
config_downlinkBWP(bwp, scc,
|
||||
servingcellconfigdedicated,
|
||||
NULL, 0,
|
||||
false, bwp_loop, true);
|
||||
asn1cSeqAdd(&SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp);
|
||||
}
|
||||
SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
|
||||
*SpCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1;
|
||||
SpCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id));
|
||||
*SpCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = servingcellconfigdedicated->defaultDownlinkBWP_Id ? *servingcellconfigdedicated->defaultDownlinkBWP_Id : 1;
|
||||
}
|
||||
|
||||
// Uplink BWPs
|
||||
int n_ul_bwp = 0;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->uplinkConfig &&
|
||||
servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList &&
|
||||
servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count > 0) {
|
||||
n_ul_bwp = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if(n_ul_bwp>0) {
|
||||
uplinkConfig->uplinkBWP_ToAddModList = calloc(1,sizeof(*uplinkConfig->uplinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_ul_bwp; bwp_loop++) {
|
||||
NR_BWP_Uplink_t *ubwp = calloc(1, sizeof(*ubwp));
|
||||
config_uplinkBWP(ubwp, bwp_loop, true, uid,
|
||||
configuration,
|
||||
servingcellconfigdedicated,
|
||||
scc,
|
||||
NULL);
|
||||
asn1cSeqAdd(&uplinkConfig->uplinkBWP_ToAddModList->list, ubwp);
|
||||
}
|
||||
uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*uplinkConfig->firstActiveUplinkBWP_Id));
|
||||
*uplinkConfig->firstActiveUplinkBWP_Id = servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id : 1;
|
||||
}
|
||||
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->csi_MeasConfig));
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
|
||||
SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
|
||||
NR_CSI_SSB_ResourceSet_t *ssbresset0 = calloc(1,sizeof(*ssbresset0));
|
||||
ssbresset0->csi_SSB_ResourceSetId=0;
|
||||
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap >> (63 - i)) & 0x01) {
|
||||
NR_SSB_Index_t *ssbres = NULL;
|
||||
asn1cCallocOne(ssbres, i);
|
||||
asn1cSeqAdd(&ssbresset0->csi_SSB_ResourceList.list, ssbres);
|
||||
}
|
||||
}
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
int bwp_loop_end = n_dl_bwp>0 ? n_dl_bwp : 1;
|
||||
for (int bwp_loop = 0; bwp_loop < bwp_loop_end; bwp_loop++) {
|
||||
|
||||
int curr_bwp, bwp_id;
|
||||
struct NR_SetupRelease_PDSCH_Config *pdsch_Config;
|
||||
if(n_dl_bwp == 0) {
|
||||
pdsch_Config = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config;
|
||||
curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
bwp_id = 0;
|
||||
}
|
||||
else {
|
||||
NR_BWP_Downlink_t *bwp = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_loop];
|
||||
pdsch_Config = bwp->bwp_Dedicated->pdsch_Config;
|
||||
curr_bwp = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
bwp_id = bwp->bwp_Id;
|
||||
}
|
||||
|
||||
config_csirs(scc, csi_MeasConfig, uid, pdsch_AntennaPorts, curr_bwp, configuration->do_CSIRS, bwp_loop);
|
||||
config_csiim(configuration->do_CSIRS, pdsch_AntennaPorts, curr_bwp, csi_MeasConfig, bwp_loop);
|
||||
|
||||
NR_CSI_ResourceConfig_t *csires1 = calloc(1,sizeof(*csires1));
|
||||
csires1->csi_ResourceConfigId = bwp_id+20;
|
||||
csires1->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
|
||||
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
|
||||
*ssbres00 = 0;
|
||||
asn1cSeqAdd(&csires1->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
|
||||
csires1->bwp_Id = bwp_id;
|
||||
csires1->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires1);
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId=bwp_id;
|
||||
pucchcsires1->pucch_Resource=2;
|
||||
|
||||
if (configuration->do_CSIRS) {
|
||||
NR_CSI_ResourceConfig_t *csires0 = calloc(1,sizeof(*csires0));
|
||||
csires0->csi_ResourceConfigId = bwp_id;
|
||||
csires0->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = bwp_loop;
|
||||
asn1cSeqAdd(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires0->bwp_Id = bwp_id;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires0);
|
||||
}
|
||||
|
||||
if (configuration->do_CSIRS && pdsch_AntennaPorts > 1) {
|
||||
NR_CSI_ResourceConfig_t *csires2 = calloc(1,sizeof(*csires2));
|
||||
csires2->csi_ResourceConfigId = bwp_id+10;
|
||||
csires2->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
|
||||
csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = bwp_loop;
|
||||
asn1cSeqAdd(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
csires2->bwp_Id = bwp_id;
|
||||
csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
|
||||
|
||||
config_csi_meas_report(csi_MeasConfig, scc, pucchcsires1, pdsch_Config, &configuration->pdsch_AntennaPorts, NR_MAX_SUPPORTED_DL_LAYERS, bwp_id, uid);
|
||||
}
|
||||
config_rsrp_meas_report(csi_MeasConfig, scc, pucchcsires1, configuration->do_CSIRS, bwp_id + 10, uid);
|
||||
}
|
||||
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
||||
pdsch_servingcellconfig->xOverhead = NULL;
|
||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
||||
pdsch_servingcellconfig->pucch_Cell= NULL;
|
||||
pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
|
||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, (void *)SpCellConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId,
|
||||
long priority,
|
||||
e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration)
|
||||
@@ -966,6 +337,42 @@ NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(long channelId,
|
||||
return rlc_BearerConfig;
|
||||
}
|
||||
|
||||
static void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config_pr)
|
||||
{
|
||||
switch (rlc_config_pr) {
|
||||
case NR_RLC_Config_PR_um_Bi_Directional:
|
||||
// RLC UM Bi-directional Bearer configuration
|
||||
LOG_I(RLC, "RLC UM Bi-directional Bearer configuration selected \n");
|
||||
rlc_Config->choice.um_Bi_Directional = calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional));
|
||||
rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength =
|
||||
calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.um_Bi_Directional->ul_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
|
||||
rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength =
|
||||
calloc(1, sizeof(*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.sn_FieldLength = NR_SN_FieldLengthUM_size12;
|
||||
rlc_Config->choice.um_Bi_Directional->dl_UM_RLC.t_Reassembly = NR_T_Reassembly_ms15;
|
||||
break;
|
||||
case NR_RLC_Config_PR_am:
|
||||
// RLC AM Bearer configuration
|
||||
rlc_Config->choice.am = calloc(1, sizeof(*rlc_Config->choice.am));
|
||||
rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.am->ul_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18;
|
||||
rlc_Config->choice.am->ul_AM_RLC.t_PollRetransmit = NR_T_PollRetransmit_ms45;
|
||||
rlc_Config->choice.am->ul_AM_RLC.pollPDU = NR_PollPDU_p64;
|
||||
rlc_Config->choice.am->ul_AM_RLC.pollByte = NR_PollByte_kB500;
|
||||
rlc_Config->choice.am->ul_AM_RLC.maxRetxThreshold = NR_UL_AM_RLC__maxRetxThreshold_t32;
|
||||
rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = calloc(1, sizeof(*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength));
|
||||
*rlc_Config->choice.am->dl_AM_RLC.sn_FieldLength = NR_SN_FieldLengthAM_size18;
|
||||
rlc_Config->choice.am->dl_AM_RLC.t_Reassembly = NR_T_Reassembly_ms15;
|
||||
rlc_Config->choice.am->dl_AM_RLC.t_StatusProhibit = NR_T_StatusProhibit_ms15;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(false, "RLC config type %d not handled\n", rlc_config_pr);
|
||||
break;
|
||||
}
|
||||
rlc_Config->present = rlc_config_pr;
|
||||
}
|
||||
|
||||
NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority)
|
||||
{
|
||||
NR_RLC_BearerConfig_t *rlc_BearerConfig = calloc(1, sizeof(NR_RLC_BearerConfig_t));
|
||||
@@ -997,6 +404,74 @@ NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR
|
||||
return rlc_BearerConfig;
|
||||
}
|
||||
|
||||
/* returns a default radio bearer config suitable for NSA etc */
|
||||
NR_RadioBearerConfig_t *get_default_rbconfig(int eps_bearer_id,
|
||||
int rb_id,
|
||||
e_NR_CipheringAlgorithm ciphering_algorithm,
|
||||
e_NR_SecurityConfig__keyToUse key_to_use)
|
||||
{
|
||||
NR_RadioBearerConfig_t *rbconfig = calloc(1, sizeof(*rbconfig));
|
||||
rbconfig->srb_ToAddModList = NULL;
|
||||
rbconfig->srb3_ToRelease = NULL;
|
||||
rbconfig->drb_ToAddModList = calloc(1,sizeof(*rbconfig->drb_ToAddModList));
|
||||
NR_DRB_ToAddMod_t *drb_ToAddMod = calloc(1,sizeof(*drb_ToAddMod));
|
||||
drb_ToAddMod->cnAssociation = calloc(1,sizeof(*drb_ToAddMod->cnAssociation));
|
||||
drb_ToAddMod->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity;
|
||||
drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity= eps_bearer_id;
|
||||
drb_ToAddMod->drb_Identity = rb_id;
|
||||
drb_ToAddMod->reestablishPDCP = NULL;
|
||||
drb_ToAddMod->recoverPDCP = NULL;
|
||||
drb_ToAddMod->pdcp_Config = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config));
|
||||
asn1cCalloc(drb_ToAddMod->pdcp_Config->drb, drb);
|
||||
asn1cCallocOne(drb->discardTimer, NR_PDCP_Config__drb__discardTimer_infinity);
|
||||
asn1cCallocOne(drb->pdcp_SN_SizeUL, NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits);
|
||||
asn1cCallocOne(drb->pdcp_SN_SizeDL, NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits);
|
||||
drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
|
||||
drb->headerCompression.choice.notUsed = 0;
|
||||
drb->integrityProtection = NULL;
|
||||
drb->statusReportRequired = NULL;
|
||||
drb->outOfOrderDelivery = NULL;
|
||||
|
||||
drb_ToAddMod->pdcp_Config->moreThanOneRLC = NULL;
|
||||
asn1cCallocOne(drb_ToAddMod->pdcp_Config->t_Reordering, NR_PDCP_Config__t_Reordering_ms100);
|
||||
drb_ToAddMod->pdcp_Config->ext1 = NULL;
|
||||
|
||||
asn1cSeqAdd(&rbconfig->drb_ToAddModList->list,drb_ToAddMod);
|
||||
|
||||
rbconfig->drb_ToReleaseList = NULL;
|
||||
|
||||
asn1cCalloc(rbconfig->securityConfig, secConf);
|
||||
asn1cCalloc(secConf->securityAlgorithmConfig, secConfAlgo);
|
||||
secConfAlgo->cipheringAlgorithm = ciphering_algorithm;
|
||||
secConfAlgo->integrityProtAlgorithm = NULL;
|
||||
asn1cCallocOne(secConf->keyToUse, key_to_use);
|
||||
return rbconfig;
|
||||
}
|
||||
|
||||
void fill_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
|
||||
NR_RLC_BearerConfig_t **rlc_rbconfig)
|
||||
{
|
||||
/* the EPS bearer ID is arbitrary; the rb_id is 1/the first DRB, it needs to
|
||||
* match the one in get_DRB_RLC_BearerConfig(). No ciphering is to be
|
||||
* configured */
|
||||
*rbconfig = get_default_rbconfig(10, 1, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master);
|
||||
AssertFatal(*rbconfig != NULL, "get_default_rbconfig() failed\n");
|
||||
/* LCID is 4 because the RLC layer requires it to be 3+rb_id; the rb_id 1 is
|
||||
* common with get_default_rbconfig() (first RB). We pre-configure RLC UM
|
||||
* Bi-directional, priority is 1 */
|
||||
*rlc_rbconfig = get_DRB_RLC_BearerConfig(4, 1, NR_RLC_Config_PR_um_Bi_Directional, 1);
|
||||
AssertFatal(*rlc_rbconfig != NULL, "get_DRB_RLC_BearerConfig() failed\n");
|
||||
}
|
||||
|
||||
void free_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
|
||||
NR_RLC_BearerConfig_t **rlc_rbconfig)
|
||||
{
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_RadioBearerConfig, *rbconfig);
|
||||
*rbconfig = NULL;
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_RLC_BearerConfig, *rlc_rbconfig);
|
||||
*rlc_rbconfig = NULL;
|
||||
}
|
||||
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGroupConfig_t *ue_context_mastercellGroup, int use_rlc_um_for_drb, uint8_t configure_srb, uint8_t bearer_id_start, uint8_t nb_bearers_to_setup, long *priority) {
|
||||
|
||||
cellGroupConfig->cellGroupId = 0;
|
||||
@@ -1020,175 +495,12 @@ void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, NR_CellGr
|
||||
}
|
||||
}
|
||||
|
||||
//TODO temp function (to remove once CSI meas config harmonization is done)
|
||||
void update_cqitables(struct NR_SetupRelease_PDSCH_Config *pdsch_Config,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig) {
|
||||
int nb_csi = csi_MeasConfig->csi_ReportConfigToAddModList->list.count;
|
||||
for (int i = 0; i < nb_csi; i++) {
|
||||
NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[i];
|
||||
if(csirep->cqi_Table) {
|
||||
if(pdsch_Config->choice.setup->mcs_Table!=NULL)
|
||||
*csirep->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table2;
|
||||
else
|
||||
*csirep->cqi_Table = NR_CSI_ReportConfig__cqi_Table_table1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const int uid,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
const gNB_RrcConfigurationReq* configuration) {
|
||||
|
||||
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
|
||||
|
||||
if (SpCellConfig == NULL) return;
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = configuration ? configuration->scc : NULL;
|
||||
|
||||
if(scc) {
|
||||
|
||||
int curr_bwp = NRRIV2BW(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
NR_UplinkConfig_t *uplinkConfig = SpCellConfig && SpCellConfig->spCellConfigDedicated ? SpCellConfig->spCellConfigDedicated->uplinkConfig : NULL;
|
||||
|
||||
uint8_t ul_max_layers = 1;
|
||||
if (uecap &&
|
||||
uecap->featureSets &&
|
||||
uecap->featureSets->featureSetsUplinkPerCC &&
|
||||
uecap->featureSets->featureSetsUplinkPerCC->list.count > 0) {
|
||||
NR_FeatureSetUplinkPerCC_t *ul_feature_setup_per_cc = uecap->featureSets->featureSetsUplinkPerCC->list.array[0];
|
||||
if (ul_feature_setup_per_cc->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH) {
|
||||
switch (*ul_feature_setup_per_cc->mimo_CB_PUSCH->maxNumberMIMO_LayersCB_PUSCH) {
|
||||
case NR_MIMO_LayersUL_twoLayers:
|
||||
ul_max_layers = 2;
|
||||
break;
|
||||
case NR_MIMO_LayersUL_fourLayers:
|
||||
ul_max_layers = 4;
|
||||
break;
|
||||
default:
|
||||
ul_max_layers = 1;
|
||||
}
|
||||
}
|
||||
ul_max_layers = min(ul_max_layers, configuration->pusch_AntennaPorts);
|
||||
if (uplinkConfig->initialUplinkBWP->pusch_Config) {
|
||||
NR_PUSCH_Config_t *pusch_Config = uplinkConfig->initialUplinkBWP->pusch_Config->choice.setup;
|
||||
if (pusch_Config->maxRank == NULL) {
|
||||
pusch_Config->maxRank = calloc(1, sizeof(*pusch_Config->maxRank));
|
||||
}
|
||||
*pusch_Config->maxRank = ul_max_layers;
|
||||
}
|
||||
if (uplinkConfig->pusch_ServingCellConfig == NULL) {
|
||||
uplinkConfig->pusch_ServingCellConfig = calloc(1, sizeof(*uplinkConfig->pusch_ServingCellConfig));
|
||||
uplinkConfig->pusch_ServingCellConfig->present = NR_SetupRelease_PUSCH_ServingCellConfig_PR_setup;
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup = calloc(1, sizeof(*uplinkConfig->pusch_ServingCellConfig->choice.setup));
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 = calloc(1, sizeof(*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1));
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers = calloc(1, sizeof(*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers));
|
||||
}
|
||||
*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers = ul_max_layers;
|
||||
}
|
||||
|
||||
long maxMIMO_Layers = uplinkConfig &&
|
||||
uplinkConfig->pusch_ServingCellConfig &&
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
|
||||
uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
|
||||
*uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
|
||||
|
||||
// UL and SRS configuration
|
||||
if (configuration->do_SRS && uplinkConfig && uplinkConfig->initialUplinkBWP) {
|
||||
if (!uplinkConfig->initialUplinkBWP->srs_Config) {
|
||||
uplinkConfig->initialUplinkBWP->srs_Config = calloc(1, sizeof(*uplinkConfig->initialUplinkBWP->srs_Config));
|
||||
}
|
||||
config_srs(scc,
|
||||
SpCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->srs_Config,
|
||||
uecap,
|
||||
curr_bwp,
|
||||
uid,
|
||||
0,
|
||||
maxMIMO_Layers,
|
||||
configuration->do_SRS);
|
||||
}
|
||||
|
||||
// Set DL MCS table
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
|
||||
set_dl_mcs_table(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing,
|
||||
configuration->force_256qam_off ? NULL : uecap, bwp_Dedicated, scc);
|
||||
struct NR_ServingCellConfig__downlinkBWP_ToAddModList *DL_BWP_list = SpCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList;
|
||||
struct NR_UplinkConfig__uplinkBWP_ToAddModList *UL_BWP_list = uplinkConfig->uplinkBWP_ToAddModList;
|
||||
if (DL_BWP_list) {
|
||||
for (int i=0; i<DL_BWP_list->list.count; i++){
|
||||
NR_BWP_Downlink_t *bwp = DL_BWP_list->list.array[i];
|
||||
int scs = bwp->bwp_Common->genericParameters.subcarrierSpacing;
|
||||
set_dl_mcs_table(scs, configuration->force_256qam_off ? NULL : uecap, bwp->bwp_Dedicated, scc);
|
||||
}
|
||||
}
|
||||
if (configuration->do_SRS && UL_BWP_list) {
|
||||
for (int i=0; i<UL_BWP_list->list.count; i++) {
|
||||
NR_BWP_Uplink_t *ul_bwp = UL_BWP_list->list.array[i];
|
||||
int bwp_size = NRRIV2BW(ul_bwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
if (ul_bwp->bwp_Dedicated->pusch_Config) {
|
||||
NR_PUSCH_Config_t *pusch_Config = ul_bwp->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
if (pusch_Config->maxRank == NULL) {
|
||||
pusch_Config->maxRank = calloc(1, sizeof(*pusch_Config->maxRank));
|
||||
}
|
||||
*pusch_Config->maxRank = ul_max_layers;
|
||||
}
|
||||
config_srs(scc,
|
||||
ul_bwp->bwp_Dedicated->srs_Config,
|
||||
uecap,
|
||||
bwp_size,
|
||||
uid,
|
||||
i+1,
|
||||
maxMIMO_Layers,
|
||||
configuration->do_SRS);
|
||||
}
|
||||
}
|
||||
update_cqitables(bwp_Dedicated->pdsch_Config, SpCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup);
|
||||
}
|
||||
}
|
||||
|
||||
void fill_initial_cellGroupConfig(int uid,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration)
|
||||
{
|
||||
|
||||
NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig = NULL;
|
||||
|
||||
cellGroupConfig->cellGroupId = 0;
|
||||
|
||||
/* Rlc Bearer Config */
|
||||
/* TS38.331 9.2.1 Default SRB configurations */
|
||||
cellGroupConfig->rlc_BearerToAddModList = calloc(1, sizeof(*cellGroupConfig->rlc_BearerToAddModList));
|
||||
NR_RLC_BearerConfig_t *rlc_BearerConfig = get_SRB_RLC_BearerConfig(1, 1, NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms1000);
|
||||
asn1cSeqAdd(&cellGroupConfig->rlc_BearerToAddModList->list, rlc_BearerConfig);
|
||||
|
||||
cellGroupConfig->rlc_BearerToReleaseList = NULL;
|
||||
|
||||
/* mac CellGroup Config */
|
||||
cellGroupConfig->mac_CellGroupConfig = configure_mac_cellgroup();
|
||||
|
||||
physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig));
|
||||
physicalCellGroupConfig->p_NR_FR1 = NULL;
|
||||
physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;
|
||||
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
|
||||
|
||||
cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
|
||||
|
||||
fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,servingcellconfigdedicated,configuration);
|
||||
|
||||
cellGroupConfig->sCellToAddModList = NULL;
|
||||
cellGroupConfig->sCellToReleaseList = NULL;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *const buffer,
|
||||
const uint8_t transaction_id,
|
||||
const uint8_t *masterCellGroup,
|
||||
int masterCellGroup_len,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
@@ -1198,7 +510,6 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
NR_RRCSetup_IEs_t *ie;
|
||||
NR_SRB_ToAddMod_t *SRB1_config = NULL;
|
||||
NR_PDCP_Config_t *pdcp_Config = NULL;
|
||||
NR_CellGroupConfig_t *cellGroupConfig = NULL;
|
||||
|
||||
AssertFatal(ue_context_pP != NULL,"ue_context_p is null\n");
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
@@ -1248,11 +559,10 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
ie->masterCellGroup.size = masterCellGroup_len;
|
||||
|
||||
// decode masterCellGroup OCTET_STRING received from DU and place in ue context
|
||||
uper_decode(NULL, &asn_DEF_NR_CellGroupConfig, (void **)&cellGroupConfig, masterCellGroup, masterCellGroup_len, 0, 0);
|
||||
ue_p->masterCellGroup = cellGroupConfig;
|
||||
ue_p->masterCellGroup = decode_cellGroupConfig(masterCellGroup, masterCellGroup_len);
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, ue_p->masterCellGroup);
|
||||
xer_fprint(stdout, &asn_DEF_NR_DL_CCCH_Message, (void *)&dl_ccch_msg);
|
||||
}
|
||||
|
||||
@@ -1877,38 +1187,6 @@ int do_RRCReestablishment(const protocol_ctxt_t *const ctxt_pP,
|
||||
*SRB_configList = CALLOC(1, sizeof(NR_SRB_ToAddModList_t));
|
||||
asn1cSeqAdd(&(*SRB_configList)->list, SRB1_config);
|
||||
/****************************** masterCellGroup ******************************/
|
||||
/*
|
||||
NR_CellGroupConfig_t *cellGroupConfig = NULL;
|
||||
char masterCellGroup_buf[1000];
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
if (masterCellGroup_from_DU) {
|
||||
// decode masterCellGroup OCTET_STRING received from DU and place in ue context
|
||||
uper_decode(NULL,
|
||||
&asn_DEF_NR_CellGroupConfig, //might be added prefix later
|
||||
(void **)&cellGroupConfig,
|
||||
(uint8_t *)masterCellGroup_from_DU->buf,
|
||||
masterCellGroup_from_DU->size, 0, 0);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)cellGroupConfig);
|
||||
}
|
||||
else {
|
||||
cellGroupConfig = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
fill_initial_cellGroupConfig(ue_context_pP->ue_context.rnti,ue_context_pP->local_uid,cellGroupConfig,scc,carrier);
|
||||
|
||||
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig,
|
||||
NULL,
|
||||
(void *)cellGroupConfig,
|
||||
masterCellGroup_buf,
|
||||
1000);
|
||||
|
||||
if(enc_rval.encoded == -1) {
|
||||
LOG_E(NR_RRC, "ASN1 message CellGroupConfig encoding failed (%s, %lu)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
ue_p->masterCellGroup = cellGroupConfig;
|
||||
*/
|
||||
rrcReestablishment->rrc_TransactionIdentifier = Transaction_id;
|
||||
rrcReestablishment->criticalExtensions.present = NR_RRCReestablishment__criticalExtensions_PR_rrcReestablishment;
|
||||
rrcReestablishment->criticalExtensions.choice.rrcReestablishment = CALLOC(1, sizeof(NR_RRCReestablishment_IEs_t));
|
||||
|
||||
@@ -55,16 +55,6 @@
|
||||
*/
|
||||
int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr);
|
||||
|
||||
uint8_t do_MIB_NR(gNB_RRC_INST *rrc,
|
||||
uint32_t frame);
|
||||
|
||||
/**
|
||||
\brief Generate configuration for SIB1 (gNB).
|
||||
@param carrier pointer to Carrier information
|
||||
@param configuration Pointer Configuration Request structure
|
||||
@return size of encoded bit stream in bytes*/
|
||||
uint16_t do_SIB1_NR(rrc_gNB_carrier_data_t *carrier, gNB_RrcConfigurationReq *configuration);
|
||||
|
||||
uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
gNB_RrcConfigurationReq *configuration);
|
||||
|
||||
@@ -74,22 +64,22 @@ void do_SpCellConfig(gNB_RRC_INST *rrc,
|
||||
int do_RRCReject(uint8_t Mod_id,
|
||||
uint8_t *const buffer);
|
||||
|
||||
void fill_initial_SpCellConfig(int uid,
|
||||
NR_SpCellConfig_t *SpCellConfig,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
NR_RLC_BearerConfig_t *get_SRB_RLC_BearerConfig(
|
||||
long channelId,
|
||||
long priority,
|
||||
e_NR_LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration bucketSizeDuration);
|
||||
NR_RLC_BearerConfig_t *get_DRB_RLC_BearerConfig(long lcChannelId, long drbId, NR_RLC_Config_PR rlc_conf, long priority);
|
||||
|
||||
void fill_initial_cellGroupConfig(int uid,
|
||||
NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
NR_RadioBearerConfig_t *get_default_rbconfig(int eps_bearer_id,
|
||||
int rb_id,
|
||||
e_NR_CipheringAlgorithm ciphering_algorithm,
|
||||
e_NR_SecurityConfig__keyToUse key_to_use);
|
||||
|
||||
void fill_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
|
||||
NR_RLC_BearerConfig_t **rlc_rbconfig);
|
||||
void free_nr_noS1_bearer_config(NR_RadioBearerConfig_t **rbconfig,
|
||||
NR_RLC_BearerConfig_t **rlc_rbconfig);
|
||||
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const int uid,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
|
||||
void fill_mastercellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
NR_CellGroupConfig_t *ue_context_mastercellGroup,
|
||||
@@ -104,8 +94,6 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t transaction_id,
|
||||
const uint8_t *masterCellGroup,
|
||||
int masterCellGroup_len,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
|
||||
uint8_t do_NR_SecurityModeCommand(
|
||||
|
||||
+1361
-117
File diff suppressed because it is too large
Load Diff
@@ -34,77 +34,51 @@
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
|
||||
|
||||
void set_phr_config(NR_MAC_CellGroupConfig_t *mac_CellGroupConfig);
|
||||
uint64_t get_ssb_bitmap(const NR_ServingCellConfigCommon_t *scc);
|
||||
void rrc_coreset_config(NR_ControlResourceSet_t *coreset,
|
||||
int bwp_id,
|
||||
int curr_bwp,
|
||||
uint64_t ssb_bitmap);
|
||||
NR_SearchSpace_t *rrc_searchspace_config(bool is_common,
|
||||
int searchspaceid,
|
||||
int coresetid);
|
||||
void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsch_TimeDomainAllocationList,
|
||||
frame_type_t frame_type,
|
||||
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,
|
||||
int curr_bwp);
|
||||
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
|
||||
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
|
||||
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
|
||||
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time, NR_SubcarrierSpacing_t subcarrierSpacing);
|
||||
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
|
||||
void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc,
|
||||
NR_PUCCH_Config_t *pucch_Config,
|
||||
int scs);
|
||||
void config_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, const NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_PUCCH_CSI_Resource_t *pucchcsires, int do_csi, int rep_id, int uid);
|
||||
void config_csi_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires,
|
||||
struct NR_SetupRelease_PDSCH_Config *pdsch_Config,
|
||||
const rrc_pdsch_AntennaPorts_t *antennaports,
|
||||
const int max_layers,
|
||||
int rep_id,
|
||||
int uid);
|
||||
void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int uid,
|
||||
int num_dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs,
|
||||
int id);
|
||||
void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig, int id);
|
||||
void config_srs(const NR_ServingCellConfigCommon_t *scc,
|
||||
NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
const int curr_bwp,
|
||||
const int uid,
|
||||
const int res_id,
|
||||
const long maxMIMO_Layers,
|
||||
const int do_srs);
|
||||
struct NR_SetupRelease_PDSCH_Config *config_pdsch(uint64_t ssb_bitmap, int bwp_Id, int dl_antenna_ports);
|
||||
void set_dl_mcs_table(int scs,
|
||||
NR_UE_NR_Capability_t *cap,
|
||||
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
|
||||
const NR_ServingCellConfigCommon_t *scc);
|
||||
|
||||
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int numerology,
|
||||
int rbsize,
|
||||
int mcs_table);
|
||||
struct NR_SetupRelease_PUSCH_Config *config_pusch(NR_PUSCH_Config_t *pusch_Config);
|
||||
void config_downlinkBWP(NR_BWP_Downlink_t *bwp,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
int dl_antenna_ports,
|
||||
bool force_256qam_off,
|
||||
int bwp_loop, bool is_SA);
|
||||
void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
|
||||
long bwp_loop, bool is_SA, int uid,
|
||||
const gNB_RrcConfigurationReq *configuration,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
NR_UE_NR_Capability_t *uecap);
|
||||
NR_MAC_CellGroupConfig_t *configure_mac_cellgroup(void);
|
||||
|
||||
|
||||
NR_BCCH_BCH_Message_t *get_new_MIB_NR(const NR_ServingCellConfigCommon_t *scc);
|
||||
void free_MIB_NR(NR_BCCH_BCH_Message_t *mib);
|
||||
int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_size);
|
||||
|
||||
|
||||
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1
|
||||
NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configuration);
|
||||
void free_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1);
|
||||
int encode_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1, uint8_t *buffer, int max_buffer_size);
|
||||
|
||||
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const int uid,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
const gNB_RrcConfigurationReq *configuration);
|
||||
void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig);
|
||||
int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size);
|
||||
NR_CellGroupConfig_t *decode_cellGroupConfig(const uint8_t *buffer, int max_buffer_size);
|
||||
|
||||
/* Note: this function returns a new CellGroupConfig for a user with given
|
||||
* configuration, but it will also overwrite the ServingCellConfig passed in
|
||||
* parameter servingcellconfigdedicated! */
|
||||
NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
const gNB_RrcConfigurationReq *configuration,
|
||||
int uid);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -442,32 +442,22 @@ typedef struct rrc_gNB_ue_context_s {
|
||||
|
||||
typedef struct {
|
||||
|
||||
// buffer that contains the encoded messages
|
||||
uint8_t *MIB;
|
||||
uint8_t sizeof_MIB;
|
||||
|
||||
uint8_t *SIB1;
|
||||
uint16_t sizeof_SIB1;
|
||||
|
||||
uint8_t *SIB23;
|
||||
uint8_t sizeof_SIB23;
|
||||
|
||||
uint8_t *ServingCellConfigCommon;
|
||||
uint8_t sizeof_servingcellconfigcommon;
|
||||
|
||||
int physCellId;
|
||||
|
||||
NR_BCCH_BCH_Message_t mib;
|
||||
NR_BCCH_BCH_Message_t *mib_DU;
|
||||
NR_BCCH_BCH_Message_t *mib;
|
||||
NR_SIB1_t *siblock1_DU;
|
||||
//NR_BCCH_DL_SCH_Message_t *siblock1_DU;
|
||||
NR_SIB1_t *sib1;
|
||||
NR_SIB2_t *sib2;
|
||||
NR_SIB3_t *sib3;
|
||||
NR_BCCH_DL_SCH_Message_t systemInformation; // SIB23
|
||||
NR_BCCH_DL_SCH_Message_t *siblock1;
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
|
||||
NR_ServingCellConfig_t *servingcellconfig;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS];
|
||||
int p_gNB;
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "openair2/RRC/common.h"
|
||||
|
||||
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 - The physical layer imposes a limit to the maximum size a SIB can take. The maximum SIB1 or SI message size is 2976 bits.
|
||||
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
|
||||
extern uint8_t DRB2LCHAN[8];
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "NR_CG-Config.h"
|
||||
#include "NR_CG-ConfigInfo.h"
|
||||
#include "NR_SecurityConfig.h"
|
||||
#include "NR_CellGroupConfig.h"
|
||||
|
||||
#define NR_MAX_SUPPORTED_DL_LAYERS 2
|
||||
void rrc_init_nr_srb_param(NR_LCHAN_DESC *chan);
|
||||
@@ -72,15 +73,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
|
||||
void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti);
|
||||
|
||||
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
const gNB_RrcConfigurationReq *configuration,
|
||||
int uid);
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_RRCReconfiguration_IEs_t *reconfig,
|
||||
@@ -89,11 +81,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
const gNB_RrcConfigurationReq *configuration,
|
||||
int uid);
|
||||
|
||||
void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig,
|
||||
int eps_bearer_id, int rb_id,
|
||||
e_NR_CipheringAlgorithm ciphering_algorithm,
|
||||
e_NR_SecurityConfig__keyToUse key_to_use);
|
||||
|
||||
int generate_CG_Config(gNB_RRC_INST *rrc,
|
||||
NR_CG_Config_t *cg_Config,
|
||||
NR_RRCReconfiguration_t *reconfig,
|
||||
@@ -136,9 +123,8 @@ void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe);
|
||||
\ *reOffset Pointer to RE Offset Value */
|
||||
void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, int *ptrsNrb, int *ptrsMcs, int *epre_Ratio, int * reOffset);
|
||||
|
||||
int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP);
|
||||
void nr_rrc_mac_remove_ue(rnti_t rntiP);
|
||||
void nr_rrc_mac_update_cellgroup(rnti_t rntiMaybeUEid, NR_CellGroupConfig_t *cgc);
|
||||
|
||||
int8_t nr_mac_rrc_bwp_switch_req(const module_id_t module_idP,
|
||||
const frame_t frameP,
|
||||
|
||||
+30
-98
@@ -92,7 +92,6 @@
|
||||
#include <openair2/X2AP/x2ap_eNB.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_e1_api.h"
|
||||
#include "openair2/F1AP/f1ap_common.h"
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap_entity.h"
|
||||
@@ -178,13 +177,16 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
|
||||
{
|
||||
|
||||
LOG_D(RRC,"%s()\n\n\n\n",__FUNCTION__);
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
rrc->carrier.MIB = (uint8_t *) malloc16(4);
|
||||
rrc->carrier.sizeof_MIB = do_MIB_NR(rrc,0);
|
||||
}
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type))
|
||||
rrc->carrier.mib = get_new_MIB_NR(rrc->carrier.servingcellconfigcommon);
|
||||
|
||||
if((get_softmodem_params()->sa) && ( (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)))) {
|
||||
rrc->carrier.sizeof_SIB1 = do_SIB1_NR(&rrc->carrier,configuration);
|
||||
NR_BCCH_DL_SCH_Message_t *sib1 = get_SIB1_NR(configuration);
|
||||
rrc->carrier.SIB1 = calloc(NR_MAX_SIB_LENGTH / 8, sizeof(*rrc->carrier.SIB1));
|
||||
AssertFatal(rrc->carrier.SIB1 != NULL, "out of memory\n");
|
||||
rrc->carrier.sizeof_SIB1 = encode_SIB1_NR(sib1, rrc->carrier.SIB1, NR_MAX_SIB_LENGTH / 8);
|
||||
rrc->carrier.siblock1 = sib1;
|
||||
nr_mac_config_sib1(RC.nrmac[rrc->module_id], sib1);
|
||||
}
|
||||
|
||||
if (!NODE_IS_DU(rrc->node_type)) {
|
||||
@@ -205,9 +207,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration
|
||||
rrc->configuration.sib1_tda,
|
||||
rrc->configuration.minRXTXTIME,
|
||||
rrc->carrier.servingcellconfigcommon);
|
||||
nr_mac_config_mib(RC.nrmac[rrc->module_id], &rrc->carrier.mib);
|
||||
if (get_softmodem_params()->sa)
|
||||
nr_mac_config_sib1(RC.nrmac[rrc->module_id], rrc->carrier.siblock1);
|
||||
nr_mac_config_mib(RC.nrmac[rrc->module_id], rrc->carrier.mib);
|
||||
}
|
||||
|
||||
/* set flag to indicate that cell information is configured. This is required
|
||||
@@ -271,7 +271,6 @@ static void openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_Rrc
|
||||
RB_INIT(&rrc->rrc_ue_head);
|
||||
rrc->configuration = *configuration;
|
||||
rrc->carrier.servingcellconfigcommon = configuration->scc;
|
||||
rrc->carrier.servingcellconfig = configuration->scd;
|
||||
nr_rrc_config_ul_tda(configuration->scc,configuration->minRXTXTIME);
|
||||
/// System Information INIT
|
||||
pthread_mutex_init(&rrc->cell_info_mutex,NULL);
|
||||
@@ -322,7 +321,7 @@ unsigned int rrc_gNB_get_next_transaction_identifier(module_id_t gnb_mod_idP)
|
||||
static void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP)
|
||||
{
|
||||
NR_CellGroupConfig_t *cgc = get_softmodem_params()->sa ? ue_context_pP->ue_context.masterCellGroup : NULL;
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_context_pP->ue_context.rnti, cgc);
|
||||
nr_rrc_mac_update_cellgroup(ue_context_pP->ue_context.rnti, cgc);
|
||||
|
||||
nr_rrc_addmod_srbs(ctxt_pP->rntiMaybeUEid, ue_context_pP->ue_context.SRB_configList, cgc->rlc_BearerToAddModList);
|
||||
nr_rrc_addmod_drbs(ctxt_pP->rntiMaybeUEid, ue_context_pP->ue_context.DRB_configList, cgc->rlc_BearerToAddModList);
|
||||
@@ -330,7 +329,7 @@ static void apply_macrlc_config(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const u
|
||||
|
||||
void apply_macrlc_config_reest(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *const ue_context_pP, const protocol_ctxt_t *const ctxt_pP, ue_id_t ue_id)
|
||||
{
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_id, ue_context_pP->ue_context.masterCellGroup);
|
||||
nr_rrc_mac_update_cellgroup(ue_id, ue_context_pP->ue_context.masterCellGroup);
|
||||
|
||||
nr_rrc_addmod_srbs(ctxt_pP->rntiMaybeUEid,
|
||||
ue_context_pP->ue_context.SRB_configList,
|
||||
@@ -342,8 +341,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance,
|
||||
rnti_t rnti,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t *masterCellGroup,
|
||||
int masterCellGroup_len,
|
||||
NR_ServingCellConfigCommon_t *scc)
|
||||
int masterCellGroup_len)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
LOG_I(NR_RRC, "rrc_gNB_generate_RRCSetup for RNTI %04x\n", rnti);
|
||||
@@ -351,8 +349,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance,
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[instance];
|
||||
unsigned char buf[1024];
|
||||
const NR_ServingCellConfig_t *sccd = rrc->configuration.scd;
|
||||
int size = do_RRCSetup(ue_context_pP, buf, rrc_gNB_get_next_transaction_identifier(instance), masterCellGroup, masterCellGroup_len, scc, sccd, &rrc->configuration);
|
||||
int size = do_RRCSetup(ue_context_pP, buf, rrc_gNB_get_next_transaction_identifier(instance), masterCellGroup, masterCellGroup_len, &rrc->configuration);
|
||||
AssertFatal(size > 0, "do_RRCSetup failed\n");
|
||||
AssertFatal(size <= 1024, "memory corruption\n");
|
||||
|
||||
@@ -386,14 +383,12 @@ static void rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t
|
||||
LOG_I(NR_RRC, "generate RRCSetup for RRCReestablishmentRequest \n");
|
||||
rrc_gNB_ue_context_t *ue_context_pP = NULL;
|
||||
gNB_RRC_INST *rrc_instance_p = RC.nrrrc[module_id];
|
||||
const NR_ServingCellConfigCommon_t *scc=rrc_instance_p->carrier.servingcellconfigcommon;
|
||||
const NR_ServingCellConfig_t *sccd = rrc_instance_p->configuration.scd;
|
||||
|
||||
ue_context_pP = rrc_gNB_create_ue_context(rnti, rrc_instance_p, 0);
|
||||
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
unsigned char buf[1024];
|
||||
int size = do_RRCSetup(ue_context_pP, buf, rrc_gNB_get_next_transaction_identifier(module_id), NULL, 0, scc, sccd, &rrc_instance_p->configuration);
|
||||
int size = do_RRCSetup(ue_context_pP, buf, rrc_gNB_get_next_transaction_identifier(module_id), NULL, 0, &rrc_instance_p->configuration);
|
||||
AssertFatal(size > 0, "do_RRCSetup failed\n");
|
||||
AssertFatal(size <= 1024, "memory corruption\n");
|
||||
|
||||
@@ -413,7 +408,7 @@ static void rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t
|
||||
rrc_instance_p->configuration.sib1_tda,
|
||||
rrc_instance_p->configuration.minRXTXTIME,
|
||||
rrc_instance_p->carrier.servingcellconfigcommon);
|
||||
nr_mac_config_mib(RC.nrmac[rrc_instance_p->module_id], &rrc_instance_p->carrier.mib);
|
||||
nr_mac_config_mib(RC.nrmac[rrc_instance_p->module_id], rrc_instance_p->carrier.mib);
|
||||
nr_mac_config_sib1(RC.nrmac[rrc_instance_p->module_id], rrc_instance_p->carrier.siblock1);
|
||||
|
||||
LOG_I(NR_RRC, " [RAPROC] rnti: %04x Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n", rnti, size);
|
||||
@@ -577,7 +572,7 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_p->rnti, ue_p->masterCellGroup);
|
||||
nr_rrc_mac_update_cellgroup(ue_p->rnti, ue_p->masterCellGroup);
|
||||
|
||||
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
|
||||
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
|
||||
@@ -766,7 +761,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.masterCellGroup);
|
||||
nr_rrc_mac_update_cellgroup(ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.masterCellGroup);
|
||||
|
||||
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
|
||||
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
|
||||
@@ -1223,18 +1218,6 @@ void rrc_gNB_generate_RRCReestablishment(const protocol_ctxt_t *ctxt_pP,
|
||||
&rrc->carrier);
|
||||
|
||||
LOG_I(NR_RRC, "[RAPROC] UE %04x Logical Channel DL-DCCH, Generating NR_RRCReestablishment (bytes %d)\n", ue_p->rnti, size);
|
||||
#if (0)
|
||||
/* TODO : It may be needed if gNB goes into full stack working. */
|
||||
UE = find_nr_UE(module_id, rnti);
|
||||
if (UE_id != -1) {
|
||||
/* Activate reject timer, if RRCComplete not received after 10 frames, reject UE */
|
||||
RC.nrmac[module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1;
|
||||
/* Reject UE after 10 frames, NR_RRCReestablishmentReject is triggered */
|
||||
RC.nrmac[module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 100;
|
||||
} else {
|
||||
LOG_E(NR_RRC, " Generating NR_RRCReestablishment without UE_id(MAC) rnti %x\n", rnti);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t *kRRCenc = NULL;
|
||||
uint8_t *kRRCint = NULL;
|
||||
@@ -1562,7 +1545,7 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_context_pP->ue_context.rnti, cellGroupConfig);
|
||||
nr_rrc_mac_update_cellgroup(ue_context_pP->ue_context.rnti, cellGroupConfig);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
}
|
||||
|
||||
@@ -1616,7 +1599,7 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP
|
||||
NULL,
|
||||
masterCellGroup);
|
||||
|
||||
nr_mac_update_cellgroup(RC.nrmac[ctxt_pP->module_id], ue_context_pP->ue_context.rnti, masterCellGroup);
|
||||
nr_rrc_mac_update_cellgroup(ue_context_pP->ue_context.rnti, masterCellGroup);
|
||||
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
@@ -1706,8 +1689,7 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
|
||||
// TODO: MAC structures should not be accessed directly from the RRC! An implementation using the F1 interface should be developed.
|
||||
if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[module_id]; // why MAC instances match RRC instances ?
|
||||
mac_remove_nr_ue(nrmac, UE->rnti);
|
||||
nr_rrc_mac_remove_ue(ue_context_p->ue_context.rnti);
|
||||
}
|
||||
|
||||
/* replace rnti in the context */
|
||||
@@ -1744,8 +1726,11 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
UE = &ue_context_p->ue_context;
|
||||
UE->establishment_cause = rrcSetupRequest->establishmentCause;
|
||||
|
||||
rrc_gNB_generate_RRCSetup(
|
||||
module_id, rnti, rrc_gNB_get_ue_context_by_rnti(gnb_rrc_inst, rnti), du_to_cu_rrc_container, du_to_cu_rrc_container_len, gnb_rrc_inst->carrier.servingcellconfigcommon);
|
||||
rrc_gNB_generate_RRCSetup(module_id,
|
||||
rnti,
|
||||
rrc_gNB_get_ue_context_by_rnti(gnb_rrc_inst, rnti),
|
||||
du_to_cu_rrc_container,
|
||||
du_to_cu_rrc_container_len);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1798,34 +1783,6 @@ static int nr_rrc_gNB_decode_ccch(module_id_t module_id, rnti_t rnti, const uint
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, c_rnti, 0);
|
||||
break;
|
||||
}
|
||||
#if 0
|
||||
int UE_id = find_nr_UE_id(gnb_rrc_inst, c_rnti);
|
||||
if (UE_id == -1) {
|
||||
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest without MAC context, rnti %04x, fallback to RRC establishment\n", c_rnti);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
// previous rnti
|
||||
rnti_t previous_rnti = 0;
|
||||
|
||||
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
|
||||
if (reestablish_rnti_map[i][1] == c_rnti) {
|
||||
previous_rnti = reestablish_rnti_map[i][0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (previous_rnti != 0) {
|
||||
UE_id = find_nr_UE_id(gnb_rrc_inst, previous_rnti);
|
||||
if (UE_id == -1) {
|
||||
LOG_E(NR_RRC,"RRCReestablishmentRequest without mac context previous rnti %04x, nex rnti %04x, fallback to RRC establishment\n",
|
||||
previous_rnti, c_rnti);
|
||||
rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id, rnti, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// c-plane not end
|
||||
if ((UE->StatusRrc != NR_RRC_RECONFIGURED) && (UE->reestablishment_cause == NR_ReestablishmentCause_spare1)) {
|
||||
LOG_E(NR_RRC, "NR_RRCReestablishmentRequest (UE %x c-plane is not end), RRC establishment failed\n", c_rnti);
|
||||
@@ -2419,24 +2376,10 @@ rrc_gNB_decode_dcch(
|
||||
break;
|
||||
}
|
||||
|
||||
#if (0)
|
||||
/* TODO : It may be needed if gNB goes into full stack working. */
|
||||
// clear
|
||||
int UE_id = find_nr_UE_id(gnb_rrc_inst, ctxt_pP->rntiMaybeUEid);
|
||||
|
||||
if (UE_id == -1) {
|
||||
LOG_E(NR_RRC, PROTOCOL_RRC_CTXT_UE_FMT " NR_RRCReestablishmentComplete without UE_id(MAC) rnti %lx, fault\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), ctxt_pP->rntiMaybeUEid);
|
||||
break;
|
||||
}
|
||||
|
||||
RC.nrmac[gnb_rrc_inst]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
|
||||
#endif
|
||||
|
||||
if (ul_dcch_msg->message.choice.c1->choice.rrcReestablishmentComplete->criticalExtensions.present == NR_RRCReestablishmentComplete__criticalExtensions_PR_rrcReestablishmentComplete) {
|
||||
rrc_gNB_process_RRCReestablishmentComplete(ctxt_pP, reestablish_rnti, ue_context_p, ul_dcch_msg->message.choice.c1->choice.rrcReestablishmentComplete->rrc_TransactionIdentifier);
|
||||
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[ctxt_pP->module_id]; // WHAT A BEAUTIFULL RACE CONDITION !!!
|
||||
mac_remove_nr_ue(nrmac, reestablish_rnti);
|
||||
nr_rrc_mac_remove_ue(reestablish_rnti);
|
||||
|
||||
UE->ue_reestablishment_counter++;
|
||||
}
|
||||
@@ -2471,26 +2414,17 @@ void rrc_gNB_process_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
|
||||
//fixme: multi instance is not consistent here
|
||||
F1AP_SETUP_RESP (msg_p).gNB_CU_name = rrc->node_name;
|
||||
// check that CU rrc instance corresponds to mcc/mnc/cgi (normally cgi should be enough, but just in case)
|
||||
rrc->carrier.MIB = malloc(f1_setup_req->mib_length[i]);
|
||||
rrc->carrier.sizeof_MIB = f1_setup_req->mib_length[i];
|
||||
LOG_W(NR_RRC, "instance %d mib length %d\n", i, f1_setup_req->mib_length[i]);
|
||||
LOG_W(NR_RRC, "instance %d sib1 length %d\n", i, f1_setup_req->sib1_length[i]);
|
||||
memcpy((void *)rrc->carrier.MIB,f1_setup_req->mib[i],f1_setup_req->mib_length[i]);
|
||||
AssertFatal(rrc->carrier.mib == NULL, "CU MIB is already initialized: double F1 setup request?\n");
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
|
||||
&asn_DEF_NR_BCCH_BCH_Message,
|
||||
(void **)&rrc->carrier.mib_DU,
|
||||
(void **)&rrc->carrier.mib,
|
||||
f1_setup_req->mib[i],
|
||||
f1_setup_req->mib_length[i]);
|
||||
AssertFatal(dec_rval.code == RC_OK,
|
||||
"[gNB_CU %"PRIu8"] Failed to decode NR_BCCH_BCH_MESSAGE (%zu bits)\n",
|
||||
j,
|
||||
dec_rval.consumed );
|
||||
NR_BCCH_BCH_Message_t *mib = &rrc->carrier.mib;
|
||||
NR_BCCH_BCH_Message_t *mib_DU = rrc->carrier.mib_DU;
|
||||
mib->message.present = NR_BCCH_BCH_MessageType_PR_mib;
|
||||
mib->message.choice.mib = CALLOC(1,sizeof(struct NR_MIB));
|
||||
memset(mib->message.choice.mib,0,sizeof(struct NR_MIB));
|
||||
memcpy(mib->message.choice.mib, mib_DU->message.choice.mib, sizeof(struct NR_MIB));
|
||||
|
||||
dec_rval = uper_decode_complete(NULL,
|
||||
&asn_DEF_NR_SIB1, //&asn_DEF_NR_BCCH_DL_SCH_Message,
|
||||
@@ -3269,8 +3203,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
// Remove here the MAC and RRC context when RRC is not connected
|
||||
if (UE->StatusRrc < NR_RRC_CONNECTED) {
|
||||
if (!NODE_IS_CU(rrc->node_type)) {
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[ctxt_pP->module_id]; // WHAT A BEAUTIFULL RACE CONDITION !!!
|
||||
mac_remove_nr_ue(nrmac, UE->rnti);
|
||||
nr_rrc_mac_remove_ue(ctxt_pP->rntiMaybeUEid);
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
nr_pdcp_remove_UE(ctxt_pP->rntiMaybeUEid);
|
||||
|
||||
@@ -3305,8 +3238,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
LOG_I(NR_RRC, "Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)\n", UE->rnti);
|
||||
UE->ue_release_timer_rrc = 0;
|
||||
if (!NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[ctxt_pP->module_id]; // WHAT A BEAUTIFULL RACE CONDITION !!!
|
||||
mac_remove_nr_ue(nrmac, UE->rnti);
|
||||
nr_rrc_mac_remove_ue(ctxt_pP->rntiMaybeUEid);
|
||||
}
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
nr_pdcp_remove_UE(ctxt_pP->rntiMaybeUEid);
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "MESSAGES/asn1_msg.h"
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info)
|
||||
{
|
||||
@@ -100,7 +101,7 @@ void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerL
|
||||
LOG_A(NR_RRC, "Successfully decoded UE NR capabilities (NR and MRDC)\n");
|
||||
|
||||
UE->spCellConfig = calloc(1, sizeof(struct NR_SpCellConfig));
|
||||
UE->spCellConfig->spCellConfigDedicated = rrc->carrier.servingcellconfig;
|
||||
UE->spCellConfig->spCellConfigDedicated = rrc->configuration.scd;
|
||||
LOG_I(NR_RRC,"Adding new NSA user (%p)\n",ue_context_p);
|
||||
rrc_add_nsa_user(rrc,ue_context_p, m);
|
||||
}
|
||||
@@ -150,15 +151,13 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
|
||||
// NR RRCReconfiguration
|
||||
UE->reconfig = calloc(1, sizeof(NR_RRCReconfiguration_t));
|
||||
UE->secondaryCellGroup = calloc(1, sizeof(NR_CellGroupConfig_t));
|
||||
memset((void *)UE->reconfig, 0, sizeof(NR_RRCReconfiguration_t));
|
||||
UE->reconfig->rrc_TransactionIdentifier = 0;
|
||||
UE->reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
||||
NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t));
|
||||
UE->reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies;
|
||||
UE->rb_config = calloc(1, sizeof(NR_RRCReconfiguration_t));
|
||||
if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1 || get_softmodem_params()->sa == 1){
|
||||
fill_default_rbconfig(UE->rb_config, 10 /* EPS bearer ID */, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master);
|
||||
UE->rb_config = get_default_rbconfig(10 /* EPS bearer ID */, 1 /* drb ID */, NR_CipheringAlgorithm_nea0, NR_SecurityConfig__keyToUse_master);
|
||||
} else {
|
||||
/* TODO: handle more than one bearer */
|
||||
if (m == NULL) {
|
||||
@@ -235,10 +234,20 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fill_default_rbconfig(UE->rb_config, m->e_rabs_tobeadded[0].e_rab_id, m->e_rabs_tobeadded[0].drb_ID, cipher_algo, NR_SecurityConfig__keyToUse_secondary);
|
||||
UE->rb_config = get_default_rbconfig(m->e_rabs_tobeadded[0].e_rab_id, m->e_rabs_tobeadded[0].drb_ID, cipher_algo, NR_SecurityConfig__keyToUse_secondary);
|
||||
}
|
||||
|
||||
NR_ServingCellConfig_t *scc = UE->spCellConfig ? UE->spCellConfig->spCellConfigDedicated : NULL;
|
||||
UE->secondaryCellGroup = get_default_secondaryCellGroup(carrier->servingcellconfigcommon,
|
||||
scc,
|
||||
UE->UE_Capability_nr,
|
||||
1,
|
||||
1,
|
||||
configuration,
|
||||
ue_context_p->ue_context.gNB_ue_ngap_id);
|
||||
AssertFatal(UE->secondaryCellGroup != NULL, "out of memory\n");
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->secondaryCellGroup);
|
||||
|
||||
fill_default_reconfig(carrier->servingcellconfigcommon, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, configuration, ue_context_p->ue_context.gNB_ue_ngap_id);
|
||||
// the UE context is not yet inserted in the RRC UE manager
|
||||
// rrc_gNB_update_ue_context_rnti(UE->secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, rrc,
|
||||
|
||||
@@ -32,7 +32,6 @@ rrc_pdu_session_param_t *find_pduSession(gNB_RRC_UE_t *ue, int id, bool create)
|
||||
ue->nb_of_pdusessions++;
|
||||
else
|
||||
return NULL;
|
||||
AssertFatal(ue->nb_of_pdusessions < NGAP_MAX_PDU_SESSION, "");
|
||||
return ue->pduSession + j;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,366 +43,10 @@
|
||||
#include "assertions.h"
|
||||
#include "oai_asn1.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "nr_rrc_config.h"
|
||||
|
||||
void fix_servingcellconfigdedicated(NR_ServingCellConfig_t *scd) {
|
||||
|
||||
int b = 0;
|
||||
while (b < scd->downlinkBWP_ToAddModList->list.count) {
|
||||
if (scd->downlinkBWP_ToAddModList->list.array[b]->bwp_Common->genericParameters.locationAndBandwidth == 0) {
|
||||
asn_sequence_del(&scd->downlinkBWP_ToAddModList->list, b, 1);
|
||||
} else {
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
if(scd->downlinkBWP_ToAddModList->list.count == 0) {
|
||||
free(scd->downlinkBWP_ToAddModList);
|
||||
scd->downlinkBWP_ToAddModList = NULL;
|
||||
}
|
||||
|
||||
b = 0;
|
||||
while (b < scd->uplinkConfig->uplinkBWP_ToAddModList->list.count) {
|
||||
if (scd->uplinkConfig->uplinkBWP_ToAddModList->list.array[b]->bwp_Common->genericParameters.locationAndBandwidth ==
|
||||
0) {
|
||||
asn_sequence_del(&scd->uplinkConfig->uplinkBWP_ToAddModList->list, b, 1);
|
||||
} else {
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
if(scd->uplinkConfig->uplinkBWP_ToAddModList->list.count == 0) {
|
||||
free(scd->uplinkConfig->uplinkBWP_ToAddModList);
|
||||
scd->uplinkConfig->uplinkBWP_ToAddModList = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup,
|
||||
NR_UE_NR_Capability_t *uecap,
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
const gNB_RrcConfigurationReq *configuration,
|
||||
int uid) {
|
||||
|
||||
const rrc_pdsch_AntennaPorts_t* pdschap = &configuration->pdsch_AntennaPorts;
|
||||
const int dl_antenna_ports = pdschap->N1 * pdschap->N2 * pdschap->XP;
|
||||
const int do_csirs = configuration->do_CSIRS;
|
||||
|
||||
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
|
||||
AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");
|
||||
|
||||
if(uecap == NULL)
|
||||
LOG_E(RRC,"No UE Capabilities available when programming default CellGroup in NSA\n");
|
||||
|
||||
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
|
||||
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
|
||||
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
|
||||
AssertFatal(uid>=0 && uid<30, "gNB cannot allocate the SRS resources\n");
|
||||
|
||||
uint64_t bitmap = get_ssb_bitmap(servingcellconfigcommon);
|
||||
fix_servingcellconfigdedicated(servingcellconfigdedicated);
|
||||
|
||||
memset(secondaryCellGroup,0,sizeof(NR_CellGroupConfig_t));
|
||||
secondaryCellGroup->cellGroupId = scg_id;
|
||||
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
|
||||
nr_rlc_bearer_init(RLC_BearerConfig, NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
|
||||
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
|
||||
//nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
|
||||
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
|
||||
|
||||
secondaryCellGroup->rlc_BearerToAddModList = calloc(1,sizeof(*secondaryCellGroup->rlc_BearerToAddModList));
|
||||
asn1cSeqAdd(&secondaryCellGroup->rlc_BearerToAddModList->list, RLC_BearerConfig);
|
||||
|
||||
secondaryCellGroup->mac_CellGroupConfig = configure_mac_cellgroup();
|
||||
|
||||
secondaryCellGroup->physicalCellGroupConfig = calloc(1,sizeof(*secondaryCellGroup->physicalCellGroupConfig));
|
||||
secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->p_NR_FR1 = NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook=NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;
|
||||
secondaryCellGroup->physicalCellGroupConfig->tpc_SRS_RNTI=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->tpc_PUCCH_RNTI=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->tpc_PUSCH_RNTI=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->sp_CSI_RNTI=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->cs_RNTI=NULL;
|
||||
secondaryCellGroup->physicalCellGroupConfig->ext1=NULL;
|
||||
secondaryCellGroup->spCellConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig));
|
||||
secondaryCellGroup->spCellConfig->servCellIndex = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->servCellIndex));
|
||||
*secondaryCellGroup->spCellConfig->servCellIndex = servCellIndex;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->reconfigurationWithSync));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->spCellConfigCommon=servingcellconfigcommon;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity=(get_softmodem_params()->phy_test==1) ? 0x1234 : (taus()&0xffff);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->t304=NR_ReconfigurationWithSync__t304_ms2000;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = NULL;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->ext1 = NULL;
|
||||
|
||||
// For 2-step contention-free random access procedure
|
||||
if(get_softmodem_params()->sa == 0) {
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated = calloc(1,sizeof(struct NR_ReconfigurationWithSync__rach_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->present= NR_ReconfigurationWithSync__rach_ConfigDedicated_PR_uplink;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink= calloc(1,sizeof(struct NR_RACH_ConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra= calloc(1,sizeof(struct NR_CFRA));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->ra_Prioritization= NULL;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions= calloc(1,sizeof(struct NR_CFRA__occasions));
|
||||
memcpy(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->rach_ConfigGeneric,
|
||||
&servingcellconfigcommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric, sizeof(NR_RACH_ConfigGeneric_t));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion= calloc(1,sizeof(long));
|
||||
*secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->occasions->ssb_perRACH_Occasion = NR_CFRA__occasions__ssb_perRACH_Occasion_one;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.present = NR_CFRA__resources_PR_ssb;
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb = calloc(1,sizeof(struct NR_CFRA__resources__ssb));
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ra_ssb_OccasionMaskIndex = 0;
|
||||
|
||||
int n_ssb = 0;
|
||||
struct NR_CFRA_SSB_Resource *ssbElem[64];
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap>>(63-i))&0x01){
|
||||
ssbElem[n_ssb] = calloc(1,sizeof(struct NR_CFRA_SSB_Resource));
|
||||
ssbElem[n_ssb]->ssb = i;
|
||||
ssbElem[n_ssb]->ra_PreambleIndex = 63 - (uid % 64);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->resources.choice.ssb->ssb_ResourceList.list,ssbElem[n_ssb]);
|
||||
n_ssb++;
|
||||
}
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink->cfra->ext1 = NULL;
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants));
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->present = NR_SetupRelease_RLF_TimersAndConstants_PR_setup;
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup));
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->t310 = NR_RLF_TimersAndConstants__t310_ms4000;
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->n310 = NR_RLF_TimersAndConstants__n310_n20;
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->n311 = NR_RLF_TimersAndConstants__n311_n1;
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1 = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1));
|
||||
secondaryCellGroup->spCellConfig->rlf_TimersAndConstants->choice.setup->ext1->t311 = NR_RLF_TimersAndConstants__ext1__t311_ms30000;
|
||||
secondaryCellGroup->spCellConfig->rlmInSyncOutOfSyncThreshold = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->tdd_UL_DL_ConfigurationDedicated = NULL;
|
||||
|
||||
/// initialDownlinkBWP
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdcch_Config=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->pdsch_Config = config_pdsch(bitmap, 0, dl_antenna_ports);
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->sps_Config = NULL; // calloc(1,sizeof(struct NR_SetupRelease_SPS_Config));
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig = NULL;
|
||||
#if 0
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->present = NR_SetupRelease_RadioLinkMonitoringConfig_PR_setup;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToAddModList=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->failureDetectionResourcesToReleaseList=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureInstanceMaxCount = NR_RadioLinkMonitoringConfig__beamFailureInstanceMaxCount_n3;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP->radioLinkMonitoringConfig->choice.setup->beamFailureDetectionTimer = NR_RadioLinkMonitoringConfig__beamFailureDetectionTimer_pbfd2;
|
||||
#endif
|
||||
|
||||
/// initialUplinkBWP
|
||||
|
||||
if (!secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig));
|
||||
}
|
||||
|
||||
NR_BWP_UplinkDedicated_t *initialUplinkBWP = calloc(1,sizeof(*initialUplinkBWP));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP = initialUplinkBWP;
|
||||
initialUplinkBWP->pucch_Config = NULL;
|
||||
|
||||
NR_PUSCH_Config_t *pusch_Config = NULL;
|
||||
if (servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
pusch_Config = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[0]->bwp_Dedicated->pusch_Config->choice.setup;
|
||||
}
|
||||
initialUplinkBWP->pusch_Config = config_pusch(pusch_Config);
|
||||
|
||||
long maxMIMO_Layers = servingcellconfigdedicated->uplinkConfig &&
|
||||
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig &&
|
||||
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1 &&
|
||||
servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers ?
|
||||
*servingcellconfigdedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup->ext1->maxMIMO_Layers : 1;
|
||||
|
||||
int curr_bwp = NRRIV2BW(servingcellconfigcommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
initialUplinkBWP->srs_Config = calloc(1,sizeof(*initialUplinkBWP->srs_Config));
|
||||
config_srs(servingcellconfigcommon, initialUplinkBWP->srs_Config, NULL, curr_bwp, uid, 0, maxMIMO_Layers, configuration->do_SRS);
|
||||
|
||||
// Downlink BWPs
|
||||
int n_dl_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->downlinkBWP_ToAddModList) {
|
||||
n_dl_bwp = servingcellconfigdedicated->downlinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if(n_dl_bwp>0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) {
|
||||
NR_BWP_Downlink_t *bwp = calloc(1,sizeof(*bwp));
|
||||
config_downlinkBWP(bwp, servingcellconfigcommon,
|
||||
servingcellconfigdedicated,
|
||||
uecap,
|
||||
dl_antenna_ports,
|
||||
configuration->force_256qam_off,
|
||||
bwp_loop, false);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list,bwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = servingcellconfigdedicated->firstActiveDownlinkBWP_Id ? *servingcellconfigdedicated->firstActiveDownlinkBWP_Id : 1;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = servingcellconfigdedicated->defaultDownlinkBWP_Id ? *servingcellconfigdedicated->defaultDownlinkBWP_Id : 1;
|
||||
}
|
||||
|
||||
// Uplink BWPs
|
||||
int n_ul_bwp = 1;
|
||||
if (servingcellconfigdedicated && servingcellconfigdedicated->uplinkConfig && servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList) {
|
||||
n_ul_bwp = servingcellconfigdedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
|
||||
}
|
||||
if(n_ul_bwp>0) {
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList));
|
||||
for (int bwp_loop = 0; bwp_loop < n_ul_bwp; bwp_loop++) {
|
||||
NR_BWP_Uplink_t *ubwp = calloc(1,sizeof(*ubwp));
|
||||
config_uplinkBWP(ubwp, bwp_loop, false, uid,
|
||||
configuration,
|
||||
servingcellconfigdedicated,
|
||||
servingcellconfigcommon,
|
||||
uecap);
|
||||
asn1cSeqAdd(&secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list,ubwp);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id));
|
||||
*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id ? *servingcellconfigdedicated->uplinkConfig->firstActiveUplinkBWP_Id : 1;
|
||||
}
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->bwp_InactivityTimer = NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToReleaseList= NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToReleaseList = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig = calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig));
|
||||
NR_PUSCH_ServingCellConfig_t *pusch_scc = calloc(1,sizeof(*pusch_scc));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->present = NR_SetupRelease_PUSCH_ServingCellConfig_PR_setup;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->pusch_ServingCellConfig->choice.setup = pusch_scc;
|
||||
pusch_scc->codeBlockGroupTransmission = NULL;
|
||||
pusch_scc->rateMatching = NULL;
|
||||
pusch_scc->xOverhead = NULL;
|
||||
pusch_scc->ext1=calloc(1,sizeof(*pusch_scc->ext1));
|
||||
pusch_scc->ext1->maxMIMO_Layers = calloc(1,sizeof(*pusch_scc->ext1->maxMIMO_Layers));
|
||||
*pusch_scc->ext1->maxMIMO_Layers = 1;
|
||||
pusch_scc->ext1->processingType2Enabled = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->carrierSwitching = NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->supplementaryUplink=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdcch_ServingCellConfig=NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig));
|
||||
NR_PDSCH_ServingCellConfig_t *pdsch_servingcellconfig = calloc(1,sizeof(*pdsch_servingcellconfig));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->present = NR_SetupRelease_PDSCH_ServingCellConfig_PR_setup;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup = pdsch_servingcellconfig;
|
||||
pdsch_servingcellconfig->codeBlockGroupTransmission = NULL;
|
||||
pdsch_servingcellconfig->xOverhead = NULL;
|
||||
pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = calloc(1, sizeof(*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH));
|
||||
*pdsch_servingcellconfig->nrofHARQ_ProcessesForPDSCH = NR_PDSCH_ServingCellConfig__nrofHARQ_ProcessesForPDSCH_n16;
|
||||
pdsch_servingcellconfig->pucch_Cell= NULL;
|
||||
pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
|
||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = NR_MAX_SUPPORTED_DL_LAYERS;
|
||||
pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=calloc(1,sizeof(*secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->present = NR_SetupRelease_CSI_MeasConfig_PR_setup;
|
||||
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1,sizeof(*csi_MeasConfig));
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup = csi_MeasConfig;
|
||||
|
||||
csi_MeasConfig->csi_ResourceConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ResourceConfigToAddModList));
|
||||
csi_MeasConfig->csi_ResourceConfigToReleaseList = NULL;
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
|
||||
csi_MeasConfig->csi_ReportConfigToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_ReportConfigToAddModList));
|
||||
csi_MeasConfig->csi_ReportConfigToReleaseList = NULL;
|
||||
|
||||
NR_CSI_SSB_ResourceSet_t *ssbresset0 = calloc(1,sizeof(*ssbresset0));
|
||||
ssbresset0->csi_SSB_ResourceSetId = 0;
|
||||
|
||||
for (int i=0;i<64;i++) {
|
||||
if ((bitmap >> (63 - i)) & 0x01) {
|
||||
NR_SSB_Index_t *ssbres = NULL;
|
||||
asn1cCallocOne(ssbres, i);
|
||||
asn1cSeqAdd(&ssbresset0->csi_SSB_ResourceList.list, ssbres);
|
||||
}
|
||||
}
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list,ssbresset0);
|
||||
|
||||
for (int bwp_loop = 0; bwp_loop < n_dl_bwp; bwp_loop++) {
|
||||
|
||||
NR_BWP_Downlink_t *bwp = secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_loop];
|
||||
int curr_bwp = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
|
||||
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs, bwp_loop);
|
||||
config_csiim(do_csirs, dl_antenna_ports, curr_bwp, csi_MeasConfig, bwp_loop);
|
||||
|
||||
if (do_csirs) {
|
||||
NR_CSI_ResourceConfig_t *csires = calloc(1,sizeof(*csires));
|
||||
csires->csi_ResourceConfigId = bwp->bwp_Id;
|
||||
csires->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList = calloc(1,sizeof(*csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1,sizeof(*nzp0));
|
||||
*nzp0 = bwp_loop;
|
||||
asn1cSeqAdd(&csires->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list,nzp0);
|
||||
csires->bwp_Id = bwp->bwp_Id;
|
||||
csires->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires);
|
||||
}
|
||||
if (do_csirs && dl_antenna_ports > 1) {
|
||||
NR_CSI_ResourceConfig_t *csiresim = calloc(1,sizeof(*csiresim));
|
||||
csiresim->csi_ResourceConfigId = bwp->bwp_Id+10;
|
||||
csiresim->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_csi_IM_ResourceSetList;
|
||||
csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList = calloc(1,sizeof(*csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = bwp_loop;
|
||||
asn1cSeqAdd(&csiresim->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
csiresim->bwp_Id = bwp->bwp_Id;
|
||||
csiresim->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csiresim);
|
||||
}
|
||||
NR_CSI_ResourceConfig_t *ssbres = calloc(1,sizeof(*ssbres));
|
||||
ssbres->csi_ResourceConfigId = bwp->bwp_Id+20;
|
||||
ssbres->csi_RS_ResourceSetList.present = NR_CSI_ResourceConfig__csi_RS_ResourceSetList_PR_nzp_CSI_RS_SSB;
|
||||
ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB = calloc(1,sizeof(*ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB));
|
||||
ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList = calloc(1,sizeof(*ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList));
|
||||
NR_CSI_SSB_ResourceSetId_t *ssbres00 = calloc(1,sizeof(*ssbres00));
|
||||
*ssbres00 = 0;
|
||||
asn1cSeqAdd(&ssbres->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list,ssbres00);
|
||||
ssbres->bwp_Id = bwp->bwp_Id;
|
||||
ssbres->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
asn1cSeqAdd(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,ssbres);
|
||||
|
||||
NR_PUCCH_CSI_Resource_t *pucchcsires1 = calloc(1,sizeof(*pucchcsires1));
|
||||
pucchcsires1->uplinkBandwidthPartId = bwp->bwp_Id;
|
||||
pucchcsires1->pucch_Resource=2;
|
||||
|
||||
config_csi_meas_report(csi_MeasConfig, servingcellconfigcommon, pucchcsires1, bwp->bwp_Dedicated->pdsch_Config, pdschap, NR_MAX_SUPPORTED_DL_LAYERS, bwp->bwp_Id, uid);
|
||||
config_rsrp_meas_report(csi_MeasConfig, servingcellconfigcommon, pucchcsires1, do_csirs, bwp->bwp_Id + 10, uid);
|
||||
}
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->sCellDeactivationTimer=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->crossCarrierSchedulingConfig=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->tag_Id=0;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->dummy1=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->pathlossReferenceLinking=NULL;
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->servingCellMO=NULL;
|
||||
|
||||
*servingcellconfigdedicated = *secondaryCellGroup->spCellConfig->spCellConfigDedicated;
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
xer_fprint(stdout, &asn_DEF_NR_SpCellConfig, (void *)secondaryCellGroup->spCellConfig);
|
||||
}
|
||||
}
|
||||
#include "MESSAGES/asn1_msg.h"
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
@@ -416,17 +60,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");
|
||||
// radioBearerConfig
|
||||
reconfig->radioBearerConfig=NULL;
|
||||
// secondaryCellGroup
|
||||
fill_default_secondaryCellGroup(servingcellconfigcommon,
|
||||
servingcellconfigdedicated,
|
||||
secondaryCellGroup,
|
||||
uecap,
|
||||
1,
|
||||
1,
|
||||
configuration,
|
||||
uid);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
char scg_buffer[1024];
|
||||
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_NR_CellGroupConfig, NULL, (void *)secondaryCellGroup, scg_buffer, 1024);
|
||||
@@ -443,54 +76,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
reconfig->nonCriticalExtension = NULL;
|
||||
}
|
||||
|
||||
void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig,
|
||||
int eps_bearer_id, int rb_id,
|
||||
e_NR_CipheringAlgorithm ciphering_algorithm,
|
||||
e_NR_SecurityConfig__keyToUse key_to_use) {
|
||||
|
||||
rbconfig->srb_ToAddModList = NULL;
|
||||
rbconfig->srb3_ToRelease = NULL;
|
||||
rbconfig->drb_ToAddModList = calloc(1,sizeof(*rbconfig->drb_ToAddModList));
|
||||
NR_DRB_ToAddMod_t *drb_ToAddMod = calloc(1,sizeof(*drb_ToAddMod));
|
||||
drb_ToAddMod->cnAssociation = calloc(1,sizeof(*drb_ToAddMod->cnAssociation));
|
||||
drb_ToAddMod->cnAssociation->present = NR_DRB_ToAddMod__cnAssociation_PR_eps_BearerIdentity;
|
||||
drb_ToAddMod->cnAssociation->choice.eps_BearerIdentity= eps_bearer_id;
|
||||
drb_ToAddMod->drb_Identity = rb_id;
|
||||
drb_ToAddMod->reestablishPDCP = NULL;
|
||||
drb_ToAddMod->recoverPDCP = NULL;
|
||||
drb_ToAddMod->pdcp_Config = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config));
|
||||
drb_ToAddMod->pdcp_Config->drb = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb));
|
||||
drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer));
|
||||
*drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_infinity;
|
||||
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL));
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
|
||||
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL));
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
|
||||
drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
|
||||
drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0;
|
||||
|
||||
drb_ToAddMod->pdcp_Config->drb->integrityProtection=NULL;
|
||||
drb_ToAddMod->pdcp_Config->drb->statusReportRequired=NULL;
|
||||
drb_ToAddMod->pdcp_Config->drb->outOfOrderDelivery=NULL;
|
||||
drb_ToAddMod->pdcp_Config->moreThanOneRLC = NULL;
|
||||
|
||||
drb_ToAddMod->pdcp_Config->t_Reordering = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->t_Reordering));
|
||||
*drb_ToAddMod->pdcp_Config->t_Reordering = NR_PDCP_Config__t_Reordering_ms100;
|
||||
drb_ToAddMod->pdcp_Config->ext1 = NULL;
|
||||
|
||||
asn1cSeqAdd(&rbconfig->drb_ToAddModList->list,drb_ToAddMod);
|
||||
|
||||
rbconfig->drb_ToReleaseList = NULL;
|
||||
|
||||
rbconfig->securityConfig = calloc(1,sizeof(*rbconfig->securityConfig));
|
||||
rbconfig->securityConfig->securityAlgorithmConfig = calloc(1,sizeof(*rbconfig->securityConfig->securityAlgorithmConfig));
|
||||
rbconfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm = ciphering_algorithm;
|
||||
rbconfig->securityConfig->securityAlgorithmConfig->integrityProtAlgorithm=NULL;
|
||||
rbconfig->securityConfig->keyToUse = calloc(1,sizeof(*rbconfig->securityConfig->keyToUse));
|
||||
*rbconfig->securityConfig->keyToUse = key_to_use;
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)rbconfig);
|
||||
}
|
||||
/* Function to set or overwrite PTRS DL RRC parameters */
|
||||
void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, int *ptrsNrb, int *ptrsMcs, int *epre_Ratio, int * reOffset)
|
||||
{
|
||||
|
||||
@@ -413,7 +413,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
|
||||
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
|
||||
LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
|
||||
LOG_D(NR_RRC, "Calling nr_rrc_ue_process_RadioBearerConfig() at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
|
||||
__LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity,
|
||||
RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity,
|
||||
RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm,
|
||||
@@ -2734,9 +2734,9 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len)
|
||||
LOG_D(NR_RRC, "Received NR band information: %ld.\n",
|
||||
nr_freq_band_list->list.array[i]->choice.bandInformationNR->bandNR);
|
||||
}
|
||||
MessageDef *dummy_msg = itti_alloc_new_message(TASK_RRC_NSA_UE, 0, UE_CAPABILITY_DUMMY);
|
||||
int dummy_msg = 0;// whatever piece of data, it will never be used by sendee
|
||||
LOG_D(NR_RRC, "We are calling nsa_sendmsg_to_lte_ue to send a UE_CAPABILITY_DUMMY\n");
|
||||
nsa_sendmsg_to_lte_ue(dummy_msg, sizeof(dummy_msg), UE_CAPABILITY_DUMMY);
|
||||
nsa_sendmsg_to_lte_ue(&dummy_msg, sizeof(dummy_msg), UE_CAPABILITY_DUMMY);
|
||||
LOG_A(NR_RRC, "Sent initial NRUE Capability response to LTE UE\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ int get_from_lte_ue_fd()
|
||||
return from_lte_ue_fd;
|
||||
}
|
||||
|
||||
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, MessagesIds msg_type)
|
||||
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, Rrc_Msg_Type_t msg_type)
|
||||
{
|
||||
LOG_I(NR_RRC, "Entered %s \n", __FUNCTION__);
|
||||
nsa_msg_t n_msg;
|
||||
|
||||
@@ -160,7 +160,7 @@ void *recv_msgs_from_lte_ue(void *args_p);
|
||||
|
||||
void init_connections_with_lte_ue(void);
|
||||
|
||||
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, MessagesIds msg_type);
|
||||
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, Rrc_Msg_Type_t msg_type);
|
||||
|
||||
void start_oai_nrue_threads(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user