Commit 8ef8582b authored by Xue Song's avatar Xue Song

add node type ngran_UE

parent 81c92d22
......@@ -42,7 +42,8 @@ typedef enum {
ngran_gNB_CU = 5,
ngran_eNB_DU = 6,
ngran_gNB_DU = 7,
ngran_eNB_MBMS_STA = 8
ngran_eNB_MBMS_STA = 8,
ngran_UE = 9
} ngran_node_t;
#define NODE_IS_MONOLITHIC(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB || (nOdE_TyPe) == ngran_ng_eNB || (nOdE_TyPe) == ngran_gNB)
......
......@@ -98,7 +98,7 @@ pthread_cond_t sync_cond;
pthread_mutex_t sync_mutex;
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
int config_sync_var=-1;
extern ngran_node_t node_type;
RAN_CONTEXT_t RC;
......@@ -514,10 +514,6 @@ int main( int argc, char **argv ) {
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
RC.nrrrc[0]->node_type = ngran_gNB;
init_NR_UE(1,rrc_config_path);
if(IS_SOFTMODEM_NOS1)
init_pdcp();
......@@ -583,9 +579,7 @@ int main( int argc, char **argv ) {
protocol_ctxt_t ctxt_pP = {0};
ctxt_pP.enb_flag = ENB_FLAG_NO;
ctxt_pP.rnti = 0x1234;
RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
RC.nrrrc[0]->node_type = ngran_gNB;
node_type = ngran_UE;
rrc_ue_generate_RRCSetupRequest(&ctxt_pP, 0);
if (create_tasks_nrue(1) < 0) {
printf("cannot create ITTI tasks\n");
......
......@@ -610,7 +610,7 @@ rb_found:
memblock = get_free_mem_block(size, __FUNCTION__);
memcpy(memblock->data, buf, size);
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
if (NODE_IS_CU(node_type)) {
LOG_D(PDCP, "call proto_agent_send_rlc_data_req()\n");
nr_pdcp_params.send_rlc_data_req_func(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock, NULL, NULL);
// proto_agent_send_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
......@@ -704,7 +704,7 @@ rb_found:
printf("!!!!!!! deliver_pdu_srb (srb %d) calling rlc_data_req size %d: ", srb_id, size);
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
printf("\n");
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
if (NODE_IS_CU(node_type)) {
NR_DL_DCCH_Message_t* dl_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
......@@ -810,7 +810,7 @@ boolean_t pdcp_data_ind(
T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(rnti),
T_INT(rb_id), T_INT(sdu_buffer_size));
if (NODE_IS_DU(RC.nrrrc[0]->node_type) && (srb_flagP == 0)) {
if (NODE_IS_DU(node_type) && (srb_flagP == 0)) {
LOG_D(RLC, "call proto_agent_send_pdcp_data_ind() \n");
nr_pdcp_params.pdcp_data_ind_func(ctxt_pP, srb_flagP, 0, rb_id, sdu_buffer_size, sdu_buffer, NULL, NULL);
return 1;
......
......@@ -44,6 +44,7 @@
#include "openair2/LAYER2/PROTO_AGENT/proto_agent.h"
extern RAN_CONTEXT_t RC;
extern ngran_node_t node_type;
#include <stdint.h>
......@@ -477,7 +478,7 @@ rb_found:
T_INT(0 /*ctxt_pP->module_id*/),
T_INT(ue->rnti), T_INT(rb_id), T_INT(size));
const ngran_node_t type = RC.nrrrc[0 /*ctxt_pP->module_id*/]->node_type;
const ngran_node_t type = node_type;
AssertFatal(type != ngran_eNB_CU && type != ngran_ng_eNB_CU && type != ngran_gNB_CU,
"Can't be CU, bad node type %d\n", type);
......
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