Commit 578ce9eb authored by Raymond Knopp's avatar Raymond Knopp

up to RRCConnectionSetupComplete Transmission in UE

parent 3d1faefa
......@@ -45,6 +45,7 @@
#include "rrc_extern.h"
#include "common/ran_context.h"
#include "rrc_eNB_UE_context.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
......@@ -179,7 +180,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
&asn_DEF_DL_CCCH_Message,
(void**)&dl_ccch_msg,
ie->value.choice.RRCContainer.buf,
ie->value.choice.RRCContainer.size,0,0);
rrc_dl_sdu_len,0,0);
switch (dl_ccch_msg->message.choice.c1.present) {
case DL_CCCH_MessageType__c1_PR_NOTHING:
......@@ -242,7 +243,19 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
// This should be somewhere in the f1ap_cudu_ue_inst_t
int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_ue[0],du_ue_f1ap_id);
struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[macrlc_instance],rnti);
eNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
(void*)ie->value.choice.RRCContainer.buf,
rrc_dl_sdu_len);
ue_p->Srb0.Tx_buffer.payload_size = rrc_dl_sdu_len;
rrc_mac_config_req_eNB(
macrlc_instance,
0, //primaryCC_id,
......@@ -250,7 +263,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
0,
#endif
f1ap_get_rnti_by_du_id(&f1ap_du_ue[0],du_ue_f1ap_id), //rnti
rnti,
(BCCH_BCH_Message_t *) NULL,
(RadioResourceConfigCommonSIB_t *) NULL,
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
......@@ -462,6 +475,12 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
return -1;
}
struct rrc_eNB_ue_context_s* ue_context_p = rrc_eNB_allocate_new_UE_context(RC.rrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
ue_context_p->ue_context.random_ue_identity = rntiP;
ue_context_p->ue_context.Srb0.Active = 1;
RB_INSERT(rrc_ue_tree_s, &RC.rrc[module_idP]->rrc_ue_head, ue_context_p);
du_f1ap_itti_send_sctp_data_req(0, f1ap_du_data->assoc_id, buffer, len, 0);
return 0;
}
......
......@@ -608,13 +608,13 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
{
eNB_MAC_INST *mac = RC.mac[module_idP];
COMMON_channels_t *cc = mac->common_channels;
int16_t rrc_sdu_length;
int UE_id = -1;
uint16_t msg4_padding;
uint16_t msg4_post_padding;
uint16_t msg4_header;
eNB_MAC_INST *mac = RC.mac[module_idP];
COMMON_channels_t *cc = mac->common_channels;
int16_t rrc_sdu_length;
int UE_id = -1;
uint16_t msg4_padding;
uint16_t msg4_post_padding;
uint16_t msg4_header;
uint8_t *vrb_map;
int first_rb;
......@@ -1021,55 +1021,52 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH,
UE_RNTI(module_idP,UE_id),1, // 1 transport block
&cc[CC_idP].CCCH_pdu.payload[0], 0); // not used in this case
LOG_D(MAC,
if (rrc_sdu_length > 0) {
LOG_D(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n",
module_idP, CC_idP, frameP, subframeP, UE_id, rrc_sdu_length);
// AssertFatal(rrc_sdu_length > 0,
// "[MAC][eNB Scheduler] CCCH not allocated, rrc_sdu_length: %d\n", rrc_sdu_length);
if (rrc_sdu_length > 0) LOG_I(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
else LOG_I(MAC,
"eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 without RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
/// Choose first 4 RBs for Msg4, should really check that these are free!
first_rb = 0;
// AssertFatal(rrc_sdu_length > 0,
// "[MAC][eNB Scheduler] CCCH not allocated, rrc_sdu_length: %d\n", rrc_sdu_length);
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
vrb_map[first_rb] = 1;
vrb_map[first_rb + 1] = 1;
vrb_map[first_rb + 2] = 1;
vrb_map[first_rb + 3] = 1;
// Compute MCS/TBS for 3 PRB (coded on 4 vrb)
msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header
if ((rrc_sdu_length + msg4_header) <= 22) {
ra->msg4_mcs = 4;
ra->msg4_TBsize = 22;
} else if ((rrc_sdu_length + msg4_header) <= 28) {
ra->msg4_mcs = 5;
ra->msg4_TBsize = 28;
} else if ((rrc_sdu_length + msg4_header) <= 32) {
ra->msg4_mcs = 6;
ra->msg4_TBsize = 32;
/// Choose first 4 RBs for Msg4, should really check that these are free!
first_rb = 0;
vrb_map[first_rb] = 1;
vrb_map[first_rb + 1] = 1;
vrb_map[first_rb + 2] = 1;
vrb_map[first_rb + 3] = 1;
// Compute MCS/TBS for 3 PRB (coded on 4 vrb)
msg4_header = 1 + 6 + 1; // CR header, CR CE, SDU header
if ((rrc_sdu_length + msg4_header) <= 22) {
ra->msg4_mcs = 4;
ra->msg4_TBsize = 22;
} else if ((rrc_sdu_length + msg4_header) <= 28) {
ra->msg4_mcs = 5;
ra->msg4_TBsize = 28;
} else if ((rrc_sdu_length + msg4_header) <= 32) {
ra->msg4_mcs = 6;
ra->msg4_TBsize = 32;
} else if ((rrc_sdu_length + msg4_header) <= 41) {
ra->msg4_mcs = 7;
ra->msg4_TBsize = 41;
ra->msg4_mcs = 7;
ra->msg4_TBsize = 41;
} else if ((rrc_sdu_length + msg4_header) <= 49) {
ra->msg4_mcs = 8;
ra->msg4_TBsize = 49;
ra->msg4_mcs = 8;
ra->msg4_TBsize = 49;
} else if ((rrc_sdu_length + msg4_header) <= 57) {
ra->msg4_mcs = 9;
ra->msg4_TBsize = 57;
ra->msg4_mcs = 9;
ra->msg4_TBsize = 57;
}
fill_nfapi_dl_dci_1A(dl_config_pdu, 4, // aggregation_level
ra->rnti, // rnti
1, // rnti_type, CRNTI
......@@ -1080,7 +1077,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
1, // ndi
0, // rv
0); // vrb_flag
LOG_D(MAC,
"Frame %d, subframe %d: Msg4 DCI pdu_num %d (rnti %x,rnti_type %d,harq_pid %d, resource_block_coding (%p) %d\n",
frameP, subframeP, dl_req_body->number_pdu,
......@@ -1218,6 +1215,18 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
set_dl_ue_select_msg4(CC_idP, 4, UE_id, ra->rnti);
}
} // CCE Allocation feasible
}
else {
LOG_I(MAC,
"eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Delaying Msg4 for RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
ra->Msg4_subframe ++;
if (ra->Msg4_subframe == 10) {
ra->Msg4_frame++;
ra->Msg4_frame&=1023;
ra->Msg4_subframe = 0;
}
}
} // msg4 frame/subframe
} // else rach_resource_type
}
......
......@@ -396,7 +396,9 @@ boolean_t pdcp_data_req(
free_mem_block(pdcp_pdu_p, __FUNCTION__);
rlc_status = ack_result;
}
else
#endif /*UETARGET*/
{
//It should never get here
rlc_status = rlc_data_req(ctxt_pP
......@@ -413,7 +415,7 @@ boolean_t pdcp_data_req(
#endif
);
}
#endif /*UETARGET*/
}
switch (rlc_status) {
......
......@@ -690,7 +690,7 @@ void rlc_data_ind (
sdu_pP);
}
else
#endif /*UETARGET*/
{
switch (RC.rrc[ctxt_pP->module_id]->node_type){
......@@ -727,6 +727,15 @@ void rlc_data_ind (
}
}
#else
pdcp_data_ind (
ctxt_pP,
srb_flagP,
MBMS_flagP,
rb_idP,
sdu_sizeP,
sdu_pP);
#endif
}
//-----------------------------------------------------------------------------
void rlc_data_conf (const protocol_ctxt_t* const ctxt_pP,
......@@ -797,19 +806,19 @@ rlc_module_init (void)
pool_buffer_init();
/*
#ifndef UETARGET
/* Launch the RLC listening server
* as a separate thread
*/
// Launch the RLC listening server
// as a separate thread
static int started = 0;
if (started == 0)
{
async_server_thread_init();
started = 1;
}
#endif /*UETARGET*/
#endif
*/
return(0);
}
//-----------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment