Merge branch 'develop' into ldpc_offload_t1_mr

Conflicts:
	openair1/SCHED_NR/phy_procedures_nr_gNB.c
This commit is contained in:
Hongzhi Wang
2022-08-18 17:38:55 +02:00
476 changed files with 11215 additions and 128419 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
*/
+10 -6
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;
@@ -675,7 +675,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
}
if (samples_received == nsamps) s->wait_for_first_pps=0;
// bring RX data into 12 LSBs for softmodem RX
// bring RX data into 12 LSBs for softmodem RX
for (int i=0; i<cc; i++) {
#if defined(__x86_64__) || defined(__i386__)
@@ -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;
@@ -22,7 +22,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,9 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
min_rxtxtime = 6;
servingCellConfigCommon = (
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -20,8 +20,6 @@ gNBs =
tr_s_preference = "local_mac"
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -20,8 +20,6 @@ gNBs =
tr_s_preference = "local_mac"
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{
#spCellConfigCommon
@@ -20,8 +20,6 @@ gNBs =
tr_s_preference = "local_mac"
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{
@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
@@ -44,7 +44,6 @@ gNBs =
local_s_portd = 2152;
remote_s_portc = 500;
remote_s_portd = 2152;
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
@@ -36,7 +36,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
@@ -36,7 +36,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
servingCellConfigCommon = (
{
@@ -28,9 +28,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 2;
do_CSIRS = 1;
do_SRS = 1;
pdcch_ConfigSIB1 = (
@@ -342,4 +339,7 @@ log_config :
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
<<<<<<< HEAD
=======
>>>>>>> origin/develop
@@ -32,9 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
@@ -28,7 +28,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_N1 = 2;
pusch_AntennaPorts = 2;
do_CSIRS = 1;
@@ -266,6 +265,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
#pusch_TargetSNRx10 = 150;
#pucch_TargetSNRx10 = 200;
ul_prbblack_SNR_threshold = 10;
ulsch_max_frame_inactivity = 0;
}
);
@@ -32,10 +32,9 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 4;
pdsch_AntennaPorts_XP = 2;
pdsch_AntennaPorts_N1 = 2;
pusch_AntennaPorts = 4;
sib1_tda = 0;
pdcch_ConfigSIB1 = (
{
@@ -73,15 +72,6 @@ gNBs =
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 12;
initialDLBWPsearchSpaceZero = 0;
#pdsch-ConfigCommon
#pdschTimeDomainAllocationList (up to 16 entries)
initialDLBWPk0_0 = 0; #for DL slot
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
initialDLBWPk0_1 = 0; #for mixed slot
initialDLBWPmappingType_1 = 0;
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
#uplinkConfigCommon
#frequencyInfoUL
@@ -136,19 +126,6 @@ gNBs =
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
# pusch-ConfigCommon (up to 16 elements)
initialULBWPk2_0 = 6; # used for UL slot
initialULBWPmappingType_0 = 1
initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
initialULBWPk2_1 = 6; # used for mixed slot
initialULBWPmappingType_1 = 1;
initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
initialULBWPk2_2 = 7; # used for Msg.3 during RA
initialULBWPmappingType_2 = 1;
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
@@ -28,7 +28,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 2;
do_CSIRS = 1;
do_SRS = 1;
@@ -264,6 +263,7 @@ MACRLCs = (
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
ul_prbblack_SNR_threshold = 10;
ulsch_max_frame_inactivity = 0;
}
);
@@ -30,7 +30,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdcch_ConfigSIB1 = (
{
@@ -27,7 +27,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 1;
pusch_AntennaPorts = 2;
do_CSIRS = 0;
@@ -27,7 +27,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 1;
pusch_AntennaPorts = 2;
do_CSIRS = 0;
@@ -318,4 +317,4 @@ log_config :
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
};
@@ -32,9 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 15;
min_rxtxtime = 6;
@@ -27,7 +27,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 1;
pusch_AntennaPorts = 2;
do_CSIRS = 0;
@@ -318,4 +317,4 @@ log_config :
rrc_log_level ="info";
ngap_log_level ="debug";
f1ap_log_level ="debug";
};
};
+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++;
+4 -4
View File
@@ -89,7 +89,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,int br_flag);
void stop_RU(RU_t **rup,int nb_ru);
void do_ru_synch(RU_t *ru);
static void do_ru_synch(RU_t *ru);
void configure_ru(int idx,
void *arg);
@@ -1059,7 +1059,7 @@ int wakeup_synch(RU_t *ru) {
}
void do_ru_synch(RU_t *ru) {
static void do_ru_synch(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_proc_t *proc = &ru->proc;
int rxs, ic, ret, i;
@@ -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++;
@@ -1924,7 +1924,7 @@ static void *ru_thread( void *param ) {
// This thread run the initial synchronization like a UE
void *ru_thread_synch(void *arg) {
static void *ru_thread_synch(void *arg) {
RU_t *ru = (RU_t *)arg;
__attribute__((unused))
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
+16 -1
View File
@@ -29,6 +29,7 @@
#include "flexran_agent.h"
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "targets/ARCH/COMMON/common_lib.h"
#include "executables/softmodem-common.h"
@@ -213,5 +214,19 @@ extern void init_UE_standalone_thread(int ue_idx);
extern PHY_VARS_UE *init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
extern void init_bler_table(void);
void feptx_ofdm_2thread(RU_t *ru,
int frame,
int subframe);
void* ru_thread_control( void* param );
void wait_eNBs(void);
void kill_feptx_thread(RU_t *ru);
void init_fep_thread(RU_t *ru, pthread_attr_t *attr_fep);
void init_feptx_thread(RU_t *ru, pthread_attr_t *attr_feptx);
void fep_full(RU_t *ru, int subframe);
void configure_ru(int, void *arg);
void configure_rru(int, void *arg);
void ru_fep_full_2thread(RU_t *ru,int subframe);
void feptx_ofdm(RU_t*ru, int frame_tx, int tti_tx);
void feptx_prec(struct RU_t_s *ru, int frame_tx, int tti_tx);
void fill_rf_config(RU_t *ru, char *rf_config_file);
#endif
-1
View File
@@ -176,7 +176,6 @@ extern char uecap_xer[1024];
char uecap_xer_in=0;
int oaisim_flag=0;
//threads_t threads= {-1,-1,-1,-1,-1,-1,-1,-1};
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
+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;
}