Merge remote-tracking branch 'origin/develop' into develop-CSI-Measurements

# Conflicts:
#	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
This commit is contained in:
Roberto Louro Magueta
2022-07-05 10:19:52 +01:00
198 changed files with 1610 additions and 1948 deletions
+2 -2
View File
@@ -380,7 +380,7 @@ struct openair0_device_t {
@param buff Buffer which holds the samples (2 dimensional)
@param nsamps number of samples to be sent
@param number of antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
int (*trx_write_func)(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int antenna_id, int flags);
@@ -390,7 +390,7 @@ struct openair0_device_t {
@param buff Buffer which holds the samples (1 dimensional)
@param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple anteannas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
int (*trx_write_func2)(openair0_device *device, openair0_timestamp timestamp, void *buff, int nsamps,int antenna_id, int flags);
+1 -1
View File
@@ -134,7 +134,7 @@ static void trx_iris_end(openair0_device *device) {
@param buff Buffer which holds the samples
@param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple anteannas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
+9 -5
View File
@@ -331,7 +331,7 @@ static void trx_usrp_end(openair0_device *device) {
@param buff Buffer which holds the samples
@param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
static int trx_usrp_write(openair0_device *device,
openair0_timestamp timestamp,
@@ -352,7 +352,7 @@ static int trx_usrp_write(openair0_device *device,
AssertFatal( MAX_WRITE_THREAD_BUFFER_SIZE >= cc,"Do not support more than %d cc number\n", MAX_WRITE_THREAD_BUFFER_SIZE);
boolean_t first_packet_state=false,last_packet_state=false;
bool first_packet_state=false,last_packet_state=false;
if (flags_lsb == 2) { // start of burst
// s->tx_md.start_of_burst = true;
@@ -481,7 +481,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI
@param buff Buffer which holds the samples
@param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
void *trx_usrp_write_thread(void * arg){
int ret=0;
@@ -1030,9 +1030,13 @@ extern "C" {
}
if (device_adds[0].get("type") == "n3xx") {
printf("Found USRP n300\n");
const std::string product = device_adds[0].get("product");
printf("Found USRP %s\n", product.c_str());
device->type=USRP_N300_DEV;
usrp_master_clock = 122.88e6;
if (product == "n320")
usrp_master_clock = 245.76e6; // N320 does not support 122.88e6 master clock rate
else
usrp_master_clock = 122.88e6;
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
if ( 0 != system("sysctl -w net.core.rmem_max=62500000 net.core.wmem_max=62500000") )
+1 -1
View File
@@ -158,7 +158,7 @@ static void trx_iqplayer_end(openair0_device *device) {
@param buff Buffer which holds the samples
@param nsamps number of samples to be sent
@param antenna_id index of the antenna if the device has multiple antennas
@param flags flags must be set to TRUE if timestamp parameter needs to be applied
@param flags flags must be set to true if timestamp parameter needs to be applied
*/
static int trx_iqplayer_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
struct timespec req;
+1 -1
View File
@@ -187,7 +187,7 @@ int main(int argc, char *argv[]) {
}
uint64_t typeStamp=ENB_MAGICDL;
boolean_t raw=false;
bool raw = false;
if ( argc == 5 ) {
raw=true;
+2 -2
View File
@@ -231,9 +231,9 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
// L2-emulator can work only one eNB.
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.active, sizeof(bool)*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_info.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_info.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_info.active, sizeof(bool)*NUMBER_OF_UE_MAX);
AssertFatal((ret= pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd, return %d\n",ret);
ru->proc.instance_pre_scd++;
+1 -1
View File
@@ -1834,7 +1834,7 @@ static void *ru_thread( void *param ) {
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_info.active, sizeof(bool)*NUMBER_OF_UE_MAX);
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_pre_scd))==0,"[eNB] error locking proc mutex for eNB pre scd\n");
ru->proc.instance_pre_scd++;
+33 -33
View File
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
list_init(&test_pdu_rx_list, NULL);
logInit();
if (init_pdcp_entity(&pdcp_array[0]) == TRUE && init_pdcp_entity(&pdcp_array[1]) == TRUE)
if (init_pdcp_entity(&pdcp_array[0]) == true && init_pdcp_entity(&pdcp_array[1]) == true)
msg("[TEST] PDCP entity initialization OK\n");
else {
msg("[TEST] Cannot initialize PDCP entities!\n");
@@ -109,7 +109,7 @@ int main(int argc, char **argv)
/* Initialize PDCP state variables */
for (index = 0; index < 2; ++index) {
if (pdcp_init_seq_numbers(&pdcp_array[index]) == FALSE) {
if (pdcp_init_seq_numbers(&pdcp_array[index]) == false) {
msg("[TEST] Cannot initialize sequence numbers of PDCP entity %d!\n", index);
exit(1);
} else {
@@ -120,11 +120,11 @@ int main(int argc, char **argv)
#if TEST_RX_AND_TX_WINDOW
/* Test TX window */
if (test_tx_window() == FALSE)
if (test_tx_window() == false)
test_result = 1;
/* Test RX window */
if (test_rx_window() == FALSE)
if (test_rx_window() == false)
test_result = 1;
#endif
@@ -132,11 +132,11 @@ int main(int argc, char **argv)
#if TEST_PDCP_DATA_REQUEST_AND_INDICATION
/* Test pdcp_data_req() method in pdcp.c */
if (test_pdcp_data_req() == FALSE)
if (test_pdcp_data_req() == false)
test_result = 1;
/* Test pdcp_data_ind() method in pdcp.c */
if (test_pdcp_data_ind() == FALSE)
if (test_pdcp_data_ind() == false)
test_result = 1;
#endif
@@ -150,10 +150,10 @@ int main(int argc, char **argv)
return test_result;
}
BOOL init_pdcp_entity(pdcp_t *pdcp_entity)
bool init_pdcp_entity(pdcp_t *pdcp_entity)
{
if (pdcp_entity == NULL)
return FALSE;
return false;
/*
* Initialize sequence number state variables of relevant PDCP entity
@@ -171,10 +171,10 @@ BOOL init_pdcp_entity(pdcp_t *pdcp_entity)
pdcp_entity->next_pdcp_rx_sn, pdcp_entity->tx_hfn, pdcp_entity->rx_hfn, \
pdcp_entity->last_submitted_pdcp_rx_sn, pdcp_entity->seq_num_size);
return TRUE;
return true;
}
BOOL test_tx_window(void)
bool test_tx_window(void)
{
unsigned long index = 0;
@@ -185,33 +185,33 @@ BOOL test_tx_window(void)
msg("TX packet # %07lu seq # %04d hfn # %04d\n", index, pseudo_tx_sn, pdcp_array[0].tx_hfn);
else {
msg("TX packet is out-of-window!\n");
return FALSE;
return false;
}
}
return TRUE;
return true;
}
BOOL test_rx_window(void)
bool test_rx_window(void)
{
unsigned long index = 0;
for (index = 0; index < NUMBER_OF_TEST_PACKETS; ++index) {
u16 pseudo_rx_sn = (index == 0) ? 0 : index % WINDOW_SIZE;
if (pdcp_is_rx_seq_number_valid(pseudo_rx_sn, &pdcp_array[1]) == TRUE) {
if (pdcp_is_rx_seq_number_valid(pseudo_rx_sn, &pdcp_array[1]) == true) {
msg("RX packet # %07lu seq # %04d last-submitted # %04d hfn # %04d\n", \
index, pdcp_array[1].next_pdcp_rx_sn, pdcp_array[1].last_submitted_pdcp_rx_sn, pdcp_array[1].rx_hfn);
} else {
msg("RX packet seq # %04lu is not valid!\n", index);
return FALSE;
return false;
}
}
return TRUE;
return true;
}
BOOL test_pdcp_data_req(void)
bool test_pdcp_data_req(void)
{
unsigned char* pdcp_test_pdu_buffer = NULL;
unsigned char pdcp_test_pdu_buffer_size = DUMMY_BUFFER_SIZE + PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
@@ -224,7 +224,7 @@ BOOL test_pdcp_data_req(void)
if (pdcp_test_pdu_buffer == NULL) {
msg("Cannot allocate a buffer for test!\n");
return FALSE;
return false;
}
/*
@@ -241,7 +241,7 @@ BOOL test_pdcp_data_req(void)
/*
* Ask PDCP to create a PDU with given buffer and enqueue it to `test_pdu_tx_list`
*/
if (pdcp_data_req(0, 0, 10, DUMMY_BUFFER, &pdcp_array[0], &test_pdu_tx_list) == TRUE) {
if (pdcp_data_req(0, 0, 10, DUMMY_BUFFER, &pdcp_array[0], &test_pdu_tx_list) == true) {
msg("[TEST] Starting to dissect PDU created by PDCP...\n");
/*
@@ -251,7 +251,7 @@ BOOL test_pdcp_data_req(void)
if (pdcp_test_pdu_buffer_size == 0 ) {
msg("[TEST] PDU created by pdcp_data_req() is invalid!\n");
return FALSE;
return false;
}
/*
@@ -269,7 +269,7 @@ BOOL test_pdcp_data_req(void)
*/
if (pdcp_test_pdu_buffer[0] & 0x80) {
msg("[TEST] First bit is not 0, which means this is not a Data PDU!\n");
return FALSE;
return false;
} else {
msg("[TEST] First bit is 0 so this is a Data PDU, OK\n");
}
@@ -279,7 +279,7 @@ BOOL test_pdcp_data_req(void)
*/
if ((pdcp_test_pdu_buffer[0] & 0x70) != 0) {
msg("[TEST] Reserved bits are not 0!\n");
return FALSE;
return false;
} else {
msg("[TEST] Reserved bits are all 0, OK\n");
}
@@ -292,21 +292,21 @@ BOOL test_pdcp_data_req(void)
if (sequence_number != index % WINDOW_SIZE) {
msg("[TEST] Sequence numbers are out-of-order!\n");
return FALSE;
return false;
} else {
msg("[TEST] Sequence number is correct\n");
}
} else {
msg("[TEST] pdcp_data_req() returned FALSE!\n");
return FALSE;
return false;
}
}
return TRUE;
return true;
}
BOOL test_pdcp_data_ind(void)
bool test_pdcp_data_ind(void)
{
/*
* This is the list that pdcp_data_ind() takes to put pdcp_data_ind_header_t
@@ -341,9 +341,9 @@ BOOL test_pdcp_data_ind(void)
test_sdu = list_remove_head(&test_pdu_rx_list);
if (pdcp_data_ind(0, 0, test_sdu_size, test_sdu, &pdcp_array[0], &test_pdu_indication_list) == FALSE) {
if (pdcp_data_ind(0, 0, test_sdu_size, test_sdu, &pdcp_array[0], &test_pdu_indication_list) == false) {
msg("[TEST] pdcp_data_ind() failed to handle data indication!\n");
return FALSE;
return false;
} else {
msg("[TEST] pdcp_data_ind() succcessfuly handled data indication\n");
}
@@ -359,7 +359,7 @@ BOOL test_pdcp_data_ind(void)
if (test_data_ind_header == NULL) {
msg("[TEST] Data indication header is not valid!\n");
return FALSE;
return false;
} else {
pdcp_data_ind_header_t* indication_header = (pdcp_data_ind_header_t*)test_data_ind_header->data;
@@ -370,7 +370,7 @@ BOOL test_pdcp_data_ind(void)
msg("[TEST] Radio bearer ID is correct\n");
} else {
msg("[TEST] Radio bearer ID is not correct! (expected: 0, parsed: %d)\n", indication_header->rb_id);
return FALSE;
return false;
}
/*
@@ -380,7 +380,7 @@ BOOL test_pdcp_data_ind(void)
msg("[TEST] SDU size is correct\n");
} else {
msg("[TEST] SDU size is not correct! (expected: %d, parsed: %d)\n", DUMMY_BUFFER_SIZE, indication_header->data_size);
return FALSE;
return false;
}
/*
@@ -412,11 +412,11 @@ BOOL test_pdcp_data_ind(void)
print_byte_stream("[TEST] TXed data: ", DUMMY_BUFFER, DUMMY_BUFFER_SIZE);
print_byte_stream("[TEST] RXed data: ", (unsigned char*)&(test_data_ind_header->data[data_index]), DUMMY_BUFFER_SIZE);
return FALSE;
return false;
}
}
return TRUE;
return true;
}
+7 -7
View File
@@ -42,17 +42,17 @@ int pdcp_fifo_flush_sdus (void) { return 0; }
int pdcp_fifo_read_input_sdus_remaining_bytes (void) { return 0; }
int pdcp_fifo_read_input_sdus (void) { return 0; }
BOOL init_pdcp_entity(pdcp_t *pdcp_entity);
BOOL test_tx_window(void);
BOOL test_rx_window(void);
BOOL test_pdcp_data_req(void);
BOOL test_pdcp_data_ind(void);
bool init_pdcp_entity(pdcp_t *pdcp_entity);
bool test_tx_window(void);
bool test_rx_window(void);
bool test_pdcp_data_req(void);
bool test_pdcp_data_ind(void);
/*
* PDCP methods that are going to be utilised throughout the test
*/
extern BOOL pdcp_init_seq_numbers(pdcp_t* pdcp_entity);
extern bool pdcp_init_seq_numbers(pdcp_t* pdcp_entity);
extern u16 pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity);
extern BOOL pdcp_is_rx_seq_number_valid(u16 seq_num, pdcp_t* pdcp_entity);
extern bool pdcp_is_rx_seq_number_valid(u16 seq_num, pdcp_t* pdcp_entity);
#endif
+6 -6
View File
@@ -109,7 +109,7 @@ int pdcp_fifo_flush_sdus () {}
int pdcp_fifo_read_input_sdus_remaining_bytes () {}
int pdcp_fifo_read_input_sdus () {}
BOOL init_pdcp_entity(pdcp_t *pdcp_entity);
bool init_pdcp_entity(pdcp_t *pdcp_entity);
//-----------------------------------------------------------------------------
void pdcp_rlc_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_data_req *data_requestP, int* drop_countP, int *tx_packetsP, int* dropped_tx_packetsP) //-----------------------------------------------------------------------------
@@ -230,7 +230,7 @@ int main(int argc, char **argv)
pdcp_module_init();
logInit();
if (init_pdcp_entity(&pdcp_array[0][1]) == TRUE && init_pdcp_entity(&pdcp_array[1][1]) == TRUE)
if (init_pdcp_entity(&pdcp_array[0][1]) == true && init_pdcp_entity(&pdcp_array[1][1]) == true)
msg("PDCP entity initialization OK\n");
else {
msg("Cannot initialize PDCP entities!\n");
@@ -239,7 +239,7 @@ int main(int argc, char **argv)
/* Initialize PDCP state variables */
for (index = 0; index < 2; ++index) {
if (pdcp_init_seq_numbers(&pdcp_array[index][1]) == FALSE) {
if (pdcp_init_seq_numbers(&pdcp_array[index][1]) == false) {
msg("Cannot initialize %s PDCP entity!\n", ((index == 0) ? "first" : "second"));
exit(1);
}
@@ -275,11 +275,11 @@ int main(int argc, char **argv)
}
//-----------------------------------------------------------------------------
BOOL init_pdcp_entity(pdcp_t *pdcp_entity)
bool init_pdcp_entity(pdcp_t *pdcp_entity)
//-----------------------------------------------------------------------------
{
if (pdcp_entity == NULL)
return FALSE;
return false;
/*
* Initialize sequence number state variables of relevant PDCP entity
@@ -292,6 +292,6 @@ BOOL init_pdcp_entity(pdcp_t *pdcp_entity)
pdcp_entity->last_submitted_pdcp_rx_sn = 4095;
pdcp_entity->seq_num_size = 12;
return TRUE;
return true;
}