Merge branch 'develop' into enhancement-10-harmony
Conflicts: cmake_targets/autotests/test_case_list.xml openair1/PHY/INIT/lte_init.c openair1/PHY/INIT/lte_param_init.c openair1/PHY/LTE_TRANSPORT/pucch.c openair1/SIMULATION/LTE_PHY/pdcchsim.c openair2/ENB_APP/enb_config.h openair2/RRC/LITE/rrc_eNB.c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf targets/RT/USER/lte-softmodem.c targets/SIMU/USER/init_lte.c targets/SIMU/USER/oaisim.c targets/SIMU/USER/oaisim_functions.c
This commit is contained in:
@@ -215,6 +215,7 @@ typedef struct protocol_ctxt_s {
|
||||
frame_t frame; /*!< \brief LTE frame number.*/
|
||||
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
|
||||
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
|
||||
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
|
||||
} protocol_ctxt_t;
|
||||
// warning time hardcoded
|
||||
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
|
||||
|
||||
@@ -179,7 +179,7 @@ typedef struct RrcConfigurationReq_s {
|
||||
long ue_TimersAndConstants_t311[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n310[MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n311[MAX_NUM_CCs];
|
||||
|
||||
long ue_TransmissionMode[MAX_NUM_CCs];
|
||||
} RrcConfigurationReq;
|
||||
|
||||
// UE: NAS -> RRC messages
|
||||
|
||||
@@ -39,6 +39,8 @@ MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText
|
||||
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_command_log)
|
||||
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMPLETE_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_complete_log)
|
||||
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_log)
|
||||
MESSAGE_DEF(S1AP_E_RAB_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_setup_request_log)
|
||||
MESSAGE_DEF(S1AP_E_RAB_SETUP_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_setup_response_log)
|
||||
|
||||
/* eNB application layer -> S1AP messages */
|
||||
MESSAGE_DEF(S1AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, s1ap_register_enb_req_t , s1ap_register_enb_req)
|
||||
@@ -58,12 +60,15 @@ MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_relea
|
||||
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMPLETE, MESSAGE_PRIORITY_MED, s1ap_ue_release_complete_t , s1ap_ue_release_complete)
|
||||
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_RESP , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_resp_t , s1ap_ue_ctxt_modification_resp)
|
||||
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_FAIL , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_fail_t , s1ap_ue_ctxt_modification_fail)
|
||||
MESSAGE_DEF(S1AP_E_RAB_SETUP_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_resp_t , s1ap_e_rab_setup_resp)
|
||||
MESSAGE_DEF(S1AP_E_RAB_SETUP_REQUEST_FAIL , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_req_fail_t , s1ap_e_rab_setup_request_fail)
|
||||
|
||||
/* S1AP -> RRC messages */
|
||||
MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas )
|
||||
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_initial_context_setup_req_t , s1ap_initial_context_setup_req )
|
||||
MESSAGE_DEF(S1AP_UE_CTXT_MODIFICATION_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_ctxt_modification_req_t , s1ap_ue_ctxt_modification_req)
|
||||
MESSAGE_DEF(S1AP_PAGING_IND , MESSAGE_PRIORITY_MED, s1ap_paging_ind_t , s1ap_paging_ind )
|
||||
MESSAGE_DEF(S1AP_E_RAB_SETUP_REQ , MESSAGE_PRIORITY_MED, s1ap_e_rab_setup_req_t , s1ap_e_rab_setup_req )
|
||||
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND, MESSAGE_PRIORITY_MED, s1ap_ue_release_command_t , s1ap_ue_release_command)
|
||||
|
||||
/* S1AP <-> RRC messages (can be initiated either by MME or eNB) */
|
||||
|
||||
@@ -47,12 +47,15 @@
|
||||
#define S1AP_NAS_NON_DELIVERY_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_nas_non_delivery_ind
|
||||
#define S1AP_UE_CTXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_resp
|
||||
#define S1AP_UE_CTXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_fail
|
||||
#define S1AP_E_RAB_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_resp
|
||||
#define S1AP_E_RAB_SETUP_FAIL(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req_fail
|
||||
|
||||
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas
|
||||
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
|
||||
#define S1AP_UE_CTXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_ctxt_modification_req
|
||||
#define S1AP_UE_CONTEXT_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_command
|
||||
#define S1AP_UE_CONTEXT_RELEASE_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_complete
|
||||
#define S1AP_E_RAB_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_setup_req
|
||||
#define S1AP_PAGIND_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_paging_ind
|
||||
|
||||
#define S1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_release_req
|
||||
@@ -390,7 +393,7 @@ typedef struct s1ap_initial_context_setup_fail_s {
|
||||
unsigned eNB_ue_s1ap_id:24;
|
||||
|
||||
/* TODO add cause */
|
||||
} s1ap_initial_context_setup_fail_t, s1ap_ue_ctxt_modification_fail_t;
|
||||
} s1ap_initial_context_setup_fail_t, s1ap_ue_ctxt_modification_fail_t, s1ap_e_rab_setup_req_fail_t;
|
||||
|
||||
typedef struct s1ap_nas_non_delivery_ind_s {
|
||||
unsigned eNB_ue_s1ap_id:24;
|
||||
@@ -439,6 +442,7 @@ typedef struct s1ap_downlink_nas_s {
|
||||
nas_pdu_t nas_pdu;
|
||||
} s1ap_downlink_nas_t;
|
||||
|
||||
|
||||
typedef struct s1ap_initial_context_setup_req_s {
|
||||
/* UE id for initial connection to S1AP */
|
||||
uint16_t ue_initial_id;
|
||||
@@ -479,6 +483,39 @@ typedef struct s1ap_paging_ind_s {
|
||||
paging_priority_t paging_priority;
|
||||
} s1ap_paging_ind_t;
|
||||
|
||||
typedef struct s1ap_e_rab_setup_req_s {
|
||||
/* UE id for initial connection to S1AP */
|
||||
uint16_t ue_initial_id;
|
||||
|
||||
/* MME UE id */
|
||||
uint16_t mme_ue_s1ap_id;
|
||||
|
||||
/* eNB ue s1ap id as initialized by S1AP layer */
|
||||
unsigned eNB_ue_s1ap_id:24;
|
||||
|
||||
/* Number of e_rab to be setup in the list */
|
||||
uint8_t nb_e_rabs_tosetup;
|
||||
|
||||
/* E RAB setup request */
|
||||
e_rab_t e_rab_setup_params[S1AP_MAX_E_RAB];
|
||||
|
||||
} s1ap_e_rab_setup_req_t;
|
||||
|
||||
typedef struct s1ap_e_rab_setup_resp_s {
|
||||
unsigned eNB_ue_s1ap_id:24;
|
||||
|
||||
/* Number of e_rab setup-ed in the list */
|
||||
uint8_t nb_of_e_rabs;
|
||||
/* list of e_rab setup-ed by RRC layers */
|
||||
e_rab_setup_t e_rabs[S1AP_MAX_E_RAB];
|
||||
|
||||
/* Number of e_rab failed to be setup in list */
|
||||
uint8_t nb_of_e_rabs_failed;
|
||||
/* list of e_rabs that failed to be setup */
|
||||
e_rab_failed_t e_rabs_failed[S1AP_MAX_E_RAB];
|
||||
} s1ap_e_rab_setup_resp_t;
|
||||
|
||||
|
||||
// S1AP --> RRC messages
|
||||
typedef struct s1ap_ue_release_command_s {
|
||||
|
||||
|
||||
@@ -187,6 +187,9 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro
|
||||
RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_n310[CC_id];
|
||||
RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_t311[CC_id];
|
||||
RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[CC_id] = enb_properties->properties[enb_id]->ue_TimersAndConstants_n311[CC_id];
|
||||
|
||||
RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[CC_id] = enb_properties->properties[enb_id]->ue_TransmissionMode[CC_id];
|
||||
|
||||
}
|
||||
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
@@ -255,6 +258,8 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end, con
|
||||
str = inet_ntoa(addr);
|
||||
strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
|
||||
|
||||
LOG_I(ENB_APP,"[eNB %d] eNB_app_register for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
|
||||
register_enb_pending++;
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
#define ENB_CONFIG_STRING_NID_CELL "Nid_cell"
|
||||
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
|
||||
#define ENB_CONFIG_STRING_CELL_MBSFN "Nid_cell_mbsfn"
|
||||
#define ENB_CONFIG_STRING_NB_ANT_PORTS "nb_antenna_ports"
|
||||
#define ENB_CONFIG_STRING_NB_ANT_TX "nb_antennas_tx"
|
||||
#define ENB_CONFIG_STRING_NB_ANT_RX "nb_antennas_rx"
|
||||
#define ENB_CONFIG_STRING_TX_GAIN "tx_gain"
|
||||
@@ -150,6 +151,7 @@
|
||||
#define ENB_CONFIG_STRING_UETIMERS_T311 "ue_TimersAndConstants_t311"
|
||||
#define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310"
|
||||
#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311"
|
||||
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
|
||||
|
||||
#define ENB_CONFIG_STRING_SRB1 "srb1_parameters"
|
||||
#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit"
|
||||
@@ -332,6 +334,7 @@ void enb_config_display(void)
|
||||
|
||||
printf( "\n\tCell ID for CC %d:\t%"PRId16":\n",j,enb_properties.properties[i]->Nid_cell[j]);
|
||||
printf( "\tN_RB_DL for CC %d:\t%"PRId16":\n",j,enb_properties.properties[i]->N_RB_DL[j]);
|
||||
printf( "\tnb_antenna_ports for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antenna_ports[j]);
|
||||
printf( "\tnb_antennas_tx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_tx[j]);
|
||||
printf( "\tnb_antennas_rx for CC %d:\t%d:\n",j,enb_properties.properties[i]->nb_antennas_rx[j]);
|
||||
|
||||
@@ -421,6 +424,8 @@ void enb_config_display(void)
|
||||
printf( "\tue_TimersAndConstants_t311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_t311[j]);
|
||||
printf( "\tue_TimersAndConstants_n311 for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TimersAndConstants_n311[j]);
|
||||
|
||||
printf( "\tue_TransmissionMode for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TransmissionMode[j]);
|
||||
|
||||
}
|
||||
|
||||
for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) {
|
||||
@@ -541,6 +546,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
libconfig_int Nid_cell = 0;
|
||||
libconfig_int Nid_cell_mbsfn = 0;
|
||||
libconfig_int N_RB_DL = 0;
|
||||
libconfig_int nb_antenna_ports = 0;
|
||||
libconfig_int nb_antennas_tx = 0;
|
||||
libconfig_int nb_antennas_rx = 0;
|
||||
libconfig_int tx_gain = 0;
|
||||
@@ -604,7 +610,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
libconfig_int ue_TimersAndConstants_t311 = 0;
|
||||
libconfig_int ue_TimersAndConstants_n310 = 0;
|
||||
libconfig_int ue_TimersAndConstants_n311 = 0;
|
||||
|
||||
libconfig_int ue_TransmissionMode = 0;
|
||||
|
||||
|
||||
libconfig_int srb1_timer_poll_retransmit = 0;
|
||||
@@ -815,6 +821,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NID_CELL, &Nid_cell)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_N_RB_DL, &N_RB_DL)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CELL_MBSFN, &Nid_cell_mbsfn)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_PORTS, &nb_antenna_ports)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_TX, &nb_antennas_tx)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_RX, &nb_antennas_rx)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TX_GAIN, &tx_gain)
|
||||
@@ -870,6 +877,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T311, &ue_TimersAndConstants_t311)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N310, &ue_TimersAndConstants_n310)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N311, &ue_TimersAndConstants_n311)
|
||||
&& config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, &ue_TransmissionMode)
|
||||
|
||||
#ifdef Rel10
|
||||
|
||||
@@ -1022,7 +1030,14 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
|
||||
enb_properties.properties[enb_properties_index]->nb_antennas_tx[j] = nb_antennas_tx;
|
||||
|
||||
if ((nb_antennas_tx <1) || (nb_antennas_tx > 4))
|
||||
if ((nb_antenna_ports <1) || (nb_antenna_ports > 2))
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n",
|
||||
lib_config_file_name_pP, i, nb_antenna_ports);
|
||||
|
||||
enb_properties.properties[enb_properties_index]->nb_antenna_ports[j] = nb_antenna_ports;
|
||||
|
||||
if ((nb_antennas_tx <1) || (nb_antennas_tx > 64))
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antennas_tx choice: 1..4 !\n",
|
||||
lib_config_file_name_pP, i, nb_antennas_tx);
|
||||
@@ -1886,6 +1901,35 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
switch (ue_TransmissionMode) {
|
||||
case 1:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm1;
|
||||
break;
|
||||
case 2:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm2;
|
||||
break;
|
||||
case 3:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm3;
|
||||
break;
|
||||
case 4:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm4;
|
||||
break;
|
||||
case 5:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm5;
|
||||
break;
|
||||
case 6:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm6;
|
||||
break;
|
||||
case 7:
|
||||
enb_properties.properties[enb_properties_index]->ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm7;
|
||||
break;
|
||||
default:
|
||||
AssertError (0, parse_errors ++,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TransmissionMode choice: 1,2,3,4,5,6,7",
|
||||
lib_config_file_name_pP, i, ue_TransmissionMode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,9 +143,10 @@ typedef struct Enb_properties_s {
|
||||
|
||||
int16_t Nid_cell[1+MAX_NUM_CCs];// for testing, change later
|
||||
int16_t N_RB_DL[1+MAX_NUM_CCs];// for testing, change later
|
||||
int nb_antennas_tx[1+MAX_NUM_CCs];
|
||||
int nb_antenna_ports[1+MAX_NUM_CCs];
|
||||
int nb_antennas_tx[1+MAX_NUM_CCs];
|
||||
int nb_antennas_rx[1+MAX_NUM_CCs];
|
||||
int tx_gain[1+MAX_NUM_CCs];
|
||||
int tx_gain[1+MAX_NUM_CCs];
|
||||
int rx_gain[1+MAX_NUM_CCs];
|
||||
long prach_root[1+MAX_NUM_CCs];
|
||||
long prach_config_index[1+MAX_NUM_CCs];
|
||||
@@ -205,6 +206,7 @@ typedef struct Enb_properties_s {
|
||||
long ue_TimersAndConstants_t311[1+MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n310[1+MAX_NUM_CCs];
|
||||
long ue_TimersAndConstants_n311[1+MAX_NUM_CCs];
|
||||
long ue_TransmissionMode[1+MAX_NUM_CCs];
|
||||
|
||||
long srb1_timer_poll_retransmit;
|
||||
long srb1_timer_reordering;
|
||||
|
||||
@@ -907,7 +907,7 @@ typedef struct {
|
||||
/// CCE table used to build DCI scheduling information
|
||||
int CCE_table[MAX_NUM_CCs][800];
|
||||
/// active flag for Other lcid
|
||||
// uint8_t lcid_active[NB_RB_MAX];
|
||||
uint8_t lcid_active[NB_RB_MAX];
|
||||
/// eNB stats
|
||||
eNB_STATS eNB_stats[MAX_NUM_CCs];
|
||||
// MAC function execution peformance profiler
|
||||
|
||||
@@ -434,10 +434,12 @@ schedule_ue_spec(
|
||||
int N_RBG[MAX_NUM_CCs];
|
||||
unsigned char aggregation;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
unsigned char header_len_dcch=0, header_len_dcch_tmp=0,header_len_dtch=0,header_len_dtch_tmp=0, ta_len=0;
|
||||
unsigned char sdu_lcids[11],offset,num_sdus=0;
|
||||
unsigned char header_len_dcch=0, header_len_dcch_tmp=0, header_len_dcch_last=0;
|
||||
unsigned char header_len_dtch=0, header_len_dtch_tmp=0, header_len_dtch_last=0;
|
||||
unsigned char ta_len=0;
|
||||
unsigned char sdu_lcids[NB_RB_MAX],lcid,offset,num_sdus=0;
|
||||
uint16_t nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
|
||||
uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0;
|
||||
uint16_t TBS,j,sdu_lengths[NB_RB_MAX],rnti,padding=0,post_padding=0;
|
||||
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
|
||||
unsigned char round = 0;
|
||||
unsigned char harq_pid = 0;
|
||||
@@ -875,7 +877,7 @@ schedule_ue_spec(
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH+1,
|
||||
(char *)&dlsch_buffer[sdu_lengths[0]]);
|
||||
(char *)&dlsch_buffer[sdu_lengths[num_sdus]]);
|
||||
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
T_INT(harq_pid), T_INT(DCCH+1), T_INT(sdu_lengths[num_sdus]));
|
||||
@@ -885,80 +887,96 @@ schedule_ue_spec(
|
||||
header_len_dcch += 2;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DCCH1]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1]+=sdu_lengths[num_sdus];
|
||||
num_sdus++;
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Got %d bytes for DCCH from RLC\n",module_idP,CC_id,sdu_lengths[0]);
|
||||
}
|
||||
}
|
||||
num_sdus++;
|
||||
#ifdef DEBUG_eNB_SCHEDULER
|
||||
LOG_T(MAC,"[eNB %d][DCCH1] CC_id %d Got %d bytes :",module_idP,CC_id,sdu_lengths[num_sdus]);
|
||||
|
||||
// check for DTCH and update header information
|
||||
// here we should loop over all possible DTCH
|
||||
|
||||
header_len_dtch = 3; // 3 bytes DTCH SDU subheader
|
||||
|
||||
LOG_D(MAC,"[eNB %d], Frame %d, DTCH->DLSCH, CC_id %d, Checking RLC status (rab %d, tbs %d, len %d)\n",
|
||||
module_idP,frameP,CC_id,DTCH,TBS,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) {
|
||||
rlc_status = mac_rlc_status_ind(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DTCH,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB], Frame %d, DTCH->DLSCH, CC_id %d, Requesting %d bytes from RLC (hdr len dtch %d)\n",
|
||||
module_idP,frameP,CC_id,TBS-header_len_dcch-sdu_length_total-header_len_dtch,header_len_dtch);
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(
|
||||
module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DTCH,
|
||||
(char*)&dlsch_buffer[sdu_length_total]);
|
||||
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
T_INT(harq_pid), T_INT(DTCH), T_INT(sdu_lengths[num_sdus]));
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] CC_id %d Got %d bytes for DTCH %d \n",
|
||||
module_idP,CC_id,sdu_lengths[num_sdus],DTCH);
|
||||
sdu_lcids[num_sdus] = DTCH;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DTCH]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DTCH]+=sdu_lengths[num_sdus];
|
||||
|
||||
if (sdu_lengths[num_sdus] < 128) {
|
||||
header_len_dtch=2;
|
||||
for (j=0; j<sdu_lengths[num_sdus]; j++) {
|
||||
LOG_T(MAC,"%x ",dlsch_buffer[j]);
|
||||
}
|
||||
|
||||
num_sdus++;
|
||||
} else {
|
||||
header_len_dtch = 0;
|
||||
}
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// there is a payload
|
||||
if (((sdu_length_total + header_len_dcch + header_len_dtch )> 0)) {
|
||||
// assume the max dtch header size, and adjust it later
|
||||
header_len_dtch=0;
|
||||
header_len_dtch_last=0; // the header length of the last mac sdu
|
||||
// lcid has to be sorted before the actual allocation (similar struct as ue_list).
|
||||
for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
|
||||
// TBD: check if the lcid is active
|
||||
|
||||
header_len_dtch+=3;
|
||||
header_len_dtch_last=3;
|
||||
LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
|
||||
module_idP,frameP,lcid,TBS,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) { // NN: > 2 ?
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
|
||||
|
||||
|
||||
// Now compute number of required RBs for total sdu length
|
||||
// Assume RAH format 2
|
||||
// adjust header lengths
|
||||
header_len_dcch_tmp = header_len_dcch;
|
||||
header_len_dtch_tmp = header_len_dtch;
|
||||
|
||||
if (header_len_dtch==0) {
|
||||
header_len_dcch = (header_len_dcch >0) ? 1 : header_len_dcch; // remove length field
|
||||
} else {
|
||||
header_len_dtch = (header_len_dtch > 0) ? 1 :header_len_dtch; // remove length field for the last SDU
|
||||
}
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
|
||||
module_idP,frameP,TBS-header_len_dcch-sdu_length_total-header_len_dtch,lcid, header_len_dtch);
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
(char*)&dlsch_buffer[sdu_length_total]);
|
||||
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
|
||||
T_INT(harq_pid), T_INT(lcid), T_INT(sdu_lengths[num_sdus]));
|
||||
|
||||
LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",module_idP,sdu_lengths[num_sdus],lcid);
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]+=1;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid]+=sdu_lengths[num_sdus];
|
||||
if (sdu_lengths[num_sdus] < 128) {
|
||||
header_len_dtch--;
|
||||
header_len_dtch_last--;
|
||||
}
|
||||
num_sdus++;
|
||||
} // no data for this LCID
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
}
|
||||
} // no TBS left
|
||||
else {
|
||||
header_len_dtch-=3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (header_len_dtch == 0 )
|
||||
header_len_dtch_last= 0;
|
||||
// there is at least one SDU
|
||||
// if (num_sdus > 0 ){
|
||||
if ((sdu_length_total + header_len_dcch + header_len_dtch )> 0) {
|
||||
|
||||
// Now compute number of required RBs for total sdu length
|
||||
// Assume RAH format 2
|
||||
// adjust header lengths
|
||||
header_len_dcch_tmp = header_len_dcch;
|
||||
header_len_dtch_tmp = header_len_dtch;
|
||||
if (header_len_dtch==0) {
|
||||
header_len_dcch = (header_len_dcch >0) ? 1 : 0;//header_len_dcch; // remove length field
|
||||
} else {
|
||||
header_len_dtch_last-=1; // now use it to find how many bytes has to be removed for the last MAC SDU
|
||||
header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last :header_len_dtch; // remove length field for the last SDU
|
||||
}
|
||||
|
||||
mcs = eNB_UE_stats->dlsch_mcs1;
|
||||
|
||||
@@ -1072,8 +1090,7 @@ schedule_ue_spec(
|
||||
"[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n",
|
||||
module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,
|
||||
ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
|
||||
}
|
||||
|
||||
}
|
||||
//#endif
|
||||
#ifdef DEBUG_eNB_SCHEDULER
|
||||
LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n");
|
||||
|
||||
@@ -71,16 +71,15 @@
|
||||
// This table holds the allowable PRB sizes for ULSCH transmissions
|
||||
uint8_t rb_table[33] = {1,2,3,4,5,6,8,9,10,12,15,16,18,20,24,25,27,30,32,36,40,45,48,50,54,60,72,75,80,81,90,96,100};
|
||||
|
||||
void rx_sdu(
|
||||
const module_id_t enb_mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t *sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
const int harq_pidP,
|
||||
uint8_t *msg3_flagP)
|
||||
void rx_sdu(const module_id_t enb_mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t *sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
const int harq_pidP,
|
||||
uint8_t *msg3_flagP)
|
||||
{
|
||||
|
||||
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr;
|
||||
@@ -325,7 +324,6 @@ void rx_sdu(
|
||||
enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH: %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
|
||||
enb_mod_idP,CC_idP,frameP,
|
||||
payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP);
|
||||
@@ -382,21 +380,19 @@ void rx_sdu(
|
||||
|
||||
} // if process is active
|
||||
} // loop on RA processes
|
||||
|
||||
break ;
|
||||
|
||||
break;
|
||||
|
||||
case DCCH :
|
||||
case DCCH :
|
||||
case DCCH1 :
|
||||
// if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){
|
||||
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP));
|
||||
|
||||
for (j=0; j<32; j++) {
|
||||
LOG_T(MAC,"%x ",payload_ptr[j]);
|
||||
}
|
||||
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
|
||||
@@ -425,67 +421,69 @@ void rx_sdu(
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
} /* UE_id != -1 */
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
break;
|
||||
|
||||
case DTCH: // default DRB
|
||||
// if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){
|
||||
// all the DRBS
|
||||
case DTCH:
|
||||
default :
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP));
|
||||
|
||||
for (j=0; j<32; j++) {
|
||||
LOG_T(MAC,"%x ",payload_ptr[j]);
|
||||
}
|
||||
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
if (rx_lcids[i] < NB_RB_MAX ) {
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
|
||||
if (UE_id != -1) {
|
||||
// adjust buffer occupancy of the correponding logical channel group
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
|
||||
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
|
||||
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
}
|
||||
else { /* rx_length[i] */
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx+=1;
|
||||
LOG_E(MAC,"[eNB %d] CC_id %d Frame %d : Max size of transport block reached LCID %d from UE %d ",
|
||||
enb_mod_idP, CC_idP, frameP, rx_lcids[i], UE_id);
|
||||
}
|
||||
}
|
||||
else {/*(UE_id != -1*/
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx+=1;
|
||||
LOG_E(MAC,"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ",
|
||||
enb_mod_idP, CC_idP, frameP, rx_lcids[i], UE_id);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]);
|
||||
|
||||
if (UE_id != -1) {
|
||||
// adjust buffer occupancy of the correponding logical channel group
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n",
|
||||
enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],
|
||||
UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
|
||||
|
||||
if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
|
||||
else
|
||||
UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
|
||||
|
||||
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
|
||||
mac_rlc_data_ind(
|
||||
enb_mod_idP,
|
||||
rntiP,
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DTCH,
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
}
|
||||
} /* UE_id != -1 */
|
||||
|
||||
// }
|
||||
break;
|
||||
|
||||
default : //if (rx_lcids[i] >= DTCH) {
|
||||
if (UE_id != -1)
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_errors_rx+=1;
|
||||
LOG_E(MAC,"[eNB %d] CC_id %d Frame %d : received unsupported or unknown LCID %d from UE %d ",
|
||||
enb_mod_idP, CC_idP, frameP, rx_lcids[i], UE_id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
payload_ptr+=rx_lengths[i];
|
||||
}
|
||||
|
||||
|
||||
@@ -302,16 +302,12 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
ue_send_sdu(
|
||||
module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t* sdu,
|
||||
uint16_t sdu_len,
|
||||
uint8_t eNB_index
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
ue_send_sdu(module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t* sdu,
|
||||
uint16_t sdu_len,
|
||||
uint8_t eNB_index) {
|
||||
|
||||
unsigned char rx_ces[MAX_NUM_CE],num_ce,num_sdu,i,*payload_ptr;
|
||||
unsigned char rx_lcids[NB_RB_MAX];
|
||||
@@ -401,7 +397,7 @@ ue_send_sdu(
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC,"[UE] SDU %d : LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]);
|
||||
#endif
|
||||
|
||||
|
||||
if (rx_lcids[i] == CCCH) {
|
||||
|
||||
LOG_D(MAC,"[UE %d] rnti %x Frame %d : DLSCH -> DL-CCCH, RRC message (eNB %d, %d bytes)\n",
|
||||
@@ -431,7 +427,7 @@ ue_send_sdu(
|
||||
eNB_index,
|
||||
0);
|
||||
|
||||
} else if (rx_lcids[i] == DCCH) {
|
||||
} else if ((rx_lcids[i] == DCCH) || (rx_lcids[i] == DCCH1)) {
|
||||
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DCCH%d, RRC message (eNB %d, %d bytes)\n", module_idP, frameP, rx_lcids[i],eNB_index,rx_lengths[i]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
@@ -439,53 +435,39 @@ ue_send_sdu(
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);
|
||||
} else if (rx_lcids[i] == DCCH1) {
|
||||
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DCCH%d, RRC message (eNB %d, %d bytes)\n", module_idP, frameP, rx_lcids[i], eNB_index,rx_lengths[i]);
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH1,
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);
|
||||
} else if (rx_lcids[i] == DTCH) {
|
||||
|
||||
} else if ((rx_lcids[i] < NB_RB_MAX) && (rx_lcids[i] > DCCH1 )) {
|
||||
|
||||
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n", module_idP, frameP,rx_lcids[i], eNB_index,rx_lengths[i]);
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
int j;
|
||||
|
||||
for (j=0; j<rx_lengths[i]; j++) {
|
||||
LOG_T(MAC,"%x.",(unsigned char)payload_ptr[j]);
|
||||
}
|
||||
|
||||
for (j=0;j<rx_lengths[i];j++)
|
||||
LOG_T(MAC,"%x.",(unsigned char)payload_ptr[j]);
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
DTCH,
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *)payload_ptr,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);
|
||||
} else {
|
||||
LOG_E(MAC,"[UE %d] Frame %d : unknown LCID %d (eNB %d)\n", module_idP, frameP,rx_lcids[i], eNB_index);
|
||||
}
|
||||
|
||||
payload_ptr+= rx_lengths[i];
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT);
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
}
|
||||
@@ -1231,10 +1213,11 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
{
|
||||
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
uint8_t dcch_header_len=0,dcch1_header_len=0,dtch_header_len=0;
|
||||
uint8_t dcch_header_len=0,dcch1_header_len=0,dtch_header_len=0,dtch_header_len_last=0;
|
||||
uint8_t dcch_header_len_tmp=0, dtch_header_len_tmp=0;
|
||||
uint8_t bsr_header_len=0, bsr_ce_len=0, bsr_len=0;
|
||||
uint8_t phr_header_len=0, phr_ce_len=0,phr_len=0;
|
||||
uint8_t lcid=0;
|
||||
uint16_t sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
uint8_t sdu_lcids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
uint8_t payload_offset=0,num_sdus=0;
|
||||
@@ -1312,18 +1295,27 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
// check for UL bandwidth requests and add SR control element
|
||||
|
||||
// Check for DCCH first
|
||||
sdu_lengths[0]=0;
|
||||
|
||||
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH] == LCID_NOT_EMPTY) {
|
||||
|
||||
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index, frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO, // eNB_index
|
||||
DCCH,
|
||||
(buflen-dcch_header_len-bsr_len-phr_len));
|
||||
LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to "
|
||||
"send (Transport Block size %d, mac header len %d)\n",
|
||||
module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dcch_header_len);
|
||||
|
||||
sdu_lengths[0] += mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
|
||||
sdu_lengths[0] += mac_rlc_data_req(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH,
|
||||
(char *)&ulsch_buff[sdu_lengths[0]]);
|
||||
|
||||
@@ -1341,11 +1333,15 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
// if the RLC AM is used, then RLC will only provide 2 bytes for ACK
|
||||
// in this case, we sould add bsr
|
||||
|
||||
|
||||
// DCCH1
|
||||
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) {
|
||||
|
||||
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO, // eNB_index
|
||||
DCCH1,
|
||||
(buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-sdu_length_total));
|
||||
|
||||
@@ -1353,9 +1349,14 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
" send (Transport Block size %d, mac header len %d)\n",
|
||||
module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dcch1_header_len);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
DCCH1,
|
||||
(char *)&ulsch_buff[sdu_lengths[0]]);
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
DCCH1,
|
||||
(char *)&ulsch_buff[sdu_lengths[num_sdus]]);
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
sdu_lcids[num_sdus] = DCCH1;
|
||||
LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH1\n",module_idP,sdu_lengths[num_sdus]);
|
||||
@@ -1366,8 +1367,14 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
dcch1_header_len =0;
|
||||
}
|
||||
|
||||
if ((UE_mac_inst[module_idP].scheduling_info.LCID_status[DTCH] == LCID_NOT_EMPTY) &&
|
||||
((bsr_len+phr_len+dcch_header_len+dcch1_header_len+dtch_header_len+sdu_length_total) <= buflen)) {
|
||||
dtch_header_len=0;
|
||||
dtch_header_len_last=0;
|
||||
for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
|
||||
dtch_header_len+=3;
|
||||
dtch_header_len_last=3;
|
||||
|
||||
if ((UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) &&
|
||||
((bsr_len+phr_len+dcch_header_len+dcch1_header_len+dtch_header_len+sdu_length_total) <= buflen)) {
|
||||
|
||||
// optimize the dtch header lenght
|
||||
//if ((UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH] > 128) &&
|
||||
@@ -1378,29 +1385,47 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
else
|
||||
dtch_header_len = 2;//sizeof(SCH_SUBHEADER_SHORT);
|
||||
*/
|
||||
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total);
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO, // eNB_index
|
||||
lcid,
|
||||
buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total);
|
||||
|
||||
LOG_D(MAC,"[UE %d] Frame %d : UL-DTCH -> ULSCH, %d bytes to send (Transport Block size %d, mac header len %d, BSR byte[DTCH] %d)\n",
|
||||
module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dtch_header_len,
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH]);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,UE_mac_inst[module_idP].crnti,eNB_index,frameP, ENB_FLAG_NO, MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
(char *)&ulsch_buff[sdu_length_total]);
|
||||
|
||||
//adjust dtch header
|
||||
dtch_header_len = (sdu_lengths[num_sdus] >= 128) ? 3 : 2;
|
||||
LOG_D(MAC,"[UE %d] TX Got %d bytes for DTCH\n",module_idP,sdu_lengths[num_sdus]);
|
||||
sdu_lcids[num_sdus] = DTCH;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
num_sdus++;
|
||||
UE_mac_inst[module_idP].ul_active = update_bsr(module_idP, frameP, eNB_index,DTCH, UE_mac_inst[module_idP].scheduling_info.LCGID[DTCH]);
|
||||
} else { // no rlc pdu : generate the dummy header
|
||||
dtch_header_len = 0;
|
||||
LOG_D(MAC,"[UE %d] Frame %d : UL-DTCH -> ULSCH%d, %d bytes to send (Transport Block size %d, mac header len %d, BSR byte[%d] %d)\n",
|
||||
module_idP,frameP, lcid, rlc_status.bytes_in_buffer,buflen,dtch_header_len,
|
||||
lcid, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcid]);
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO, // eNB_index
|
||||
lcid,
|
||||
(char *)&ulsch_buff[sdu_length_total]);
|
||||
|
||||
//adjust dtch header
|
||||
LOG_D(MAC,"[UE %d] TX Got %d bytes for DTCH\n",module_idP,sdu_lengths[num_sdus]);
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
if (sdu_lengths[num_sdus] < 128) {
|
||||
dtch_header_len --;
|
||||
dtch_header_len_last --;
|
||||
}
|
||||
num_sdus++;
|
||||
UE_mac_inst[module_idP].ul_active = update_bsr(module_idP, frameP, eNB_index,lcid, UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]);
|
||||
} else {
|
||||
dtch_header_len -= 3;
|
||||
}
|
||||
} else { // no rlc pdu : generate the dummy header
|
||||
dtch_header_len -= 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lcgid= get_bsr_lcgid(module_idP);
|
||||
|
||||
if (lcgid < 0 ) {
|
||||
@@ -1441,6 +1466,9 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
|
||||
LOG_T(MAC,"[UE %d] Frame %d: bsr s %p bsr_l %p, phr_p %p\n", module_idP,frameP,bsr_s, bsr_l, phr_p);
|
||||
|
||||
if (dtch_header_len == 0 )
|
||||
dtch_header_len_last =0;
|
||||
|
||||
// adjust the header length
|
||||
dcch_header_len_tmp = dcch_header_len;
|
||||
dtch_header_len_tmp = dtch_header_len;
|
||||
@@ -1448,7 +1476,8 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
if (dtch_header_len==0) {
|
||||
dcch_header_len = (dcch_header_len>0)? 1: dcch_header_len;
|
||||
} else {
|
||||
dtch_header_len= (dtch_header_len >0)? 1: dtch_header_len; // for short and long, cut the length+F fields
|
||||
dtch_header_len_last-=1;
|
||||
dtch_header_len= (dtch_header_len >0)? dtch_header_len - dtch_header_len_last : dtch_header_len;
|
||||
}
|
||||
|
||||
if ((buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total) <= 2) {
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
|
||||
/*! \file pdcp.c
|
||||
* \brief pdcp interface with RLC
|
||||
* \author Lionel GAUTHIER and Navid Nikaein
|
||||
* \author Navid Nikaein and Lionel GAUTHIER
|
||||
* \date 2009-2012
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \version 1.0
|
||||
*/
|
||||
|
||||
@@ -83,7 +84,7 @@ extern int otg_enabled;
|
||||
* code at targets/TEST/PDCP/test_pdcp.c:test_pdcp_data_req()
|
||||
*/
|
||||
boolean_t pdcp_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t* ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
@@ -105,7 +106,6 @@ boolean_t pdcp_data_req(
|
||||
rlc_op_status_t rlc_status;
|
||||
boolean_t ret = TRUE;
|
||||
|
||||
|
||||
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
|
||||
hashtable_rc_t h_rc;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_IN);
|
||||
@@ -116,28 +116,6 @@ boolean_t pdcp_data_req(
|
||||
T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
|
||||
#endif
|
||||
|
||||
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
|
||||
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
} else {
|
||||
if (srb_flagP) {
|
||||
AssertError (rb_idP < 2, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, 2, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
} else {
|
||||
AssertError (rb_idP < maxDRB, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, maxDRB, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
}
|
||||
}
|
||||
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
|
||||
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
if (modeP != PDCP_TRANSMISSION_MODE_TRANSPARENT) {
|
||||
LOG_W(PDCP, PROTOCOL_CTXT_FMT" Instance is not configured for rb_id %d Ignoring SDU...\n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
rb_idP);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (sdu_buffer_sizeP == 0) {
|
||||
LOG_W(PDCP, "Handed SDU is of size 0! Ignoring...\n");
|
||||
return FALSE;
|
||||
@@ -153,14 +131,39 @@ boolean_t pdcp_data_req(
|
||||
// XXX What does following call do?
|
||||
mac_xface->macphy_exit("PDCP sdu buffer size > MAX_IP_PACKET_SIZE");
|
||||
}
|
||||
|
||||
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
|
||||
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
} else {
|
||||
if (srb_flagP) {
|
||||
AssertError (rb_idP < 3, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, 3, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
} else {
|
||||
AssertError (rb_idP < maxDRB, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, maxDRB, ctxt_pP->module_id, ctxt_pP->rnti);
|
||||
}
|
||||
}
|
||||
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
|
||||
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
if (modeP != PDCP_TRANSMISSION_MODE_TRANSPARENT) {
|
||||
LOG_W(PDCP, PROTOCOL_CTXT_FMT" Instance is not configured for rb_id %d Ignoring SDU...\n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
rb_idP);
|
||||
ctxt_pP->configured=FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
}else{
|
||||
// instance for a given RB is configured
|
||||
ctxt_pP->configured=TRUE;
|
||||
}
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].data_req);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].data_req);
|
||||
}
|
||||
|
||||
|
||||
// PDCP transparent mode for MBMS traffic
|
||||
|
||||
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
|
||||
@@ -916,7 +919,7 @@ pdcp_run (
|
||||
RRC_DCCH_DATA_REQ (msg_p).frame,
|
||||
0,
|
||||
RRC_DCCH_DATA_REQ (msg_p).eNB_index);
|
||||
LOG_D(PDCP, PROTOCOL_CTXT_FMT"Received %s from %s: instance %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
|
||||
LOG_I(PDCP, PROTOCOL_CTXT_FMT"Received %s from %s: instance %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
|
||||
PROTOCOL_CTXT_ARGS(&ctxt),
|
||||
msg_name,
|
||||
ITTI_MSG_ORIGIN_NAME(msg_p),
|
||||
@@ -1103,7 +1106,7 @@ rrc_pdcp_config_asn1_req (
|
||||
srb_id = srb2add_list_pP->list.array[cnt]->srb_Identity;
|
||||
srb_toaddmod_p = srb2add_list_pP->list.array[cnt];
|
||||
rlc_type = RLC_MODE_AM;
|
||||
lc_id = srb_id + 2;
|
||||
lc_id = srb_id;// + 2;
|
||||
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, srb_id, SRB_FLAG_YES);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
|
||||
|
||||
@@ -1439,13 +1442,14 @@ pdcp_config_req_asn1 (
|
||||
pdcp_pP->first_missing_pdu = -1;
|
||||
pdcp_pP->rx_hfn_offset = 0;
|
||||
|
||||
LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" Action ADD LCID %d (rb id %d) "
|
||||
LOG_N(PDCP, PROTOCOL_PDCP_CTXT_FMT" Action ADD LCID %d (%s id %d) "
|
||||
"configured with SN size %d bits and RLC %s\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
|
||||
lc_idP,
|
||||
(srb_flagP == SRB_FLAG_YES) ? "SRB" : "DRB",
|
||||
rb_idP,
|
||||
pdcp_pP->seq_num_size,
|
||||
(rlc_modeP == RLC_MODE_AM ) ? "AM" : (rlc_modeP == RLC_MODE_TM) ? "TM" : "UM");
|
||||
(rlc_modeP == RLC_MODE_AM ) ? "AM" : (rlc_modeP == RLC_MODE_TM) ? "TM" : "UM");
|
||||
/* Setup security */
|
||||
if (security_modeP != 0xff) {
|
||||
pdcp_config_set_security(
|
||||
@@ -1487,8 +1491,8 @@ pdcp_config_req_asn1 (
|
||||
pdcp_pP->seq_num_size=5;
|
||||
}
|
||||
|
||||
LOG_D(PDCP,PROTOCOL_PDCP_CTXT_FMT" Action MODIFY LCID %d "
|
||||
"RB id %d configured with SN size %d and RLC %s \n",
|
||||
LOG_N(PDCP,PROTOCOL_PDCP_CTXT_FMT" Action MODIFY LCID %d "
|
||||
"RB id %d reconfigured with SN size %d and RLC %s \n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
|
||||
lc_idP,
|
||||
rb_idP,
|
||||
|
||||
@@ -221,7 +221,7 @@ typedef struct pdcp_mbms_s {
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
public_pdcp(boolean_t pdcp_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t* ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
|
||||
@@ -29,9 +29,10 @@
|
||||
|
||||
/*! \file pdcp_fifo.c
|
||||
* \brief pdcp interface with linux IP interface, have a look at http://man7.org/linux/man-pages/man7/netlink.7.html for netlink
|
||||
* \author Lionel GAUTHIER and Navid Nikaein
|
||||
* \date 2009
|
||||
* \author Navid Nikaein and Lionel GAUTHIER
|
||||
* \date 2009 - 2016
|
||||
* \version 0.5
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \warning This component can be runned only in user-space
|
||||
* @ingroup pdcp
|
||||
*/
|
||||
@@ -484,7 +485,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
ctxt.enb_flag = ENB_FLAG_NO;
|
||||
ctxt.module_id = pdcp_read_header_g.inst - oai_emulation.info.nb_enb_local + oai_emulation.info.first_ue_local;
|
||||
ctxt.rnti = pdcp_UE_UE_module_id_to_rnti[ctxt.module_id];
|
||||
rab_id = pdcp_read_header_g.rb_id % maxDRB;
|
||||
rab_id = pdcp_read_header_g.rb_id % maxDRB;
|
||||
}
|
||||
|
||||
CHECK_CTXT_ARGS(&ctxt);
|
||||
|
||||
@@ -234,7 +234,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
|
||||
drb_id = drb_toaddmod_p->drb_Identity;
|
||||
lc_id = drb_id + 2;
|
||||
|
||||
LOG_D(RLC, "Adding DRB %d, lc_id %d\n",drb_id,lc_id);
|
||||
LOG_I(RLC, "Adding DRB %d, lc_id %d\n",drb_id,lc_id);
|
||||
|
||||
|
||||
if (drb_toaddmod_p->rlc_Config) {
|
||||
|
||||
@@ -601,14 +601,14 @@ rrc_data_ind(
|
||||
rb_id_t DCCH_index = Srb_id;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
LOG_N(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB ???\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id-1,sdu_sizeP);
|
||||
LOG_N(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index);
|
||||
} else {
|
||||
LOG_N(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %x\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
DCCH_index,
|
||||
Srb_id-1,
|
||||
Srb_id,
|
||||
sdu_sizeP,
|
||||
ctxt_pP->rnti);
|
||||
}
|
||||
@@ -660,7 +660,7 @@ void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
|
||||
//LOG_I(RRC,"sending a message to task_mac_ue\n");
|
||||
message_p = itti_alloc_new_message (TASK_MAC_UE, RRC_MAC_IN_SYNC_IND);
|
||||
RRC_MAC_IN_SYNC_IND (message_p).frame = frameP;
|
||||
RRC_MAC_IN_SYNC_IND (message_p).enb_index = eNB_index;
|
||||
|
||||
@@ -1566,9 +1566,11 @@ do_RRCConnectionSetup(
|
||||
*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportModeAperiodic=CQI_ReportConfig__cqi_ReportModeAperiodic_rm30; // HLC CQI, no PMI
|
||||
#endif
|
||||
physicalConfigDedicated2->cqi_ReportConfig->nomPDSCH_RS_EPRE_Offset = 0; // 0 dB
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=NULL;
|
||||
/*
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
|
||||
//physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=NULL;
|
||||
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic=CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_release;
|
||||
/*
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = CQI_ReportPeriodic_PR_setup;
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex = 0; // n2_pucch
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex = 0; // Icqi/pmi
|
||||
@@ -1602,6 +1604,8 @@ do_RRCConnectionSetup(
|
||||
// AntennaInfoDedicated__transmissionMode_tm2);
|
||||
|
||||
switch (transmission_mode) {
|
||||
default:
|
||||
LOG_W(RRC,"At RRCConnectionSetup Transmission mode can only take values 1 or 2! Defaulting to 1!\n");
|
||||
case 1:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm1;
|
||||
break;
|
||||
@@ -1609,7 +1613,7 @@ do_RRCConnectionSetup(
|
||||
case 2:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm2;
|
||||
break;
|
||||
|
||||
/*
|
||||
case 3:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm3;
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.codebookSubsetRestriction= CALLOC(1,
|
||||
@@ -1634,6 +1638,11 @@ do_RRCConnectionSetup(
|
||||
case 6:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm6;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
physicalConfigDedicated2->antennaInfo->choice.explicitValue.transmissionMode= AntennaInfoDedicated__transmissionMode_tm7;
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -2015,7 +2024,7 @@ do_RRCConnectionReconfiguration(
|
||||
(void*)&dl_dcch_msg,
|
||||
buffer,
|
||||
RRC_BUF_SIZE);
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
|
||||
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %l)!\n",
|
||||
enc_rval.failed_type->name, enc_rval.encoded);
|
||||
|
||||
#ifdef XER_PRINT
|
||||
|
||||
@@ -187,6 +187,9 @@ typedef enum HO_STATE_e {
|
||||
#define CBA_OFFSET 0xfff4
|
||||
// #define NUM_MAX_CBA_GROUP 4 // in the platform_constants
|
||||
|
||||
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
|
||||
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
|
||||
typedef struct UE_RRC_INFO_s {
|
||||
UE_STATE_t State;
|
||||
uint8_t SIB1systemInfoValueTag;
|
||||
@@ -220,19 +223,20 @@ typedef struct UE_S_TMSI_s {
|
||||
#if defined(ENABLE_ITTI)
|
||||
typedef enum e_rab_satus_e {
|
||||
E_RAB_STATUS_NEW,
|
||||
E_RAB_STATUS_DONE,
|
||||
E_RAB_STATUS_DONE, // from the eNB perspective
|
||||
E_RAB_STATUS_ESTABLISHED, // get the reconfigurationcomplete form UE
|
||||
E_RAB_STATUS_FAILED,
|
||||
} e_rab_status_t;
|
||||
|
||||
typedef struct e_rab_param_s {
|
||||
e_rab_t param;
|
||||
uint8_t status;
|
||||
uint8_t xid; // transaction_id
|
||||
} __attribute__ ((__packed__)) e_rab_param_t;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */
|
||||
typedef struct HANDOVER_INFO_s {
|
||||
uint8_t ho_prepare;
|
||||
@@ -282,7 +286,7 @@ typedef struct SRB_INFO_TABLE_ENTRY_s {
|
||||
SRB_INFO Srb_info;
|
||||
uint8_t Active;
|
||||
uint8_t Status;
|
||||
uint32_t Next_check_frame;
|
||||
uint32_t Next_check_frame;
|
||||
} SRB_INFO_TABLE_ENTRY;
|
||||
|
||||
typedef struct MEAS_REPORT_LIST_s {
|
||||
@@ -302,7 +306,9 @@ typedef struct eNB_RRC_UE_s {
|
||||
SCellToAddMod_r10_t sCell_config[2];
|
||||
#endif
|
||||
SRB_ToAddModList_t* SRB_configList;
|
||||
SRB_ToAddModList_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
DRB_ToAddModList_t* DRB_configList;
|
||||
DRB_ToAddModList_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
uint8_t DRB_active[8];
|
||||
struct PhysicalConfigDedicated* physicalConfigDedicated;
|
||||
struct SPS_Config* sps_Config;
|
||||
@@ -347,10 +353,12 @@ typedef struct eNB_RRC_UE_s {
|
||||
|
||||
security_capabilities_t security_capabilities;
|
||||
|
||||
/* Total number of e_rab already setup in the list */
|
||||
uint8_t setup_e_rabs;
|
||||
/* Number of e_rab to be setup in the list */
|
||||
uint8_t nb_of_e_rabs;
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_param_t e_rab[S1AP_MAX_E_RAB];
|
||||
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
|
||||
|
||||
// LG: For GTPV1 TUNNELS
|
||||
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
|
||||
@@ -409,10 +417,10 @@ typedef struct {
|
||||
#endif
|
||||
SRB_INFO SI;
|
||||
SRB_INFO Srb0;
|
||||
} rcc_eNB_carrier_data_t;
|
||||
} rrc_eNB_carrier_data_t;
|
||||
|
||||
typedef struct eNB_RRC_INST_s {
|
||||
rcc_eNB_carrier_data_t carrier[MAX_NUM_CCs];
|
||||
rrc_eNB_carrier_data_t carrier[MAX_NUM_CCs];
|
||||
uid_allocator_t uid_allocator; // for rrc_ue_head
|
||||
RB_HEAD(rrc_ue_tree_s, rrc_eNB_ue_context_s) rrc_ue_head; // ue_context tree key search by rnti
|
||||
uint8_t HO_flag;
|
||||
@@ -433,6 +441,11 @@ typedef struct eNB_RRC_INST_s {
|
||||
/// localization list for aggregated measurements from PHY
|
||||
struct list loc_list;
|
||||
#endif
|
||||
|
||||
//RRC configuration
|
||||
#if defined(ENABLE_ITTI)
|
||||
RrcConfigurationReq configuration;
|
||||
#endif
|
||||
} eNB_RRC_INST;
|
||||
|
||||
#define MAX_UE_CAPABILITY_SIZE 255
|
||||
|
||||
@@ -228,19 +228,21 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
);
|
||||
|
||||
/**\brief Process the RRCConnectionReconfigurationComplete based on information coming from UE
|
||||
\param ctxt_pP Running context
|
||||
\param ue_context_pP RRC UE context
|
||||
\param rrcConnectionReconfigurationComplete Pointer to RRCConnectionReconfigurationComplete message*/
|
||||
\param rrcConnectionReconfigurationComplete Pointer to RRCConnectionReconfigurationComplete message
|
||||
\param xid the transaction id for the rrcconnectionreconfiguration procedure
|
||||
*/
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
RRCConnectionReconfigurationComplete_r8_IEs_t* rrcConnectionReconfigurationComplete
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const uint8_t xid
|
||||
);
|
||||
|
||||
/**\brief Generate the RRCConnectionRelease
|
||||
@@ -259,6 +261,17 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
/**\brief RRC eNB task.
|
||||
\param void *args_p Pointer on arguments to start the task. */
|
||||
|
||||
+536
-66
@@ -101,7 +101,7 @@
|
||||
|
||||
#include "SIMULATION/TOOLS/defs.h" // for taus
|
||||
|
||||
//#define XER_PRINT
|
||||
#define XER_PRINT
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
extern EMULATION_VARS *Emul_vars;
|
||||
@@ -114,9 +114,6 @@ extern void* bigphys_malloc(int);
|
||||
|
||||
extern uint16_t two_tier_hexagonal_cellIds[7];
|
||||
|
||||
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
|
||||
static const uint8_t RRC_TRANSACTION_IDENTIFIER_NUMBER = 4;
|
||||
|
||||
mui_t rrc_eNB_mui = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -506,6 +503,7 @@ rrc_eNB_get_next_transaction_identifier(
|
||||
{
|
||||
static uint8_t rrc_transaction_identifier[NUMBER_OF_eNB_MAX];
|
||||
rrc_transaction_identifier[enb_mod_idP] = (rrc_transaction_identifier[enb_mod_idP] + 1) % RRC_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
LOG_T(RRC,"generated xid is %d\n",rrc_transaction_identifier[enb_mod_idP]);
|
||||
return rrc_transaction_identifier[enb_mod_idP];
|
||||
}
|
||||
/*------------------------------------------------------------------------------*/
|
||||
@@ -851,15 +849,16 @@ rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s*
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
RRCConnectionSetupComplete_r8_IEs_t * rrcConnectionSetupComplete
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE\n",
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE (SRB1 Active)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
|
||||
ue_context_pP->ue_context.Srb1.Active=1;
|
||||
T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
|
||||
@@ -1149,13 +1148,293 @@ rrc_eNB_generate_RRCConnectionRelease(
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
|
||||
uint8_t qci_to_priority[9]={2,4,3,5,1,6,7,8,9};
|
||||
|
||||
// TBD: this directive can be remived if we create a similar e_rab_param_t structure in RRC context
|
||||
#if defined(ENABLE_ITTI)
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
)
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
uint8_t buffer[RRC_BUF_SIZE];
|
||||
uint16_t size;
|
||||
int i;
|
||||
|
||||
struct DRB_ToAddMod *DRB_config = NULL;
|
||||
struct RLC_Config *DRB_rlc_config = NULL;
|
||||
struct PDCP_Config *DRB_pdcp_config = NULL;
|
||||
struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL;
|
||||
struct PDCP_Config__rlc_UM *PDCP_rlc_UM = NULL;
|
||||
struct LogicalChannelConfig *DRB_lchan_config = NULL;
|
||||
struct LogicalChannelConfig__ul_SpecificParameters
|
||||
*DRB_ul_SpecificParameters = NULL;
|
||||
// DRB_ToAddModList_t** DRB_configList=&ue_context_pP->ue_context.DRB_configList;
|
||||
DRB_ToAddModList_t* DRB_configList=ue_context_pP->ue_context.DRB_configList;
|
||||
DRB_ToAddModList_t** DRB_configList2=NULL;
|
||||
//DRB_ToAddModList_t** RRC_DRB_configList=&ue_context_pP->ue_context.DRB_configList;
|
||||
|
||||
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL;
|
||||
DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
|
||||
/* for no gcc warnings */
|
||||
(void)dedicatedInfoNas;
|
||||
|
||||
long *logicalchannelgroup_drb;
|
||||
int drb_identity_index=0;
|
||||
|
||||
uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id,
|
||||
DRB_configList2=&ue_context_pP->ue_context.DRB_configList2[xid];
|
||||
if (*DRB_configList2) {
|
||||
free(*DRB_configList2);
|
||||
}
|
||||
//*DRB_configList = CALLOC(1, sizeof(*DRB_configList));
|
||||
*DRB_configList2 = CALLOC(1, sizeof(**DRB_configList2));
|
||||
/* Initialize NAS list */
|
||||
dedicatedInfoNASList = CALLOC(1, sizeof(struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList));
|
||||
|
||||
int e_rab_done=0;
|
||||
|
||||
for ( i = 0 ;
|
||||
i < ue_context_pP->ue_context.setup_e_rabs ;
|
||||
i++){
|
||||
|
||||
// bypass the new and already configured erabs
|
||||
if (ue_context_pP->ue_context.e_rab[i].status >= E_RAB_STATUS_DONE) {
|
||||
drb_identity_index++;
|
||||
continue;
|
||||
}
|
||||
|
||||
DRB_config = CALLOC(1, sizeof(*DRB_config));
|
||||
|
||||
DRB_config->eps_BearerIdentity = CALLOC(1, sizeof(long));
|
||||
// allowed value 5..15, value : x+4
|
||||
*(DRB_config->eps_BearerIdentity) = ue_context_pP->ue_context.e_rab[i].param.e_rab_id;//+ 4; // especial case generation
|
||||
|
||||
DRB_config->drb_Identity = 1 + drb_identity_index + e_rab_done;// + i ;// (DRB_Identity_t) ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
|
||||
// 1 + drb_identiy_index;
|
||||
|
||||
DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long));
|
||||
*(DRB_config->logicalChannelIdentity) = DRB_config->drb_Identity + 2; //(long) (ue_context_pP->ue_context.e_rab[i].param.e_rab_id + 2); // value : x+2
|
||||
|
||||
DRB_rlc_config = CALLOC(1, sizeof(*DRB_rlc_config));
|
||||
DRB_config->rlc_Config = DRB_rlc_config;
|
||||
|
||||
DRB_pdcp_config = CALLOC(1, sizeof(*DRB_pdcp_config));
|
||||
DRB_config->pdcp_Config = DRB_pdcp_config;
|
||||
DRB_pdcp_config->discardTimer = CALLOC(1, sizeof(long));
|
||||
*DRB_pdcp_config->discardTimer = PDCP_Config__discardTimer_infinity;
|
||||
DRB_pdcp_config->rlc_AM = NULL;
|
||||
DRB_pdcp_config->rlc_UM = NULL;
|
||||
|
||||
|
||||
switch (ue_context_pP->ue_context.e_rab[i].param.qos.qci){
|
||||
/*
|
||||
* type: realtime data with medium packer error rate
|
||||
* action: swtich to RLC UM
|
||||
*/
|
||||
case 1: // 100ms, 10^-2, p2, GBR
|
||||
case 2: // 150ms, 10^-3, p4, GBR
|
||||
case 3: // 50ms, 10^-3, p3, GBR
|
||||
case 4: // 300ms, 10^-6, p5
|
||||
case 7: // 100ms, 10^-3, p7, GBR
|
||||
case 9: // 300ms, 10^-6, p9
|
||||
case 65: // 75ms, 10^-2, p0.7, mission critical voice, GBR
|
||||
case 66: // 100ms, 10^-2, p2, non-mission critical voice , GBR
|
||||
// RLC
|
||||
DRB_rlc_config->present = RLC_Config_PR_um_Bi_Directional;
|
||||
DRB_rlc_config->choice.um_Bi_Directional.ul_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
|
||||
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
|
||||
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = T_Reordering_ms35;
|
||||
// PDCP
|
||||
PDCP_rlc_UM = CALLOC(1, sizeof(*PDCP_rlc_UM));
|
||||
DRB_pdcp_config->rlc_UM = PDCP_rlc_UM;
|
||||
PDCP_rlc_UM->pdcp_SN_Size = PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits;
|
||||
break;
|
||||
|
||||
/*
|
||||
* type: non-realtime data with low packer error rate
|
||||
* action: swtich to RLC AM
|
||||
*/
|
||||
case 5: // 100ms, 10^-6, p1 , IMS signaling
|
||||
case 6: // 300ms, 10^-6, p6
|
||||
case 8: // 300ms, 10^-6, p8
|
||||
case 69: // 60ms, 10^-6, p0.5, mission critical delay sensitive data, Lowest Priority
|
||||
case 70: // 200ms, 10^-6, p5.5, mision critical data
|
||||
// RLC
|
||||
DRB_rlc_config->present = RLC_Config_PR_am;
|
||||
DRB_rlc_config->choice.am.ul_AM_RLC.t_PollRetransmit = T_PollRetransmit_ms50;
|
||||
DRB_rlc_config->choice.am.ul_AM_RLC.pollPDU = PollPDU_p16;
|
||||
DRB_rlc_config->choice.am.ul_AM_RLC.pollByte = PollByte_kBinfinity;
|
||||
DRB_rlc_config->choice.am.ul_AM_RLC.maxRetxThreshold = UL_AM_RLC__maxRetxThreshold_t8;
|
||||
DRB_rlc_config->choice.am.dl_AM_RLC.t_Reordering = T_Reordering_ms35;
|
||||
DRB_rlc_config->choice.am.dl_AM_RLC.t_StatusProhibit = T_StatusProhibit_ms25;
|
||||
|
||||
// PDCP
|
||||
PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM));
|
||||
DRB_pdcp_config->rlc_AM = PDCP_rlc_AM;
|
||||
PDCP_rlc_AM->statusReportRequired = FALSE;
|
||||
|
||||
break;
|
||||
default :
|
||||
LOG_E(RRC,"not supported qci %d\n", ue_context_pP->ue_context.e_rab[i].param.qos.qci);
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_FAILED;
|
||||
ue_context_pP->ue_context.e_rab[i].xid = xid;
|
||||
continue;
|
||||
}
|
||||
|
||||
DRB_pdcp_config->headerCompression.present = PDCP_Config__headerCompression_PR_notUsed;
|
||||
|
||||
DRB_lchan_config = CALLOC(1, sizeof(*DRB_lchan_config));
|
||||
DRB_config->logicalChannelConfig = DRB_lchan_config;
|
||||
DRB_ul_SpecificParameters = CALLOC(1, sizeof(*DRB_ul_SpecificParameters));
|
||||
DRB_lchan_config->ul_SpecificParameters = DRB_ul_SpecificParameters;
|
||||
|
||||
if (ue_context_pP->ue_context.e_rab[i].param.qos.qci < 9 )
|
||||
DRB_ul_SpecificParameters->priority = qci_to_priority[ue_context_pP->ue_context.e_rab[i].param.qos.qci-1] + 3;
|
||||
// ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.priority_level;
|
||||
else
|
||||
DRB_ul_SpecificParameters->priority= 4;
|
||||
|
||||
DRB_ul_SpecificParameters->prioritisedBitRate = LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8;
|
||||
//LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
DRB_ul_SpecificParameters->bucketSizeDuration =
|
||||
LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
|
||||
|
||||
logicalchannelgroup_drb = CALLOC(1, sizeof(long));
|
||||
*logicalchannelgroup_drb = 1;//(i+1) % 3;
|
||||
DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb;
|
||||
|
||||
ASN_SEQUENCE_ADD(&DRB_configList->list, DRB_config);
|
||||
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
|
||||
//ue_context_pP->ue_context.DRB_configList2[drb_identity_index] = &(*DRB_configList);
|
||||
|
||||
LOG_I(RRC,"EPS ID %d, DRB ID %d (index %d), QCI %d, priority %d, LCID %d LCGID %d \n",
|
||||
*DRB_config->eps_BearerIdentity,
|
||||
DRB_config->drb_Identity, i,
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.qci,
|
||||
DRB_ul_SpecificParameters->priority,
|
||||
*(DRB_config->logicalChannelIdentity),
|
||||
*DRB_ul_SpecificParameters->logicalChannelGroup
|
||||
);
|
||||
|
||||
e_rab_done++;
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_DONE;
|
||||
ue_context_pP->ue_context.e_rab[i].xid = xid;
|
||||
|
||||
{
|
||||
if (ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer != NULL) {
|
||||
dedicatedInfoNas = CALLOC(1, sizeof(DedicatedInfoNAS_t));
|
||||
memset(dedicatedInfoNas, 0, sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(dedicatedInfoNas,
|
||||
(char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length);
|
||||
ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas);
|
||||
LOG_I(RRC,"add NAS info with size %d (rab id %d)\n",ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length, i);
|
||||
}
|
||||
else {
|
||||
LOG_W(RRC,"Not received activate dedicated EPS bearer context request\n");
|
||||
}
|
||||
/* TODO parameters yet to process ... */
|
||||
{
|
||||
// ue_context_pP->ue_context.e_rab[i].param.qos;
|
||||
// ue_context_pP->ue_context.e_rab[i].param.sgw_addr;
|
||||
// ue_context_pP->ue_context.e_rab[i].param.gtp_teid;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* If list is empty free the list and reset the address */
|
||||
if (dedicatedInfoNASList != NULL) {
|
||||
if (dedicatedInfoNASList->list.count == 0) {
|
||||
free(dedicatedInfoNASList);
|
||||
dedicatedInfoNASList = NULL;
|
||||
LOG_W(RRC,"dedlicated NAS list is empty, free the list and reset the address\n");
|
||||
}
|
||||
} else {
|
||||
LOG_W(RRC,"dedlicated NAS list is empty\n");
|
||||
}
|
||||
|
||||
memset(buffer, 0, RRC_BUF_SIZE);
|
||||
|
||||
size = do_RRCConnectionReconfiguration(ctxt_pP,
|
||||
buffer,
|
||||
xid,
|
||||
(SRB_ToAddModList_t*)NULL,
|
||||
(DRB_ToAddModList_t*)*DRB_configList2,
|
||||
(DRB_ToReleaseList_t*)NULL, // DRB2_list,
|
||||
(struct SPS_Config*)NULL, // *sps_Config,
|
||||
NULL, NULL, NULL, NULL,NULL,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
(struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList*)dedicatedInfoNASList
|
||||
#ifdef Rel10
|
||||
, (SCellToAddMod_r10_t*)NULL
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
#ifdef RRC_MSG_PRINT
|
||||
LOG_F(RRC,"[MSG] RRC Connection Reconfiguration\n");
|
||||
for (i = 0; i < size; i++) {
|
||||
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
|
||||
}
|
||||
LOG_F(RRC,"\n");
|
||||
////////////////////////////////////////
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Free all NAS PDUs */
|
||||
for (i = 0; i < ue_context_pP->ue_context.nb_of_e_rabs; i++) {
|
||||
if (ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer != NULL) {
|
||||
/* Free the NAS PDU buffer and invalidate it */
|
||||
free(ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer);
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LOG_I(RRC,
|
||||
"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCConnectionReconfiguration (bytes %d, UE RNTI %x)\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated rrcConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_eNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
uint8_t buffer[RRC_BUF_SIZE];
|
||||
@@ -1163,8 +1442,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
int i;
|
||||
|
||||
// configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
|
||||
//eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
|
||||
//struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
|
||||
eNB_RRC_INST* rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
|
||||
struct PhysicalConfigDedicated** physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
|
||||
|
||||
struct SRB_ToAddMod *SRB2_config = NULL;
|
||||
struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL;
|
||||
@@ -1172,7 +1451,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
struct LogicalChannelConfig__ul_SpecificParameters
|
||||
*SRB2_ul_SpecificParameters = NULL;
|
||||
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
||||
SRB_ToAddModList_t *SRB_configList2 = NULL;
|
||||
SRB_ToAddModList_t **SRB_configList2 = NULL;
|
||||
|
||||
struct DRB_ToAddMod *DRB_config = NULL;
|
||||
struct RLC_Config *DRB_rlc_config = NULL;
|
||||
@@ -1183,8 +1462,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
struct LogicalChannelConfig__ul_SpecificParameters
|
||||
*DRB_ul_SpecificParameters = NULL;
|
||||
DRB_ToAddModList_t** DRB_configList = &ue_context_pP->ue_context.DRB_configList;
|
||||
|
||||
MAC_MainConfig_t *mac_MainConfig = NULL;
|
||||
DRB_ToAddModList_t** DRB_configList2 = NULL;
|
||||
MAC_MainConfig_t *mac_MainConfig = NULL;
|
||||
MeasObjectToAddModList_t *MeasObj_list = NULL;
|
||||
MeasObjectToAddMod_t *MeasObj = NULL;
|
||||
ReportConfigToAddModList_t *ReportConfig_list = NULL;
|
||||
@@ -1212,6 +1491,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
(void)dedicatedInfoNas;
|
||||
|
||||
C_RNTI_t *cba_RNTI = NULL;
|
||||
|
||||
uint8_t xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); //Transaction_id,
|
||||
|
||||
#ifdef CBA
|
||||
//struct PUSCH_CBAConfigDedicated_vlola *pusch_CBAConfigDedicated_vlola;
|
||||
uint8_t *cba_RNTI_buf;
|
||||
@@ -1243,9 +1525,13 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
|
||||
// Configure SRB2
|
||||
/// SRB2
|
||||
SRB_configList2=&ue_context_pP->ue_context.SRB_configList2[xid];
|
||||
if (*SRB_configList2) {
|
||||
free(*SRB_configList2);
|
||||
}
|
||||
*SRB_configList2 = CALLOC(1, sizeof(**SRB_configList2));
|
||||
memset(*SRB_configList2, 0, sizeof(**SRB_configList2));
|
||||
SRB2_config = CALLOC(1, sizeof(*SRB2_config));
|
||||
SRB_configList2 = CALLOC(1, sizeof(*SRB_configList2));
|
||||
memset(SRB_configList2, 0, sizeof(*SRB_configList2));
|
||||
|
||||
SRB2_config->srb_Identity = 2;
|
||||
SRB2_rlc_config = CALLOC(1, sizeof(*SRB2_rlc_config));
|
||||
@@ -1267,7 +1553,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
|
||||
SRB2_ul_SpecificParameters = CALLOC(1, sizeof(*SRB2_ul_SpecificParameters));
|
||||
|
||||
SRB2_ul_SpecificParameters->priority = 1;
|
||||
SRB2_ul_SpecificParameters->priority = 3; // let some priority for SRB1 and dedicated DRBs
|
||||
SRB2_ul_SpecificParameters->prioritisedBitRate =
|
||||
LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
SRB2_ul_SpecificParameters->bucketSizeDuration =
|
||||
@@ -1280,12 +1566,29 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
SRB2_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup;
|
||||
|
||||
SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters = SRB2_ul_SpecificParameters;
|
||||
// this list has the configuration for SRB1 and SRB2
|
||||
ASN_SEQUENCE_ADD(&SRB_configList->list, SRB2_config);
|
||||
ASN_SEQUENCE_ADD(&SRB_configList2->list, SRB2_config);
|
||||
// this list has only the configuration for SRB2
|
||||
ASN_SEQUENCE_ADD(&(*SRB_configList2)->list, SRB2_config);
|
||||
|
||||
// Configure DRB
|
||||
//*DRB_configList = CALLOC(1, sizeof(*DRB_configList));
|
||||
// list for all the configured DRB
|
||||
if (*DRB_configList) {
|
||||
free(*DRB_configList);
|
||||
}
|
||||
*DRB_configList = CALLOC(1, sizeof(**DRB_configList));
|
||||
memset(*DRB_configList, 0, sizeof(**DRB_configList));
|
||||
|
||||
// list for the configured DRB for a this xid
|
||||
DRB_configList2=&ue_context_pP->ue_context.DRB_configList2[xid];
|
||||
if (*DRB_configList2) {
|
||||
free(*DRB_configList2);
|
||||
}
|
||||
*DRB_configList2 = CALLOC(1, sizeof(**DRB_configList2));
|
||||
memset(*DRB_configList2, 0, sizeof(**DRB_configList2));
|
||||
|
||||
|
||||
/// DRB
|
||||
DRB_config = CALLOC(1, sizeof(*DRB_config));
|
||||
|
||||
@@ -1293,7 +1596,6 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
*(DRB_config->eps_BearerIdentity) = 5L; // LW set to first value, allowed value 5..15, value : x+4
|
||||
// DRB_config->drb_Identity = (DRB_Identity_t) 1; //allowed values 1..32
|
||||
// NN: this is the 1st DRB for this ue, so set it to 1
|
||||
// NN: this is the 1st DRB for this ue, so set it to 1
|
||||
DRB_config->drb_Identity = (DRB_Identity_t) 1; // (ue_mod_idP+1); //allowed values 1..32, value: x
|
||||
DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long));
|
||||
*(DRB_config->logicalChannelIdentity) = (long)3; // value : x+2
|
||||
@@ -1346,9 +1648,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
DRB_ul_SpecificParameters = CALLOC(1, sizeof(*DRB_ul_SpecificParameters));
|
||||
DRB_lchan_config->ul_SpecificParameters = DRB_ul_SpecificParameters;
|
||||
|
||||
DRB_ul_SpecificParameters->priority = 2; // lower priority than srb1, srb2
|
||||
DRB_ul_SpecificParameters->prioritisedBitRate =
|
||||
LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
DRB_ul_SpecificParameters->priority = 12; // lower priority than srb1, srb2 and other dedicated bearer
|
||||
DRB_ul_SpecificParameters->prioritisedBitRate =LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8 ;
|
||||
//LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
|
||||
DRB_ul_SpecificParameters->bucketSizeDuration =
|
||||
LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
|
||||
|
||||
@@ -1358,6 +1660,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb;
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*DRB_configList)->list, DRB_config);
|
||||
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
|
||||
|
||||
//ue_context_pP->ue_context.DRB_configList2[0] = &(*DRB_configList);
|
||||
|
||||
mac_MainConfig = CALLOC(1, sizeof(*mac_MainConfig));
|
||||
ue_context_pP->ue_context.mac_MainConfig = mac_MainConfig;
|
||||
@@ -1394,6 +1699,80 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
//sps_RA_ConfigList_rlola = NULL;
|
||||
#endif
|
||||
|
||||
//change the transmission mode for the primary component carrier
|
||||
//TODO: add codebook subset restriction here
|
||||
//TODO: change TM for secondary CC in SCelltoaddmodlist
|
||||
if (*physicalConfigDedicated) {
|
||||
if ((*physicalConfigDedicated)->antennaInfo) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.transmissionMode = rrc_inst->configuration.ue_TransmissionMode[0];
|
||||
LOG_D(RRC,"Setting transmission mode to %d+1\n",rrc_inst->configuration.ue_TransmissionMode[0]);
|
||||
if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm3) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
|
||||
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
|
||||
AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm3;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf= MALLOC(1);
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.buf[0] = 0xc0;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.size=1;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm3.bits_unused=6;
|
||||
}
|
||||
else if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm4) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
|
||||
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
|
||||
AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm4;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm4.buf= MALLOC(1);
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm4.buf[0] = 0xfc;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm4.size=1;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm4.bits_unused=2;
|
||||
|
||||
}
|
||||
else if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm5) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
|
||||
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
|
||||
AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm5;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm5.buf= MALLOC(1);
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm5.buf[0] = 0xf0;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm5.size=1;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm5.bits_unused=4;
|
||||
}
|
||||
else if (rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm6) {
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction=
|
||||
CALLOC(1,sizeof(AntennaInfoDedicated__codebookSubsetRestriction_PR));
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->present =
|
||||
AntennaInfoDedicated__codebookSubsetRestriction_PR_n2TxAntenna_tm6;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.buf= MALLOC(1);
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.buf[0] = 0xf0;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.size=1;
|
||||
(*physicalConfigDedicated)->antennaInfo->choice.explicitValue.codebookSubsetRestriction->choice.n2TxAntenna_tm6.bits_unused=4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_E(RRC,"antenna_info not present in physical_config_dedicated. Not reconfiguring!\n");
|
||||
}
|
||||
if ((*physicalConfigDedicated)->cqi_ReportConfig) {
|
||||
if ((rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm4) ||
|
||||
(rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm5) ||
|
||||
(rrc_inst->configuration.ue_TransmissionMode[0]==AntennaInfoDedicated__transmissionMode_tm6)) {
|
||||
//feedback mode needs to be set as well
|
||||
//TODO: I think this is taken into account in the PHY automatically based on the transmission mode variable
|
||||
printf("setting cqi reporting mode to rm31\n");
|
||||
#ifdef Rel10
|
||||
*((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic)=CQI_ReportModeAperiodic_rm31;
|
||||
#else
|
||||
*((*physicalConfigDedicated)->cqi_ReportConfig->cqi_ReportModeAperiodic)=CQI_ReportConfig__cqi_ReportModeAperiodic_rm31; // HLC CQI, no PMI
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_E(RRC,"cqi_ReportConfig not present in physical_config_dedicated. Not reconfiguring!\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_E(RRC,"physical_config_dedicated not present in RRCConnectionReconfiguration. Not reconfiguring!\n");
|
||||
}
|
||||
|
||||
// Measurement ID list
|
||||
MeasId_list = CALLOC(1, sizeof(*MeasId_list));
|
||||
memset((void *)MeasId_list, 0, sizeof(*MeasId_list));
|
||||
@@ -1647,7 +2026,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
//rrc_inst->handover_info.as_config.sourceRadioResourceConfig.srb_ToAddModList = CALLOC(1,sizeof());
|
||||
ue_context_pP->ue_context.handover_info = CALLOC(1, sizeof(*(ue_context_pP->ue_context.handover_info)));
|
||||
//memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.srb_ToAddModList,(void *)SRB_list,sizeof(SRB_ToAddModList_t));
|
||||
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.srb_ToAddModList = SRB_configList2;
|
||||
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.srb_ToAddModList = *SRB_configList2;
|
||||
//memcpy((void *)rrc_inst->handover_info[ue_mod_idP]->as_config.sourceRadioResourceConfig.drb_ToAddModList,(void *)DRB_list,sizeof(DRB_ToAddModList_t));
|
||||
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.drb_ToAddModList = *DRB_configList;
|
||||
ue_context_pP->ue_context.handover_info->as_config.sourceRadioResourceConfig.drb_ToReleaseList = NULL;
|
||||
@@ -1673,7 +2052,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
if (ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer != NULL) {
|
||||
dedicatedInfoNas = CALLOC(1, sizeof(DedicatedInfoNAS_t));
|
||||
memset(dedicatedInfoNas, 0, sizeof(OCTET_STRING_t));
|
||||
OCTET_STRING_fromBuf(dedicatedInfoNas, (char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
|
||||
OCTET_STRING_fromBuf(dedicatedInfoNas,
|
||||
(char*)ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer,
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length);
|
||||
ASN_SEQUENCE_ADD(&dedicatedInfoNASList->list, dedicatedInfoNas);
|
||||
}
|
||||
@@ -1687,6 +2067,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
|
||||
/* TODO should test if e RAB are Ok before! */
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_DONE;
|
||||
LOG_D(RRC, "setting the status for the default DRB (index %d) to (%d,%s)\n",
|
||||
i, ue_context_pP->ue_context.e_rab[i].status, "E_RAB_STATUS_DONE");
|
||||
}
|
||||
|
||||
/* If list is empty free the list and reset the address */
|
||||
@@ -1701,15 +2083,15 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
|
||||
size = do_RRCConnectionReconfiguration(ctxt_pP,
|
||||
buffer,
|
||||
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id), //Transaction_id,
|
||||
(SRB_ToAddModList_t*)NULL, /// NN: do not reconfig srb1: SRB_configList2,
|
||||
xid, //Transaction_id,
|
||||
(SRB_ToAddModList_t*)*SRB_configList2, // SRB_configList
|
||||
(DRB_ToAddModList_t*)*DRB_configList,
|
||||
(DRB_ToReleaseList_t*)NULL, // DRB2_list,
|
||||
(struct SPS_Config*)NULL, // *sps_Config,
|
||||
#ifdef EXMIMO_IOT
|
||||
NULL, NULL, NULL, NULL,NULL,
|
||||
#else
|
||||
(struct PhysicalConfigDedicated*)*physicalConfigDedicated,
|
||||
#ifdef EXMIMO_IOT
|
||||
NULL, NULL, NULL,NULL,
|
||||
#else
|
||||
(MeasObjectToAddModList_t*)MeasObj_list,
|
||||
(ReportConfigToAddModList_t*)ReportConfig_list,
|
||||
(QuantityConfig_t*)quantityConfig,
|
||||
@@ -1729,11 +2111,9 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
|
||||
#ifdef RRC_MSG_PRINT
|
||||
LOG_F(RRC,"[MSG] RRC Connection Reconfiguration\n");
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
|
||||
}
|
||||
|
||||
LOG_F(RRC,"\n");
|
||||
////////////////////////////////////////
|
||||
#endif
|
||||
@@ -2885,11 +3265,12 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
memcpy(&ue_context_pP->ue_context.Srb1.Srb_info.Lchan_desc[0], &DCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
|
||||
memcpy(&ue_context_pP->ue_context.Srb1.Srb_info.Lchan_desc[1], &DCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
|
||||
|
||||
// SRB2
|
||||
// SRB2
|
||||
ue_context_pP->ue_context.Srb2.Active = 1;
|
||||
ue_context_pP->ue_context.Srb2.Srb_info.Srb_id = Idx;
|
||||
memcpy(&ue_context_pP->ue_context.Srb2.Srb_info.Lchan_desc[0], &DCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
|
||||
memcpy(&ue_context_pP->ue_context.Srb2.Srb_info.Lchan_desc[1], &DCCH_LCHAN_DESC, LCHAN_DESC_SIZE);
|
||||
|
||||
LOG_I(RRC, "[eNB %d] CALLING RLC CONFIG SRB1 (rbid %d) for UE %x\n",
|
||||
ctxt_pP->module_id, Idx, ue_context_pP->ue_context.rnti);
|
||||
|
||||
@@ -3047,8 +3428,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
RRCConnectionReconfigurationComplete_r8_IEs_t* rrcConnectionReconfigurationComplete
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const uint8_t xid
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
@@ -3067,8 +3448,8 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
uint8_t *kRRCint = NULL;
|
||||
uint8_t *kUPenc = NULL;
|
||||
|
||||
DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList;
|
||||
//SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
||||
DRB_ToAddModList_t* DRB_configList = ue_context_pP->ue_context.DRB_configList2[xid];
|
||||
SRB_ToAddModList_t* SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid];
|
||||
|
||||
T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
@@ -3131,8 +3512,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
|
||||
rrc_pdcp_config_asn1_req(
|
||||
ctxt_pP,
|
||||
NULL, //LG-RK 14/05/2014 SRB_configList,
|
||||
DRB_configList, (DRB_ToReleaseList_t *) NULL,
|
||||
SRB_configList, //NULL, //LG-RK 14/05/2014 SRB_configList,
|
||||
DRB_configList,
|
||||
(DRB_ToReleaseList_t *) NULL,
|
||||
/*eNB_rrc_inst[ctxt_pP->module_id].ciphering_algorithm[ue_mod_idP] |
|
||||
(eNB_rrc_inst[ctxt_pP->module_id].integrity_algorithm[ue_mod_idP] << 4),
|
||||
*/
|
||||
@@ -3147,14 +3529,36 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
// Refresh SRBs/DRBs
|
||||
rrc_rlc_config_asn1_req(
|
||||
ctxt_pP,
|
||||
NULL, //LG-RK 14/05/2014 SRB_configList,
|
||||
SRB_configList, // NULL, //LG-RK 14/05/2014 SRB_configList,
|
||||
DRB_configList,
|
||||
(DRB_ToReleaseList_t *) NULL
|
||||
#ifdef Rel10
|
||||
, (PMCH_InfoList_r9_t *) NULL
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
// set the SRB active in Ue context
|
||||
if (SRB_configList != NULL) {
|
||||
for (i = 0; (i < SRB_configList->list.count) && (i < 3); i++) {
|
||||
if (SRB_configList->list.array[i]->srb_Identity == 1 ){
|
||||
ue_context_pP->ue_context.Srb1.Active=1;
|
||||
}
|
||||
else if (SRB_configList->list.array[i]->srb_Identity == 2 ) {
|
||||
ue_context_pP->ue_context.Srb2.Active=1;
|
||||
ue_context_pP->ue_context.Srb2.Srb_info.Srb_id=2;
|
||||
LOG_I(RRC,"[eNB %d] Frame %d CC %d : SRB2 is now active\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
ue_context_pP->ue_context.primaryCC_id);
|
||||
} else {
|
||||
LOG_W(RRC,"[eNB %d] Frame %d CC %d : invalide SRB identity %d\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
SRB_configList->list.array[i]->srb_Identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through DRBs and establish if necessary
|
||||
|
||||
if (DRB_configList != NULL) {
|
||||
@@ -3341,7 +3745,7 @@ rrc_eNB_generate_RRCConnectionSetup(
|
||||
do_RRCConnectionSetup(ctxt_pP,
|
||||
ue_context_pP,
|
||||
(uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload,
|
||||
(mac_xface->frame_parms->nb_antennas_tx==2)?2:1,
|
||||
(mac_xface->lte_frame_parms->nb_antennas_tx_eNB==2)?2:1, //at this point we do not have the UE capability information, so it can only be TM1 or TM2
|
||||
rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id),
|
||||
mac_xface->frame_parms,
|
||||
SRB_configList,
|
||||
@@ -3504,6 +3908,7 @@ openair_rrc_eNB_init(
|
||||
eNB_rrc_inst[ctxt.module_id].initial_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
eNB_rrc_inst[ctxt.module_id].s1ap_id2_s1ap_ids = hashtable_create (NUMBER_OF_UE_MAX * 2, NULL, NULL);
|
||||
|
||||
memcpy(&eNB_rrc_inst[ctxt.module_id].configuration,configuration,sizeof(RrcConfigurationReq));
|
||||
|
||||
/// System Information INIT
|
||||
|
||||
@@ -3903,7 +4308,7 @@ rrc_eNB_decode_ccch(
|
||||
&DCCH_LCHAN_DESC,
|
||||
LCHAN_DESC_SIZE);
|
||||
|
||||
// SRB2
|
||||
// SRB2: set it to go through SRB1 with id 1 (DCCH)
|
||||
ue_context_p->ue_context.Srb2.Active = 1;
|
||||
ue_context_p->ue_context.Srb2.Srb_info.Srb_id = Idx;
|
||||
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[0],
|
||||
@@ -3912,7 +4317,7 @@ rrc_eNB_decode_ccch(
|
||||
memcpy(&ue_context_p->ue_context.Srb2.Srb_info.Lchan_desc[1],
|
||||
&DCCH_LCHAN_DESC,
|
||||
LCHAN_DESC_SIZE);
|
||||
|
||||
|
||||
rrc_eNB_generate_RRCConnectionSetup(ctxt_pP, ue_context_p, CC_id);
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -3987,6 +4392,8 @@ rrc_eNB_decode_dcch(
|
||||
int i;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
|
||||
int dedicated_DRB=0;
|
||||
|
||||
T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
|
||||
@@ -3994,8 +4401,11 @@ rrc_eNB_decode_dcch(
|
||||
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Received message on SRB%d, should not have ...\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
Srb_id);
|
||||
} else {
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Received message on SRB%d\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
Srb_id);
|
||||
}
|
||||
|
||||
//memset(ul_dcch_msg,0,sizeof(UL_DCCH_Message_t));
|
||||
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Decoding UL-DCCH Message\n",
|
||||
@@ -4110,30 +4520,44 @@ rrc_eNB_decode_dcch(
|
||||
if (ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.criticalExtensions.
|
||||
present ==
|
||||
RRCConnectionReconfigurationComplete__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r8) {
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
/*NN: revise the condition */
|
||||
if (ue_context_p->ue_context.Status == RRC_RECONFIGURED){
|
||||
dedicated_DRB = 1;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}else {
|
||||
dedicated_DRB = 0;
|
||||
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
ctxt_pP,
|
||||
ue_context_p,
|
||||
&ul_dcch_msg->message.choice.c1.choice.
|
||||
rrcConnectionReconfigurationComplete.
|
||||
criticalExtensions.choice.
|
||||
rrcConnectionReconfigurationComplete_r8);
|
||||
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# if defined(ENABLE_ITTI)
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# if defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED == 1) {
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
ctxt_pP,
|
||||
ue_context_p);
|
||||
if (dedicated_DRB == 1){
|
||||
rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p,
|
||||
ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
|
||||
}else {
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(ctxt_pP,
|
||||
ue_context_p);
|
||||
}
|
||||
}
|
||||
#else // establish a dedicated bearer
|
||||
if (dedicated_DRB == 0 ) {
|
||||
// ue_context_p->ue_context.e_rab[0].status = E_RAB_STATUS_ESTABLISHED;
|
||||
rrc_eNB_reconfigure_DRBs(ctxt_pP,ue_context_p);
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
case UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete:
|
||||
@@ -4356,7 +4780,14 @@ rrc_eNB_decode_dcch(
|
||||
ue_context_p,
|
||||
ul_dcch_msg);
|
||||
}
|
||||
|
||||
#else
|
||||
ue_context_p->ue_context.nb_of_e_rabs = 1;
|
||||
for (i = 0; i < ue_context_p->ue_context.nb_of_e_rabs; i++){
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.e_rab[i].param.e_rab_id = 1+i;
|
||||
ue_context_p->ue_context.e_rab[i].param.qos.qci=9;
|
||||
}
|
||||
ue_context_p->ue_context.setup_e_rabs =ue_context_p->ue_context.nb_of_e_rabs;
|
||||
#endif
|
||||
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(ctxt_pP,
|
||||
@@ -4466,6 +4897,40 @@ rrc_eNB_decode_dcch(
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP){
|
||||
|
||||
int i;
|
||||
int e_rab_done=0;
|
||||
for (i = 0;
|
||||
i < 3;//NB_RB_MAX - 3; // S1AP_MAX_E_RAB
|
||||
i++) {
|
||||
|
||||
if ( ue_context_pP->ue_context.e_rab[i].status < E_RAB_STATUS_DONE){
|
||||
ue_context_pP->ue_context.e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_pP->ue_context.e_rab[i].param.e_rab_id = i + 1;
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.qci = i % 9;
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.priority_level= i % PRIORITY_LEVEL_LOWEST;
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.pre_emp_capability= PRE_EMPTION_CAPABILITY_DISABLED;
|
||||
ue_context_pP->ue_context.e_rab[i].param.qos.allocation_retention_priority.pre_emp_vulnerability= PRE_EMPTION_VULNERABILITY_DISABLED;
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.buffer = NULL;
|
||||
ue_context_pP->ue_context.e_rab[i].param.nas_pdu.length = 0;
|
||||
// memset (ue_context_pP->ue_context.e_rab[i].param.sgw_addr.buffer,0,20);
|
||||
ue_context_pP->ue_context.e_rab[i].param.sgw_addr.length = 0;
|
||||
ue_context_pP->ue_context.e_rab[i].param.gtp_teid=0;
|
||||
|
||||
ue_context_pP->ue_context.nb_of_e_rabs++;
|
||||
e_rab_done++;
|
||||
LOG_I(RRC,"setting up the dedicated DRBs %d (index %d) status %d \n",
|
||||
ue_context_pP->ue_context.e_rab[i].param.e_rab_id, i, ue_context_pP->ue_context.e_rab[i].status);
|
||||
}
|
||||
}
|
||||
ue_context_pP->ue_context.setup_e_rabs+=e_rab_done;
|
||||
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(ctxt_pP, ue_context_pP, 0);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void*
|
||||
rrc_enb_task(
|
||||
@@ -4561,7 +5026,12 @@ rrc_enb_task(
|
||||
case S1AP_PAGING_IND:
|
||||
LOG_E(RRC, "[eNB %d] Received not yet implemented message %s\n", instance, msg_name_p);
|
||||
break;
|
||||
|
||||
|
||||
case S1AP_E_RAB_SETUP_REQ:
|
||||
rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(msg_p, msg_name_p, instance);
|
||||
LOG_D(RRC, "[eNB %d] Received the message %s\n", instance, msg_name_p);
|
||||
break;
|
||||
|
||||
case S1AP_UE_CONTEXT_RELEASE_REQ:
|
||||
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
@@ -68,14 +68,19 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
ctxt_pP->rnti);
|
||||
|
||||
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel %u bearer index %u id %u\n",
|
||||
|
||||
ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
ue_context_p->ue_context.enb_gtp_addrs[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_addr;
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
create_tunnel_resp_pP->enb_S1u_teid[i],
|
||||
i,
|
||||
create_tunnel_resp_pP->eps_bearer_id[i]);
|
||||
ue_context_p->ue_context.enb_gtp_teid[i] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
ue_context_p->ue_context.enb_gtp_addrs[i] = create_tunnel_resp_pP->enb_addr;
|
||||
ue_context_p->ue_context.enb_gtp_ebi[i] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs],
|
||||
i+ue_context_p->ue_context.setup_e_rabs,
|
||||
i,
|
||||
create_tunnel_resp_pP->eps_bearer_id[i],
|
||||
create_tunnel_resp_pP->enb_addr.length);
|
||||
}
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
Copyright(c) 1999 - 2016 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -28,8 +28,8 @@
|
||||
*******************************************************************************/
|
||||
/*! \file rrc_eNB_S1AP.c
|
||||
* \brief rrc S1AP procedures for eNB
|
||||
* \author Laurent Winckel and Sebastien ROUX and Navid Nikaein and Lionel GAUTHIER
|
||||
* \date 2013-2014
|
||||
* \author Navid Nikaein, Laurent Winckel, Sebastien ROUX, and Lionel GAUTHIER
|
||||
* \date 2013-2016
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
@@ -481,8 +481,10 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).e_rabs[e_rab].gtp_teid = ue_context_pP->ue_context.enb_gtp_teid[e_rab];
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr = ue_context_pP->ue_context.enb_gtp_addrs[e_rab];
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.length = 4;
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
} else {
|
||||
e_rabs_failed++;
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).e_rabs_failed[e_rab].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
// TODO add cause when it will be integrated
|
||||
}
|
||||
@@ -772,12 +774,15 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
uint32_t length;
|
||||
uint8_t *buffer;
|
||||
|
||||
uint8_t srb_id;
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
ue_initial_id = S1AP_DOWNLINK_NAS (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
srb_id = ue_context_p->ue_context.Srb2.Srb_info.Srb_id;
|
||||
|
||||
LOG_I(RRC, "[eNB %d] Received %s: ue_initial_id %d, eNB_ue_s1ap_id %d\n",
|
||||
instance,
|
||||
msg_name,
|
||||
@@ -858,10 +863,13 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
|
||||
LOG_F(RRC,"\n");
|
||||
#endif
|
||||
/*
|
||||
* switch UL or DL NAS message without RRC piggybacked to SRB2 if active.
|
||||
*/
|
||||
/* Transfer data to PDCP */
|
||||
rrc_data_req (
|
||||
&ctxt,
|
||||
DCCH,
|
||||
srb_id,
|
||||
*rrc_eNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
length,
|
||||
@@ -913,7 +921,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
|
||||
memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
ue_context_p->ue_context.nb_of_e_rabs = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).nb_of_e_rabs;
|
||||
|
||||
|
||||
for (i = 0; i < ue_context_p->ue_context.nb_of_e_rabs; i++) {
|
||||
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.e_rab[i].param = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).e_rab_param[i];
|
||||
@@ -926,7 +934,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
&S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).e_rab_param[i].sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
}
|
||||
|
||||
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = i;
|
||||
|
||||
@@ -937,7 +945,8 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp);
|
||||
&create_tunnel_resp);
|
||||
ue_context_p->ue_context.setup_e_rabs=ue_context_p->ue_context.nb_of_e_rabs;
|
||||
}
|
||||
|
||||
/* TODO parameters yet to process ... */
|
||||
@@ -1246,6 +1255,183 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
|
||||
}
|
||||
}
|
||||
|
||||
int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
{
|
||||
uint16_t ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
MessageDef *message_gtpv1u_p = NULL;
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
ue_initial_id = S1AP_E_RAB_SETUP_REQ (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_E_RAB_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
LOG_I(RRC, "[eNB %d] Received %s: ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d\n",
|
||||
instance, msg_name, ue_initial_id, eNB_ue_s1ap_id, S1AP_E_RAB_SETUP_REQ (msg_p).nb_e_rabs_tosetup);
|
||||
|
||||
if (ue_context_p == NULL) {
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
MessageDef *msg_fail_p = NULL;
|
||||
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_E_RAB_SETUP_REQ: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
|
||||
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_SETUP_REQUEST_FAIL);
|
||||
S1AP_E_RAB_SETUP_REQ (msg_fail_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
|
||||
// TODO add failure cause when defined!
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
} else {
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_E_RAB_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
int i;
|
||||
|
||||
memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
uint8_t nb_e_rabs_tosetup = S1AP_E_RAB_SETUP_REQ (msg_p).nb_e_rabs_tosetup;
|
||||
|
||||
// keep the previous bearer
|
||||
// the index for the rec
|
||||
for (i = 0;
|
||||
i < nb_e_rabs_tosetup;
|
||||
i++) {
|
||||
if (ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status == E_RAB_STATUS_DONE)
|
||||
LOG_W(RRC,"E-RAB already configured, reconfiguring\n");
|
||||
ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].status = E_RAB_STATUS_NEW;
|
||||
ue_context_p->ue_context.e_rab[i+ue_context_p->ue_context.setup_e_rabs].param = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i];
|
||||
|
||||
|
||||
create_tunnel_req.eps_bearer_id[i] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[i] = S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].gtp_teid;
|
||||
|
||||
memcpy(&create_tunnel_req.sgw_addr[i],
|
||||
& S1AP_E_RAB_SETUP_REQ (msg_p).e_rab_setup_params[i].sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
|
||||
LOG_I(RRC,"E_RAB setup REQ: local index %d teid %u, eps id %d \n",
|
||||
i+ue_context_p->ue_context.setup_e_rabs,
|
||||
create_tunnel_req.sgw_S1u_teid[i],
|
||||
create_tunnel_req.eps_bearer_id[i] );
|
||||
}
|
||||
ue_context_p->ue_context.nb_of_e_rabs=nb_e_rabs_tosetup;
|
||||
|
||||
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = i;
|
||||
|
||||
// NN: not sure if we should create a new tunnel: need to check teid, etc.
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp);
|
||||
|
||||
ue_context_p->ue_context.setup_e_rabs+=nb_e_rabs_tosetup;
|
||||
|
||||
}
|
||||
|
||||
/* TODO parameters yet to process ... */
|
||||
{
|
||||
// S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).ue_ambr;
|
||||
}
|
||||
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(&ctxt, ue_context_p, 0);
|
||||
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/*NN: careful about the typcast of xid (long -> uint8_t*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t xid ){
|
||||
|
||||
MessageDef *msg_p = NULL;
|
||||
int e_rab;
|
||||
int e_rabs_done = 0;
|
||||
int e_rabs_failed = 0;
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_E_RAB_SETUP_RESP);
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
for (e_rab = 0; e_rab < ue_context_pP->ue_context.setup_e_rabs ; e_rab++) {
|
||||
|
||||
/* only respond to the corresponding transaction */
|
||||
//if (((xid+1)%4) == ue_context_pP->ue_context.e_rab[e_rab].xid) {
|
||||
if (xid == ue_context_pP->ue_context.e_rab[e_rab].xid) {
|
||||
|
||||
if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_DONE) {
|
||||
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
// TODO add other information from S1-U when it will be integrated
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].gtp_teid = ue_context_pP->ue_context.enb_gtp_teid[e_rab];
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr = ue_context_pP->ue_context.enb_gtp_addrs[e_rab];
|
||||
//S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rab].eNB_addr.length += 4;
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_ESTABLISHED;
|
||||
|
||||
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d, xid %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
|
||||
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[e_rab].status, xid,
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].e_rab_id,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].gtp_teid,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[0],
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[1],
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[2],
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs[e_rabs_done].eNB_addr.buffer[3]);
|
||||
|
||||
e_rabs_done++;
|
||||
} else if ((ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_NEW) ||
|
||||
(ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED)){
|
||||
LOG_D (RRC,"E-RAB is NEW or already ESTABLISHED\n");
|
||||
}else { /* to be improved */
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status = E_RAB_STATUS_FAILED;
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).e_rabs_failed[e_rabs_failed].e_rab_id = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
e_rabs_failed++;
|
||||
// TODO add cause when it will be integrated
|
||||
}
|
||||
|
||||
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
|
||||
// NN: add conditions for e_rabs_failed
|
||||
if ((e_rabs_done > 0) ){
|
||||
|
||||
LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: sending the message: nb_of_erabs %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_E_RAB_SETUP_RESP (msg_p),
|
||||
sizeof(s1ap_e_rab_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" E_RAB_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
} else {
|
||||
/*debug info for the xid */
|
||||
LOG_D(RRC,"xid does not corresponds (context e_rab index %d, status %d, xid %d/%d) \n ",
|
||||
e_rab, ue_context_pP->ue_context.e_rab[e_rab].status, xid, ue_context_pP->ue_context.e_rab[e_rab].xid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif /* defined(ENABLE_ITTI) */
|
||||
#endif /* defined(ENABLE_USE_MME) */
|
||||
|
||||
@@ -166,6 +166,25 @@ int rrc_eNB_process_S1AP_DOWNLINK_NAS(MessageDef *msg_p, const char *msg_name, i
|
||||
*/
|
||||
int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
*\brief process a S1AP dedicated E_RAB setup request message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
*\param msg_name Message name.
|
||||
*\param instance Message instance.
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
/*! \fn rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid )
|
||||
*\brief send a S1AP dedicated E_RAB setup response
|
||||
*\param ctxt_pP contxt infirmation
|
||||
*\param e_contxt_pP ue specific context at the eNB
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
*\brief process a S1AP_UE_CTXT_MODIFICATION_REQ message received from S1AP.
|
||||
*\param msg_p Message received by RRC.
|
||||
|
||||
@@ -75,7 +75,8 @@ public_mem_block(void check_mem_area (void);)
|
||||
private_mem_block(void check_free_mem_block (mem_block_t * leP);)
|
||||
# endif
|
||||
#ifdef USER_MODE
|
||||
# define MEM_SCALE /*MAX_RG */ MAX_MOBILES_PER_ENB
|
||||
//# define MEM_SCALE MAX_MOBILES_PER_ENB*NB_RB_MAX
|
||||
# define MEM_SCALE MAX_MOBILES_PER_ENB
|
||||
#else
|
||||
# ifdef NODE_RG
|
||||
# define MEM_SCALE 2
|
||||
|
||||
Reference in New Issue
Block a user