- Fix: avoid infinite loop on mulitcast read thread if no data to read

Pre-ci test passed

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4000 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Cedric Roux
2013-06-25 09:05:02 +00:00
commit 56c66c09aa
4111 changed files with 2133103 additions and 0 deletions
+141
View File
@@ -0,0 +1,141 @@
CC = gcc
SSE3PROC = $(shell echo `grep ssse3 /proc/cpuinfo`)
SSE4PROC = $(shell echo `grep sse4 /proc/cpuinfo`)
CPUFLAGS = -mmmx -msse -msse2 -m32 -mssse3 #-msse4
CPUFLAGS += $(shell if [ -z $$SSE3PROC]; then echo "" ; else echo "-mssse3"; fi)
CPUFLAGS += $(shell if [ -z $$SSE4PROC]; then echo "" ; else echo "-msse4"; fi)
cygwin = $(shell if [ $$OSTYPE = "cygwin" ] ; then echo "1" ; else echo "0" ; fi)
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3_TOP = $(OPENAIR3_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
EXE_FILE_NAME = test_pdcp_rlc
CFLAGS = -Wall -fno-strict-aliasing -DPHYSIM -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DMAX_MODULES=1 -g -ggdb $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
CFLAGS += -DOPENAIR_LTE -DOPENAIR2 #-DOFDMA_ULSCH -DIFFT_FPGA -DIFFT_FPGA_UE
CFLAGS += -I/usr/include/libxml2 -lxml2
#CFLAGS += -DXFORMS
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef NAS_NETLINK
CFLAGS += -DNAS_NETLINK -DLINUX -DDEBUG_CONTROL
endif
CFLAGS += -DPHY_ABSTRACTION #-DEMIT_ASN_DEBUG=1
CFLAGS += $(shell if [ $$OSTYPE = "cygwin" ] ; then echo "-DCYGWIN" ; fi)
#include $(OPENAIR1_DIR)/PHY/Makefile.inc
#include $(OPENAIR1_DIR)/SCHED/Makefile.inc
EXTRA_CFLAGS += -DOPENAIR2
EXTRA_CFLAGS += -DASSERT
EXTRA_CFLAGS += -DNO_RRM
COMMON_DIR = $(OPENAIR2_TOP)/COMMON
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v9.3.0
RLC_AM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/AM_v9.3.0
RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM
RLC_DIR = $(OPENAIR2_TOP)/LAYER2/RLC
PDCP_DIR = $(OPENAIR2_TOP)/LAYER2/PDCP_v10.1.0
MEM_DIR = $(OPENAIR2_TOP)/UTIL/MEM
LIST_DIR = $(OPENAIR2_TOP)/UTIL/LISTS
MATH_DIR = $(OPENAIR2_TOP)/UTIL/MATH
TIMER_DIR = $(OPENAIR2_TOP)/UTIL/TIMER
PHY_INTERFACE_DIR = $(OPENAIR2_TOP)/PHY_INTERFACE
RRC_DIR = $(OPENAIR2_TOP)/RRC/LITE
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
MAC_DIR = $(OPENAIR2_TOP)/LAYER2/MAC
LOG_DIR=$(OPENAIR2_TOP)/UTIL/LOG
OCG_DIR=$(OPENAIR2_TOP)/UTIL/OCG
OPT_DIR=$(OPENAIR2_TOP)/UTIL/OPT
SOURCES_L2 = $(LIST_DIR)/list.c
SOURCES_L2 += $(LIST_DIR)/list2.c
SOURCES_L2 += $(PDCP_DIR)/pdcp.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_primitives.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_sequence_manager.c
SOURCES_L2 += $(RLC_DIR)/rlc_mac.c
SOURCES_L2 += $(RLC_DIR)/rlc.c
SOURCES_L2 += $(RLC_DIR)/rlc_rrc.c
SOURCES_L2 += $(RLC_DIR)/rlc_mpls.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_control_primitives.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_dar.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_fsm.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_reassembly.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_receiver.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_segment.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_test.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_init.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_poll_retransmit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_reordering.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_status_prohibit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_segment.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_segments_holes.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_in_sdu.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_receiver.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_retransmit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_windows.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_rx_list.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_reassembly.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_status_report.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_control_primitives.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_fsm.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_segment.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_reassembly.c
SOURCES_L2 += $(MEM_DIR)/mem_block.c
LOG_OBJS = $(LOG_DIR)/log.o
OPT_OBJS = $(OPT_DIR)/probe.o
L2_OBJS=$(addsuffix .o,$(basename $(SOURCES_L2))) $(PHY_INTERFACE_OBJS) $(MAC_OBJS) $(L2_INTERFACE_OBJS) $(RRC_OBJS) $(LOG_OBJS) $(OPT_OBJS)
L2_incl = -I$(OPENAIR2_TOP) -I$(COMMON_DIR) -I$(RLC_DIR) -I$(RLC_AM_DIR) -I$(RLC_UM_DIR) -I$(RLC_TM_DIR) -I$(PDCP_DIR) -I$(MEM_DIR) -I$(LIST_DIR) \
-I$(LOG_DIR) -I$(MATH_DIR) -I$(TIMER_DIR) -I$(OPENAIR3)/MESH -I$(OPENAIR2_TOP)/RRC/MESH -I$(OPENAIR2_TOP)/RRC/MESH/MESSAGES -I$(OPENAIR3)/MESH/RRM -I$(OPT_DIR) \
-I$(OCG_DIR)
ASN1_MSG_OBJS2 := $(foreach file, $(ASN1_MSG_OBJS), $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/$(file))
# Define object file directory for RLM code
#RLC_OBJ_DIR = $(RLC_DIR)/*.o $(RLC_AM_DIR)/*.o $(RLC_UM_DIR)/*.o $(RLC_TM_DIR)/*.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(ASN1_MSG_OBJS2) $(RLC_OBJ_DIR)
all: build_test_pdcp_rlc
$(OBJ) : %.o : %.c
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o $@ $<
$(L2_OBJS) : %.o : %.c
$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -DMAC_CONTEXT=1 -DPHY_CONTEXT=1 -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o $@ $<
build_test_pdcp_rlc : $(OBJ) $(L2_OBJS) test_pdcp_rlc.c
echo CYGWIN variable is $(cygwin)
$(CC) test_pdcp_rlc.c -I$(TOP_DIR) $(L2_incl) -I$(ASN1_MSG_INC) -o $(EXE_FILE_NAME) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(L2_OBJS) -lm -lcurses
clean:
rm -f test_pdcp_rlc
rm -f *.o
+59
View File
@@ -0,0 +1,59 @@
#----------------------------------------------------------------------------------------------------------------
The aim of the test code test_pdcp_rlc.c is primarily to test a PDCP protocol entity integrated with RLC layer.
This is a first step, in near future, this test may be extended with an other type of RLC (AM), and may be
integrated with the upcoming traffic generator.
#----------------------------------------------------------------------------------------------------------------
The code implements the following figure:
#----------------------------------------------------------------------------------------------------------------
+-+-+-+-+ +-+-+-+-+
| PDCP1 | | PDCP2 |
+-+-+-+-+ +-+-+-+-+
| |
+-+-+-+-+ +-+-+-+-+
| RLC1 | | RLC2 |
| UM | | UM |
+-+-+-+-+ +-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MAC LAYER EMULATION |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
#----------------------------------------------------------------------------------------------------------------
Compilation of the code:
#----------------------------------------------------------------------------------------------------------------
make -f Makefile.data_bearer
#----------------------------------------------------------------------------------------------------------------
Execution of the code:
#----------------------------------------------------------------------------------------------------------------
./test_pdcp_rlc
#----------------------------------------------------------------------------------------------------------------
What Could Be Frequently Asked Questions:
#----------------------------------------------------------------------------------------------------------------
#-------------------
Q:How to send a SDU?
A:
pdcp_rlc_test_send_sdu(0, 1, 2); // prototype pdcp_rlc_test_send_sdu(module_id_t module_idP, rb_id_t rab_idP, int sdu_indexP)
#-------------------
Q:How to fix the bitrate of the radio bearer?
A:
pdcp_rlc_test_exchange_pdus(&rlc[0].m_rlc_um_array[rlc[0].m_rlc_pointer[1].rlc_index],
&rlc[1].m_rlc_um_array[rlc[1].m_rlc_pointer[1].rlc_index],
1000,
1000);
Prototype:
pdcp_rlc_test_exchange_pdus(rlc_um_entity_t *um1P, // RLC UM instance 1
rlc_um_entity_t *um2P, // RLC UM instance 2
u16_t bytes_tx1P, // tx bytes requested at RLC UM instance 1 and sent to RLC UM instance 2
u16_t bytes_tx2P) // tx bytes requested at RLC UM instance 2 and sent to RLC UM instance 1
+270
View File
@@ -0,0 +1,270 @@
#define PDCP_C
#include <string.h>
#include <math.h>
#include <unistd.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/vars.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "RRC/LITE/vars.h"
#include "PHY_INTERFACE/vars.h"
#include "UTIL/OCG/OCG.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "OCG_vars.h"
#include "rlc.h"
#include "pdcp.h"
#define TEST_MAX_SEND_SDU 8192
#define TARGET_MAX_RX_ERROR_RATE 10
#define TARGET_MAX_TX_ERROR_RATE 10
static int g_error_on_phy = 0;
static int g_random_sdu;
static int g_random_nb_frames;
static int g_random_tx_pdu_size;
static int g_random_rx_pdu_size;
static int g_target_tx_error_rate;
static int g_target_rx_error_rate;
static int g_tx_packets = 0;
static int g_dropped_tx_packets = 0;
static int g_rx_packets = 0;
static int g_dropped_rx_packets = 0;
static int g_drop_rx = 0;
static int g_drop_tx = 0;
static int g_send_sdu_ids[TEST_MAX_SEND_SDU][2];
static int g_send_id_write_index[2];
static int g_send_id_read_index[2];
static s8_t *g_sdus[] = {"En dépit de son volontarisme affiché, le premier ministre est de plus en plus décrié pour son incompétence. La tension politique et dans l'opinion publique est encore montée d'un cran au Japon, sur fond d'inquiétantes nouvelles, avec du plutonium détecté dans le sol autour de la centrale de Fukushima. Le premier ministre Naoto Kan a solennellement déclaré que son gouvernement était «en état d'alerte maximum». Tout en reconnaissant que la situation restait «imprévisible». Ce volontarisme affiché par le premier ministre - que Nicolas Sarkozy rencontrera demain lors d'une visite au Japon - ne l'a pas empêché d'être la cible de violentes critiques de la part de parlementaires sur sa gestion de la crise. Attaqué sur le manque de transparence, il a assuré qu'il rendait publiques toutes les informations en sa possession. Un député de l'opposition, Yosuke Isozaki, a aussi reproché à Naoto Kan de ne pas avoir ordonné l'évacuation des populations dans la zone comprise entre 20 et 30 km autour de la centrale. «Peut-il y avoir quelque chose de plus irresponsable que cela ?», a-t-il lancé. Pour l'heure, la zone d'évacuation est limitée à un rayon de 20 km, seul le confinement étant recommandé pour les 10 km suivants. Sur ce sujet, les autorités japonaises ont été fragilisées mardi par les déclarations de Greenpeace, affirmant que ses experts avaient détecté une radioactivité dangereuse à 40 km de la centrale. L'organisation écologiste a appelé à une extension de la zone d'évacuation, exhortant Tokyo à «cesser de privilégier la politique aux dépens de la science». L'Agence japonaise de sûreté nucléaire a balayé ces critiques.",
"La pâquerette (Bellis perennis) est une plante vivace des prés, des pelouses, des bords de chemins et des prairies, haute de dix à vingt centimètres, de la famille des Astéracées, dont les fleurs naissent sur des inflorescences appelées capitules : celles du pourtour, que l'on croit à tort être des pétales, appelées fleurs ligulées, parce qu'elles ont la forme d'une languette, ou demi-fleurons, sont des fleurs femelles, dont la couleur varie du blanc au rose plus ou moins prononcé ; celles du centre, jaunes, appelées fleurs tubuleuses, parce que leur corolle forme un tube, ou fleurons, sont hermaphrodites. Ainsi, contrairement à l'opinion populaire, ce qu'on appelle une « fleur » de pâquerette n'est en réalité pas « une » fleur mais un capitule portant des fleurs très nombreuses.Leurs fruits s'envolent grâce au vent et dégagent des odeurs qui attirent les insectes.Une variété muricole peut pousser sur des murs humides verticaux.Les pâquerettes sont des fleurs rustiques et très communes en Europe, sur les gazons, les prairies, les chemins et les zones d'herbe rase.Elles ont la particularité, comme certaines autres fleurs de plantes herbacées, de se fermer la nuit et de s'ouvrir le matin pour s'épanouir au soleil ; elles peuvent aussi se fermer pendant les averses, voire un peu avant, ce qui permet dans les campagnes de prédire la pluie légèrement à l'avance.",
"La pâquerette",
" (Bellis perennis)",
" est une plante vivace des prés,",
" des pelouses,",
" des bords de chemins et des prairies,",
"haute de dix à",
" vingt centimètres",
", de la",
" famille des",
" Astéracées",
", dont",
" les",
" fleurs",
" naissent",
" sur",
" des",
" inflorescences",
" appelées",
" capitules",
" : celles",
" du pourtour",
", que l'on",
" croit à",
" tort",
" être",
" des pétales",
", appelées",
" fleurs ligulées",
", parce qu'elles",
" ont la forme d'une languette, ou demi-fleurons, sont",
" des fleurs femelles,",
" dont la couleur varie du blanc au rose plus ou moins prononcé ; celles du centre, jaunes,",
" appelées ",
"fleurs tubuleuses",
", parce que leur corolle forme un tube, ou fleurons, sont hermaphrodites."
};
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);
//-----------------------------------------------------------------------------
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) //-----------------------------------------------------------------------------
{
mem_block_t* tb_src;
mem_block_t* tb_dst;
unsigned int tb_size;
data_indP->no_tb = 0;
while (data_requestP->data.nb_elements > 0) {
tb_src = list_remove_head (&data_requestP->data);
if (tb_src != NULL) {
tb_size = ((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits >> 3;
printf("[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %d sizeof (mac_rlc_max_rx_header_size_t) %d\n",
((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits,
tb_size, sizeof (mac_rlc_max_rx_header_size_t));
*tx_packetsP = *tx_packetsP + 1;
if (*drop_countP == 0) {
tb_dst = get_free_mem_block(sizeof (mac_rlc_max_rx_header_size_t) + tb_size);
if (tb_dst != NULL) {
((struct mac_tb_ind *) (tb_dst->data))->first_bit = 0;
((struct mac_tb_ind *) (tb_dst->data))->data_ptr = &tb_dst->data[sizeof (mac_rlc_max_rx_header_size_t)];
((struct mac_tb_ind *) (tb_dst->data))->size = tb_size;
((struct mac_tb_ind *) (tb_dst->data))->error_indication = 0;
memcpy(((struct mac_tb_ind *) (tb_dst->data))->data_ptr,
&((struct mac_tb_req *) (tb_src->data))->data_ptr[0],
tb_size);
list_add_tail_eurecom(tb_dst, &data_indP->data);
data_indP->no_tb += 1;
} else {
printf("Out of memory error\n");
exit(-1);
}
} else {
printf("[RLC-LOOP] DROPPING 1 TB\n");
*drop_countP = *drop_countP - 1;
*dropped_tx_packetsP = *dropped_tx_packetsP + 1;
}
free_mem_block(tb_src);
if (data_indP->no_tb > 0) {
printf("[RLC-LOOP] Exchange %d TBs\n",data_indP->no_tb);
}
}
}
}
//-----------------------------------------------------------------------------
void pdcp_rlc_test_exchange_pdus(rlc_um_entity_t *um_txP,
rlc_um_entity_t *um_rxP,
u16_t bytes_txP,
u16_t bytes_rxP)
//-----------------------------------------------------------------------------
{
struct mac_data_req data_request_tx;
struct mac_data_req data_request_rx;
struct mac_data_ind data_ind_tx;
struct mac_data_ind data_ind_rx;
struct mac_status_ind tx_status;
struct mac_status_resp mac_rlc_status_resp_tx;
struct mac_status_resp mac_rlc_status_resp_rx;
memset(&data_request_tx, 0, sizeof(struct mac_data_req));
memset(&data_request_rx, 0, sizeof(struct mac_data_req));
memset(&data_ind_tx, 0, sizeof(struct mac_data_ind));
memset(&data_ind_rx, 0, sizeof(struct mac_data_ind));
memset(&tx_status, 0, sizeof(struct mac_status_ind));
memset(&mac_rlc_status_resp_tx, 0, sizeof(struct mac_status_resp));
memset(&mac_rlc_status_resp_rx, 0, sizeof(struct mac_status_resp));
mac_rlc_status_resp_tx = rlc_um_mac_status_indication(um_txP, bytes_txP, tx_status);
data_request_tx = rlc_um_mac_data_request(um_txP);
mac_rlc_status_resp_rx = rlc_um_mac_status_indication(um_rxP, bytes_rxP, tx_status);
data_request_rx = rlc_um_mac_data_request(um_rxP);
pdcp_rlc_test_mac_rlc_loop(&data_ind_rx, &data_request_tx, &g_drop_tx, &g_tx_packets, &g_dropped_tx_packets);
pdcp_rlc_test_mac_rlc_loop(&data_ind_tx, &data_request_rx, &g_drop_rx, &g_rx_packets, &g_dropped_rx_packets);
rlc_um_mac_data_indication(um_rxP, data_ind_rx);
rlc_um_mac_data_indication(um_txP, data_ind_tx);
mac_xface->frame += 1;
//rlc_um_tx_buffer_display(um_txP,NULL);
//assert(um_txP->t_status_prohibit.time_out != 1);
//assert(um_rxP->t_status_prohibit.time_out != 1);
//assert(!((um_txP->vt_a == 954) && (um_txP->vt_us == 53)));
//assert(mac_xface->frame <= 151);
//check_mem_area(NULL);
//display_mem_load();
}
//-----------------------------------------------------------------------------
void pdcp_rlc_test_send_sdu(module_id_t module_idP, rb_id_t rab_idP, int sdu_indexP)
//-----------------------------------------------------------------------------
{
pdcp_data_req(module_idP, rab_idP, strlen(g_sdus[sdu_indexP]) + 1, g_sdus[sdu_indexP]);
}
//-----------------------------------------------------------------------------
int main(int argc, char **argv)
//-----------------------------------------------------------------------------
{
unsigned long index = 0;
rlc_op_status_t rlc_op_status;
rlc_info_t rlc_info;
char * g_log_level = "trace"; // by default global log level is set to trace
mac_xface = malloc(sizeof(MAC_xface));
Mac_rlc_xface = (MAC_RLC_XFACE*)malloc16(sizeof(MAC_RLC_XFACE));
rlc_module_init ();
pdcp_module_init();
logInit();
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");
return 1;
}
/* Initialize PDCP state variables */
for (index = 0; index < 2; ++index) {
if (pdcp_init_seq_numbers(&pdcp_array[index][1]) == FALSE) {
msg("Cannot initialize %s PDCP entity!\n", ((index == 0) ? "first" : "second"));
exit(1);
}
}
/* Configure RLCs */
rlc_info.rlc_mode = RLC_UM;
rlc_info.rlc.rlc_um_info.timer_reordering = 20;
rlc_info.rlc.rlc_um_info.sn_field_length = 10;
rlc_info.rlc.rlc_um_info.is_mXch = 0;
rlc_op_status = rrc_rlc_config_req (0, ACTION_ADD, 1, RADIO_ACCESS_BEARER, rlc_info);
assert(rlc_op_status == RLC_OP_STATUS_OK);
rlc_op_status = rrc_rlc_config_req (1, ACTION_ADD, 1, RADIO_ACCESS_BEARER, rlc_info);
assert(rlc_op_status == RLC_OP_STATUS_OK);
/* Simulate data traffic */
pdcp_rlc_test_send_sdu(0, 1, 2);
pdcp_rlc_test_exchange_pdus(&rlc[0].m_rlc_um_array[rlc[0].m_rlc_pointer[1].rlc_index],
&rlc[1].m_rlc_um_array[rlc[1].m_rlc_pointer[1].rlc_index],
1000,
1000);
pdcp_rlc_test_exchange_pdus(&rlc[1].m_rlc_um_array[rlc[1].m_rlc_pointer[1].rlc_index],
&rlc[0].m_rlc_um_array[rlc[0].m_rlc_pointer[1].rlc_index],
1000,
1000);
return 0;
}
//-----------------------------------------------------------------------------
BOOL init_pdcp_entity(pdcp_t *pdcp_entity)
//-----------------------------------------------------------------------------
{
if (pdcp_entity == NULL)
return FALSE;
/*
* Initialize sequence number state variables of relevant PDCP entity
*/
pdcp_entity->next_pdcp_tx_sn = 0;
pdcp_entity->next_pdcp_rx_sn = 0;
pdcp_entity->tx_hfn = 0;
pdcp_entity->rx_hfn = 0;
/* SN of the last PDCP SDU delivered to upper layers */
pdcp_entity->last_submitted_pdcp_rx_sn = 4095;
pdcp_entity->seq_num_size = 12;
return TRUE;
}