Commit e7921f03 authored by Lionel Gauthier's avatar Lionel Gauthier

Changed default DRB id from 3 to 1

With folowwing implicit rule
drb id = x => correspondind lc id = x+2, eps bearer id = x+4

Changed RLC inner structs, no more statically allocated array, now it is dynamic via malloc and collection of RLC entities are stored in a hashtable.
Changed misc simple types
Started compiling with all warning setted and treated as errors, still working on RLC and around...
Add const qualifier wherever suitable (for example param frame, module id, const pointers, etc)

Thinking about a type of context parameter in procedure calls in L2 data plane (modules id, frame, srb flag, enb flag, etc)...


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5222 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4b95c852
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#include <stddef.h> #include <stddef.h>
typedef size_t hash_size_t; typedef size_t hash_size_t;
typedef uint64_t hash_key_t;
#define HASHTABLE_QUESTIONABLE_KEY_VALUE ((uint64_t)-1)
typedef enum hashtable_return_code_e { typedef enum hashtable_return_code_e {
HASH_TABLE_OK = 0, HASH_TABLE_OK = 0,
...@@ -18,7 +21,7 @@ typedef enum hashtable_return_code_e { ...@@ -18,7 +21,7 @@ typedef enum hashtable_return_code_e {
typedef struct hash_node_s { typedef struct hash_node_s {
uint64_t key; hash_key_t key;
void *data; void *data;
struct hash_node_s *next; struct hash_node_s *next;
} hash_node_t; } hash_node_t;
...@@ -27,19 +30,19 @@ typedef struct hash_table_s { ...@@ -27,19 +30,19 @@ typedef struct hash_table_s {
hash_size_t size; hash_size_t size;
hash_size_t num_elements; hash_size_t num_elements;
struct hash_node_s **nodes; struct hash_node_s **nodes;
hash_size_t (*hashfunc)(const uint64_t); hash_size_t (*hashfunc)(const hash_key_t);
void (*freefunc)(void*); void (*freefunc)(void*);
} hash_table_t; } hash_table_t;
char* hashtble_rc_code2string(hashtable_rc_t rcP); char* hashtble_rc_code2string(hashtable_rc_t rcP);
void hash_free_int_func(void* memoryP); void hash_free_int_func(void* memoryP);
hash_table_t *hashtable_create (hash_size_t size, hash_size_t (*hashfunc)(const uint64_t ), void (*freefunc)(void*)); hash_table_t *hashtable_create (hash_size_t size, hash_size_t (*hashfunc)(const hash_key_t ), void (*freefunc)(void*));
hashtable_rc_t hashtable_destroy(hash_table_t *hashtbl); hashtable_rc_t hashtable_destroy(hash_table_t *hashtbl);
hashtable_rc_t hashtable_is_key_exists (hash_table_t *hashtbl, const uint64_t key); hashtable_rc_t hashtable_is_key_exists (hash_table_t *hashtbl, const uint64_t key);
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *hashtblP, void funct(uint64_t keyP, void* dataP, void* parameterP), void* parameterP); hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *hashtblP, void funct(hash_key_t keyP, void* dataP, void* parameterP), void* parameterP);
hashtable_rc_t hashtable_insert (hash_table_t *hashtbl, const uint64_t key, void *data); hashtable_rc_t hashtable_insert (hash_table_t *hashtbl, const hash_key_t key, void *data);
hashtable_rc_t hashtable_remove (hash_table_t *hashtbl, const uint64_t key); hashtable_rc_t hashtable_remove (hash_table_t *hashtbl, const hash_key_t key);
hashtable_rc_t hashtable_get (hash_table_t *hashtbl, const uint64_t key, void **dataP); hashtable_rc_t hashtable_get (hash_table_t *hashtbl, const hash_key_t key, void **dataP);
hashtable_rc_t hashtable_resize (hash_table_t *hashtbl, hash_size_t size); hashtable_rc_t hashtable_resize (hash_table_t *hashtbl, hash_size_t size);
......
...@@ -109,7 +109,7 @@ struct mac_tx_tb_management { ...@@ -109,7 +109,7 @@ struct mac_tx_tb_management {
unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc. unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc.
// Previously designed for interlayers optimizations, (avoid aligning on byte boundary) // Previously designed for interlayers optimizations, (avoid aligning on byte boundary)
// but not used by L1 !, so extra cost for alignement in MAC. // but not used by L1 !, so extra cost for alignement in MAC.
unsigned short tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte tb_size_t tb_size_in_bits; // L1H does not care of the field first bit any more, so in order to byte
// align the tb we have to know its size // align the tb we have to know its size
// for reporting tx status to upper layers // for reporting tx status to upper layers
...@@ -123,8 +123,8 @@ struct mac_tx_tb_management { ...@@ -123,8 +123,8 @@ struct mac_tx_tb_management {
struct mac_rx_tb_management { struct mac_rx_tb_management {
unsigned char *data_ptr; unsigned char *data_ptr;
unsigned short tb_size; // in bits tb_size_t tb_size; // in bits
unsigned char valid_checksum; boolean_t valid_checksum;
unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc unsigned char first_bit; // 0 if data starts on byte boundary(b7), 1 if b6, 2 if b5, etc
}; };
...@@ -132,7 +132,7 @@ struct mac_tb_req { ...@@ -132,7 +132,7 @@ struct mac_tb_req {
// BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management // BE CAREFULL TO KEEP THE SAME MAPPING FOR THE 6 FIELDS BELLOW AS FOR struct mac_tx_tb_management
unsigned char *data_ptr; unsigned char *data_ptr;
unsigned char first_bit; unsigned char first_bit;
unsigned short tb_size; tb_size_t tb_size;
// align the tb we have to know its size // align the tb we have to know its size
// for reporting tx status to upper layers // for reporting tx status to upper layers
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#define MAX_MANAGED_ENB_PER_MOBILE 2 #define MAX_MANAGED_ENB_PER_MOBILE 2
#define DEFAULT_RAB_ID 3 #define DEFAULT_RAB_ID 1
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */ #define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if defined(Rel10) #if defined(Rel10)
......
...@@ -26,11 +26,12 @@ typedef signed char boolean_t; ...@@ -26,11 +26,12 @@ typedef signed char boolean_t;
#define FALSE (boolean_t)0x00 #define FALSE (boolean_t)0x00
#endif #endif
#define BOOL_NOT(b) (b^TRUE)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// GENERIC ACCESS STRATUM TYPES // GENERIC ACCESS STRATUM TYPES
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
typedef uint16_t sdu_size_t; typedef int32_t sdu_size_t;
typedef int16_t sdu_ssize_t;
typedef uint32_t frame_t; typedef uint32_t frame_t;
typedef int32_t sframe_t; typedef int32_t sframe_t;
typedef uint32_t sub_frame_t; typedef uint32_t sub_frame_t;
...@@ -74,8 +75,8 @@ typedef unsigned int crc_t; ...@@ -74,8 +75,8 @@ typedef unsigned int crc_t;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// MAC TYPES // MAC TYPES
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
typedef unsigned int tbs_size_t; typedef sdu_size_t tbs_size_t;
typedef unsigned int tb_size_t; typedef sdu_size_t tb_size_t;
typedef unsigned int logical_chan_id_t; typedef unsigned int logical_chan_id_t;
typedef unsigned int num_tb_t; typedef unsigned int num_tb_t;
...@@ -87,7 +88,7 @@ typedef unsigned int confirm_t; ...@@ -87,7 +88,7 @@ typedef unsigned int confirm_t;
typedef unsigned int rlc_tx_status_t; typedef unsigned int rlc_tx_status_t;
typedef int16_t rlc_sn_t; typedef int16_t rlc_sn_t;
typedef uint16_t rlc_usn_t; typedef uint16_t rlc_usn_t;
typedef uint32_t rlc_buffer_occupancy_t; typedef int32_t rlc_buffer_occupancy_t;
typedef signed int rlc_op_status_t; typedef signed int rlc_op_status_t;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -6,10 +6,8 @@ EXTRA_CFLAGS += -DNO_RRM ...@@ -6,10 +6,8 @@ EXTRA_CFLAGS += -DNO_RRM
COMMON_DIR = $(OPENAIR2_TOP)/COMMON COMMON_DIR = $(OPENAIR2_TOP)/COMMON
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
#RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v6.1.0_LITE
RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v9.3.0 RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v9.3.0
RLC_AM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/AM_v9.3.0 RLC_AM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/AM_v9.3.0
#RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM
RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM_v9.3.0 RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM_v9.3.0
RLC_DIR = $(OPENAIR2_TOP)/LAYER2/RLC RLC_DIR = $(OPENAIR2_TOP)/LAYER2/RLC
PDCP_DIR = $(OPENAIR2_TOP)/LAYER2/PDCP_v10.1.0 PDCP_DIR = $(OPENAIR2_TOP)/LAYER2/PDCP_v10.1.0
...@@ -47,10 +45,6 @@ SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_status_report.c ...@@ -47,10 +45,6 @@ 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.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_init.c SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_init.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 += $(RLC_UM_DIR)/rlc_um.c SOURCES_L2 += $(RLC_UM_DIR)/rlc_um.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_fsm.c SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_fsm.c
...@@ -96,7 +90,6 @@ MAC_OBJS += $(MAC_DIR)/config.o ...@@ -96,7 +90,6 @@ MAC_OBJS += $(MAC_DIR)/config.o
L2_INTERFACE_OBJS = $(L2_INTERFACE_DIR)/openair_rrc_L2_interface.o L2_INTERFACE_OBJS = $(L2_INTERFACE_DIR)/openair_rrc_L2_interface.o
L2_OBJS=$(addsuffix .o,$(basename $(SOURCES_L2))) $(PHY_INTERFACE_OBJS) $(MAC_OBJS) $(L2_INTERFACE_OBJS) L2_OBJS=$(addsuffix .o,$(basename $(SOURCES_L2))) $(PHY_INTERFACE_OBJS) $(MAC_OBJS) $(L2_INTERFACE_OBJS)
#$(OPT_OBJS)
L2_incl = -I$(OPENAIR2_TOP) L2_incl = -I$(OPENAIR2_TOP)
L2_incl += -I$(COMMON_DIR) L2_incl += -I$(COMMON_DIR)
......
...@@ -317,26 +317,20 @@ pdcp_fifo_read_input_sdus () ...@@ -317,26 +317,20 @@ pdcp_fifo_read_input_sdus ()
// if remaining bytes to read // if remaining bytes to read
if (pdcp_fifo_read_input_sdus_remaining_bytes () > 0) { if (pdcp_fifo_read_input_sdus_remaining_bytes () > 0) {
// all bytes that had to be read for a SDU were read // all bytes that had to be read for a SDU were read
// if not overflow of list, try to get new sdus from rt fifo // if not overflow of list, try to get new sdus from rt fifo
cont = 1; cont = 1;
while (cont > 0) { while (cont > 0) {
bytes_read = rtf_get (NAS2PDCP_FIFO, bytes_read = rtf_get (NAS2PDCP_FIFO,
&(((uint8_t *) & pdcp_input_header)[pdcp_input_index_header]), &(((uint8_t *) & pdcp_input_header)[pdcp_input_index_header]),
sizeof (pdcp_data_req_header_t) - pdcp_input_index_header); sizeof (pdcp_data_req_header_t) - pdcp_input_index_header);
if (bytes_read > 0) { if (bytes_read > 0) {
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
msg("[PDCP_FIFOS] TTI %d Read %d Bytes of data (header %d) from Nas_mesh\n", msg("[PDCP_FIFOS] TTI %d Read %d Bytes of data (header %d) from Nas_mesh\n",
Mac_rlc_xface->frame, Mac_rlc_xface->frame,
bytes_read, bytes_read,
sizeof(pdcp_data_req_header_t)); sizeof(pdcp_data_req_header_t));
#endif // PDCP_DEBUG #endif
pdcp_input_index_header += bytes_read; pdcp_input_index_header += bytes_read;
if (pdcp_input_index_header == sizeof (pdcp_data_req_header_t)) { if (pdcp_input_index_header == sizeof (pdcp_data_req_header_t)) {
...@@ -344,11 +338,11 @@ pdcp_fifo_read_input_sdus () ...@@ -344,11 +338,11 @@ pdcp_fifo_read_input_sdus ()
msg("[PDCP] TTI %d IP->RADIO READ HEADER sdu size %d\n", msg("[PDCP] TTI %d IP->RADIO READ HEADER sdu size %d\n",
Mac_rlc_xface->frame, Mac_rlc_xface->frame,
pdcp_input_header.data_size); pdcp_input_header.data_size);
#endif //PDCP_DEBUG #endif
pdcp_input_index_header = 0; pdcp_input_index_header = 0;
if(pdcp_input_header.data_size<0){
msg("[PDCP][FATAL ERROR] READ_FIFO: DATA_SIZE %d < 0\n",pdcp_input_header.data_size);
if (pdcp_input_header.data_size < 0) {
msg("[PDCP][FATAL ERROR] READ_FIFO: DATA_SIZE %d < 0\n",pdcp_input_header.data_size);
mac_xface->macphy_exit(""); mac_xface->macphy_exit("");
return 0; return 0;
} }
...@@ -381,10 +375,7 @@ pdcp_fifo_read_input_sdus () ...@@ -381,10 +375,7 @@ pdcp_fifo_read_input_sdus ()
int bytes_read; int bytes_read;
int len; int len;
if (pdcp_read_state == 0) { if (pdcp_read_state == 0) {
#ifdef LINUX #ifdef LINUX
len = recvmsg(nas_sock_fd, &nas_msg, 0); len = recvmsg(nas_sock_fd, &nas_msg, 0);
#else #else
...@@ -392,7 +383,7 @@ pdcp_fifo_read_input_sdus () ...@@ -392,7 +383,7 @@ pdcp_fifo_read_input_sdus ()
#endif #endif
if (len<0) { if (len<0) {
// printf("[PDCP][NETLINK %d] nothing in pdcp NAS socket\n", nas_sock_fd); //printf("[PDCP][NETLINK %d] nothing in pdcp NAS socket\n", nas_sock_fd);
} }
else { else {
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
...@@ -408,7 +399,6 @@ pdcp_fifo_read_input_sdus () ...@@ -408,7 +399,6 @@ pdcp_fifo_read_input_sdus ()
} }
#ifdef LINUX #ifdef LINUX
if (nas_nlh->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) { if (nas_nlh->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
pdcp_read_state = 1; //get pdcp_read_state = 1; //get
memcpy((void *)&pdcp_read_header, memcpy((void *)&pdcp_read_header,
(void *)NLMSG_DATA(nas_nlh), (void *)NLMSG_DATA(nas_nlh),
...@@ -429,12 +419,9 @@ pdcp_fifo_read_input_sdus () ...@@ -429,12 +419,9 @@ pdcp_fifo_read_input_sdus ()
if (len<0) { if (len<0) {
// nothing in pdcp NAS socket // nothing in pdcp NAS socket
} } else {
else {
pdcp_read_state = 0; pdcp_read_state = 0;
// print_active_requests() //print_active_requests()
#ifdef LINUX #ifdef LINUX
memcpy(pdcp_read_payload, memcpy(pdcp_read_payload,
...@@ -463,7 +450,6 @@ pdcp_fifo_read_input_sdus () ...@@ -463,7 +450,6 @@ pdcp_fifo_read_input_sdus ()
pdcp_read_header.data_size, pdcp_read_header.data_size,
pdcp_read_payload); pdcp_read_payload);
} }
} }
} }
#endif #endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -204,7 +204,7 @@ void *pdcp_netlink_thread_fct(void *arg) { ...@@ -204,7 +204,7 @@ void *pdcp_netlink_thread_fct(void *arg) {
* NOTE: netlink messages can be assembled to form a multipart message * NOTE: netlink messages can be assembled to form a multipart message
*/ */
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf; for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
NLMSG_OK(nas_nlh_rx, len); NLMSG_OK(nas_nlh_rx, (unsigned int)len);
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) { nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) {
/* There is no need to check for nlmsg_type because /* There is no need to check for nlmsg_type because
......
...@@ -38,7 +38,8 @@ Address : EURECOM, ...@@ -38,7 +38,8 @@ Address : EURECOM,
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
#endif #endif
# include "assertions.h" #include "assertions.h"
#include "hashtable.h"
#include "rlc_am.h" #include "rlc_am.h"
#include "rlc_am_segment.h" #include "rlc_am_segment.h"
#include "rlc_am_timer_poll_retransmit.h" #include "rlc_am_timer_poll_retransmit.h"
...@@ -107,18 +108,26 @@ void rlc_am_release (rlc_am_entity_t *rlc_pP) ...@@ -107,18 +108,26 @@ void rlc_am_release (rlc_am_entity_t *rlc_pP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void config_req_rlc_am (frame_t frameP, void config_req_rlc_am (
eNB_flag_t eNB_flagP,
module_id_t enb_module_idP, module_id_t enb_module_idP,
module_id_t ue_module_idP, module_id_t ue_module_idP,
frame_t frameP,
eNB_flag_t eNB_flagP,
srb_flag_t srb_flagP,
rlc_am_info_t *config_am_pP, rlc_am_info_t *config_am_pP,
rb_id_t rb_idP, rb_id_t rb_idP)
rb_type_t rb_typeP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_am_entity_t *rlc = NULL; rlc_union_t *rlc_union_p = NULL;
rlc_am_entity_t *rlc_p = NULL;
LOG_D(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u]\n", hash_key_t key = RLC_COLL_KEY_VALUE(enb_module_idP, ue_module_idP, eNB_flagP, rb_idP, srb_flagP);
hashtable_rc_t h_rc;
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
rlc_p = &rlc_union_p->rlc.am;
LOG_D(RLC,
"[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u]\n",
frameP, frameP,
( eNB_flagP > 0) ? "eNB":"UE", ( eNB_flagP > 0) ? "eNB":"UE",
enb_module_idP, enb_module_idP,
...@@ -132,22 +141,25 @@ void config_req_rlc_am (frame_t frameP, ...@@ -132,22 +141,25 @@ void config_req_rlc_am (frame_t frameP,
enb_module_idP, enb_module_idP,
ue_module_idP, ue_module_idP,
rb_idP); rb_idP);
rlc_am_init(rlc_p,frameP);
if (eNB_flagP) { rlc_am_set_debug_infos(rlc_p, frameP, eNB_flagP, enb_module_idP, ue_module_idP, rb_idP, srb_flagP);
rlc = &rlc_array_eNB[enb_module_idP][ue_module_idP][rb_idP].rlc.am; rlc_am_configure(rlc_p,frameP,
} else {
rlc = &rlc_array_ue[ue_module_idP][rb_idP].rlc.am;
}
rlc_am_init(rlc,frameP);
rlc_am_set_debug_infos(rlc, frameP, eNB_flagP, enb_module_idP, ue_module_idP, rb_idP, rb_typeP);
rlc_am_configure(rlc,frameP,
config_am_pP->max_retx_threshold, config_am_pP->max_retx_threshold,
config_am_pP->poll_pdu, config_am_pP->poll_pdu,
config_am_pP->poll_byte, config_am_pP->poll_byte,
config_am_pP->t_poll_retransmit, config_am_pP->t_poll_retransmit,
config_am_pP->t_reordering, config_am_pP->t_reordering,
config_am_pP->t_status_prohibit); config_am_pP->t_status_prohibit);
} else {
LOG_E(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ --->][RLC_AM][MOD %u/%u][RB %u] RLC NOT FOUND\n",
frameP,
(eNB_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
enb_module_idP,
ue_module_idP,
rb_idP);
}
} }
uint32_t pollPDU_tab[PollPDU_pInfinity+1]={4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now uint32_t pollPDU_tab[PollPDU_pInfinity+1]={4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now
uint32_t maxRetxThreshold_tab[UL_AM_RLC__maxRetxThreshold_t32+1]={1,2,3,4,6,8,16,32}; uint32_t maxRetxThreshold_tab[UL_AM_RLC__maxRetxThreshold_t32+1]={1,2,3,4,6,8,16,32};
...@@ -157,22 +169,24 @@ uint32_t am_t_Reordering_tab[T_Reordering_spare1]={0,5,10,15,20,25,30,35,40,45,5 ...@@ -157,22 +169,24 @@ uint32_t am_t_Reordering_tab[T_Reordering_spare1]={0,5,10,15,20,25,30,35,40,45,5
uint32_t t_StatusProhibit_tab[T_StatusProhibit_spare8]={0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,300,350,400,450,500}; uint32_t t_StatusProhibit_tab[T_StatusProhibit_spare8]={0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,300,350,400,450,500};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void config_req_rlc_am_asn1 (frame_t frameP, void config_req_rlc_am_asn1 (
eNB_flag_t eNB_flagP, const module_id_t enb_module_idP,
module_id_t enb_module_idP, const module_id_t ue_module_idP,
module_id_t ue_module_idP, const frame_t frameP,
struct RLC_Config__am *config_am_pP, const eNB_flag_t eNB_flagP,
rb_id_t rb_idP, const srb_flag_t srb_flagP,
rb_type_t rb_typeP) const struct RLC_Config__am * const config_am_pP,
const rb_id_t rb_idP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_am_entity_t *rlc = NULL; rlc_union_t *rlc_union_p = NULL;
rlc_am_entity_t *rlc_p = NULL;
if (eNB_flagP) { hash_key_t key = RLC_COLL_KEY_VALUE(enb_module_idP, ue_module_idP, eNB_flagP, rb_idP, srb_flagP);
rlc = &rlc_array_eNB[enb_module_idP][ue_module_idP][rb_idP].rlc.am; hashtable_rc_t h_rc;
} else {
rlc = &rlc_array_ue[ue_module_idP][rb_idP].rlc.am; h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
} if (h_rc == HASH_TABLE_OK) {
rlc_p = &rlc_union_p->rlc.am;
if ((config_am_pP->ul_AM_RLC.maxRetxThreshold <= UL_AM_RLC__maxRetxThreshold_t32) && if ((config_am_pP->ul_AM_RLC.maxRetxThreshold <= UL_AM_RLC__maxRetxThreshold_t32) &&
(config_am_pP->ul_AM_RLC.pollPDU<=PollPDU_pInfinity) && (config_am_pP->ul_AM_RLC.pollPDU<=PollPDU_pInfinity) &&
(config_am_pP->ul_AM_RLC.pollByte<PollByte_spare1) && (config_am_pP->ul_AM_RLC.pollByte<PollByte_spare1) &&
...@@ -195,9 +209,9 @@ void config_req_rlc_am_asn1 (frame_t frameP, ...@@ -195,9 +209,9 @@ void config_req_rlc_am_asn1 (frame_t frameP,
ue_module_idP, ue_module_idP,
rb_idP); rb_idP);
rlc_am_init(rlc,frameP); rlc_am_init(rlc_p,frameP);
rlc_am_set_debug_infos(rlc, frameP, eNB_flagP, enb_module_idP, ue_module_idP, rb_idP, rb_typeP); rlc_am_set_debug_infos(rlc_p, frameP, eNB_flagP, srb_flagP, enb_module_idP, ue_module_idP, rb_idP);
rlc_am_configure(rlc, rlc_am_configure(rlc_p,
frameP, frameP,
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold], maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
pollPDU_tab[config_am_pP->ul_AM_RLC.pollPDU], pollPDU_tab[config_am_pP->ul_AM_RLC.pollPDU],
...@@ -206,7 +220,8 @@ void config_req_rlc_am_asn1 (frame_t frameP, ...@@ -206,7 +220,8 @@ void config_req_rlc_am_asn1 (frame_t frameP,
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
} else { } else {
LOG_D(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- ILLEGAL CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u], RLC-AM NOT CONFIGURED\n", LOG_D(RLC,
"[FRAME %5u][%s][RRC][MOD %u/%u][][--- ILLEGAL CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d) --->][RLC_AM][MOD %u/%u][RB %u], RLC-AM NOT CONFIGURED\n",
frameP, frameP,
(eNB_flagP) ? "eNB" : "UE", (eNB_flagP) ? "eNB" : "UE",
enb_module_idP, enb_module_idP,
...@@ -221,6 +236,16 @@ void config_req_rlc_am_asn1 (frame_t frameP, ...@@ -221,6 +236,16 @@ void config_req_rlc_am_asn1 (frame_t frameP,
ue_module_idP, ue_module_idP,
rb_idP); rb_idP);
} }
} else {
LOG_E(RLC, "[FRAME %5u][%s][RRC][MOD %u/%u][][--- CONFIG_REQ --->][RLC_AM][MOD %u/%u][RB %u] RLC NOT FOUND\n",
frameP,
(eNB_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
enb_module_idP,
ue_module_idP,
rb_idP);
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -398,7 +423,11 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -398,7 +423,11 @@ rlc_am_get_pdus (rlc_am_entity_t *rlc_pP, frame_t frameP)
tx_data_pdu_management->nack_so_start, tx_data_pdu_management->nack_so_start,
tx_data_pdu_management->nack_so_stop); tx_data_pdu_management->nack_so_stop);
mem_block_t* copy = rlc_am_retransmit_get_subsegment(rlc_pP, frameP, rlc_pP->first_retrans_pdu_sn, &rlc_pP->nb_bytes_requested_by_mac); mem_block_t* copy = rlc_am_retransmit_get_subsegment(
rlc_pP,
frameP,
rlc_pP->first_retrans_pdu_sn,
&rlc_pP->nb_bytes_requested_by_mac);
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] SEND SEGMENT OF DATA PDU SN %04d (NEW SO %05d)\n", LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] SEND SEGMENT OF DATA PDU SN %04d (NEW SO %05d)\n",
frameP, frameP,
(rlc_pP->is_enb) ? "eNB" : "UE", (rlc_pP->is_enb) ? "eNB" : "UE",
...@@ -615,7 +644,7 @@ rlc_am_mac_data_request (void *rlc_pP, frame_t frameP) ...@@ -615,7 +644,7 @@ rlc_am_mac_data_request (void *rlc_pP, frame_t frameP)
rlc_am_pdu_info_t pdu_info; rlc_am_pdu_info_t pdu_info;
rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p; rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p;
mem_block_t *tb_p; mem_block_t *tb_p;
int16_t tb_size_in_bytes; tb_size_t tb_size_in_bytes;
int num_nack; int num_nack;
char message_string[9000]; char message_string[9000];
size_t message_string_size = 0; size_t message_string_size = 0;
...@@ -775,7 +804,7 @@ rlc_am_mac_data_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, ...@@ -775,7 +804,7 @@ rlc_am_mac_data_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP,
rlc_am_pdu_info_t pdu_info; rlc_am_pdu_info_t pdu_info;
rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p; rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p;
mem_block_t *tb_p; mem_block_t *tb_p;
int16_t tb_size_in_bytes; sdu_size_t tb_size_in_bytes;
int num_nack; int num_nack;
char message_string[7000]; char message_string[7000];
size_t message_string_size = 0; size_t message_string_size = 0;
......
...@@ -93,35 +93,49 @@ Address : EURECOM, ...@@ -93,35 +93,49 @@ Address : EURECOM,
* \brief Empty function, TO DO. * \brief Empty function, TO DO.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
*/ */
public_rlc_am(void rlc_am_release (rlc_am_entity_t *rlcP);) public_rlc_am(void rlc_am_release (rlc_am_entity_t * const rlcP);)
/** @addtogroup _rlc_am_init_impl_ /** @addtogroup _rlc_am_init_impl_
* @{ * @{
*/ */
/*! \fn void config_req_rlc_am (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rlc_am_info_t * config_amP, rb_id_t rb_idP, rb_type_t rb_typeP) /*! \fn void config_req_rlc_am (const frame_t frame, const eNB_flag_t eNB_flagP, const srb_flag_t srb_flagP, const module_id_t enb_module_idP, const module_id_t ue_module_idP, rlc_am_info_t * config_amP, rb_id_t rb_idP)
* \brief Configure the UL and DL parameters of the RLC AM * \brief Configure the UL and DL parameters of the RLC AM
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0) * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] enb_module_idP eNB Virtualized module identifier. * \param[in] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier. * \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] config_amP Configuration parameters for RLC AM instance. * \param[in] config_amP Configuration parameters for RLC AM instance.
* \param[in] rb_idP Radio bearer identifier. * \param[in] rb_idP Radio bearer identifier.
* \param[in] rb_typeP Radio bearer type (Signalling or Data).
*/ */
public_rlc_am(void config_req_rlc_am (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rlc_am_info_t * config_amP, rb_id_t rb_idP, rb_type_t rb_typeP);) public_rlc_am(void config_req_rlc_am (
const frame_t frame,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const rlc_am_info_t * const config_amP,
const rb_id_t rb_idP);)
/*! \fn void config_req_rlc_am_asn1 (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, struct RLC_Config__am * config_amP, rb_id_t rb_idP, rb_type_t rb_typeP) /*! \fn void config_req_rlc_am_asn1 (const frame_t frame, const eNB_flag_t eNB_flagP, const srb_flag_t srb_flagP, const module_id_t enb_module_idP, const module_id_t ue_module_idP, struct RLC_Config__am * config_amP, rb_id_t rb_idP)
* \brief Configure the UL and DL parameters of the RLC AM with the asn1c autogenerated pameters structs * \brief Configure the UL and DL parameters of the RLC AM with the asn1c autogenerated pameters structs
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0) * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] enb_module_idP eNB Virtualized module identifier. * \param[in] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier. * \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] config_amP Configuration parameters for RLC AM instance. * \param[in] config_amP Configuration parameters for RLC AM instance.
* \param[in] rb_idP Radio bearer identifier. * \param[in] rb_idP Radio bearer identifier.
* \param[in] rb_typeP Radio bearer type (Signalling or Data).
*/ */
public_rlc_am(void config_req_rlc_am_asn1 (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, struct RLC_Config__am * config_amP, rb_id_t rb_idP, rb_type_t rb_typeP);) public_rlc_am(void config_req_rlc_am_asn1 (
const const frame_t frame,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const struct RLC_Config__am * const config_amP,
const rb_id_t rb_idP);)
/** @} */ /** @} */
...@@ -218,14 +232,14 @@ public_rlc_am(void rlc_am_stat_req (rlc_am_entity_t *rlcP, ...@@ -218,14 +232,14 @@ public_rlc_am(void rlc_am_stat_req (rlc_am_entity_t *rlcP,
*/ */
private_rlc_am( void rlc_am_get_pdus (void *argP);) private_rlc_am( void rlc_am_get_pdus (void *argP);)
/*! \fn void rlc_am_rx (void *rlcP, uint32_t frame, uint8_t eNB_flag, struct mac_data_ind data_indication) /*! \fn void rlc_am_rx (void *rlcP, uint32_t frame, const eNB_flag_t eNB_flag, struct mac_data_ind data_indication)
* \brief Process the received PDUs from lower layer. * \brief Process the received PDUs from lower layer.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0). * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0).
* \param[in] data_indication PDUs from MAC. * \param[in] data_indication PDUs from MAC.
*/ */
protected_rlc_am( void rlc_am_rx (void *, uint32_t frame, struct mac_data_ind);) protected_rlc_am( void rlc_am_rx (void *, const frame_t frame, struct mac_data_ind);)
/*! \fn struct mac_status_resp rlc_am_mac_status_indication (void *rlcP, uint32_t frame,uint16_t tbs_sizeP, struct mac_status_ind tx_statusP) /*! \fn struct mac_status_resp rlc_am_mac_status_indication (void *rlcP, uint32_t frame,uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission. * \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
...@@ -235,7 +249,7 @@ protected_rlc_am( void rlc_am_rx (void *, uint32_t frame, struct mac_data_in ...@@ -235,7 +249,7 @@ protected_rlc_am( void rlc_am_rx (void *, uint32_t frame, struct mac_data_in
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU. * \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
* \return The maximum number of bytes that can be served by RLC instance to MAC. * \return The maximum number of bytes that can be served by RLC instance to MAC.
*/ */
public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (void *rlcP, uint32_t frame, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);) public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (void *rlcP, const frame_t frame, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);)
/*! \fn struct mac_data_req rlc_am_mac_data_request (void *rlcP, uint32_t frame) /*! \fn struct mac_data_req rlc_am_mac_data_request (void *rlcP, uint32_t frame)
* \brief Gives PDUs to lower layer MAC. * \brief Gives PDUs to lower layer MAC.
...@@ -243,16 +257,16 @@ public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (void *rlc ...@@ -243,16 +257,16 @@ public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (void *rlc
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission. * \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
*/ */
public_rlc_am( struct mac_data_req rlc_am_mac_data_request (void *rlcP, uint32_t frame);) public_rlc_am( struct mac_data_req rlc_am_mac_data_request (void *rlcP, const frame_t frame);)
/*! \fn void rlc_am_mac_data_indication (void *rlcP, uint32_t frame, uint8_t eNB_flag, struct mac_data_ind data_indP) /*! \fn void rlc_am_mac_data_indication (void *rlcP, uint32_t frame, const eNB_flag_t eNB_flag, struct mac_data_ind data_indP)
* \brief Receive PDUs from lower layer MAC. * \brief Receive PDUs from lower layer MAC.
* \param[in] rlcP RLC UM protocol instance pointer. * \param[in] rlcP RLC UM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0). * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0).
* \param[in] data_indP PDUs from MAC. * \param[in] data_indP PDUs from MAC.
*/ */
public_rlc_am( void rlc_am_mac_data_indication (void *rlcP, uint32_t frame, uint8_t eNB_flag, struct mac_data_ind data_indP);) public_rlc_am( void rlc_am_mac_data_indication (void *rlcP, const frame_t frame, const eNB_flag_t eNB_flag, struct mac_data_ind data_indP);)
/*! \fn void rlc_am_data_req (void *rlcP, uint32_t frame, mem_block_t *sduP) /*! \fn void rlc_am_data_req (void *rlcP, uint32_t frame, mem_block_t *sduP)
* \brief Interface with higher layers, buffer higher layer SDUS for transmission. * \brief Interface with higher layers, buffer higher layer SDUS for transmission.
...@@ -260,6 +274,6 @@ public_rlc_am( void rlc_am_mac_data_indication (void *rlcP, uint32_t fram ...@@ -260,6 +274,6 @@ public_rlc_am( void rlc_am_mac_data_indication (void *rlcP, uint32_t fram
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] sduP SDU. (A struct rlc_am_data_req is mapped on sduP->data.) * \param[in] sduP SDU. (A struct rlc_am_data_req is mapped on sduP->data.)
*/ */
public_rlc_am( void rlc_am_data_req (void *rlcP, uint32_t frame, mem_block_t *sduP);) public_rlc_am( void rlc_am_data_req (void *rlcP, const frame_t frame, mem_block_t *sduP);)
/** @} */ /** @} */
# endif # endif
...@@ -73,7 +73,6 @@ typedef struct rlc_am_entity_s { ...@@ -73,7 +73,6 @@ typedef struct rlc_am_entity_s {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// TX BUFFERS // TX BUFFERS
//--------------------------------------------------------------------- //---------------------------------------------------------------------
mem_block_t* input_sdus_alloc; /*!< \brief Allocated memory for the input SDU buffer (for SDUs coming from upper layers). */
rlc_am_tx_sdu_management_t *input_sdus; /*!< \brief Input SDU buffer (for SDUs coming from upper layers). */ rlc_am_tx_sdu_management_t *input_sdus; /*!< \brief Input SDU buffer (for SDUs coming from upper layers). */
signed int nb_sdu; /*!< \brief Total number of valid rlc_am_tx_sdu_management_t in input_sdus[]. */ signed int nb_sdu; /*!< \brief Total number of valid rlc_am_tx_sdu_management_t in input_sdus[]. */
signed int nb_sdu_no_segmented; /*!< \brief Total number of SDUs not segmented and partially segmented. */ signed int nb_sdu_no_segmented; /*!< \brief Total number of SDUs not segmented and partially segmented. */
...@@ -81,7 +80,6 @@ typedef struct rlc_am_entity_s { ...@@ -81,7 +80,6 @@ typedef struct rlc_am_entity_s {
signed int current_sdu_index; /*!< \brief Current SDU index in input_sdus array to be segmented. */ signed int current_sdu_index; /*!< \brief Current SDU index in input_sdus array to be segmented. */
mem_block_t* pdu_retrans_buffer_alloc; /*!< \brief Allocated memory for the retransmission buffer. */
rlc_am_tx_data_pdu_management_t *pdu_retrans_buffer; /*!< \brief Retransmission buffer. */ rlc_am_tx_data_pdu_management_t *pdu_retrans_buffer; /*!< \brief Retransmission buffer. */
signed int retrans_num_pdus; /*!< \brief Number of PDUs in the retransmission buffer. */ signed int retrans_num_pdus; /*!< \brief Number of PDUs in the retransmission buffer. */
signed int retrans_num_bytes; /*!< \brief Number of bytes in the retransmission buffer. */ signed int retrans_num_bytes; /*!< \brief Number of bytes in the retransmission buffer. */
...@@ -175,7 +173,7 @@ typedef struct rlc_am_entity_s { ...@@ -175,7 +173,7 @@ typedef struct rlc_am_entity_s {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// OUTPUTS // OUTPUTS
//--------------------------------------------------------------------- //---------------------------------------------------------------------
uint16_t nb_bytes_requested_by_mac; /*!< \brief Number of bytes requested by lower layer for next transmission. */ sdu_size_t nb_bytes_requested_by_mac; /*!< \brief Number of bytes requested by lower layer for next transmission. */
list_t pdus_to_mac_layer; /*!< \brief PDUs buffered for transmission to MAC layer. */ list_t pdus_to_mac_layer; /*!< \brief PDUs buffered for transmission to MAC layer. */
list_t control_pdu_list; /*!< \brief Control PDUs buffered for transmission to MAC layer. */ list_t control_pdu_list; /*!< \brief Control PDUs buffered for transmission to MAC layer. */
rlc_sn_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */ rlc_sn_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */
......
...@@ -45,7 +45,10 @@ Address : EURECOM, ...@@ -45,7 +45,10 @@ Address : EURECOM,
#define TRACE_RLC_AM_FREE_SDU #define TRACE_RLC_AM_FREE_SDU
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_free_in_sdu(rlc_am_entity_t *rlcP, frame_t frameP, unsigned int index_in_bufferP) void rlc_am_free_in_sdu(
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const unsigned int index_in_bufferP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) { if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
...@@ -82,7 +85,9 @@ void rlc_am_free_in_sdu(rlc_am_entity_t *rlcP, frame_t frameP, unsigned int inde ...@@ -82,7 +85,9 @@ void rlc_am_free_in_sdu(rlc_am_entity_t *rlcP, frame_t frameP, unsigned int inde
} }
// called when segmentation is done // called when segmentation is done
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_free_in_sdu_data(rlc_am_entity_t *rlcP, unsigned int index_in_bufferP) void rlc_am_free_in_sdu_data(
rlc_am_entity_t *const rlcP,
const unsigned int index_in_bufferP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) { if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
...@@ -95,7 +100,7 @@ void rlc_am_free_in_sdu_data(rlc_am_entity_t *rlcP, unsigned int index_in_buffer ...@@ -95,7 +100,7 @@ void rlc_am_free_in_sdu_data(rlc_am_entity_t *rlcP, unsigned int index_in_buffer
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP) signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *const rlcP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlcP->nb_sdu == 0) { if (rlcP->nb_sdu == 0) {
...@@ -103,117 +108,3 @@ signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP) ...@@ -103,117 +108,3 @@ signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP)
} }
return 0; return 0;
} }
//uint8_t in_sdu_data_ring_buffer [RLC_AM_SDU_DATA_BUFFER_SIZE];
//rlc_am_in_sdu_control_t in_sdu_control_ring_buffer[RLC_AM_SDU_CONTROL_BUFFER_SIZE];
//signed int in_sdu_data_buffer_index_start;
//signed int in_sdu_data_buffer_index_end;
//signed int in_sdu_data_buffer_index_next;
//signed int in_sdu_control_buffer_index_start;
//signed int in_sdu_control_buffer_index_end;
//signed int in_sdu_control_buffer_index_next;
/*//-----------------------------------------------------------------------------
signed int rlc_am_in_sdu_data_get_available_size(rlc_am_entity_t *rlcP)
//-----------------------------------------------------------------------------
{
signed int index_diff = rlcP->in_sdu_data_buffer_index_next - rlcP->in_sdu_data_buffer_index_start;
if (index_diff > 0) {
return RLC_AM_SDU_DATA_BUFFER_SIZE - index_diff;
} else {
return 0 - index_diff;
}
}
//-----------------------------------------------------------------------------
signed int rlc_am_in_sdu_control_get_available_size(rlc_am_entity_t *rlcP)
//-----------------------------------------------------------------------------
{
signed int index_diff = rlcP->in_sdu_control_buffer_index_next - rlcP->in_sdu_control_buffer_index_start;
if (index_diff > 0) {
return RLC_AM_SDU_CONTROL_BUFFER_SIZE - index_diff;
} else {
return 0 - index_diff;
}
}
//-----------------------------------------------------------------------------
void rlc_am_in_sdu_data_copy_sdu(rlc_am_entity_t *rlcP, char* sourceP, unsigned int sizeP, unsigned int muiP)
//-----------------------------------------------------------------------------
{
signed int index_diff = rlcP->in_sdu_data_buffer_index_next - rlcP->in_sdu_data_buffer_index_start;
if (index_diff > 0) {
signed int available_size_first_write = RLC_AM_SDU_DATA_BUFFER_SIZE - rlcP->in_sdu_data_buffer_index_next;
if (sizeP <= available_size_first_write) {
memcpy(&rlcP->in_sdu_data_ring_buffer[rlcP->in_sdu_data_buffer_index_next],
sourceP,
sizeP);
} else {
memcpy(&rlcP->in_sdu_data_ring_buffer[rlcP->in_sdu_data_buffer_index_next],
sourceP,
available_size_first_write);
memcpy(&rlcP->in_sdu_data_ring_buffer[0],
&sourceP[available_size_first_write],
sizeP - available_size_first_write);
}
} else {
memcpy(&rlcP->in_sdu_data_ring_buffer[rlcP->in_sdu_data_buffer_index_next],
sourceP,
sizeP);
}
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].sdu_data_buffer_index_start = rlcP->in_sdu_data_buffer_index_next;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].sdu_data_buffer_index_end = (rlcP->in_sdu_data_buffer_index_end + sizeP) % RLC_AM_SDU_DATA_BUFFER_SIZE;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].sdu_size = sizeP;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].sdu_mui = muiP;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].sdu_segmented_size = 0;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].nb_pdus = 0;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].nb_pdus_ack = 0;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].segmented = 0;
rlcP->in_sdu_control_ring_buffer[rlcP->in_sdu_control_buffer_index_next].discarded = 0;
rlcP->in_sdu_data_buffer_index_end = (rlcP->in_sdu_data_buffer_index_end + sizeP) % RLC_AM_SDU_DATA_BUFFER_SIZE;
rlcP->in_sdu_data_buffer_index_next = (rlcP->in_sdu_data_buffer_index_end + 1) % RLC_AM_SDU_DATA_BUFFER_SIZE;
rlcP->in_sdu_control_buffer_index_end = (rlcP->in_sdu_control_buffer_index_end + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
rlcP->in_sdu_control_buffer_index_next = (rlcP->in_sdu_control_buffer_index_end + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
//rlc->stat_tx_pdcp_sdu += 1;
}
//-----------------------------------------------------------------------------
void rlc_am_in_sdu_data_req (rlc_am_entity_t *rlcP, mem_block_t * sduP)
//-----------------------------------------------------------------------------
{
uint32_t mui;
uint16_t data_offset;
uint16_t data_size;
if (rlcP->protocol_state == RLC_NULL_STATE) {
#ifdef DEBUG_RLC_AM_DATA_REQUEST
msg ("[RLC_AM] RLC_AM_DATA_REQ RLC NOT INITIALIZED, DISCARD SDU\n");
#endif
free_mem_block (sduP);
}
signed int size_available_in_data_buffer = rlc_am_in_sdu_data_get_available_size();
signed int size_available_in_control_buffer = rlc_am_in_sdu_control_get_available_size();
if ((size_available_in_control_buffer > 0) && (size_available_in_control_buffer > 0)){
// parameters from SDU
mui = ((struct rlc_am_data_req *) (sduP->data))->mui;
data_offset = ((struct rlc_am_data_req *) (sduP->data))->data_offset;
data_size = ((struct rlc_am_data_req *) (sduP->data))->data_size;
rlc_am_in_sdu_data_copy_sdu(rlcP, &sduP->data[data_offset], data_size, mui);
} else {
#ifdef DEBUG_RLC_AM_DATA_REQUEST
msg ("[RLC_AM][RB %d] RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d\n",
rlcP->rb_id, size_available_in_control_buffer, rlcP->in_sdu_control_buffer_index_start, rlcP->in_sdu_control_buffer_index_end, size_available_in_data_buffer);
#endif
rlc->stat_tx_pdcp_sdu_discarded += 1;
free_mem_block (sduP);
}
}*/
...@@ -53,10 +53,8 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -53,10 +53,8 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
list_init(&rlc_pP->segmentation_pdu_list, "SEGMENTATION PDU LIST"); list_init(&rlc_pP->segmentation_pdu_list, "SEGMENTATION PDU LIST");
//LOG_D(RLC,"RLC_AM_SDU_CONTROL_BUFFER_SIZE %d sizeof(rlc_am_tx_sdu_management_t) %d \n", RLC_AM_SDU_CONTROL_BUFFER_SIZE, sizeof(rlc_am_tx_sdu_management_t)); //LOG_D(RLC,"RLC_AM_SDU_CONTROL_BUFFER_SIZE %d sizeof(rlc_am_tx_sdu_management_t) %d \n", RLC_AM_SDU_CONTROL_BUFFER_SIZE, sizeof(rlc_am_tx_sdu_management_t));
rlc_pP->input_sdus_alloc = get_free_mem_block(RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t)); rlc_pP->input_sdus = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
rlc_pP->input_sdus = (rlc_am_tx_sdu_management_t*)((rlc_pP->input_sdus_alloc)->data); rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
rlc_pP->pdu_retrans_buffer_alloc = get_free_mem_block((uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
rlc_pP->pdu_retrans_buffer = (rlc_am_tx_data_pdu_management_t*)((rlc_pP->pdu_retrans_buffer_alloc)->data);
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] input_sdus[] = %p element size=%d\n", frameP, rlc_pP->input_sdus,sizeof(rlc_am_tx_sdu_management_t)); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] input_sdus[] = %p element size=%d\n", frameP, rlc_pP->input_sdus,sizeof(rlc_am_tx_sdu_management_t));
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", frameP, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t)); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", frameP, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t));
...@@ -79,11 +77,10 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -79,11 +77,10 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
rlc_pP->first_retrans_pdu_sn = -1; rlc_pP->first_retrans_pdu_sn = -1;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_cleanup(rlc_am_entity_t *rlc_pP, frame_t frameP) void rlc_am_cleanup(rlc_am_entity_t *rlc_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n", LOG_I(RLC, "[FRAME ?????][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE", (rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id, rlc_pP->enb_module_id,
rlc_pP->ue_module_id, rlc_pP->ue_module_id,
...@@ -100,26 +97,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -100,26 +97,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP, frame_t frameP)
rlc_pP->output_sdu_in_construction = NULL; rlc_pP->output_sdu_in_construction = NULL;
} }
unsigned int i; unsigned int i;
if (rlc_pP->input_sdus_alloc != NULL) { if (rlc_pP->input_sdus != NULL) {
for (i=0; i < RLC_AM_SDU_CONTROL_BUFFER_SIZE; i++) { for (i=0; i < RLC_AM_SDU_CONTROL_BUFFER_SIZE; i++) {
if (rlc_pP->input_sdus[i].mem_block != NULL) { if (rlc_pP->input_sdus[i].mem_block != NULL) {
free_mem_block(rlc_pP->input_sdus[i].mem_block); free_mem_block(rlc_pP->input_sdus[i].mem_block);
rlc_pP->input_sdus[i].mem_block = NULL; rlc_pP->input_sdus[i].mem_block = NULL;
} }
} }
free_mem_block(rlc_pP->input_sdus_alloc); free(rlc_pP->input_sdus);
rlc_pP->input_sdus_alloc = NULL;
rlc_pP->input_sdus = NULL; rlc_pP->input_sdus = NULL;
} }
if (rlc_pP->pdu_retrans_buffer_alloc != NULL) { if (rlc_pP->pdu_retrans_buffer != NULL) {
for (i=0; i < RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE; i++) { for (i=0; i < RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE; i++) {
if (rlc_pP->pdu_retrans_buffer[i].mem_block != NULL) { if (rlc_pP->pdu_retrans_buffer[i].mem_block != NULL) {
free_mem_block(rlc_pP->pdu_retrans_buffer[i].mem_block); free_mem_block(rlc_pP->pdu_retrans_buffer[i].mem_block);
rlc_pP->pdu_retrans_buffer[i].mem_block = NULL; rlc_pP->pdu_retrans_buffer[i].mem_block = NULL;
} }
} }
free_mem_block(rlc_pP->pdu_retrans_buffer_alloc); free(rlc_pP->pdu_retrans_buffer);
rlc_pP->pdu_retrans_buffer_alloc = NULL;
rlc_pP->pdu_retrans_buffer = NULL; rlc_pP->pdu_retrans_buffer = NULL;
} }
memset(rlc_pP, 0, sizeof(rlc_am_entity_t)); memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
...@@ -161,13 +156,13 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP, ...@@ -161,13 +156,13 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP,
void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP,
frame_t frameP, frame_t frameP,
eNB_flag_t eNB_flagP, eNB_flag_t eNB_flagP,
srb_flag_t srb_flagP,
module_id_t enb_module_idP, module_id_t enb_module_idP,
module_id_t ue_module_idP, module_id_t ue_module_idP,
rb_id_t rb_idP, rb_id_t rb_idP)
rb_type_t rb_typeP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][SET DEBUG INFOS] module_id %d rb_id %d rb_type %d\n", LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][SET DEBUG INFOS] module_id %d rb_id %d is SRB %d\n",
frameP, frameP,
(rlc_pP->is_enb) ? "eNB" : "UE", (rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id, rlc_pP->enb_module_id,
...@@ -176,15 +171,15 @@ void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, ...@@ -176,15 +171,15 @@ void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP,
enb_module_idP, enb_module_idP,
ue_module_idP, ue_module_idP,
rb_idP, rb_idP,
rb_typeP); (srb_flagP) ? "TRUE" : "FALSE");
rlc_pP->enb_module_id = enb_module_idP; rlc_pP->enb_module_id = enb_module_idP;
rlc_pP->ue_module_id = ue_module_idP; rlc_pP->ue_module_id = ue_module_idP;
rlc_pP->rb_id = rb_idP; rlc_pP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) { if (srb_flagP) {
rlc_pP->is_data_plane = 1;
} else {
rlc_pP->is_data_plane = 0; rlc_pP->is_data_plane = 0;
} else {
rlc_pP->is_data_plane = 1;
} }
rlc_pP->is_enb = eNB_flagP; rlc_pP->is_enb = eNB_flagP;
} }
...@@ -88,12 +88,11 @@ typedef volatile struct { ...@@ -88,12 +88,11 @@ typedef volatile struct {
*/ */
public_rlc_am_init( void rlc_am_init (rlc_am_entity_t* rlc_pP,frame_t frameP);) public_rlc_am_init( void rlc_am_init (rlc_am_entity_t* rlc_pP,frame_t frameP);)
/*! \fn void rlc_am_cleanup(rlc_am_entity_t* rlc_pP,frame_t frameP) /*! \fn void rlc_am_cleanup(rlc_am_entity_t* rlc_pP)
* \brief Free all memory resources allocated and kept by this RLC AM instance. * \brief Free all memory resources allocated and kept by this RLC AM instance.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
*/ */
public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP,frame_t frameP);) public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP);)
/*! \fn void rlc_am_configure(rlc_am_entity_t *rlc_pP, frame_t frameP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP) /*! \fn void rlc_am_configure(rlc_am_entity_t *rlc_pP, frame_t frameP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP)
* \brief Set RLC AM protocol parameters. * \brief Set RLC AM protocol parameters.
...@@ -116,16 +115,16 @@ public_rlc_am_init( void rlc_am_configure(rlc_am_entity_t *rlc_pP, ...@@ -116,16 +115,16 @@ public_rlc_am_init( void rlc_am_configure(rlc_am_entity_t *rlc_pP,
uint32_t t_reorderingP, uint32_t t_reorderingP,
uint32_t t_status_prohibitP);) uint32_t t_status_prohibitP);)
/*! \fn void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP, rb_type_t rb_typeP) /*! \fn void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, srb_flag_t srb_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP)
* \brief Set informations that will be displayed in traces, helping the debug process. * \brief Set informations that will be displayed in traces, helping the debug process.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index * \param[in] frame Frame index
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0) * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] enb_module_idP eNB Virtualization variable, module identifier. * \param[in] enb_module_idP eNB Virtualization variable, module identifier.
* \param[in] ue_module_idP UE Virtualization variable, module identifier. * \param[in] ue_module_idP UE Virtualization variable, module identifier.
* \param[in] rb_idP Radio bearer identifier. * \param[in] rb_idP Radio bearer identifier.
* \param[in] rb_typeP Radio bearer type (Signalling or data).
*/ */
public_rlc_am_init( void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP, rb_type_t rb_typeP);) public_rlc_am_init( void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, srb_flag_t srb_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP);)
/** @} */ /** @} */
#endif #endif
...@@ -128,7 +128,16 @@ void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP, eNB_flag_t eNB_fla ...@@ -128,7 +128,16 @@ void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP, eNB_flag_t eNB_fla
rlc_pP->output_sdu_size_to_write, rlc_pP->output_sdu_size_to_write,
rlc_pP->output_sdu_in_construction); rlc_pP->output_sdu_in_construction);
#else #else
rlc_data_ind (rlc_pP->enb_module_id, rlc_pP->ue_module_id, frameP, eNB_flagP, MBMS_FLAG_NO, rlc_pP->rb_id, rlc_pP->output_sdu_size_to_write, rlc_pP->output_sdu_in_construction, rlc_pP->is_data_plane); rlc_data_ind (
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
frameP,
eNB_flagP,
BOOL_NOT(rlc_pP->is_data_plane),
MBMS_FLAG_NO,
rlc_pP->rb_id,
rlc_pP->output_sdu_size_to_write,
rlc_pP->output_sdu_in_construction);
#endif #endif
rlc_pP->output_sdu_in_construction = NULL; rlc_pP->output_sdu_in_construction = NULL;
} else { } else {
......
...@@ -45,7 +45,7 @@ Address : EURECOM, ...@@ -45,7 +45,7 @@ Address : EURECOM,
//#define DEBUG_RLC_AM_DISPLAY_TB_DATA //#define DEBUG_RLC_AM_DISPLAY_TB_DATA
//#define RLC_AM_GENERATE_ERRORS //#define RLC_AM_GENERATE_ERRORS
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_am_get_data_pdu_infos(frame_t frameP, rlc_am_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_am_pdu_info_t* pdu_info_pP) signed int rlc_am_get_data_pdu_infos(const const frame_t frameP, rlc_am_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_am_pdu_info_t* pdu_info_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
memset(pdu_info_pP, 0, sizeof (rlc_am_pdu_info_t)); memset(pdu_info_pP, 0, sizeof (rlc_am_pdu_info_t));
...@@ -124,7 +124,7 @@ signed int rlc_am_get_data_pdu_infos(frame_t frameP, rlc_am_pdu_sn_10_t* header_ ...@@ -124,7 +124,7 @@ signed int rlc_am_get_data_pdu_infos(frame_t frameP, rlc_am_pdu_sn_10_t* header_
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_display_data_pdu_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_info_t* pdu_info_pP) void rlc_am_display_data_pdu_infos(rlc_am_entity_t * const rlc_pP, const const frame_t frameP, rlc_am_pdu_info_t* pdu_info_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int num_li; int num_li;
...@@ -170,7 +170,7 @@ void rlc_am_display_data_pdu_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_ ...@@ -170,7 +170,7 @@ void rlc_am_display_data_pdu_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_
} }
// assumed the sn of the tb_p is equal to VR(MS) // assumed the sn of the tb_p is equal to VR(MS)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_rx_update_vr_ms(rlc_am_entity_t *rlc_pP, frame_t frameP, mem_block_t* tb_pP) void rlc_am_rx_update_vr_ms(rlc_am_entity_t * const rlc_pP, const const frame_t frameP, mem_block_t* tb_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
//rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info; //rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
...@@ -211,7 +211,7 @@ void rlc_am_rx_update_vr_ms(rlc_am_entity_t *rlc_pP, frame_t frameP, mem_block_t ...@@ -211,7 +211,7 @@ void rlc_am_rx_update_vr_ms(rlc_am_entity_t *rlc_pP, frame_t frameP, mem_block_t
} }
// assumed the sn of the tb_p is equal to VR(R) // assumed the sn of the tb_p is equal to VR(R)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_rx_update_vr_r(rlc_am_entity_t *rlc_pP,frame_t frameP,mem_block_t* tb_pP) void rlc_am_rx_update_vr_r(rlc_am_entity_t * const rlc_pP,const const frame_t frameP,mem_block_t* tb_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_am_pdu_info_t* pdu_info_cursor_p = NULL; rlc_am_pdu_info_t* pdu_info_cursor_p = NULL;
...@@ -249,12 +249,12 @@ void rlc_am_rx_update_vr_r(rlc_am_entity_t *rlc_pP,frame_t frameP,mem_block_t* t ...@@ -249,12 +249,12 @@ void rlc_am_rx_update_vr_r(rlc_am_entity_t *rlc_pP,frame_t frameP,mem_block_t* t
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP) rlc_am_receive_routing (rlc_am_entity_t * const rlc_pP, const const frame_t frameP, const eNB_flag_t eNB_flagP, struct mac_data_ind data_indP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
mem_block_t *tb_p = NULL; mem_block_t *tb_p = NULL;
uint8_t *first_byte_p = NULL; uint8_t *first_byte_p = NULL;
int16_t tb_size_in_bytes; sdu_size_t tb_size_in_bytes;
while ((tb_p = list_remove_head (&data_indP.data))) { while ((tb_p = list_remove_head (&data_indP.data))) {
first_byte_p = ((struct mac_tb_ind *) (tb_p->data))->data_ptr; first_byte_p = ((struct mac_tb_ind *) (tb_p->data))->data_ptr;
...@@ -286,7 +286,7 @@ rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_ ...@@ -286,7 +286,7 @@ rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_
} // end while } // end while
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byte_pP, uint16_t tb_size_in_bytesP) void rlc_am_receive_process_data_pdu (rlc_am_entity_t * const rlc_pP, const const frame_t frameP, const eNB_flag_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byte_pP, uint16_t tb_size_in_bytesP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// 5.1.3.2 Receive operations // 5.1.3.2 Receive operations
......
...@@ -59,7 +59,7 @@ Address : EURECOM, ...@@ -59,7 +59,7 @@ Address : EURECOM,
# define public_rlc_am_receiver(x) extern x # define public_rlc_am_receiver(x) extern x
# endif # endif
# endif # endif
/*! \fn signed int rlc_am_get_data_pdu_infos(frame_t frameP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP) /*! \fn signed int rlc_am_get_data_pdu_infos(const frame_t frameP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP)
* \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU. * \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] headerP RLC AM header PDU pointer. * \param[in] headerP RLC AM header PDU pointer.
...@@ -67,44 +67,44 @@ Address : EURECOM, ...@@ -67,44 +67,44 @@ Address : EURECOM,
* \param[in] pdu_infoP Structure containing extracted informations from PDU. * \param[in] pdu_infoP Structure containing extracted informations from PDU.
* \return 0 if no error was encountered during the parsing of the PDU, else -1; * \return 0 if no error was encountered during the parsing of the PDU, else -1;
*/ */
protected_rlc_am_receiver( signed int rlc_am_get_data_pdu_infos(frame_t frameP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP)); protected_rlc_am_receiver( signed int rlc_am_get_data_pdu_infos(const frame_t frameP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP));
/*! \fn void rlc_am_display_data_pdu_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_info_t* pdu_infoP) /*! \fn void rlc_am_display_data_pdu_infos(rlc_am_entity_t * const rlc_pP, const frame_t frameP, rlc_am_pdu_info_t* pdu_infoP)
* \brief Display RLC AM PDU informations. * \brief Display RLC AM PDU informations.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] pdu_infoP Structure containing extracted informations of a PDU. * \param[in] pdu_infoP Structure containing extracted informations of a PDU.
*/ */
protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_info_t* pdu_infoP);) protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(rlc_am_entity_t * const rlc_pP, const frame_t frameP, rlc_am_pdu_info_t* pdu_infoP);)
/*! \fn void rlc_am_rx_update_vr_ms(rlc_am_entity_t *rlc_pP,mem_block_t* tb_pP) /*! \fn void rlc_am_rx_update_vr_ms(rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP)
* \brief Update RLC AM protocol variable VR(MS). * \brief Update RLC AM protocol variable VR(MS).
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] tb_pP PDU embedded in a mem_block_t struct. * \param[in] tb_pP PDU embedded in a mem_block_t struct.
* \note It is assumed that the sequence number of the transport block is equal to VR(MS) * \note It is assumed that the sequence number of the transport block is equal to VR(MS)
*/ */
protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(rlc_am_entity_t *rlc_pP,frame_t frameP, mem_block_t* tb_pP);) protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(rlc_am_entity_t * const rlc_pP,const frame_t frameP, mem_block_t* tb_pP);)
/*! \fn void rlc_am_rx_update_vr_r (rlc_am_entity_t *rlc_pP,frame_t frameP,mem_block_t* tb_pP) /*! \fn void rlc_am_rx_update_vr_r (rlc_am_entity_t * const rlc_pP,const frame_t frameP,mem_block_t* tb_pP)
* \brief Update RLC AM protocol variable VR(R). * \brief Update RLC AM protocol variable VR(R).
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] tb_pP PDU embedded in a mem_block_t struct. * \param[in] tb_pP PDU embedded in a mem_block_t struct.
* \note It is assumed that the sequence number of the transport block is equal to VR(R) * \note It is assumed that the sequence number of the transport block is equal to VR(R)
*/ */
protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (rlc_am_entity_t *rlc_pP,frame_t frameP, mem_block_t* tb_pP);) protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (rlc_am_entity_t * const rlc_pP,const frame_t frameP, mem_block_t* tb_pP);)
/*! \fn void rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, frame_t frameP, uint8_t eNB_flagP, struct mac_data_ind data_indP) /*! \fn void rlc_am_receive_routing (rlc_am_entity_t * const rlc_pP, const frame_t frameP, uint8_t eNB_flagP, struct mac_data_ind data_indP)
* \brief Convert transport blocks received from MAC layer into RLC AM PDUs, and dispatch to the right processing block these PDUS upon their type (CONTROL/DATA). * \brief Convert transport blocks received from MAC layer into RLC AM PDUs, and dispatch to the right processing block these PDUS upon their type (CONTROL/DATA).
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
* \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0). * \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0).
* \param[in] data_indP Transport blocks received from MAC layer. * \param[in] data_indP Transport blocks received from MAC layer.
*/ */
protected_rlc_am_receiver( void rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP)); protected_rlc_am_receiver( void rlc_am_receive_routing (rlc_am_entity_t * const rlc_pP, const frame_t frameP, const eNB_flag_t eNB_flagP, struct mac_data_ind data_indP));
/*! \fn void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, uint8_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP) /*! \fn void rlc_am_receive_process_data_pdu (rlc_am_entity_t * const rlc_pP, const frame_t frameP, uint8_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP)
* \brief Process an incoming data PDU received from MAC layer. * \brief Process an incoming data PDU received from MAC layer.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frame Frame index.
...@@ -113,6 +113,6 @@ protected_rlc_am_receiver( void rlc_am_receive_routing (rlc_am_entity_t *rlc_pP, ...@@ -113,6 +113,6 @@ protected_rlc_am_receiver( void rlc_am_receive_routing (rlc_am_entity_t *rlc_pP,
* \param[in] first_byteP Pointer on first byte of the PDU. * \param[in] first_byteP Pointer on first byte of the PDU.
* \param[in] tb_size_in_bytesP Transport block size in bytes (same as PDU size in bytes). * \param[in] tb_size_in_bytesP Transport block size in bytes (same as PDU size in bytes).
*/ */
private_rlc_am_receiver( void rlc_am_receive_process_data_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP)); private_rlc_am_receiver( void rlc_am_receive_process_data_pdu (rlc_am_entity_t * const rlc_pP, const frame_t frameP, const eNB_flag_t eNB_flagP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP));
/** @} */ /** @} */
# endif # endif
...@@ -43,7 +43,12 @@ Address : EURECOM, ...@@ -43,7 +43,12 @@ Address : EURECOM,
//#define TRACE_RLC_AM_NACK //#define TRACE_RLC_AM_NACK
//#define TRACE_RLC_AM_ACK //#define TRACE_RLC_AM_ACK
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_nack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_endP) void rlc_am_nack_pdu (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_endP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// 5.2.1 Retransmission // 5.2.1 Retransmission
...@@ -59,11 +64,11 @@ void rlc_am_nack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu ...@@ -59,11 +64,11 @@ void rlc_am_nack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu
// - indicate to upper layers that max retransmission has been reached. // - indicate to upper layers that max retransmission has been reached.
mem_block_t* mb_pP = rlc_pP->pdu_retrans_buffer[snP].mem_block; mem_block_t* mb_p = rlc_pP->pdu_retrans_buffer[snP].mem_block;
int pdu_sdu_index; int pdu_sdu_index;
int sdu_index; int sdu_index;
if (mb_pP != NULL) { if (mb_p != NULL) {
rlc_pP->num_nack_sn += 1; rlc_pP->num_nack_sn += 1;
assert(so_startP <= so_endP); assert(so_startP <= so_endP);
//----------------------------------------- //-----------------------------------------
...@@ -134,18 +139,21 @@ void rlc_am_nack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu ...@@ -134,18 +139,21 @@ void rlc_am_nack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP) void rlc_am_ack_pdu (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
mem_block_t* mb_pP = rlc_pP->pdu_retrans_buffer[snP].mem_block; mem_block_t* mb_p = rlc_pP->pdu_retrans_buffer[snP].mem_block;
int pdu_sdu_index; int pdu_sdu_index;
int sdu_index; int sdu_index;
rlc_pP->pdu_retrans_buffer[snP].flags.retransmit = 0; rlc_pP->pdu_retrans_buffer[snP].flags.retransmit = 0;
if ((rlc_pP->pdu_retrans_buffer[snP].flags.ack == 0) && (mb_pP != NULL)) { if ((rlc_pP->pdu_retrans_buffer[snP].flags.ack == 0) && (mb_p != NULL)) {
//if (mb_pP != NULL) { //if (mb_pP != NULL) {
free_mem_block(mb_pP); free_mem_block(mb_p);
rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL; rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL;
LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][ACK-PDU] ACK PDU SN %05d previous retx_count %d \n", LOG_D(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][ACK-PDU] ACK PDU SN %05d previous retx_count %d \n",
frameP, frameP,
...@@ -170,9 +178,21 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP) ...@@ -170,9 +178,21 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP)
if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) && if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) &&
(rlc_pP->input_sdus[sdu_index].sdu_remaining_size == 0)) { (rlc_pP->input_sdus[sdu_index].sdu_remaining_size == 0)) {
#ifdef TEST_RLC_AM #ifdef TEST_RLC_AM
rlc_am_v9_3_0_test_data_conf (rlc_pP->module_id, rlc_pP->rb_id, rlc_pP->input_sdus[sdu_index].mui, RLC_SDU_CONFIRM_YES); rlc_am_v9_3_0_test_data_conf (
rlc_pP->module_id,
rlc_pP->rb_id,
rlc_pP->input_sdus[sdu_index].mui,
RLC_SDU_CONFIRM_YES);
#else #else
rlc_data_conf(rlc_pP->enb_module_id, rlc_pP->ue_module_id, frameP, rlc_pP->is_enb, rlc_pP->rb_id, rlc_pP->input_sdus[sdu_index].mui, RLC_SDU_CONFIRM_YES, rlc_pP->is_data_plane); rlc_data_conf(
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
frameP,
rlc_pP->is_enb,
rlc_pP->rb_id,
rlc_pP->input_sdus[sdu_index].mui,
RLC_SDU_CONFIRM_YES,
rlc_pP->is_data_plane);
#endif #endif
rlc_am_free_in_sdu(rlc_pP, frameP, sdu_index); rlc_am_free_in_sdu(rlc_pP, frameP, sdu_index);
} }
...@@ -238,8 +258,8 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP) ...@@ -238,8 +258,8 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP)
rlc_pP->ue_module_id, rlc_pP->ue_module_id,
rlc_pP->rb_id, rlc_pP->rb_id,
snP); snP);
if (mb_pP != NULL) { if (mb_p != NULL) {
free_mem_block(mb_pP); free_mem_block(mb_p);
rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL; rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL;
} }
if (rlc_pP->pdu_retrans_buffer[snP].flags.ack > 0) { if (rlc_pP->pdu_retrans_buffer[snP].flags.ack > 0) {
...@@ -268,7 +288,10 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP) ...@@ -268,7 +288,10 @@ void rlc_am_ack_pdu (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP) mem_block_t* rlc_am_retransmit_get_copy (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
mem_block_t* mb_original_p = rlc_pP->pdu_retrans_buffer[snP].mem_block; mem_block_t* mb_original_p = rlc_pP->pdu_retrans_buffer[snP].mem_block;
...@@ -292,7 +315,11 @@ mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlc_pP, frame_t frameP ...@@ -292,7 +315,11 @@ mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlc_pP, frame_t frameP
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu_size_t *sizeP) mem_block_t* rlc_am_retransmit_get_subsegment(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t * const sizeP /* in-out*/)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
...@@ -773,7 +800,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlc_pP, frame_t f ...@@ -773,7 +800,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlc_pP, frame_t f
&rlc_pP->pdu_retrans_buffer[snP].payload[start_offset], &rlc_pP->pdu_retrans_buffer[snP].payload[start_offset],
test_pdu_copy_size); test_pdu_copy_size);
((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size = (((uint64_t)fill_payload_p)+ test_pdu_copy_size) - ((uint64_t)(&pdu_sub_segment_p->b1)); ((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size = (tb_size_t)(((uint64_t)fill_payload_p)+ test_pdu_copy_size) - ((uint64_t)(&pdu_sub_segment_p->b1));
// set LSF // set LSF
if ((test_pdu_copy_size + start_offset) == rlc_pP->pdu_retrans_buffer[snP].payload_size) { if ((test_pdu_copy_size + start_offset) == rlc_pP->pdu_retrans_buffer[snP].payload_size) {
...@@ -852,7 +879,10 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlc_pP, frame_t f ...@@ -852,7 +879,10 @@ mem_block_t* rlc_am_retransmit_get_subsegment(rlc_am_entity_t *rlc_pP, frame_t f
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_tx_buffer_display (rlc_am_entity_t* rlc_pP, frame_t frameP, char* message_pP) void rlc_am_tx_buffer_display (
rlc_am_entity_t* const rlc_pP,
const frame_t frameP,
char* const message_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_sn_t sn = rlc_pP->vt_a; rlc_sn_t sn = rlc_pP->vt_a;
...@@ -904,7 +934,9 @@ void rlc_am_tx_buffer_display (rlc_am_entity_t* rlc_pP, frame_t frameP, char* me ...@@ -904,7 +934,9 @@ void rlc_am_tx_buffer_display (rlc_am_entity_t* rlc_pP, frame_t frameP, char* me
LOG_D(RLC, "\n"); LOG_D(RLC, "\n");
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlc_pP,frame_t frameP) void rlc_am_retransmit_any_pdu(
rlc_am_entity_t* const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_sn_t sn = (rlc_pP->vt_s - 1) & RLC_AM_SN_MASK; rlc_sn_t sn = (rlc_pP->vt_s - 1) & RLC_AM_SN_MASK;
......
...@@ -69,7 +69,12 @@ Address : EURECOM, ...@@ -69,7 +69,12 @@ Address : EURECOM,
* \param[in] so_endP Transport blocks received from MAC layer. * \param[in] so_endP Transport blocks received from MAC layer.
* \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU. * \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
*/ */
protected_rlc_am_retransmit(void rlc_am_nack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_endP);) protected_rlc_am_retransmit(void rlc_am_nack_pdu (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_endP);)
/*! \fn void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP) /*! \fn void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
...@@ -78,7 +83,10 @@ protected_rlc_am_retransmit(void rlc_am_nack_pdu (rlc_am_entity_t *rlcP, ...@@ -78,7 +83,10 @@ protected_rlc_am_retransmit(void rlc_am_nack_pdu (rlc_am_entity_t *rlcP,
* \param[in] snP Sequence number of the PDU that is acknowledged. * \param[in] snP Sequence number of the PDU that is acknowledged.
* \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU. * \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU.
*/ */
protected_rlc_am_retransmit(void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP);) protected_rlc_am_retransmit(void rlc_am_ack_pdu (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP);)
/*! \fn mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP) /*! \fn mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
...@@ -87,7 +95,10 @@ protected_rlc_am_retransmit(void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, ...@@ -87,7 +95,10 @@ protected_rlc_am_retransmit(void rlc_am_ack_pdu (rlc_am_entity_t *rlcP,
* \param[in] snP Sequence number of the PDU to be copied. * \param[in] snP Sequence number of the PDU to be copied.
* \return A copy of the PDU having sequence number equal to parameter snP. * \return A copy of the PDU having sequence number equal to parameter snP.
*/ */
protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP)); protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP));
/*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t *sizeP) /*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t *sizeP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
...@@ -97,14 +108,20 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (rlc_am_enti ...@@ -97,14 +108,20 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (rlc_am_enti
* \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment). * \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment).
* \return A copy of a segment of the PDU having sequence number equal to parameter snP. * \return A copy of a segment of the PDU having sequence number equal to parameter snP.
*/ */
protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t *sizeP)); protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t *const sizeP));
/*! \fn void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,frame_t frameP) /*! \fn void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,frame_t frameP)
* \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU. * \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index. * \param[in] frameP Frame index.
*/ */
protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,frame_t frameP);) protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(
rlc_am_entity_t* const rlcP,
const frame_t frameP);)
/*! \fn void rlc_am_tx_buffer_display (rlc_am_entity_t* rlcP, frame_t frameP, char* message_pP) /*! \fn void rlc_am_tx_buffer_display (rlc_am_entity_t* rlcP, frame_t frameP, char* message_pP)
* \brief Display the dump of the retransmission buffer. * \brief Display the dump of the retransmission buffer.
...@@ -112,6 +129,9 @@ protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP ...@@ -112,6 +129,9 @@ protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP
* \param[in] frameP Frame index. * \param[in] frameP Frame index.
* \param[in] message_pP Message to be displayed along with the display of the dump of the retransmission buffer. * \param[in] message_pP Message to be displayed along with the display of the dump of the retransmission buffer.
*/ */
protected_rlc_am_retransmit(void rlc_am_tx_buffer_display (rlc_am_entity_t* rlcP, frame_t frameP, char* message_pP);) protected_rlc_am_retransmit(void rlc_am_tx_buffer_display (
rlc_am_entity_t* const rlcP,
const frame_t frameP,
char* const message_pP);)
/** @} */ /** @} */
# endif # endif
...@@ -45,7 +45,11 @@ Address : EURECOM, ...@@ -45,7 +45,11 @@ Address : EURECOM,
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_pdu_polling (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_sn_10_t *pdu_pP, int16_t payload_sizeP) void rlc_am_pdu_polling (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
rlc_am_pdu_sn_10_t *const pdu_pP,
const int16_t payload_sizeP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// 5.2.2 Polling // 5.2.2 Polling
...@@ -134,14 +138,16 @@ void rlc_am_pdu_polling (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_sn_ ...@@ -134,14 +138,16 @@ void rlc_am_pdu_polling (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_am_pdu_sn_
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_segment_10 (rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_segment_10 (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
list_t pdus; list_t pdus;
signed int pdu_remaining_size = 0; sdu_size_t pdu_remaining_size = 0;
signed int test_pdu_remaining_size = 0; sdu_size_t test_pdu_remaining_size = 0;
int nb_bytes_to_transmit = rlc_pP->nb_bytes_requested_by_mac; sdu_size_t nb_bytes_to_transmit = rlc_pP->nb_bytes_requested_by_mac;
rlc_am_pdu_sn_10_t *pdu_p = NULL; rlc_am_pdu_sn_10_t *pdu_p = NULL;
struct mac_tb_req *pdu_tb_req_p = NULL; struct mac_tb_req *pdu_tb_req_p = NULL;
mem_block_t *pdu_mem_p = NULL; mem_block_t *pdu_mem_p = NULL;
...@@ -151,21 +157,21 @@ void rlc_am_segment_10 (rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -151,21 +157,21 @@ void rlc_am_segment_10 (rlc_am_entity_t *rlc_pP,frame_t frameP)
rlc_am_tx_sdu_management_t *sdu_mngt_p = NULL; rlc_am_tx_sdu_management_t *sdu_mngt_p = NULL;
rlc_am_tx_data_pdu_management_t *pdu_mngt_p = NULL; rlc_am_tx_data_pdu_management_t *pdu_mngt_p = NULL;
unsigned int li_length_in_bytes = 0; sdu_size_t li_length_in_bytes = 0;
unsigned int test_li_length_in_bytes = 0; sdu_size_t test_li_length_in_bytes = 0;
unsigned int test_remaining_size_to_substract= 0; sdu_size_t test_remaining_size_to_substract= 0;
unsigned int test_remaining_num_li_to_substract = 0; unsigned int test_remaining_num_li_to_substract = 0;
unsigned int continue_fill_pdu_with_sdu = 0; unsigned int continue_fill_pdu_with_sdu = 0;
unsigned int num_fill_sdu = 0; unsigned int num_fill_sdu = 0;
unsigned int test_num_li = 0; unsigned int test_num_li = 0;
unsigned int fill_num_li = 0; unsigned int fill_num_li = 0;
unsigned int sdu_buffer_index = 0; unsigned int sdu_buffer_index = 0;
unsigned int data_pdu_size = 0; sdu_size_t data_pdu_size = 0;
unsigned int fi_first_byte_pdu_is_first_byte_sdu = 0; unsigned int fi_first_byte_pdu_is_first_byte_sdu = 0;
unsigned int fi_last_byte_pdu_is_last_byte_sdu = 0; unsigned int fi_last_byte_pdu_is_last_byte_sdu = 0;
unsigned int fi = 0; unsigned int fi = 0;
unsigned int max_li_overhead = 0; signed int max_li_overhead = 0;
LOG_T(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][SEGMENT] rlc_pP->current_sdu_index %d rlc_pP->next_sdu_index %d rlc_pP->input_sdus[rlc_pP->current_sdu_index].mem_block %p sdu_buffer_occupancy %d\n", LOG_T(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][SEGMENT] rlc_pP->current_sdu_index %d rlc_pP->next_sdu_index %d rlc_pP->input_sdus[rlc_pP->current_sdu_index].mem_block %p sdu_buffer_occupancy %d\n",
frameP, frameP,
......
...@@ -38,13 +38,18 @@ Address : EURECOM, ...@@ -38,13 +38,18 @@ Address : EURECOM,
#define TRACE_RLC_AM_HOLE #define TRACE_RLC_AM_HOLE
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_clear_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP) void rlc_am_clear_holes (
rlc_am_entity_t * const rlc_pP,
const rlc_sn_t snP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_pP->pdu_retrans_buffer[snP].num_holes = 0; rlc_pP->pdu_retrans_buffer[snP].num_holes = 0;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_shift_down_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP) void rlc_am_shift_down_holes (
rlc_am_entity_t *const rlc_pP,
const rlc_sn_t snP,
const int indexP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int i; int i;
...@@ -55,7 +60,10 @@ void rlc_am_shift_down_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP) ...@@ -55,7 +60,10 @@ void rlc_am_shift_down_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP)
rlc_pP->pdu_retrans_buffer[snP].num_holes = rlc_pP->pdu_retrans_buffer[snP].num_holes - 1; rlc_pP->pdu_retrans_buffer[snP].num_holes = rlc_pP->pdu_retrans_buffer[snP].num_holes - 1;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_shift_up_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP) void rlc_am_shift_up_holes (
rlc_am_entity_t *const rlc_pP,
const rlc_sn_t snP,
const int indexP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// shift include indexP // shift include indexP
...@@ -68,7 +76,12 @@ void rlc_am_shift_up_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP) ...@@ -68,7 +76,12 @@ void rlc_am_shift_up_holes (rlc_am_entity_t *rlc_pP, rlc_sn_t snP, int indexP)
assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU); assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_remove_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, uint16_t so_startP, uint16_t so_stopP) void rlc_am_remove_hole (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_stopP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int i; int i;
...@@ -174,7 +187,12 @@ void rlc_am_remove_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, ...@@ -174,7 +187,12 @@ void rlc_am_remove_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP,
assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size); assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_get_next_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, int* so_startP, int* so_stopP) void rlc_am_get_next_hole (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t* const so_startP,
sdu_size_t* const so_stopP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) { if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
...@@ -209,7 +227,12 @@ void rlc_am_get_next_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP ...@@ -209,7 +227,12 @@ void rlc_am_get_next_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_add_hole (rlc_am_entity_t *rlc_pP, frame_t frameP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP) void rlc_am_add_hole (
rlc_am_entity_t *const rlc_pP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t so_startP,
sdu_size_t so_stopP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
int i, hole_index; int i, hole_index;
......
...@@ -66,9 +66,11 @@ Address : EURECOM, ...@@ -66,9 +66,11 @@ Address : EURECOM,
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] snP Sequence number. * \param[in] snP Sequence number.
*/ */
protected_rlc_am_segments_holes(void rlc_am_clear_holes (rlc_am_entity_t *rlcP, rlc_sn_t snP);) protected_rlc_am_segments_holes(void rlc_am_clear_holes (
rlc_am_entity_t *const rlcP,
const rlc_sn_t snP);)
/*! \fn void rlc_am_remove_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, uint16_t so_startP, uint16_t so_stopP) /*! \fn void rlc_am_remove_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP)
* \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. * \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP].
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index. * \param[in[ frame Frame index.
...@@ -76,9 +78,14 @@ protected_rlc_am_segments_holes(void rlc_am_clear_holes (rlc_am_entity_t *rlcP, ...@@ -76,9 +78,14 @@ protected_rlc_am_segments_holes(void rlc_am_clear_holes (rlc_am_entity_t *rlcP,
* \param[in] so_startP Start of segment offset. * \param[in] so_startP Start of segment offset.
* \param[in] so_stopP End of segment offset. * \param[in] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_remove_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, uint16_t so_startP, uint16_t so_stopP);) protected_rlc_am_segments_holes(void rlc_am_remove_hole (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_stopP);)
/*! \fn void rlc_am_get_next_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, int* so_startP, int* so_stopP) /*! \fn void rlc_am_get_next_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t* so_startP, sdu_size_t* so_stopP)
* \brief Get for PDU with sequence number "snP" the first hole start and stop parameters. * \brief Get for PDU with sequence number "snP" the first hole start and stop parameters.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index. * \param[in[ frame Frame index.
...@@ -86,9 +93,14 @@ protected_rlc_am_segments_holes(void rlc_am_remove_hole (rlc_am_entity_t *rlcP, ...@@ -86,9 +93,14 @@ protected_rlc_am_segments_holes(void rlc_am_remove_hole (rlc_am_entity_t *rlcP,
* \param[in,out] so_startP Start of segment offset. * \param[in,out] so_startP Start of segment offset.
* \param[in,out] so_stopP End of segment offset. * \param[in,out] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_get_next_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, int* so_startP, int* so_stopP);) protected_rlc_am_segments_holes(void rlc_am_get_next_hole (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t* const so_startP,
sdu_size_t* const so_stopP);)
/*! \fn void rlc_am_add_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, uint16_t so_startP, uint16_t so_stopP) /*! \fn void rlc_am_add_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP)
* \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. * \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP].
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index. * \param[in[ frame Frame index.
...@@ -96,6 +108,11 @@ protected_rlc_am_segments_holes(void rlc_am_get_next_hole (rlc_am_entity_t *rlcP ...@@ -96,6 +108,11 @@ protected_rlc_am_segments_holes(void rlc_am_get_next_hole (rlc_am_entity_t *rlcP
* \param[in,out] so_startP Start of segment offset. * \param[in,out] so_startP Start of segment offset.
* \param[in,out] so_stopP End of segment offset. * \param[in,out] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_add_hole (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, uint16_t so_startP, uint16_t so_stopP);) protected_rlc_am_segments_holes(void rlc_am_add_hole (
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t so_startP,
sdu_size_t so_stopP);)
/** @} */ /** @} */
#endif #endif
...@@ -115,7 +115,7 @@ void rlc_am_write16_bit_field(uint8_t** data_ppP, unsigned int* bit_pos_pP, sign ...@@ -115,7 +115,7 @@ void rlc_am_write16_bit_field(uint8_t** data_ppP, unsigned int* bit_pos_pP, sign
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_t* header_pP, sdu_ssize_t *total_size_pP, rlc_am_control_pdu_info_t* pdu_info_pP) signed int rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_t* header_pP, sdu_size_t *total_size_pP, rlc_am_control_pdu_info_t* pdu_info_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
memset(pdu_info_pP, 0, sizeof (rlc_am_control_pdu_info_t)); memset(pdu_info_pP, 0, sizeof (rlc_am_control_pdu_info_t));
...@@ -153,16 +153,16 @@ signed int rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_t* header_pP, sdu_ssize ...@@ -153,16 +153,16 @@ signed int rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_t* header_pP, sdu_ssize
if (!pdu_info_pP->nack_list[pdu_info_pP->num_nack - 1].e1) { if (!pdu_info_pP->nack_list[pdu_info_pP->num_nack - 1].e1) {
nack_to_read = 0; nack_to_read = 0;
*total_size_pP = *total_size_pP - (sdu_ssize_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP); *total_size_pP = *total_size_pP - (sdu_size_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP);
return 0; return 0;
} }
if (pdu_info_pP->num_nack == RLC_AM_MAX_NACK_IN_STATUS_PDU) { if (pdu_info_pP->num_nack == RLC_AM_MAX_NACK_IN_STATUS_PDU) {
*total_size_pP = *total_size_pP - (sdu_ssize_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP); *total_size_pP = *total_size_pP - (sdu_size_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP);
return -2; return -2;
} }
} }
*total_size_pP = *total_size_pP - (sdu_ssize_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP); *total_size_pP = *total_size_pP - (sdu_size_t)((uint64_t)byte_pos_p + (uint64_t)((bit_pos + 7)/8) - (uint64_t)header_pP);
} else { } else {
*total_size_pP = *total_size_pP - 2; *total_size_pP = *total_size_pP - 2;
} }
...@@ -195,11 +195,11 @@ void rlc_am_display_control_pdu_infos(rlc_am_control_pdu_info_t* pdu_info_pP) ...@@ -195,11 +195,11 @@ void rlc_am_display_control_pdu_infos(rlc_am_control_pdu_info_t* pdu_info_pP)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_receive_process_control_pdu(rlc_am_entity_t* rlc_pP, frame_t frameP, mem_block_t* tb_pP, uint8_t** first_byte_ppP, sdu_ssize_t *tb_size_in_bytes_pP) void rlc_am_receive_process_control_pdu(rlc_am_entity_t* rlc_pP, frame_t frameP, mem_block_t* tb_pP, uint8_t** first_byte_ppP, sdu_size_t *tb_size_in_bytes_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)*first_byte_ppP; rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)*first_byte_ppP;
sdu_ssize_t initial_pdu_size = *tb_size_in_bytes_pP; sdu_size_t initial_pdu_size = *tb_size_in_bytes_pP;
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &g_rlc_am_control_pdu_info) >= 0) { if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &g_rlc_am_control_pdu_info) >= 0) {
......
...@@ -93,15 +93,22 @@ protected_rlc_am_status_report(void rlc_am_write8_bit_field(uint8_t** dat ...@@ -93,15 +93,22 @@ protected_rlc_am_status_report(void rlc_am_write8_bit_field(uint8_t** dat
* \param[in] bits_to_writeP Number of bits to write (max 16). * \param[in] bits_to_writeP Number of bits to write (max 16).
* \param[in] valueP Value to write. * \param[in] valueP Value to write.
*/ */
protected_rlc_am_status_report(void rlc_am_write16_bit_field(uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, uint16_t valueP);) protected_rlc_am_status_report(void rlc_am_write16_bit_field(
uint8_t** dataP,
unsigned int* bit_posP,
signed int bits_to_writeP,
uint16_t valueP);)
/*! \fn signed int rlc_am_get_control_pdu_infos (rlc_am_pdu_sn_10_t* headerP, int16_t total_sizeP, rlc_am_control_pdu_info_t* pdu_infoP) /*! \fn signed int rlc_am_get_control_pdu_infos (rlc_am_pdu_sn_10_t* headerP, sdu_size_t *total_sizeP, rlc_am_control_pdu_info_t* pdu_infoP)
* \brief Retrieve control PDU informations from a serialized control PDU. * \brief Retrieve control PDU informations from a serialized control PDU.
* \param[in] headerP Pointer on the header of the RLC AM PDU. * \param[in] headerP Pointer on the header of the RLC AM PDU.
* \param[in] total_size_pP Pointer on PDU size in bytes. * \param[in] total_size_pP Pointer on PDU size in bytes.
* \param[in,out] pdu_infoP Struct containing interpreted PDU control informations. * \param[in,out] pdu_infoP Struct containing interpreted PDU control informations.
*/ */
protected_rlc_am_status_report( signed int rlc_am_get_control_pdu_infos (rlc_am_pdu_sn_10_t* headerP, int16_t *total_size_pP, rlc_am_control_pdu_info_t* pdu_infoP);) protected_rlc_am_status_report( signed int rlc_am_get_control_pdu_infos (
rlc_am_pdu_sn_10_t* headerP,
sdu_size_t *total_size_pP,
rlc_am_control_pdu_info_t* pdu_infoP);)
/*! \fn void rlc_am_display_control_pdu_infos(rlc_am_control_pdu_info_t* pdu_infoP) /*! \fn void rlc_am_display_control_pdu_infos(rlc_am_control_pdu_info_t* pdu_infoP)
* \brief Dump on LOG output the informations contained in the pdu_infoP structure. * \brief Dump on LOG output the informations contained in the pdu_infoP structure.
...@@ -117,7 +124,12 @@ protected_rlc_am_status_report( void rlc_am_display_control_pdu_infos(rlc_am_con ...@@ -117,7 +124,12 @@ protected_rlc_am_status_report( void rlc_am_display_control_pdu_infos(rlc_am_con
* \param[in] first_byte Pointer on first byte of control PDU. * \param[in] first_byte Pointer on first byte of control PDU.
* \param[in] tb_size_in_bytes Pointer on size of serialized control PDU in bytes. * \param[in] tb_size_in_bytes Pointer on size of serialized control PDU in bytes.
*/ */
protected_rlc_am_status_report( void rlc_am_receive_process_control_pdu(rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* tbP, uint8_t** first_byte, int16_t *tb_size_in_bytes);) protected_rlc_am_status_report( void rlc_am_receive_process_control_pdu(
rlc_am_entity_t* rlcP,
frame_t frameP,
mem_block_t* tbP,
uint8_t** first_byte,
sdu_size_t *tb_size_in_bytes);)
/*! \fn int rlc_am_write_status_pdu(frame_t frameP,rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10P, rlc_am_control_pdu_info_t* pdu_infoP) /*! \fn int rlc_am_write_status_pdu(frame_t frameP,rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10P, rlc_am_control_pdu_info_t* pdu_infoP)
* \brief Remove all marked holes for PDU with sequence number "snP". * \brief Remove all marked holes for PDU with sequence number "snP".
......
...@@ -117,11 +117,11 @@ typedef struct rlc_am_tx_data_pdu_management { ...@@ -117,11 +117,11 @@ typedef struct rlc_am_tx_data_pdu_management {
sdu_size_t hole_so_start [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the start segment offsets for marking a hole (negative acknowledged area) in the PDU. */ sdu_size_t hole_so_start [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the start segment offsets for marking a hole (negative acknowledged area) in the PDU. */
sdu_size_t hole_so_stop [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the stop segment offsets for marking a hole (negative acknowledged area) in the PDU. */ sdu_size_t hole_so_stop [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the stop segment offsets for marking a hole (negative acknowledged area) in the PDU. */
uint8_t num_holes; /*!< \brief Number of registereg holes in hole_so_start[], hole_so_stop[]. */ uint8_t num_holes; /*!< \brief Number of registereg holes in hole_so_start[], hole_so_stop[]. */
sdu_ssize_t header_and_payload_size; /*!< \brief Size of the PDU in bytes, including header and payload. */ sdu_size_t header_and_payload_size; /*!< \brief Size of the PDU in bytes, including header and payload. */
sdu_ssize_t payload_size; /*!< \brief Size of the PDU payload in bytes. */ sdu_size_t payload_size; /*!< \brief Size of the PDU payload in bytes. */
rlc_sn_t sn; /*!< \brief Sequence number of the PDU. */ rlc_sn_t sn; /*!< \brief Sequence number of the PDU. */
sdu_ssize_t nack_so_start; /*!< \brief Lowest NACK start segment offset, must be set to 0 if global NACK. */ sdu_size_t nack_so_start; /*!< \brief Lowest NACK start segment offset, must be set to 0 if global NACK. */
sdu_ssize_t nack_so_stop; /*!< \brief Highest NACK stop segment offset, must be set to data_size if global NACK */ sdu_size_t nack_so_stop; /*!< \brief Highest NACK stop segment offset, must be set to data_size if global NACK */
int8_t nb_sdus; /*!< \brief Number of sdu having segments in this pdu. */ int8_t nb_sdus; /*!< \brief Number of sdu having segments in this pdu. */
int8_t retx_count; /*!< \brief Counts the number of retransmissions of an AMD PDU (see subclause 5.2.1). There is one RETX_COUNT counter per PDU that needs to be retransmitted. there is one VT(DAT) for each PDU and it is incremented each time the PDU is transmitted. */ int8_t retx_count; /*!< \brief Counts the number of retransmissions of an AMD PDU (see subclause 5.2.1). There is one RETX_COUNT counter per PDU that needs to be retransmitted. there is one VT(DAT) for each PDU and it is incremented each time the PDU is transmitted. */
......
...@@ -40,7 +40,9 @@ Address : EURECOM, ...@@ -40,7 +40,9 @@ Address : EURECOM,
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_check_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_check_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
// 5.2.2.3 Expiry of t-PollRetransmit // 5.2.2.3 Expiry of t-PollRetransmit
...@@ -82,19 +84,21 @@ void rlc_am_check_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -82,19 +84,21 @@ void rlc_am_check_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP)
rlc_pP->ue_module_id, rlc_pP->ue_module_id,
rlc_pP->rb_id); rlc_pP->rb_id);
#warning TO DO rlc_am_check_timer_poll_retransmit //#warning TO DO rlc_am_check_timer_poll_retransmit
rlc_pP->t_poll_retransmit.frame_time_out = frameP + rlc_pP->t_poll_retransmit.time_out; rlc_pP->t_poll_retransmit.frame_time_out = frameP + rlc_pP->t_poll_retransmit.time_out;
} }
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *rlc_pP) int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *const rlc_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
return rlc_pP->t_poll_retransmit.timed_out; return rlc_pP->t_poll_retransmit.timed_out;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_stop_and_reset_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_D(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][T_POLL_RETRANSMIT] STOPPED AND RESET\n", LOG_D(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][T_POLL_RETRANSMIT] STOPPED AND RESET\n",
...@@ -109,7 +113,9 @@ void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t ...@@ -109,7 +113,9 @@ void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t
rlc_pP->t_poll_retransmit.timed_out = 0; rlc_pP->t_poll_retransmit.timed_out = 0;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_start_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_pP->t_poll_retransmit.running = 1; rlc_pP->t_poll_retransmit.running = 1;
...@@ -125,7 +131,9 @@ void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -125,7 +131,9 @@ void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP)
rlc_pP->t_poll_retransmit.frame_time_out); rlc_pP->t_poll_retransmit.frame_time_out);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_init_timer_poll_retransmit(rlc_am_entity_t *rlc_pP, uint32_t time_outP) void rlc_am_init_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const uint32_t time_outP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_pP->t_poll_retransmit.running = 0; rlc_pP->t_poll_retransmit.running = 0;
......
...@@ -66,34 +66,42 @@ Address : EURECOM, ...@@ -66,34 +66,42 @@ Address : EURECOM,
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index * \param[in] frame Frame index
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_check_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP)); protected_rlc_am_timer_poll_retransmit(void rlc_am_check_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP));
/*! \fn int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *rlc_pP) /*! \fn int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *rlc_pP)
* \brief Boolean function, check if timer Poll-retransmit has timed-out. * \brief Boolean function, check if timer Poll-retransmit has timed-out.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \return 1 if timer Poll-retransmit has timed-out, else 0. * \return 1 if timer Poll-retransmit has timed-out, else 0.
*/ */
protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *rlc_pP);) protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *const rlc_pP);)
/*! \fn void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP)
* \brief Stop and reset the timer Poll-retransmit. * \brief Stop and reset the timer Poll-retransmit.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index * \param[in] frame Frame index
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP);) protected_rlc_am_timer_poll_retransmit(void rlc_am_stop_and_reset_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP);)
/*! \fn void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP)
* \brief Re-arm (based on RLC AM config parameter) and start timer Poll-retransmit. * \brief Re-arm (based on RLC AM config parameter) and start timer Poll-retransmit.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index * \param[in] frame Frame index
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP);) protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP);)
/*! \fn void rlc_am_init_timer_poll_retransmit(rlc_am_entity_t *rlc_pP, uint32_t time_outP) /*! \fn void rlc_am_init_timer_poll_retransmit(rlc_am_entity_t *rlc_pP, uint32_t time_outP)
* \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter. * \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] time_outP Time-out in frame units. * \param[in] time_outP Time-out in frame units.
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_init_timer_poll_retransmit(rlc_am_entity_t *rlc_pP, uint32_t time_outP);) protected_rlc_am_timer_poll_retransmit(void rlc_am_init_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP,
const uint32_t time_outP);)
/** @} */ /** @} */
#endif #endif
...@@ -40,7 +40,9 @@ Address : EURECOM, ...@@ -40,7 +40,9 @@ Address : EURECOM,
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_check_timer_status_prohibit(
rlc_am_entity_t * const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->t_status_prohibit.time_out > 0) { if (rlc_pP->t_status_prohibit.time_out > 0) {
...@@ -74,7 +76,7 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -74,7 +76,7 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP)
rlc_pP->enb_module_id, rlc_pP->enb_module_id,
rlc_pP->ue_module_id, rlc_pP->ue_module_id,
rlc_pP->rb_id); rlc_pP->rb_id);
#warning TO DO rlc_am_check_timer_status_prohibit //#warning TO DO rlc_am_check_timer_status_prohibit
rlc_am_stop_and_reset_timer_status_prohibit(rlc_pP, frameP); rlc_am_stop_and_reset_timer_status_prohibit(rlc_pP, frameP);
//rlc_pP->t_status_prohibit.frame_time_out = frameP + rlc_pP->t_status_prohibit.time_out; //rlc_pP->t_status_prohibit.frame_time_out = frameP + rlc_pP->t_status_prohibit.time_out;
} }
...@@ -82,7 +84,9 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -82,7 +84,9 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_stop_and_reset_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_stop_and_reset_timer_status_prohibit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->t_status_prohibit.time_out > 0) { if (rlc_pP->t_status_prohibit.time_out > 0) {
...@@ -99,7 +103,9 @@ void rlc_am_stop_and_reset_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t ...@@ -99,7 +103,9 @@ void rlc_am_stop_and_reset_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_start_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) void rlc_am_start_timer_status_prohibit(
rlc_am_entity_t *const rlc_pP,
const frame_t frameP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->t_status_prohibit.time_out > 0) { if (rlc_pP->t_status_prohibit.time_out > 0) {
...@@ -118,7 +124,9 @@ void rlc_am_start_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP) ...@@ -118,7 +124,9 @@ void rlc_am_start_timer_status_prohibit(rlc_am_entity_t *rlc_pP,frame_t frameP)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_init_timer_status_prohibit(rlc_am_entity_t *rlc_pP, uint32_t time_outP) void rlc_am_init_timer_status_prohibit(
rlc_am_entity_t *const rlc_pP,
const uint32_t time_outP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
rlc_pP->t_status_prohibit.running = 0; rlc_pP->t_status_prohibit.running = 0;
......
This diff is collapsed.
...@@ -69,58 +69,73 @@ Address : EURECOM, ...@@ -69,58 +69,73 @@ Address : EURECOM,
/*! \fn void rlc_tm_send_sdu (rlc_tm_entity_t *rlcP, uint8_t error_indicationP, uint8_t * srcP, uint16_t length_in_bitsP) /*! \fn void rlc_tm_send_sdu (
* rlc_tm_entity_t * const rlc_pP,
* const frame_t frameP,
* const eNB_flag_t eNB_flag,
* const boolean_t error_indicationP,
* uint8_t * const srcP,
* const sdu_size_t length_in_bitsP)
* \brief Send SDU if any reassemblied to upper layer. * \brief Send SDU if any reassemblied to upper layer.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] error_indicationP Error indicated by lower layers for this SDU. * \param[in] error_indicationP Error indicated by lower layers for this SDU.
* \param[in] srcP SDU data pointer. * \param[in] srcP SDU data pointer.
* \param[in] length_in_bitsP Length of SDU in bits. * \param[in] length_in_bitsP Length of SDU in bits.
*/ */
private_rlc_tm(void rlc_tm_send_sdu (rlc_tm_entity_t *rlcP, uint8_t error_indicationP, uint8_t * srcP, uint16_t length_in_bitsP);) private_rlc_tm(void rlc_tm_send_sdu (
rlc_tm_entity_t * const rlc_pP,
const frame_t frameP,
const eNB_flag_t eNB_flag,
const boolean_t error_indicationP,
uint8_t * const srcP,
const sdu_size_t length_in_bitsP);)
/*! \fn void rlc_tm_no_segment (rlc_tm_entity_t *rlcP) /*! \fn void rlc_tm_no_segment (rlc_tm_entity_t *rlcP)
* \brief Schedule a SDU to be transmited by lower layers. * \brief Schedule a SDU to be transmited by lower layers.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
private_rlc_tm(void rlc_tm_no_segment (rlc_tm_entity_t *rlcP);) private_rlc_tm(void rlc_tm_no_segment (rlc_tm_entity_t *const rlcP);)
/*! \fn void rlc_tm_rx (void *rlcP, frame_t frame, struct mac_data_ind data_indP) /*! \fn void rlc_tm_rx (void *const rlcP, const frame_t frameP, struct mac_data_ind data_indP)
* \brief Process the received PDUs from lower layer. * \brief Process the received PDUs from lower layer.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frameP Frame index.
* \param[in] data_indP PDUs from MAC. * \param[in] data_indP PDUs from MAC.
*/ */
private_rlc_tm( void rlc_tm_rx (void *rlcP, frame_t frame, struct mac_data_ind data_indP);) private_rlc_tm( void rlc_tm_rx (
void *const rlcP,
const frame_t frameP,
struct mac_data_ind data_indP);)
/*! \fn struct mac_status_resp rlc_tm_mac_status_indication (void *rlcP, frame_t frame, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP) /*! \fn struct mac_status_resp rlc_tm_mac_status_indication (void *rlcP, const frame_t frameP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
* \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission. * \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frameP Frame index.
* \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission. * \param[in] tbs_sizeP Number of bytes requested by MAC for next transmission.
* \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU. * \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU.
* \return The maximum number of bytes that can be served by RLC instance to MAC. * \return The maximum number of bytes that can be served by RLC instance to MAC.
*/ */
public_rlc_tm( struct mac_status_resp rlc_tm_mac_status_indication (void *rlcP, frame_t frame, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);) public_rlc_tm( struct mac_status_resp rlc_tm_mac_status_indication (void *rlcP, const frame_t frameP, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);)
/*! \fn struct mac_data_req rlc_tm_mac_data_request (void *rlcP, frame_t frame) /*! \fn struct mac_data_req rlc_tm_mac_data_request (void *rlcP, const frame_t frameP)
* \brief Gives PDUs to lower layer MAC. * \brief Gives PDUs to lower layer MAC.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] frame Frame index. * \param[in] frameP Frame index.
* \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission. * \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
*/ */
public_rlc_tm( struct mac_data_req rlc_tm_mac_data_request (void *rlcP, frame_t frame);) public_rlc_tm( struct mac_data_req rlc_tm_mac_data_request (void *rlcP, const frame_t frameP);)
/*! \fn void rlc_tm_mac_data_indication (void *rlcP, frame_t frame, uint8_t eNB_flag, struct mac_data_ind data_indP) /*! \fn void rlc_tm_mac_data_indication (void *rlcP, const frame_t frameP, uint8_t eNB_flag, struct mac_data_ind data_indP)
* \brief Receive PDUs from lower layer MAC. * \brief Receive PDUs from lower layer MAC.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] frame Frame Index. * \param[in] frameP Frame Index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0). * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0).
* \param[in] data_indP PDUs from MAC. * \param[in] data_indP PDUs from MAC.
*/ */
public_rlc_tm( void rlc_tm_mac_data_indication (void *rlcP, frame_t frame, uint8_t eNB_flag, struct mac_data_ind data_indP);) public_rlc_tm( void rlc_tm_mac_data_indication (void *rlcP, const frame_t frameP, uint8_t eNB_flag, struct mac_data_ind data_indP);)
/*! \fn void rlc_tm_data_req (void *rlcP, mem_block_t *sduP) /*! \fn void rlc_tm_data_req (void *rlcP, mem_block_t *sduP)
......
...@@ -35,13 +35,26 @@ Address : EURECOM, ...@@ -35,13 +35,26 @@ Address : EURECOM,
#include "rlc_tm.h" #include "rlc_tm.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void config_req_rlc_tm ( uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rlc_tm_info_t * config_tmP, rb_id_t rb_idP, rb_type_t rb_typeP) void config_req_rlc_tm (
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rlc_tm_info_t * const config_tmP,
const rb_id_t rb_idP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_tm_entity_t *rlc = NULL; rlc_union_t *rlc_union_p = NULL;
rlc_tm_entity_t *rlc_p = NULL;
hash_key_t key = RLC_COLL_KEY_VALUE(enb_module_idP, ue_module_idP, eNB_flagP, rb_idP, srb_flagP);
hashtable_rc_t h_rc;
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
rlc_p = &rlc_union_p->rlc.tm;
LOG_D(RLC, "[FRAME %05d][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (is_uplink_downlink=%d) --->][RLC_TM][MOD %u/%u][RB %u]\n", LOG_D(RLC, "[FRAME %05d][%s][RRC][MOD %u/%u][][--- CONFIG_REQ (is_uplink_downlink=%d) --->][RLC_TM][MOD %u/%u][RB %u]\n",
frame, frameP,
( eNB_flagP > 0) ? "eNB":"UE", ( eNB_flagP > 0) ? "eNB":"UE",
enb_module_idP, enb_module_idP,
ue_module_idP, ue_module_idP,
...@@ -50,19 +63,24 @@ void config_req_rlc_tm ( uint32_t frame, uint8_t eNB_flagP, module_id_t enb_modu ...@@ -50,19 +63,24 @@ void config_req_rlc_tm ( uint32_t frame, uint8_t eNB_flagP, module_id_t enb_modu
ue_module_idP, ue_module_idP,
rb_idP); rb_idP);
if (eNB_flagP) { rlc_tm_init(rlc_p);
rlc = &rlc_array_eNB[enb_module_idP][ue_module_idP][rb_idP].rlc.tm; rlc_p->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_tm_set_debug_infos(rlc_p, frameP, eNB_flagP, enb_module_idP, ue_module_idP, rb_idP, srb_flagP);
rlc_tm_configure(rlc_p, config_tmP->is_uplink_downlink);
} else { } else {
rlc = &rlc_array_ue[ue_module_idP][rb_idP].rlc.tm; LOG_E(RLC, "[FRAME %05d][%s][RRC][MOD %u/%u][][--- CONFIG_REQ --->][RLC_TM][MOD %u/%u][RB %u], RLC NOT FOUND\n",
frameP,
( eNB_flagP > 0) ? "eNB":"UE",
enb_module_idP,
ue_module_idP,
enb_module_idP,
ue_module_idP,
rb_idP);
} }
rlc_tm_init(rlc);
rlc->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_tm_set_debug_infos(rlc, frame, eNB_flagP, enb_module_idP, ue_module_idP, rb_idP, rb_typeP);
rlc_tm_configure(rlc, config_tmP->is_uplink_downlink);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_tm_init (rlc_tm_entity_t *rlcP) void rlc_tm_init (rlc_tm_entity_t * const rlcP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int saved_allocation = rlcP->allocation; int saved_allocation = rlcP->allocation;
...@@ -90,7 +108,7 @@ void rlc_tm_init (rlc_tm_entity_t *rlcP) ...@@ -90,7 +108,7 @@ void rlc_tm_init (rlc_tm_entity_t *rlcP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_tm_reset_state_variables (struct rlc_tm_entity *rlcP) void rlc_tm_reset_state_variables (struct rlc_tm_entity * const rlcP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlcP->output_sdu_size_to_write = 0; rlcP->output_sdu_size_to_write = 0;
...@@ -101,7 +119,7 @@ void rlc_tm_reset_state_variables (struct rlc_tm_entity *rlcP) ...@@ -101,7 +119,7 @@ void rlc_tm_reset_state_variables (struct rlc_tm_entity *rlcP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_tm_cleanup (rlc_tm_entity_t *rlcP) rlc_tm_cleanup (rlc_tm_entity_t * const rlcP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int index; int index;
...@@ -125,7 +143,9 @@ rlc_tm_cleanup (rlc_tm_entity_t *rlcP) ...@@ -125,7 +143,9 @@ rlc_tm_cleanup (rlc_tm_entity_t *rlcP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_tm_configure(rlc_tm_entity_t *rlcP, uint8_t is_uplink_downlinkP) void rlc_tm_configure(
rlc_tm_entity_t * const rlcP,
const boolean_t is_uplink_downlinkP)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlcP->is_uplink_downlink = is_uplink_downlinkP; rlcP->is_uplink_downlink = is_uplink_downlinkP;
...@@ -133,11 +153,18 @@ void rlc_tm_configure(rlc_tm_entity_t *rlcP, uint8_t is_uplink_downlinkP) ...@@ -133,11 +153,18 @@ void rlc_tm_configure(rlc_tm_entity_t *rlcP, uint8_t is_uplink_downlinkP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP, rb_type_t rb_typeP) void rlc_tm_set_debug_infos(
rlc_tm_entity_t * const rlcP,
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
msg ("[FRAME %05d][%s][RLC_TM][MOD %02u/%02u][RB %u][SET DEBUG INFOS] enb module_id %d ue module_id %d rb_id %d rb_type %d\n", msg ("[FRAME %05d][%s][RLC_TM][MOD %02u/%02u][RB %u][SET DEBUG INFOS] enb module_id %d ue module_id %d rb_id %d srb_flag %d\n",
frame, frameP,
(eNB_flagP) ? "eNB" : "UE", (eNB_flagP) ? "eNB" : "UE",
enb_module_idP, enb_module_idP,
ue_module_idP, ue_module_idP,
...@@ -145,15 +172,15 @@ void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, uint32_t frame, uint8_t eNB_f ...@@ -145,15 +172,15 @@ void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, uint32_t frame, uint8_t eNB_f
enb_module_idP, enb_module_idP,
ue_module_idP, ue_module_idP,
rb_idP, rb_idP,
rb_typeP); srb_flagP);
rlcP->enb_module_id = enb_module_idP; rlcP->enb_module_id = enb_module_idP;
rlcP->ue_module_id = ue_module_idP; rlcP->ue_module_id = ue_module_idP;
rlcP->rb_id = rb_idP; rlcP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) { if (srb_flagP) {
rlcP->is_data_plane = 1;
} else {
rlcP->is_data_plane = 0; rlcP->is_data_plane = 0;
} else {
rlcP->is_data_plane = 1;
} }
rlcP->is_enb = eNB_flagP; rlcP->is_enb = eNB_flagP;
} }
...@@ -68,59 +68,82 @@ Address : EURECOM, ...@@ -68,59 +68,82 @@ Address : EURECOM,
# endif # endif
# endif # endif
typedef volatile struct { typedef volatile struct rlc_tm_info_s{
uint8_t is_uplink_downlink; uint8_t is_uplink_downlink;
} rlc_tm_info_t; } rlc_tm_info_t;
/*! \fn void config_req_rlc_tm (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rlc_tm_info_t * config_tmP, rb_id_t rb_idP, rb_type_t rb_typeP) /*! \fn void config_req_rlc_tm (void config_req_rlc_tm (
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rlc_tm_info_t * const config_tmP,
const rb_id_t rb_idP,
const srb_flag_t srb_flagP)
* \brief Allocate memory for RLC TM instance, reset protocol variables, and set protocol parameters. * \brief Allocate memory for RLC TM instance, reset protocol variables, and set protocol parameters.
* \param[in] frame Frame index. * \param[in] frameP Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0) * \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] srb_flagP Flag to indicate SRB (1) or DRB (0)
* \param[in] enb_module_idP eNB Virtualized module identifier. * \param[in] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier. * \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] config_tmP Configuration parameters for RLC TM instance. * \param[in] config_tmP Configuration parameters for RLC TM instance.
* \param[in] rb_idP Radio bearer identifier. * \param[in] rb_idP Radio bearer identifier.
* \param[in] rb_typeP Radio bearer type (Signalling or Data). * \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
*/ */
public_rlc_tm_init( void config_req_rlc_tm (uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rlc_tm_info_t * config_tmP, rb_id_t rb_idP, rb_type_t rb_typeP);) public_rlc_tm_init( void config_req_rlc_tm (
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rlc_tm_info_t * const config_tmP,
const rb_id_t rb_idP);)
/*! \fn void rlc_tm_init (rlc_tm_entity_t *rlcP) /*! \fn void rlc_tm_init (rlc_tm_entity_t *rlcP)
* \brief Initialize a RLC TM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC TM protocol instance will be in RLC_NULL_STATE state. * \brief Initialize a RLC TM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC TM protocol instance will be in RLC_NULL_STATE state.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
protected_rlc_tm_init(void rlc_tm_init (rlc_tm_entity_t *rlcP);) protected_rlc_tm_init(void rlc_tm_init (rlc_tm_entity_t * const rlcP);)
/*! \fn void rlc_tm_reset_state_variables (rlc_tm_entity_t *rlcP) /*! \fn void rlc_tm_reset_state_variables (rlc_tm_entity_t *rlcP)
* \brief Reset protocol variables and state variables to initial values. * \brief Reset protocol variables and state variables to initial values.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
protected_rlc_tm_init(void rlc_tm_reset_state_variables (rlc_tm_entity_t *rlcP);) protected_rlc_tm_init(void rlc_tm_reset_state_variables (rlc_tm_entity_t * const rlcP);)
/*! \fn void rlc_tm_cleanup(rlc_tm_entity_t *rlcP) /*! \fn void rlc_tm_cleanup(rlc_tm_entity_t *rlcP)
* \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance. * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
*/ */
public_rlc_tm_init( void rlc_tm_cleanup(rlc_tm_entity_t *rlcP);) public_rlc_tm_init( void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP);)
/*! \fn void rlc_tm_configure(rlc_tm_entity_t *rlcP, uint32_t timer_reorderingP, uint32_t is_uplink_downlinkP) /*! \fn void rlc_tm_configure(rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP)
* \brief Configure RLC TM protocol parameters. * \brief Configure RLC TM protocol parameters.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY, * \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY,
RECEIVER_ONLY, or TRANSMITTER_AND_RECEIVER. RECEIVER_ONLY, or TRANSMITTER_AND_RECEIVER.
*/ */
protected_rlc_tm_init(void rlc_tm_configure(rlc_tm_entity_t *rlcP, uint8_t is_uplink_downlinkP);) protected_rlc_tm_init(void rlc_tm_configure(rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP);)
/*! \fn void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP, rb_type_t rb_typeP) /*! \fn void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, const frame_t frameP, uint8_t eNB_flagP, const module_id_t enb_module_idP, const module_id_t ue_module_idP, const rb_id_t rb_idP, const srb_flag_t srb_flagP)
* \brief Set debug informations for a RLC TM protocol instance, these informations are only for trace purpose. * \brief Set debug informations for a RLC TM protocol instance, these informations are only for trace purpose.
* \param[in] rlcP RLC TM protocol instance pointer. * \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] enb_module_idP eNB Virtualized module identifier. * \param[in] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier. * \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] frameP Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0)
* \param[in] srb_flagP Flag to indicate signalling radio bearer (1) or data radio bearer (0).
* \param[in] rb_idP Radio bearer identifier. * \param[in] rb_idP Radio bearer identifier.
* \param[in] rb_typeP Radio bearer type (Signalling or Data).
*/ */
protected_rlc_tm_init(void rlc_tm_set_debug_infos(rlc_tm_entity_t *rlcP, uint32_t frame, uint8_t eNB_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP, rb_type_t rb_typeP);) protected_rlc_tm_init(void rlc_tm_set_debug_infos(
rlc_tm_entity_t * const rlcP,
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frameP,
const eNB_flag_t eNB_flagP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP);)
/** @} */ /** @} */
# endif # endif
...@@ -47,7 +47,12 @@ Address : EURECOM, ...@@ -47,7 +47,12 @@ Address : EURECOM,
//#define TRACE_RLC_UM_RX 1 //#define TRACE_RLC_UM_RX 1
//#define TRACE_DISPLAY_NVIDIA 1 //#define TRACE_DISPLAY_NVIDIA 1
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_um_get_pdu_infos(frame_t frameP,rlc_um_pdu_sn_10_t* header_pP, sdu_ssize_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP) signed int rlc_um_get_pdu_infos(
const frame_t frameP,
rlc_um_pdu_sn_10_t * const header_pP,
const sdu_size_t total_sizeP,
rlc_um_pdu_info_t * const pdu_info_pP,
const uint8_t sn_lengthP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
sdu_size_t sum_li = 0; sdu_size_t sum_li = 0;
......
...@@ -74,7 +74,12 @@ Address : EURECOM, ...@@ -74,7 +74,12 @@ Address : EURECOM,
* \param[in] sn_lengthP Sequence number length in bits in PDU header (5 or 10). * \param[in] sn_lengthP Sequence number length in bits in PDU header (5 or 10).
* \return 0 if no error was encountered during the parsing of the PDU, else -1; * \return 0 if no error was encountered during the parsing of the PDU, else -1;
*/ */
protected_rlc_um_dar( signed int rlc_um_get_pdu_infos(frame_t frameP, rlc_um_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP)); protected_rlc_um_dar( signed int rlc_um_get_pdu_infos(
const frame_t frameP,
rlc_um_pdu_sn_10_t * const header_pP,
const sdu_size_t total_sizeP,
rlc_um_pdu_info_t * const pdu_info_pP,
const uint8_t sn_lengthP));
/*! \fn int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP) /*! \fn int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP)
* \brief Reset protocol variables and state variables to initial values. * \brief Reset protocol variables and state variables to initial values.
......
...@@ -97,7 +97,6 @@ typedef struct rlc_um_entity_s { ...@@ -97,7 +97,6 @@ typedef struct rlc_um_entity_s {
//----------------------------- //-----------------------------
// sdu communication; // sdu communication;
mem_block_t **input_sdus; /*!< \brief Input SDU buffer (for SDUs coming from upper layers). Should be accessed as an array. */ mem_block_t **input_sdus; /*!< \brief Input SDU buffer (for SDUs coming from upper layers). Should be accessed as an array. */
mem_block_t * input_sdus_alloc; /*!< \brief Allocated memory for the input SDU buffer (for SDUs coming from upper layers). */
uint16_t size_input_sdus_buffer; /*!< \brief Size of the input SDU buffer. */ uint16_t size_input_sdus_buffer; /*!< \brief Size of the input SDU buffer. */
uint16_t nb_sdu; /*!< \brief Total number of SDUs in input_sdus[] */ uint16_t nb_sdu; /*!< \brief Total number of SDUs in input_sdus[] */
uint16_t next_sdu_index; /*!< \brief Next SDU index for a new incomin SDU in input_sdus[]. */ uint16_t next_sdu_index; /*!< \brief Next SDU index for a new incomin SDU in input_sdus[]. */
...@@ -112,7 +111,6 @@ typedef struct rlc_um_entity_s { ...@@ -112,7 +111,6 @@ typedef struct rlc_um_entity_s {
sdu_size_t output_sdu_size_to_write; /*!< \brief Size of the reassemblied SDU. */ sdu_size_t output_sdu_size_to_write; /*!< \brief Size of the reassemblied SDU. */
mem_block_t **dar_buffer; /*!< \brief Array of rx PDUs. */ mem_block_t **dar_buffer; /*!< \brief Array of rx PDUs. */
mem_block_t *dar_buffer_alloc; /*!< \brief Allocated memory for the DAR buffer. */
list_t pdus_from_mac_layer; /*!< \brief Not Used. */ list_t pdus_from_mac_layer; /*!< \brief Not Used. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */ logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
......
...@@ -171,7 +171,16 @@ rlc_um_send_sdu (rlc_um_entity_t *rlc_pP,frame_t frameP, eNB_flag_t eNB_flagP) ...@@ -171,7 +171,16 @@ rlc_um_send_sdu (rlc_um_entity_t *rlc_pP,frame_t frameP, eNB_flag_t eNB_flagP)
rlc_um_v9_3_0_test_data_ind (rlc_pP->module_id, rlc_pP->rb_id, rlc_pP->output_sdu_size_to_write, rlc_pP->output_sdu_in_construction); rlc_um_v9_3_0_test_data_ind (rlc_pP->module_id, rlc_pP->rb_id, rlc_pP->output_sdu_size_to_write, rlc_pP->output_sdu_in_construction);
#else #else
// msg("[RLC] DATA IND ON MOD_ID %d RB ID %d, size %d\n",rlc_pP->module_id, rlc_pP->rb_id, frameP,rlc_pP->output_sdu_size_to_write); // msg("[RLC] DATA IND ON MOD_ID %d RB ID %d, size %d\n",rlc_pP->module_id, rlc_pP->rb_id, frameP,rlc_pP->output_sdu_size_to_write);
rlc_data_ind (rlc_pP->enb_module_id, rlc_pP->ue_module_id, frameP, eNB_flagP, rlc_pP->is_mxch, rlc_pP->rb_id, rlc_pP->output_sdu_size_to_write, rlc_pP->output_sdu_in_construction,rlc_pP->is_data_plane); rlc_data_ind (
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
frameP,
eNB_flagP,
BOOL_NOT(rlc_pP->is_data_plane),
rlc_pP->is_mxch,
rlc_pP->rb_id,
rlc_pP->output_sdu_size_to_write,
rlc_pP->output_sdu_in_construction);
#endif #endif
rlc_pP->output_sdu_in_construction = NULL; rlc_pP->output_sdu_in_construction = NULL;
} else { } else {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -42,9 +42,15 @@ Address : EURECOM, ...@@ -42,9 +42,15 @@ Address : EURECOM,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_op_status_t mpls_rlc_data_req (module_id_t enb_module_idP, module_id_t ue_module_idP, uint32_t frame, rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t* sduP) { rlc_op_status_t mpls_rlc_data_req (
const module_id_t enb_module_idP,
const module_id_t ue_module_idP,
const frame_t frame,
const rb_id_t rb_idP,
const sdu_size_t sdu_sizeP,
mem_block_t* const sduP) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// third arg should be set to 1 or 0 // third arg should be set to 1 or 0
return rlc_data_req(enb_module_idP, ue_module_idP, frame, 0, 0,rb_idP, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, sdu_sizeP, sduP); return rlc_data_req(enb_module_idP, ue_module_idP, frame, ENB_FLAG_NO, SRB_FLAG_NO, MBMS_FLAG_NO, rb_idP, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, sdu_sizeP, sduP);
} }
This diff is collapsed.
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
#define OAI_NW_DRV_PROTOCOL_UDP IPPROTO_UDP #define OAI_NW_DRV_PROTOCOL_UDP IPPROTO_UDP
#define OAI_NW_DRV_PROTOCOL_ICMP4 IPPROTO_ICMP #define OAI_NW_DRV_PROTOCOL_ICMP4 IPPROTO_ICMP
#define OAI_NW_DRV_PROTOCOL_ICMP6 IPPROTO_ICMPV6 #define OAI_NW_DRV_PROTOCOL_ICMP6 IPPROTO_ICMPV6
#warning "OAI_NW_DRV_PROTOCOL_ARP value 200 may collide with new defined values in kernel" //#warning "OAI_NW_DRV_PROTOCOL_ARP value 200 may collide with new defined values in kernel"
#define OAI_NW_DRV_PROTOCOL_ARP 200 #define OAI_NW_DRV_PROTOCOL_ARP 200
#define OAI_NW_DRV_PORT_DEFAULT __constant_htons(65535) #define OAI_NW_DRV_PORT_DEFAULT __constant_htons(65535)
......
...@@ -588,8 +588,16 @@ struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t ...@@ -588,8 +588,16 @@ struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t
#ifdef NAS_DEBUG_CLASS #ifdef NAS_DEBUG_CLASS
printk("NAS_COMMON_SEARCH_RB - rab_id %d\n", rab_id); printk("NAS_COMMON_SEARCH_RB - rab_id %d\n", rab_id);
#endif #endif
for (rb=cx->rb; rb!=NULL; rb=rb->next) for (rb=cx->rb; rb!=NULL; rb=rb->next) {
{ #ifdef NAS_DEBUG_CLASS
printk("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n");
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.rab_id %u \n", rb->rab_id);
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.sapi %u \n", rb->sapi;
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.qos %u \n", rb->qos;
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.state %u \n", rb->state;
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.retry %u \n", rb->retry;
printk("NAS_COMMON_SEARCH_RB - rab_id %d Comparing rb_entity.countimer %u \n\n", rb->countimer;);
#endif
if (rb->rab_id==rab_id) if (rb->rab_id==rab_id)
return rb; return rb;
} }
......
...@@ -248,7 +248,7 @@ void nas_set_msg_rb_establishment_reply(struct nas_msg_rb_establishment_reply *m ...@@ -248,7 +248,7 @@ void nas_set_msg_rb_establishment_reply(struct nas_msg_rb_establishment_reply *m
struct nas_priv *priv){ struct nas_priv *priv){
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// if ((msgreq->rab_id<3)||(msgreq->rab_id>127)) // if ((msgreq->rab_id<3)||(msgreq->rab_id>127))
if ((msgreq->rab_id<3)||(msgreq->rab_id>MAX_RABS)) // navid : increase the number if ((msgreq->rab_id<1)||(msgreq->rab_id>MAX_RABS)) // navid : increase the number
msgrep->status=-NAS_ERROR_NOTCORRECTRABI; msgrep->status=-NAS_ERROR_NOTCORRECTRABI;
else else
{ {
...@@ -319,7 +319,8 @@ void nas_set_msg_rb_release_reply(struct nas_msg_rb_release_reply *msgrep, ...@@ -319,7 +319,8 @@ void nas_set_msg_rb_release_reply(struct nas_msg_rb_release_reply *msgrep,
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int nas_ioCTL_rb_release_request(struct nas_ioctl *gifr, int nas_ioCTL_rb_release_request(
struct nas_ioctl *gifr,
struct nas_priv *priv){ struct nas_priv *priv){
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
struct nas_msg_rb_release_request msgreq; struct nas_msg_rb_release_request msgreq;
...@@ -342,9 +343,10 @@ int nas_ioCTL_rb_release_request(struct nas_ioctl *gifr, ...@@ -342,9 +343,10 @@ int nas_ioCTL_rb_release_request(struct nas_ioctl *gifr,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Classifier List // Classifier List
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void nas_set_msg_class_list_reply(uint8_t *msgrep, void nas_set_msg_class_list_reply(
uint8_t *msgrep,
struct nas_msg_class_list_request *msgreq, struct nas_msg_class_list_request *msgreq,
struct nas_priv *priv){ struct nas_priv *priv) {
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
struct cx_entity *cx; struct cx_entity *cx;
struct classifier_entity *gc; struct classifier_entity *gc;
...@@ -401,7 +403,8 @@ void nas_set_msg_class_list_reply(uint8_t *msgrep, ...@@ -401,7 +403,8 @@ void nas_set_msg_class_list_reply(uint8_t *msgrep,
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int nas_ioCTL_class_list_request(struct nas_ioctl *gifr, int nas_ioCTL_class_list_request(
struct nas_ioctl *gifr,
struct nas_priv *priv){ struct nas_priv *priv){
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1]; uint8_t msgrep[NAS_LIST_CLASS_MAX*sizeof(struct nas_msg_class_list_reply)+1];
...@@ -424,7 +427,8 @@ int nas_ioCTL_class_list_request(struct nas_ioctl *gifr, ...@@ -424,7 +427,8 @@ int nas_ioCTL_class_list_request(struct nas_ioctl *gifr,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Request the addition of a classifier rule // Request the addition of a classifier rule
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void nas_set_msg_class_add_reply(struct nas_msg_class_add_reply *msgrep, void nas_set_msg_class_add_reply(
struct nas_msg_class_add_reply *msgrep,
struct nas_msg_class_add_request *msgreq, struct nas_msg_class_add_request *msgreq,
struct nas_priv *priv){ struct nas_priv *priv){
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -519,7 +519,7 @@ uint8_t rrc_lite_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame ...@@ -519,7 +519,7 @@ uint8_t rrc_lite_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame
} }
#else #else
return pdcp_data_req (enb_mod_idP, ue_mod_idP, frameP, enb_flagP, rb_idP, muiP, confirmP, sdu_size, buffer_pP, mode); return pdcp_data_req (enb_mod_idP, ue_mod_idP, frameP, enb_flagP, SRB_FLAG_YES, rb_idP, muiP, confirmP, sdu_size, buffer_pP, mode);
#endif #endif
} }
......
...@@ -319,7 +319,7 @@ void rrc_ue_generate_RRCConnectionRequest(module_id_t ue_mod_idP, frame_t frameP ...@@ -319,7 +319,7 @@ void rrc_ue_generate_RRCConnectionRequest(module_id_t ue_mod_idP, frame_t frameP
mui_t rrc_mui=0; mui_t rrc_mui=0;
/* NAS Attach request with IMSI */ /* NAS Attach request with IMSI */
static const char nas_attach_req_imsi[] = static const char const nas_attach_req_imsi[] =
{ {
0x07, 0x41, 0x07, 0x41,
/* EPS Mobile identity = IMSI */ /* EPS Mobile identity = IMSI */
...@@ -334,7 +334,7 @@ static const char nas_attach_req_imsi[] = ...@@ -334,7 +334,7 @@ static const char nas_attach_req_imsi[] =
}; };
/* NAS Attach request with GUTI */ /* NAS Attach request with GUTI */
static const char nas_attach_req_guti[] = static const char const nas_attach_req_guti[] =
{ {
0x07, 0x41, 0x07, 0x41,
/* EPS Mobile identity = GUTI */ /* EPS Mobile identity = GUTI */
...@@ -354,7 +354,7 @@ void rrc_ue_generate_RRCConnectionSetupComplete(module_id_t ue_mod_idP, frame_t ...@@ -354,7 +354,7 @@ void rrc_ue_generate_RRCConnectionSetupComplete(module_id_t ue_mod_idP, frame_t
uint8_t buffer[100]; uint8_t buffer[100];
uint8_t size; uint8_t size;
char *nas_msg; const char * nas_msg;
int nas_msg_length; int nas_msg_length;
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) #if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
...@@ -609,12 +609,12 @@ int32_t rrc_ue_establish_drb(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_ ...@@ -609,12 +609,12 @@ int32_t rrc_ue_establish_drb(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n", LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
ue_mod_idP, ue_mod_idP,
ip_addr_offset3+ue_mod_idP, ip_addr_offset3+ue_mod_idP,
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity); (eNB_index * maxDRB) + DRB_config->drb_Identity);
rb_conf_ipv4(0,//add rb_conf_ipv4(0,//add
ue_mod_idP,//cx align with the UE index ue_mod_idP,//cx align with the UE index
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,//rb (eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
0,//dscp 0,//dscp
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
...@@ -1413,14 +1413,14 @@ void rrc_ue_process_mobilityControlInfo(uint8_t eNB_index, uint8_t UE_id, frame_ ...@@ -1413,14 +1413,14 @@ void rrc_ue_process_mobilityControlInfo(uint8_t eNB_index, uint8_t UE_id, frame_
//Removing SRB1 and SRB2 and DRB0 //Removing SRB1 and SRB2 and DRB0
LOG_N(RRC,"[UE %d] : Update needed for rrc_pdcp_config_req (deprecated) and rrc_rlc_config_req commands(deprecated)\n", UE_id); LOG_N(RRC,"[UE %d] : Update needed for rrc_pdcp_config_req (deprecated) and rrc_rlc_config_req commands(deprecated)\n", UE_id);
rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, CONFIG_ACTION_REMOVE, DCCH,UNDEF_SECURITY_MODE); rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO,CONFIG_ACTION_REMOVE,ue_mod_idP+DCCH,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO, SRB_FLAG_YES, MBMS_FLAG_NO, CONFIG_ACTION_REMOVE,ue_mod_idP+DCCH,Rlc_info_am_config);
rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, CONFIG_ACTION_REMOVE, DCCH1,UNDEF_SECURITY_MODE); rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, SRB_FLAG_YES, CONFIG_ACTION_REMOVE, DCCH1,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO,CONFIG_ACTION_REMOVE,ue_mod_idP+DCCH1,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO, SRB_FLAG_YES,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ue_mod_idP+DCCH1,Rlc_info_am_config);
rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, CONFIG_ACTION_REMOVE, DTCH,UNDEF_SECURITY_MODE); rrc_pdcp_config_req (eNB_index, UE_id, frameP, ENB_FLAG_NO, SRB_FLAG_NO, CONFIG_ACTION_REMOVE, DTCH,UNDEF_SECURITY_MODE);
rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO,CONFIG_ACTION_REMOVE,ue_mod_idP+DTCH,RADIO_ACCESS_BEARER,Rlc_info_um); rrc_rlc_config_req(eNB_index, ue_mod_idP,frameP,ENB_FLAG_NO, SRB_FLAG_NO,CONFIG_ACTION_REMOVE, MBMS_FLAG_NO,ue_mod_idP+DTCH,Rlc_info_um);
/* /*
rrc_pdcp_config_asn1_req(NB_eNB_INST+ue_mod_idP,frameP, 0,eNB_index, rrc_pdcp_config_asn1_req(NB_eNB_INST+ue_mod_idP,frameP, 0,eNB_index,
NULL, // SRB_ToAddModList NULL, // SRB_ToAddModList
...@@ -2457,7 +2457,7 @@ void rrc_ue_generate_MeasurementReport(module_id_t eNB_id, module_id_t UE_id, fr ...@@ -2457,7 +2457,7 @@ void rrc_ue_generate_MeasurementReport(module_id_t eNB_id, module_id_t UE_id, fr
LOG_I(RRC, "[UE %d] Frame %d : Generating Measurement Report for eNB %d\n", UE_id, frameP, eNB_id); LOG_I(RRC, "[UE %d] Frame %d : Generating Measurement Report for eNB %d\n", UE_id, frameP, eNB_id);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RRC_UE][UE %02d][][--- PDCP_DATA_REQ/%d Bytes (MeasurementReport to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", LOG_D(RLC, "[MSC_MSG][FRAME %05d][RRC_UE][UE %02d][][--- PDCP_DATA_REQ/%d Bytes (MeasurementReport to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frameP, UE_id, size, eNB_id, rrc_mui, eNB_id, DCCH); frameP, UE_id, size, eNB_id, rrc_mui, eNB_id, DCCH);
result = pdcp_data_req(eNB_id, UE_id, frameP, 0, DCCH, rrc_mui++, 0, size, buffer, PDCP_TRANSMISSION_MODE_DATA); result = pdcp_data_req(eNB_id, UE_id, frameP, ENB_FLAG_NO, SRB_FLAG_YES, DCCH, rrc_mui++, 0, size, buffer, PDCP_TRANSMISSION_MODE_DATA);
AssertFatal (result == TRUE, "PDCP data request failed!\n"); AssertFatal (result == TRUE, "PDCP data request failed!\n");
//LOG_D(RRC, "[UE %d] Frame %d Sending MeasReport (%d bytes) through DCCH%d to PDCP \n",ue_mod_idP,frameP, size, DCCH); //LOG_D(RRC, "[UE %d] Frame %d Sending MeasReport (%d bytes) through DCCH%d to PDCP \n",ue_mod_idP,frameP, size, DCCH);
} }
......
...@@ -55,7 +55,7 @@ extern UE_MAC_INST *UE_mac_inst; ...@@ -55,7 +55,7 @@ extern UE_MAC_INST *UE_mac_inst;
extern mui_t rrc_eNB_mui; extern mui_t rrc_eNB_mui;
//configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs //configure BCCH & CCCH Logical Channels and associated rrc_buffers, configure associated SRBs
void openair_rrc_on(module_id_t Mod_id, eNB_flag_t eNB_flag) { void openair_rrc_on(module_id_t Mod_id, const eNB_flag_t eNB_flag) {
unsigned short i; unsigned short i;
if (eNB_flag == 1) { if (eNB_flag == 1) {
...@@ -288,7 +288,7 @@ void rrc_top_cleanup(void) { ...@@ -288,7 +288,7 @@ void rrc_top_cleanup(void) {
} }
void rrc_t310_expiration(frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) { void rrc_t310_expiration(const frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) {
if (UE_rrc_inst[Mod_id].Info[eNB_index].State != RRC_CONNECTED) { if (UE_rrc_inst[Mod_id].Info[eNB_index].State != RRC_CONNECTED) {
LOG_D(RRC, "Timer 310 expired, going to RRC_IDLE\n"); LOG_D(RRC, "Timer 310 expired, going to RRC_IDLE\n");
...@@ -304,10 +304,10 @@ void rrc_t310_expiration(frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) { ...@@ -304,10 +304,10 @@ void rrc_t310_expiration(frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) {
if (UE_rrc_inst[Mod_id].Srb2[eNB_index].Active == 1) { if (UE_rrc_inst[Mod_id].Srb2[eNB_index].Active == 1) {
msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", Mod_id, eNB_index, msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", Mod_id, eNB_index,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id);
rrc_pdcp_config_req (eNB_index, Mod_id, frameP, 0, CONFIG_ACTION_REMOVE, rrc_pdcp_config_req (eNB_index, Mod_id, frameP, ENB_FLAG_NO, SRB_FLAG_YES, CONFIG_ACTION_REMOVE,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, 0); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, 0);
rrc_rlc_config_req (eNB_index, Mod_id, frameP, 0, CONFIG_ACTION_REMOVE, rrc_rlc_config_req (eNB_index, Mod_id, frameP, ENB_FLAG_NO, SRB_FLAG_YES, MBMS_FLAG_NO, CONFIG_ACTION_REMOVE,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, SIGNALLING_RADIO_BEARER, Rlc_info_um); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, Rlc_info_um);
UE_rrc_inst[Mod_id].Srb2[eNB_index].Active = 0; UE_rrc_inst[Mod_id].Srb2[eNB_index].Active = 0;
UE_rrc_inst[Mod_id].Srb2[eNB_index].Status = IDLE; UE_rrc_inst[Mod_id].Srb2[eNB_index].Status = IDLE;
UE_rrc_inst[Mod_id].Srb2[eNB_index].Next_check_frame = 0; UE_rrc_inst[Mod_id].Srb2[eNB_index].Next_check_frame = 0;
...@@ -318,7 +318,7 @@ void rrc_t310_expiration(frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) { ...@@ -318,7 +318,7 @@ void rrc_t310_expiration(frame_t frameP, uint8_t Mod_id, uint8_t eNB_index) {
} }
} }
RRC_status_t rrc_rx_tx(uint8_t Mod_id,frame_t frameP, eNB_flag_t eNB_flagP,uint8_t index){ RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eNB_flagP,uint8_t index){
if(eNB_flagP == 0) { if(eNB_flagP == 0) {
// check timers // check timers
......
...@@ -590,34 +590,34 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration( ...@@ -590,34 +590,34 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration(
struct PhysicalConfigDedicated **physicalConfigDedicated = &rrc_inst->physicalConfigDedicated[ue_mod_idP]; struct PhysicalConfigDedicated **physicalConfigDedicated = &rrc_inst->physicalConfigDedicated[ue_mod_idP];
struct SRB_ToAddMod *SRB2_config; struct SRB_ToAddMod *SRB2_config = NULL;
struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config; struct SRB_ToAddMod__rlc_Config *SRB2_rlc_config = NULL;
struct SRB_ToAddMod__logicalChannelConfig *SRB2_lchan_config; struct SRB_ToAddMod__logicalChannelConfig *SRB2_lchan_config = NULL;
struct LogicalChannelConfig__ul_SpecificParameters struct LogicalChannelConfig__ul_SpecificParameters
*SRB2_ul_SpecificParameters; *SRB2_ul_SpecificParameters = NULL;
SRB_ToAddModList_t *SRB_configList = rrc_inst->SRB_configList[ue_mod_idP]; SRB_ToAddModList_t *SRB_configList = rrc_inst->SRB_configList[ue_mod_idP];
SRB_ToAddModList_t *SRB_configList2; SRB_ToAddModList_t *SRB_configList2 = NULL;
struct DRB_ToAddMod *DRB_config; struct DRB_ToAddMod *DRB_config = NULL;
struct RLC_Config *DRB_rlc_config; struct RLC_Config *DRB_rlc_config = NULL;
struct PDCP_Config *DRB_pdcp_config; struct PDCP_Config *DRB_pdcp_config = NULL;
struct PDCP_Config__rlc_AM *PDCP_rlc_AM; struct PDCP_Config__rlc_AM *PDCP_rlc_AM = NULL;
struct PDCP_Config__rlc_UM *PDCP_rlc_UM; struct PDCP_Config__rlc_UM *PDCP_rlc_UM = NULL;
struct LogicalChannelConfig *DRB_lchan_config; struct LogicalChannelConfig *DRB_lchan_config = NULL;
struct LogicalChannelConfig__ul_SpecificParameters struct LogicalChannelConfig__ul_SpecificParameters
*DRB_ul_SpecificParameters; *DRB_ul_SpecificParameters = NULL;
DRB_ToAddModList_t **DRB_configList = &rrc_inst->DRB_configList[ue_mod_idP]; DRB_ToAddModList_t **DRB_configList = &rrc_inst->DRB_configList[ue_mod_idP];
MAC_MainConfig_t *mac_MainConfig; MAC_MainConfig_t *mac_MainConfig = NULL;
MeasObjectToAddModList_t *MeasObj_list; MeasObjectToAddModList_t *MeasObj_list = NULL;
MeasObjectToAddMod_t *MeasObj; MeasObjectToAddMod_t *MeasObj = NULL;
ReportConfigToAddModList_t *ReportConfig_list; ReportConfigToAddModList_t *ReportConfig_list = NULL;
ReportConfigToAddMod_t *ReportConfig_per, *ReportConfig_A1, ReportConfigToAddMod_t *ReportConfig_per, *ReportConfig_A1,
*ReportConfig_A2, *ReportConfig_A3, *ReportConfig_A4, *ReportConfig_A5; *ReportConfig_A2, *ReportConfig_A3, *ReportConfig_A4, *ReportConfig_A5;
MeasIdToAddModList_t *MeasId_list; MeasIdToAddModList_t *MeasId_list = NULL;
MeasIdToAddMod_t *MeasId0, *MeasId1, *MeasId2, *MeasId3, *MeasId4, *MeasId5; MeasIdToAddMod_t *MeasId0, *MeasId1, *MeasId2, *MeasId3, *MeasId4, *MeasId5;
#if Rel10 #if Rel10
long *sr_ProhibitTimer_r9; long *sr_ProhibitTimer_r9 = NULL;
#endif #endif
long *logicalchannelgroup, *logicalchannelgroup_drb; long *logicalchannelgroup, *logicalchannelgroup_drb;
...@@ -626,10 +626,10 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration( ...@@ -626,10 +626,10 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration(
RSRP_Range_t *rsrp = NULL; RSRP_Range_t *rsrp = NULL;
struct MeasConfig__speedStatePars *Sparams = NULL; struct MeasConfig__speedStatePars *Sparams = NULL;
QuantityConfig_t *quantityConfig = NULL; QuantityConfig_t *quantityConfig = NULL;
CellsToAddMod_t *CellToAdd; CellsToAddMod_t *CellToAdd = NULL;
CellsToAddModList_t *CellsToAddModList; CellsToAddModList_t *CellsToAddModList = NULL;
struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL; struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL;
DedicatedInfoNAS_t *dedicatedInfoNas; DedicatedInfoNAS_t *dedicatedInfoNas = NULL;
C_RNTI_t *cba_RNTI = NULL; C_RNTI_t *cba_RNTI = NULL;
#ifdef CBA #ifdef CBA
...@@ -1299,9 +1299,9 @@ void check_handovers( ...@@ -1299,9 +1299,9 @@ void check_handovers(
"[eNB %d] Frame %d: handover Command received for new UE_idx %d current eNB %d target eNB: %d \n", "[eNB %d] Frame %d: handover Command received for new UE_idx %d current eNB %d target eNB: %d \n",
enb_mod_idP, frameP, i, enb_mod_idP, eNB_rrc_inst[enb_mod_idP].handover_info[i]->modid_t); enb_mod_idP, frameP, i, enb_mod_idP, eNB_rrc_inst[enb_mod_idP].handover_info[i]->modid_t);
//rrc_eNB_process_handoverPreparationInformation(enb_mod_idP,frameP,i); //rrc_eNB_process_handoverPreparationInformation(enb_mod_idP,frameP,i);
result = pdcp_data_req(enb_mod_idP, i, frameP, 1, result = pdcp_data_req(enb_mod_idP, i, frameP, ENB_FLAG_YES, SRB_FLAG_YES,
DCCH, DCCH,
rrc_eNB_mui++, 0, rrc_eNB_mui++, FALSE,
eNB_rrc_inst[enb_mod_idP].handover_info[i]->size, eNB_rrc_inst[enb_mod_idP].handover_info[i]->size,
eNB_rrc_inst[enb_mod_idP].handover_info[i]->buf, 1); eNB_rrc_inst[enb_mod_idP].handover_info[i]->buf, 1);
AssertFatal(result == TRUE, "PDCP data request failed!\n"); AssertFatal(result == TRUE, "PDCP data request failed!\n");
...@@ -2239,7 +2239,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -2239,7 +2239,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
#endif #endif
// Refresh SRBs/DRBs // Refresh SRBs/DRBs
rrc_pdcp_config_asn1_req(enb_mod_idP, ue_mod_idP, frameP, 1, rrc_pdcp_config_asn1_req(enb_mod_idP, ue_mod_idP, frameP, ENB_FLAG_YES,
SRB_configList, SRB_configList,
DRB_configList, (DRB_ToReleaseList_t *) NULL, DRB_configList, (DRB_ToReleaseList_t *) NULL,
eNB_rrc_inst[enb_mod_idP].ciphering_algorithm[ue_mod_idP] | eNB_rrc_inst[enb_mod_idP].ciphering_algorithm[ue_mod_idP] |
...@@ -2283,7 +2283,8 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -2283,7 +2283,8 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
// can mean also IPV6 since ether -> ipv6 autoconf // can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) # if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO)
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n", enb_mod_idP, enb_mod_idP); LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n", enb_mod_idP, enb_mod_idP);
oip_ifup = nas_config(enb_mod_idP, // interface index oip_ifup = nas_config(
enb_mod_idP, // interface index
enb_mod_idP + 1, // thrid octet enb_mod_idP + 1, // thrid octet
enb_mod_idP + 1); // fourth octet enb_mod_idP + 1); // fourth octet
...@@ -2297,11 +2298,12 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -2297,11 +2298,12 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
LOG_I(OIP, LOG_I(OIP,
"[eNB %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n", "[eNB %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
enb_mod_idP, enb_mod_idP, enb_mod_idP, enb_mod_idP,
(ue_mod_idP * NB_RB_MAX) + *DRB_configList->list.array[i]->logicalChannelIdentity); (ue_mod_idP * maxDRB) + DRB_configList->list.array[i]->drb_Identity);
rb_conf_ipv4(0, //add rb_conf_ipv4(0, //add
ue_mod_idP, //cx ue_mod_idP, //cx
enb_mod_idP, //inst enb_mod_idP, //inst
(ue_mod_idP * NB_RB_MAX) + *DRB_configList->list.array[i]->logicalChannelIdentity, 0, //dscp (ue_mod_idP * maxDRB) + DRB_configList->list.array[i]->drb_Identity,
0, //dscp
ipv4_address(enb_mod_idP + 1, enb_mod_idP + 1), //saddr ipv4_address(enb_mod_idP + 1, enb_mod_idP + 1), //saddr
ipv4_address(enb_mod_idP + 1, dest_ip_offset + ue_mod_idP + 1)); //daddr ipv4_address(enb_mod_idP + 1, dest_ip_offset + ue_mod_idP + 1)); //daddr
...@@ -2319,7 +2321,11 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -2319,7 +2321,11 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
frameP, enb_mod_idP, ue_mod_idP, enb_mod_idP); frameP, enb_mod_idP, ue_mod_idP, enb_mod_idP);
if (DRB_configList->list.array[i]->logicalChannelIdentity) if (DRB_configList->list.array[i]->logicalChannelIdentity)
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity; DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
rrc_mac_config_req(enb_mod_idP, ENB_FLAG_YES, ue_mod_idP, 0, rrc_mac_config_req(
enb_mod_idP,
ENB_FLAG_YES,
ue_mod_idP,
0,
(RadioResourceConfigCommonSIB_t *) NULL, (RadioResourceConfigCommonSIB_t *) NULL,
eNB_rrc_inst[enb_mod_idP].physicalConfigDedicated[ue_mod_idP], eNB_rrc_inst[enb_mod_idP].physicalConfigDedicated[ue_mod_idP],
(MeasObjectToAddMod_t **) NULL, (MeasObjectToAddMod_t **) NULL,
...@@ -2346,8 +2352,8 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete( ...@@ -2346,8 +2352,8 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
/* rrc_pdcp_config_req (enb_mod_idP, frameP, 1, CONFIG_ACTION_REMOVE, /* rrc_pdcp_config_req (enb_mod_idP, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE); (ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
*/ */
rrc_rlc_config_req(enb_mod_idP, ue_mod_idP, frameP, 1, CONFIG_ACTION_REMOVE, rrc_rlc_config_req(enb_mod_idP, ue_mod_idP, frameP, ENB_FLAG_YES, SRB_FLAG_NO, MBMS_FLAG_NO, CONFIG_ACTION_REMOVE,
DRB2LCHAN[i], RADIO_ACCESS_BEARER, Rlc_info_um); DRB2LCHAN[i], Rlc_info_um);
} }
eNB_rrc_inst[enb_mod_idP].DRB_active[ue_mod_idP][i] = 0; eNB_rrc_inst[enb_mod_idP].DRB_active[ue_mod_idP][i] = 0;
LOG_D(RRC, LOG_D(RRC,
......
...@@ -48,7 +48,7 @@ OMG_OBJS += $(OMG_DIR)/job.o ...@@ -48,7 +48,7 @@ OMG_OBJS += $(OMG_DIR)/job.o
OMG_OBJS += $(OMG_DIR)/static.o OMG_OBJS += $(OMG_DIR)/static.o
OMG_OBJS += $(OMG_DIR)/rwp.o OMG_OBJS += $(OMG_DIR)/rwp.o
OMG_OBJS += $(OMG_DIR)/rwalk.o OMG_OBJS += $(OMG_DIR)/rwalk.o
OMG_OBJS += $(OMG_DIR)/hashtable.o OMG_OBJS += $(OMG_DIR)/omg_hashtable.o
OMG_OBJS += $(OMG_DIR)/mobility_parser.o OMG_OBJS += $(OMG_DIR)/mobility_parser.o
OMG_OBJS += $(OMG_DIR)/trace.o OMG_OBJS += $(OMG_DIR)/trace.o
OMG_OBJS += $(OMG_DIR)/sumo.o OMG_OBJS += $(OMG_DIR)/sumo.o
......
...@@ -3,10 +3,10 @@ CC= gcc ...@@ -3,10 +3,10 @@ CC= gcc
OBJstatic = omg.c common.c static.c OBJstatic = omg.c common.c static.c
OBJrwp = omg.c common.c job.c rwp.c OBJrwp = omg.c common.c job.c rwp.c
OBJrwalk = omg.c common.c job.c rwalk.c OBJrwalk = omg.c common.c job.c rwalk.c
OBJtrace = omg.c common.c job.c trace.c mobility_parser.c hashtable.c OBJtrace = omg.c common.c job.c trace.c mobility_parser.c omg_hashtable.c
OBJsumo = omg.c common.c sumo.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c OBJsumo = omg.c common.c sumo.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c
OBJ = omg.c common.c static.c job.c rwp.c rwalk.c trace.c sumo.c mobility_parser.c hashtable.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c OBJ = omg.c common.c static.c job.c rwp.c rwalk.c trace.c sumo.c mobility_parser.c omg_hashtable.c client_traci_OMG.c socket_traci_OMG.c storage_traci_OMG.c id_manager.c
CFLAGS += -DSTANDALONE -DUSER_MODE CFLAGS += -DSTANDALONE -DUSER_MODE
......
...@@ -42,12 +42,12 @@ ...@@ -42,12 +42,12 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "mobility_parser.h" #include "mobility_parser.h"
#include "hashtable.h" #include "omg_hashtable.h"
#include "omg.h" #include "omg.h"
node_info* head_node_info =NULL; node_info* head_node_info =NULL;
hash_table_t* table=NULL; omg_hash_table_t* table=NULL;
//need to be removed , used only once (old code) //need to be removed , used only once (old code)
struct Exnode* gen_list(){ struct Exnode* gen_list(){
...@@ -186,7 +186,7 @@ void print_list(struct Exnode* head){ ...@@ -186,7 +186,7 @@ void print_list(struct Exnode* head){
head=head->next; head=head->next;
} }
Exnode* get_next_position(hash_table_t *table,int node_id){ Exnode* get_next_position(omg_hash_table_t *table,int node_id){
node_info* head_node=head_node_info; node_info* head_node=head_node_info;
while(head_node->next!=NULL){ while(head_node->next!=NULL){
...@@ -233,7 +233,7 @@ Exnode* get_next_position(hash_table_t *table,int node_id){ ...@@ -233,7 +233,7 @@ Exnode* get_next_position(hash_table_t *table,int node_id){
} }
void reset_visit_status(hash_table_t *table,float time, int node_id){ void reset_visit_status(omg_hash_table_t *table,float time, int node_id){
node_info* head_node=head_node_info; node_info* head_node=head_node_info;
while(head_node->next!=NULL){ while(head_node->next!=NULL){
...@@ -280,7 +280,7 @@ int get_num_nodes(){ ...@@ -280,7 +280,7 @@ int get_num_nodes(){
} }
return count; return count;
} }
void sort_veh_movement(hash_table_t *table){ void sort_veh_movement(omg_hash_table_t *table){
node_info* head_node=head_node_info; node_info* head_node=head_node_info;
while(head_node->next!=NULL){ while(head_node->next!=NULL){
int *value1 = NULL; int *value1 = NULL;
...@@ -401,7 +401,7 @@ int main(){ ...@@ -401,7 +401,7 @@ int main(){
Exnode* next_loc=NULL; Exnode* next_loc=NULL;
//mobility_file = (char*) malloc(256); //mobility_file = (char*) malloc(256);
//mobility_file=strtok("regular.tr"); //mobility_file=strtok("regular.tr");
hash_table_t *table=read_mobility_file(); omg_hash_table_t *table=read_mobility_file();
sort_veh_movement(table); sort_veh_movement(table);
printf("Number of nodes --> %d \n",get_num_nodes()); printf("Number of nodes --> %d \n",get_num_nodes());
next_loc=get_next_position(table,140392); next_loc=get_next_position(table,140392);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#ifndef MOBILITY_PARSER_H_ #ifndef MOBILITY_PARSER_H_
#define MOBILITY_PARSER_H_ #define MOBILITY_PARSER_H_
#include "hashtable.h" #include "omg_hashtable.h"
/** /**
* @struct Simple struct to hold only few information * @struct Simple struct to hold only few information
...@@ -120,7 +120,7 @@ int get_num_nodes(); ...@@ -120,7 +120,7 @@ int get_num_nodes();
* @param ending pointer of the vehicles linked list * @param ending pointer of the vehicles linked list
*/ */
void sort_veh_movement(hash_table_t *table); void sort_veh_movement(omg_hash_table_t *table);
void quicksortlist(Exnode *pLeft, Exnode *pRight); void quicksortlist(Exnode *pLeft, Exnode *pRight);
/** /**
...@@ -129,9 +129,9 @@ void quicksortlist(Exnode *pLeft, Exnode *pRight); ...@@ -129,9 +129,9 @@ void quicksortlist(Exnode *pLeft, Exnode *pRight);
* @param hashtable from which the node is to be looked * @param hashtable from which the node is to be looked
* @param node_id is the nodes whose next location need to be retrieved from the linked list * @param node_id is the nodes whose next location need to be retrieved from the linked list
*/ */
Exnode* get_next_position(hash_table_t *table,int node_id); Exnode* get_next_position(omg_hash_table_t *table,int node_id);
void reset_visit_status(hash_table_t *table, float time, int node_id); void reset_visit_status(omg_hash_table_t *table, float time, int node_id);
void clear_llist(); void clear_llist();
......
This diff is collapsed.
...@@ -217,6 +217,7 @@ INCLUDES += $(ENB_APP_incl) ...@@ -217,6 +217,7 @@ INCLUDES += $(ENB_APP_incl)
INCLUDES += $(UTIL_incl) INCLUDES += $(UTIL_incl)
INCLUDES += $(UTILS_incl) INCLUDES += $(UTILS_incl)
INCLUDES += -I$(ASN1_MSG_INC) INCLUDES += -I$(ASN1_MSG_INC)
INCLUDES += -I$(COMMON_UTILS_DIR)/collection
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
......
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