Commit d0b43673 authored by francescomani's avatar francescomani

Merge remote-tracking branch 'origin/NR_UE_Capabilities' into NR_RRC_256QAM

parents 196c7572 fcfcc605
...@@ -606,6 +606,9 @@ class Containerize(): ...@@ -606,6 +606,9 @@ class Containerize():
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
else: else:
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
# all the xNB run logs shall be on the server 0 for logCollecting
if self.eNB_serverId[self.eNB_instance] != '0':
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/')
logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m') logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m')
def DeployGenObject(self, HTML): def DeployGenObject(self, HTML):
...@@ -638,7 +641,7 @@ class Containerize(): ...@@ -638,7 +641,7 @@ class Containerize():
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml up -d ' + self.services[0] cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml up -d ' + self.services[0]
logging.debug(cmd) logging.debug(cmd)
try: try:
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=100)
except Exception as e: except Exception as e:
self.exitStatus = 1 self.exitStatus = 1
logging.error('Could not deploy') logging.error('Could not deploy')
...@@ -651,7 +654,7 @@ class Containerize(): ...@@ -651,7 +654,7 @@ class Containerize():
healthy = 0 healthy = 0
while (count < 10): while (count < 10):
count += 1 count += 1
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
healthy = 0 healthy = 0
for state in deployStatus.split('\n'): for state in deployStatus.split('\n'):
res = re.search('Up \(healthy\)', state) res = re.search('Up \(healthy\)', state)
...@@ -683,7 +686,7 @@ class Containerize(): ...@@ -683,7 +686,7 @@ class Containerize():
# if the containers are running, recover the logs! # if the containers are running, recover the logs!
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps --all' cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml ps --all'
logging.debug(cmd) logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
anyLogs = False anyLogs = False
for state in deployStatus.split('\n'): for state in deployStatus.split('\n'):
res = re.search('Name|----------', state) res = re.search('Name|----------', state)
...@@ -697,7 +700,7 @@ class Containerize(): ...@@ -697,7 +700,7 @@ class Containerize():
cName = res.group('container_name') cName = res.group('container_name')
cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1' cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1'
logging.debug(cmd) logging.debug(cmd)
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
if anyLogs: if anyLogs:
cmd = 'mkdir -p ../cmake_targets/log && mv ' + self.yamlPath[0] + '/*.log ../cmake_targets/log' cmd = 'mkdir -p ../cmake_targets/log && mv ' + self.yamlPath[0] + '/*.log ../cmake_targets/log'
logging.debug(cmd) logging.debug(cmd)
...@@ -805,7 +808,7 @@ class Containerize(): ...@@ -805,7 +808,7 @@ class Containerize():
time.sleep(5) time.sleep(5)
cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log ../cmake_targets/log/iperf_server_' + HTML.testCase_id + '.log' cmd = 'docker cp ' + self.svrContName + ':/tmp/iperf_server.log ../cmake_targets/log/iperf_server_' + HTML.testCase_id + '.log'
logging.debug(cmd) logging.debug(cmd)
serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10) serverStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
# Analyze client output # Analyze client output
result = re.search('Server Report:', clientStatus) result = re.search('Server Report:', clientStatus)
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include <dlfcn.h> #include <dlfcn.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <form.h>
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#include "common/utils/threadPool/thread-pool.h" #include "common/utils/threadPool/thread-pool.h"
......
...@@ -307,8 +307,10 @@ The following features are valid for the gNB and the 5G-NR UE. ...@@ -307,8 +307,10 @@ The following features are valid for the gNB and the 5G-NR UE.
- MAC <-> PHY data interface using FAPI P7 interface for BCH PDU, DCI PDU, PDSCH PDU - MAC <-> PHY data interface using FAPI P7 interface for BCH PDU, DCI PDU, PDSCH PDU
- Scheduler procedures for SIB1 - Scheduler procedures for SIB1
- Scheduler procedures for RA - Scheduler procedures for RA
- Contention free RA procedure - Contention Free RA procedure
- Contention based RA procedure - Contention Based RA procedure
- Msg3 can transfer uplink CCCH, DTCH or DCCH messages
- CBRA can be performed using MAC CE or C-RNTI
- Scheduler procedures for CSI-RS - Scheduler procedures for CSI-RS
- MAC downlink scheduler - MAC downlink scheduler
- phy-test scheduler (fixed allocation and usable also without UE) - phy-test scheduler (fixed allocation and usable also without UE)
......
...@@ -449,6 +449,7 @@ static OAI_phy_scope_t *create_phy_scope_gnb(void) { ...@@ -449,6 +449,7 @@ static OAI_phy_scope_t *create_phy_scope_gnb(void) {
OAI_phy_scope_t *fdui = calloc(( sizeof *fdui ),1); OAI_phy_scope_t *fdui = calloc(( sizeof *fdui ),1);
// Define form // Define form
fdui->phy_scope = fl_bgn_form( FL_NO_BOX, 800, 800 ); fdui->phy_scope = fl_bgn_form( FL_NO_BOX, 800, 800 );
fl_set_form_dblbuffer(fdui->phy_scope, 1);
// This the whole UI box // This the whole UI box
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 800, "" ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 800, "" );
fl_set_object_color( obj, FL_BLACK, FL_WHITE ); fl_set_object_color( obj, FL_BLACK, FL_WHITE );
...@@ -530,7 +531,10 @@ static void *scope_thread_gNB(void *arg) { ...@@ -530,7 +531,10 @@ static void *scope_thread_gNB(void *arg) {
OAI_phy_scope_t *form_gnb = create_phy_scope_gnb(); OAI_phy_scope_t *form_gnb = create_phy_scope_gnb();
while (!oai_exit) { while (!oai_exit) {
fl_freeze_form(form_gnb->phy_scope);
phy_scope_gNB(form_gnb, p, nb_ue); phy_scope_gNB(form_gnb, p, nb_ue);
fl_unfreeze_form(form_gnb->phy_scope);
fl_redraw_form(form_gnb->phy_scope);
usleep(99*1000); usleep(99*1000);
} }
...@@ -801,6 +805,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) { ...@@ -801,6 +805,7 @@ static OAI_phy_scope_t *create_phy_scope_nrue( int ID ) {
OAI_phy_scope_t *fdui = calloc(( sizeof *fdui ),1); OAI_phy_scope_t *fdui = calloc(( sizeof *fdui ),1);
// Define form // Define form
fdui->phy_scope = fl_bgn_form( FL_NO_BOX, 800, 900 ); fdui->phy_scope = fl_bgn_form( FL_NO_BOX, 800, 900 );
fl_set_form_dblbuffer(fdui->phy_scope, 1);
// This the whole UI box // This the whole UI box
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 900, "" ); obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 900, "" );
fl_set_object_color( obj, FL_BLACK, FL_BLACK ); fl_set_object_color( obj, FL_BLACK, FL_BLACK );
......
...@@ -192,8 +192,13 @@ uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP, ...@@ -192,8 +192,13 @@ uint8_t get_transformPrecoding(const NR_BWP_UplinkCommon_t *initialUplinkBWP,
uint8_t configuredGrant); uint8_t configuredGrant);
void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP, void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
const int CC_idP, const int CC_idP,
const frame_t frameP, const frame_t frameP,
const sub_frame_t subframeP, const sub_frame_t subframeP,
const rnti_t rntiP) ; const rnti_t rntiP);
void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP);
#endif #endif
...@@ -822,6 +822,24 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -822,6 +822,24 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->state = Msg4; ra->state = Msg4;
ra->Msg4_frame = (frameP + 2) % 1024; ra->Msg4_frame = (frameP + 2) % 1024;
ra->Msg4_slot = 1; ra->Msg4_slot = 1;
if (ra->msg3_dcch_dtch) {
// Check if the UE identified by C-RNTI still exists at the gNB
int UE_id_C = find_nr_UE_id(gnb_mod_idP, ra->crnti);
if (UE_id_C < 0) {
// The UE identified by C-RNTI no longer exists at the gNB
// Let's abort the current RA, so the UE will trigger a new RA later but using RRCSetupRequest instead. A better solution may be implemented
mac_remove_nr_ue(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
return;
} else {
// The UE identified by C-RNTI still exists at the gNB
// Reset uplink failure flags/counters/timers at MAC and at RRC so gNB will resume again scheduling resources for this UE
UE_info->UE_sched_ctrl[UE_id_C].pusch_consecutive_dtx_cnt = 0;
UE_info->UE_sched_ctrl[UE_id_C].ul_failure = 0;
nr_mac_gNB_rrc_ul_failure_reset(gnb_mod_idP, frameP, slotP, ra->crnti);
}
}
LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI 0x%04x (state %d, frame %d, slot %d)\n", LOG_I(NR_MAC, "Scheduling RA-Msg4 for TC_RNTI 0x%04x (state %d, frame %d, slot %d)\n",
(ra->msg3_dcch_dtch?ra->crnti:ra->rnti), ra->state, ra->Msg4_frame, ra->Msg4_slot); (ra->msg3_dcch_dtch?ra->crnti:ra->rnti), ra->state, ra->Msg4_frame, ra->Msg4_slot);
} }
......
...@@ -215,6 +215,182 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP, ...@@ -215,6 +215,182 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
/* rlc_data_req queue - end */ /* rlc_data_req queue - end */
/****************************************************************************/ /****************************************************************************/
/****************************************************************************/
/* pdcp_data_ind thread - begin */
/****************************************************************************/
typedef struct {
protocol_ctxt_t ctxt_pP;
srb_flag_t srb_flagP;
MBMS_flag_t MBMS_flagP;
rb_id_t rb_id;
sdu_size_t sdu_buffer_size;
mem_block_t *sdu_buffer;
} pdcp_data_ind_queue_item;
#define PDCP_DATA_IND_QUEUE_SIZE 10000
typedef struct {
pdcp_data_ind_queue_item q[PDCP_DATA_IND_QUEUE_SIZE];
volatile int start;
volatile int length;
pthread_mutex_t m;
pthread_cond_t c;
} pdcp_data_ind_queue;
static pdcp_data_ind_queue pq;
static void do_pdcp_data_ind(
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
mem_block_t *const sdu_buffer)
{
nr_pdcp_ue_t *ue;
nr_pdcp_entity_t *rb;
int rnti = ctxt_pP->rnti;
if (ctxt_pP->module_id != 0 ||
//ctxt_pP->enb_flag != 1 ||
ctxt_pP->instance != 0 ||
ctxt_pP->eNB_index != 0 ||
ctxt_pP->configured != 1 ||
ctxt_pP->brOption != 0) {
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
if (ctxt_pP->enb_flag)
T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(rnti),
T_INT(rb_id), T_INT(sdu_buffer_size));
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
if (srb_flagP == 1) {
if (rb_id < 1 || rb_id > 2)
rb = NULL;
else
rb = ue->srb[rb_id - 1];
} else {
if (rb_id < 1 || rb_id > 5)
rb = NULL;
else
rb = ue->drb[rb_id - 1];
}
if (rb != NULL) {
rb->recv_pdu(rb, (char *)sdu_buffer->data, sdu_buffer_size);
} else {
LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n",
__FILE__, __LINE__, __FUNCTION__, rb_id, srb_flagP);
exit(1);
}
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
free_mem_block(sdu_buffer, __FUNCTION__);
}
static void *pdcp_data_ind_thread(void *_)
{
int i;
pthread_setname_np(pthread_self(), "PDCP data ind");
while (1) {
if (pthread_mutex_lock(&pq.m) != 0) abort();
while (pq.length == 0)
if (pthread_cond_wait(&pq.c, &pq.m) != 0) abort();
i = pq.start;
if (pthread_mutex_unlock(&pq.m) != 0) abort();
do_pdcp_data_ind(&pq.q[i].ctxt_pP,
pq.q[i].srb_flagP,
pq.q[i].MBMS_flagP,
pq.q[i].rb_id,
pq.q[i].sdu_buffer_size,
pq.q[i].sdu_buffer);
if (pthread_mutex_lock(&pq.m) != 0) abort();
pq.length--;
pq.start = (pq.start + 1) % PDCP_DATA_IND_QUEUE_SIZE;
if (pthread_cond_signal(&pq.c) != 0) abort();
if (pthread_mutex_unlock(&pq.m) != 0) abort();
}
}
static void init_nr_pdcp_data_ind_queue(void)
{
pthread_t t;
pthread_mutex_init(&pq.m, NULL);
pthread_cond_init(&pq.c, NULL);
if (pthread_create(&t, NULL, pdcp_data_ind_thread, NULL) != 0) {
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
}
static void enqueue_pdcp_data_ind(
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
mem_block_t *const sdu_buffer)
{
int i;
int logged = 0;
if (pthread_mutex_lock(&pq.m) != 0) abort();
while (pq.length == PDCP_DATA_IND_QUEUE_SIZE) {
if (!logged) {
logged = 1;
LOG_W(PDCP, "%s: pdcp_data_ind queue is full\n", __FUNCTION__);
}
if (pthread_cond_wait(&pq.c, &pq.m) != 0) abort();
}
i = (pq.start + pq.length) % PDCP_DATA_IND_QUEUE_SIZE;
pq.length++;
pq.q[i].ctxt_pP = *ctxt_pP;
pq.q[i].srb_flagP = srb_flagP;
pq.q[i].MBMS_flagP = MBMS_flagP;
pq.q[i].rb_id = rb_id;
pq.q[i].sdu_buffer_size = sdu_buffer_size;
pq.q[i].sdu_buffer = sdu_buffer;
if (pthread_cond_signal(&pq.c) != 0) abort();
if (pthread_mutex_unlock(&pq.m) != 0) abort();
}
boolean_t pdcp_data_ind(
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
mem_block_t *const sdu_buffer)
{
enqueue_pdcp_data_ind(ctxt_pP,
srb_flagP,
MBMS_flagP,
rb_id,
sdu_buffer_size,
sdu_buffer);
return true;
}
/****************************************************************************/
/* pdcp_data_ind thread - end */
/****************************************************************************/
/****************************************************************************/ /****************************************************************************/
/* hacks to be cleaned up at some point - begin */ /* hacks to be cleaned up at some point - begin */
/****************************************************************************/ /****************************************************************************/
...@@ -375,6 +551,7 @@ void pdcp_layer_init(void) ...@@ -375,6 +551,7 @@ void pdcp_layer_init(void)
init_nr_rlc_data_req_queue(); init_nr_rlc_data_req_queue();
} }
init_nr_pdcp_data_ind_queue();
nr_pdcp_init_timer_thread(nr_pdcp_ue_manager); nr_pdcp_init_timer_thread(nr_pdcp_ue_manager);
} }
...@@ -639,62 +816,6 @@ srb_found: ...@@ -639,62 +816,6 @@ srb_found:
} }
} }
boolean_t pdcp_data_ind(
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
mem_block_t *const sdu_buffer)
{
nr_pdcp_ue_t *ue;
nr_pdcp_entity_t *rb;
int rnti = ctxt_pP->rnti;
if (ctxt_pP->module_id != 0 ||
//ctxt_pP->enb_flag != 1 ||
ctxt_pP->instance != 0 ||
ctxt_pP->eNB_index != 0 ||
ctxt_pP->configured != 1 ||
ctxt_pP->brOption != 0) {
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
if (ctxt_pP->enb_flag)
T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(rnti),
T_INT(rb_id), T_INT(sdu_buffer_size));
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
if (srb_flagP == 1) {
if (rb_id < 1 || rb_id > 2)
rb = NULL;
else
rb = ue->srb[rb_id - 1];
} else {
if (rb_id < 1 || rb_id > 5)
rb = NULL;
else
rb = ue->drb[rb_id - 1];
}
if (rb != NULL) {
rb->recv_pdu(rb, (char *)sdu_buffer->data, sdu_buffer_size);
} else {
LOG_E(PDCP, "%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)\n",
__FILE__, __LINE__, __FUNCTION__, rb_id, srb_flagP);
exit(1);
}
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
free_mem_block(sdu_buffer, __FUNCTION__);
return 1;
}
void pdcp_run(const protocol_ctxt_t *const ctxt_pP) void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
{ {
MessageDef *msg_p; MessageDef *msg_p;
......
...@@ -383,3 +383,17 @@ void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP, ...@@ -383,3 +383,17 @@ void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
LOG_D(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP); LOG_D(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
} }
} }
void nr_mac_gNB_rrc_ul_failure_reset(const module_id_t Mod_instP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP) {
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[Mod_instP], rntiP);
if (ue_context_p != NULL) {
LOG_W(RRC,"Frame %d, Subframe %d: UE %x UL failure reset, deactivating timer\n",frameP,subframeP,rntiP);
ue_context_p->ue_context.ul_failure_timer=0;
} else {
LOG_W(RRC,"Frame %d, Subframe %d: UL failure reset: UE %x unknown \n",frameP,subframeP,rntiP);
}
}
...@@ -142,6 +142,28 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_ ...@@ -142,6 +142,28 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
unsigned char *kUPenc = NULL; unsigned char *kUPenc = NULL;
unsigned char *kUPint = NULL; unsigned char *kUPint = NULL;
int i; int i;
// In case of phy-test and do-ra mode, read UE capabilities directly from file
if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1) {
NR_UE_NR_Capability_t* UE_Capability_nr = NULL;
char UE_NR_Capability_xer_fname[1024];
char UE_NR_Capability_xer[65536];
sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml");
FILE *f = fopen(UE_NR_Capability_xer_fname, "r");
if(f){
size_t size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f);
if (size == 0 || size == sizeof UE_NR_Capability_xer)
LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size);
else {
UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
asn_dec_rval_t dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size);
assert(dec_rval.code == RC_OK);
xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr);
}
}
ue_context_p->ue_context.UE_Capability_nr = UE_Capability_nr;
}
// NR RRCReconfiguration // NR RRCReconfiguration
AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n"); AssertFatal(rrc->Nb_ue < MAX_NR_RRC_UE_CONTEXTS,"cannot add another UE\n");
ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t)); ue_context_p->ue_context.reconfig = calloc(1,sizeof(NR_RRCReconfiguration_t));
......
...@@ -2619,14 +2619,22 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ...@@ -2619,14 +2619,22 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
asn_enc_rval_t enc_rval; asn_enc_rval_t enc_rval;
asn_dec_rval_t dec_rval;
NR_UL_DCCH_Message_t ul_dcch_msg; NR_UL_DCCH_Message_t ul_dcch_msg;
NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container; NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container;
char UE_NR_Capability_xer_fname[1024];
char UE_NR_Capability_xer[65536];
size_t size;
uint8_t buffer[200]; uint8_t buffer[200];
int i; int i;
LOG_I(NR_RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing UECapabilityEnquiry (gNB %d)\n", LOG_I(NR_RRC,"[UE %d] Frame %d: Receiving from SRB1 (DL-DCCH), Processing UECapabilityEnquiry (gNB %d)\n",
ctxt_pP->module_id, ctxt_pP->module_id,
ctxt_pP->frame, ctxt_pP->frame,
gNB_index); gNB_index);
sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml");
FILE *f = fopen(UE_NR_Capability_xer_fname, "r");
memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t));
memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t));
ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1;
...@@ -2635,20 +2643,29 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ...@@ -2635,20 +2643,29 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation)); ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation = CALLOC(1, sizeof(struct NR_UECapabilityInformation));
ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ul_dcch_msg.message.choice.c1->choice.ueCapabilityInformation->rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier;
ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr;
NR_UE_NR_Capability_t* UE_Capability_nr; NR_UE_NR_Capability_t* UE_Capability_nr = NULL;
UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
NR_BandNR_t *nr_bandnr; if(f){
nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t)); size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f);
nr_bandnr->bandNR = 1; if (size == 0 || size == sizeof UE_NR_Capability_xer) {
ASN_SEQUENCE_ADD( LOG_E(NR_RRC,"UE Capabilities XER file %s is too large (%ld)\n", UE_NR_Capability_xer_fname,size);
&UE_Capability_nr->rf_Parameters.supportedBandListNR.list, free(UE_Capability_nr);
nr_bandnr); return;
}
dec_rval = xer_decode(0, &asn_DEF_NR_UE_NR_Capability, (void *)&UE_Capability_nr, UE_NR_Capability_xer, size);
assert(dec_rval.code == RC_OK);
}
else {
NR_BandNR_t *nr_bandnr;
nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
nr_bandnr->bandNR = 1;
ASN_SEQUENCE_ADD(&UE_Capability_nr->rf_Parameters.supportedBandListNR.list,
nr_bandnr);
}
OAI_NR_UECapability_t *UECap; OAI_NR_UECapability_t *UECap;
UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t)); UECap = CALLOC(1,sizeof(OAI_NR_UECapability_t));
UECap->UE_NR_Capability = UE_Capability_nr; UECap->UE_NR_Capability = UE_Capability_nr;
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr);
xer_fprint(stdout,&asn_DEF_NR_UE_NR_Capability,(void *)UE_Capability_nr);
}
enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_NR_Capability, enc_rval = uper_encode_to_buffer(&asn_DEF_NR_UE_NR_Capability,
NULL, NULL,
......
...@@ -70,7 +70,7 @@ typedef enum { ...@@ -70,7 +70,7 @@ typedef enum {
nr_RadioBearerConfigX_r15=1 nr_RadioBearerConfigX_r15=1
} nsa_message_t; } nsa_message_t;
#define MAX_UE_NR_CAPABILITY_SIZE 255 #define MAX_UE_NR_CAPABILITY_SIZE 2048
typedef struct OAI_NR_UECapability_s { typedef struct OAI_NR_UECapability_s {
uint8_t sdu[MAX_UE_NR_CAPABILITY_SIZE]; uint8_t sdu[MAX_UE_NR_CAPABILITY_SIZE];
uint8_t sdu_size; uint8_t sdu_size;
......
This diff is collapsed.
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