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
......@@ -4,7 +4,10 @@
#include <stdint.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 {
HASH_TABLE_OK = 0,
......@@ -18,28 +21,28 @@ typedef enum hashtable_return_code_e {
typedef struct hash_node_s {
uint64_t key;
void *data;
struct hash_node_s *next;
hash_key_t key;
void *data;
struct hash_node_s *next;
} hash_node_t;
typedef struct hash_table_s {
hash_size_t size;
hash_size_t num_elements;
struct hash_node_s **nodes;
hash_size_t (*hashfunc)(const uint64_t);
hash_size_t (*hashfunc)(const hash_key_t);
void (*freefunc)(void*);
} hash_table_t;
char* hashtble_rc_code2string(hashtable_rc_t rcP);
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_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_insert (hash_table_t *hashtbl, const uint64_t key, void *data);
hashtable_rc_t hashtable_remove (hash_table_t *hashtbl, const uint64_t key);
hashtable_rc_t hashtable_get (hash_table_t *hashtbl, const uint64_t key, void **dataP);
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 hash_key_t key, void *data);
hashtable_rc_t hashtable_remove (hash_table_t *hashtbl, const hash_key_t key);
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);
......
......@@ -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.
// Previously designed for interlayers optimizations, (avoid aligning on byte boundary)
// 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
// for reporting tx status to upper layers
......@@ -123,8 +123,8 @@ struct mac_tx_tb_management {
struct mac_rx_tb_management {
unsigned char *data_ptr;
unsigned short tb_size; // in bits
unsigned char valid_checksum;
tb_size_t tb_size; // in bits
boolean_t valid_checksum;
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 {
// 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 first_bit;
unsigned short tb_size;
tb_size_t tb_size;
// align the tb we have to know its size
// for reporting tx status to upper layers
......
......@@ -54,7 +54,7 @@
#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 */
#if defined(Rel10)
......
......@@ -26,11 +26,12 @@ typedef signed char boolean_t;
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
//-----------------------------------------------------------------------------
// GENERIC ACCESS STRATUM TYPES
//-----------------------------------------------------------------------------
typedef uint16_t sdu_size_t;
typedef int16_t sdu_ssize_t;
typedef int32_t sdu_size_t;
typedef uint32_t frame_t;
typedef int32_t sframe_t;
typedef uint32_t sub_frame_t;
......@@ -74,8 +75,8 @@ typedef unsigned int crc_t;
//-----------------------------------------------------------------------------
// MAC TYPES
//-----------------------------------------------------------------------------
typedef unsigned int tbs_size_t;
typedef unsigned int tb_size_t;
typedef sdu_size_t tbs_size_t;
typedef sdu_size_t tb_size_t;
typedef unsigned int logical_chan_id_t;
typedef unsigned int num_tb_t;
......@@ -87,7 +88,7 @@ typedef unsigned int confirm_t;
typedef unsigned int rlc_tx_status_t;
typedef int16_t rlc_sn_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;
//-----------------------------------------------------------------------------
......
......@@ -6,10 +6,8 @@ EXTRA_CFLAGS += -DNO_RRM
COMMON_DIR = $(OPENAIR2_TOP)/COMMON
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
#RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v6.1.0_LITE
RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v9.3.0
RLC_AM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/AM_v9.3.0
#RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM
RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM_v9.3.0
RLC_DIR = $(OPENAIR2_TOP)/LAYER2/RLC
PDCP_DIR = $(OPENAIR2_TOP)/LAYER2/PDCP_v10.1.0
......@@ -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_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_fsm.c
......@@ -96,7 +90,6 @@ MAC_OBJS += $(MAC_DIR)/config.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)
#$(OPT_OBJS)
L2_incl = -I$(OPENAIR2_TOP)
L2_incl += -I$(COMMON_DIR)
......
......@@ -317,53 +317,47 @@ pdcp_fifo_read_input_sdus ()
// if remaining bytes to read
if (pdcp_fifo_read_input_sdus_remaining_bytes () > 0) {
// 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
cont = 1;
while (cont > 0) {
bytes_read = rtf_get (NAS2PDCP_FIFO,
// 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
cont = 1;
while (cont > 0) {
bytes_read = rtf_get (NAS2PDCP_FIFO,
&(((uint8_t *) & pdcp_input_header)[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
msg("[PDCP_FIFOS] TTI %d Read %d Bytes of data (header %d) from Nas_mesh\n",
Mac_rlc_xface->frame,
bytes_read,
sizeof(pdcp_data_req_header_t));
#endif // PDCP_DEBUG
pdcp_input_index_header += bytes_read;
msg("[PDCP_FIFOS] TTI %d Read %d Bytes of data (header %d) from Nas_mesh\n",
Mac_rlc_xface->frame,
bytes_read,
sizeof(pdcp_data_req_header_t));
#endif
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)) {
#ifdef PDCP_DEBUG
msg("[PDCP] TTI %d IP->RADIO READ HEADER sdu size %d\n",
Mac_rlc_xface->frame,
pdcp_input_header.data_size);
#endif //PDCP_DEBUG
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);
mac_xface->macphy_exit("");
return 0;
}
pdcp_input_sdu_remaining_size_to_read = pdcp_input_header.data_size;
pdcp_input_sdu_size_read = 0;
// we know the size of the sdu, so read the sdu;
cont = pdcp_fifo_read_input_sdus_remaining_bytes ();
} else {
cont = 0;
}
// error while reading rt fifo
} else {
cont = 0;
msg("[PDCP] TTI %d IP->RADIO READ HEADER sdu size %d\n",
Mac_rlc_xface->frame,
pdcp_input_header.data_size);
#endif
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);
mac_xface->macphy_exit("");
return 0;
}
pdcp_input_sdu_remaining_size_to_read = pdcp_input_header.data_size;
pdcp_input_sdu_size_read = 0;
// we know the size of the sdu, so read the sdu;
cont = pdcp_fifo_read_input_sdus_remaining_bytes ();
} else {
cont = 0;
}
// error while reading rt fifo
} else {
cont = 0;
}
}
}
}
return 0;
}
......@@ -381,89 +375,81 @@ pdcp_fifo_read_input_sdus ()
int bytes_read;
int len;
if (pdcp_read_state == 0) {
#ifdef LINUX
len = recvmsg(nas_sock_fd, &nas_msg, 0);
len = recvmsg(nas_sock_fd, &nas_msg, 0);
#else
len = -1;
len = -1;
#endif
if (len<0) {
// printf("[PDCP][NETLINK %d] nothing in pdcp NAS socket\n", nas_sock_fd);
}
else {
if (len<0) {
//printf("[PDCP][NETLINK %d] nothing in pdcp NAS socket\n", nas_sock_fd);
}
else {
#ifdef PDCP_DEBUG
#ifdef LINUX
printf("[PDCP][NETLINK] Received socket with length %d (nlmsg_len = %d)\n",len,nas_nlh->nlmsg_len-sizeof(struct nlmsghdr));
printf("[PDCP][NETLINK] Received socket with length %d (nlmsg_len = %d)\n",len,nas_nlh->nlmsg_len-sizeof(struct nlmsghdr));
#endif PDCP_DEBUG
#ifdef PDCP_DEBUG
printf("[PDCP][NETLINK] nlmsg_len = %d (%d,%d)\n",nas_nlh->nlmsg_len,
sizeof(pdcp_data_req_header_t),
sizeof(struct nlmsghdr));
printf("[PDCP][NETLINK] nlmsg_len = %d (%d,%d)\n",nas_nlh->nlmsg_len,
sizeof(pdcp_data_req_header_t),
sizeof(struct nlmsghdr));
#endif LINUX
#endif PDCP_DEBUG
}
}
#ifdef LINUX
if (nas_nlh->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
pdcp_read_state = 1; //get
memcpy((void *)&pdcp_read_header,
(void *)NLMSG_DATA(nas_nlh),
sizeof(pdcp_data_req_header_t));
}
if (nas_nlh->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
pdcp_read_state = 1; //get
memcpy((void *)&pdcp_read_header,
(void *)NLMSG_DATA(nas_nlh),
sizeof(pdcp_data_req_header_t));
}
#else //LINUX
pdcp_read_state = 1;
pdcp_read_state = 1;
#endif //LINUX
}
if (pdcp_read_state == 1) {
#ifdef LINUX
len = recvmsg(nas_sock_fd, &nas_msg, 0);
len = recvmsg(nas_sock_fd, &nas_msg, 0);
#else
len = -1;
len = -1;
#endif //LINUX
if (len<0) {
// nothing in pdcp NAS socket
}
else {
pdcp_read_state = 0;
// print_active_requests()
if (len<0) {
// nothing in pdcp NAS socket
} else {
pdcp_read_state = 0;
//print_active_requests()
#ifdef LINUX
memcpy(pdcp_read_payload,
(unsigned char *)NLMSG_DATA(nas_nlh),
nas_nlh->nlmsg_len - sizeof(struct nlmsghdr));
memcpy(pdcp_read_payload,
(unsigned char *)NLMSG_DATA(nas_nlh),
nas_nlh->nlmsg_len - sizeof(struct nlmsghdr));
#endif
#ifdef IDROMEL_NEMO
pdcp_read_header.inst = 0;
pdcp_read_header.inst = 0;
#endif
pdcp_read_header.inst = (pdcp_read_header.inst >= oai_emulation.info.nb_enb_local) ?
pdcp_read_header.inst - oai_emulation.info.nb_enb_local+ NB_eNB_INST + oai_emulation.info.first_ue_local :
pdcp_read_header.inst + oai_emulation.info.first_enb_local;
pdcp_read_header.inst = (pdcp_read_header.inst >= oai_emulation.info.nb_enb_local) ?
pdcp_read_header.inst - oai_emulation.info.nb_enb_local+ NB_eNB_INST + oai_emulation.info.first_ue_local :
pdcp_read_header.inst + oai_emulation.info.first_enb_local;
#ifdef PDCP_DEBUG
printf("[PDCP][NETLINK][IP->PDCP] TTI %d, INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
Mac_rlc_xface->frame,
pdcp_read_header.inst,
len,
nas_nlh->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header.rb_id);
printf("[PDCP][NETLINK][IP->PDCP] TTI %d, INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
Mac_rlc_xface->frame,
pdcp_read_header.inst,
len,
nas_nlh->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header.rb_id);
#endif PDCP_DEBUG
pdcp_data_req(pdcp_read_header.inst,
pdcp_read_header.rb_id,
pdcp_read_header.data_size,
pdcp_read_payload);
}
pdcp_data_req(pdcp_read_header.inst,
pdcp_read_header.rb_id,
pdcp_read_header.data_size,
pdcp_read_payload);
}
}
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -204,7 +204,7 @@ void *pdcp_netlink_thread_fct(void *arg) {
* NOTE: netlink messages can be assembled to form a multipart message
*/
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)) {
/* There is no need to check for nlmsg_type because
......
This diff is collapsed.
......@@ -93,35 +93,49 @@ Address : EURECOM,
* \brief Empty function, TO DO.
* \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_
* @{
*/
/*! \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
* \param[in] frame 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] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] config_amP Configuration parameters for RLC AM instance.
* \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
* \param[in] frame 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] enb_module_idP eNB Virtualized module identifier.
* \param[in] ue_module_idP UE Virtualized module identifier.
* \param[in] config_amP Configuration parameters for RLC AM instance.
* \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,
*/
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.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0).
* \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)
* \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
* \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.
*/
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)
* \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
* \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.
*/
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.
* \param[in] rlcP RLC UM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flag Flag to indicate eNB (1) or UE (0).
* \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)
* \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
* \param[in] frame Frame index.
* \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
......@@ -73,7 +73,6 @@ typedef struct rlc_am_entity_s {
//---------------------------------------------------------------------
// 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). */
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. */
......@@ -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. */
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. */
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. */
......@@ -175,7 +173,7 @@ typedef struct rlc_am_entity_s {
//---------------------------------------------------------------------
// 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 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. */
......
......@@ -45,7 +45,10 @@ Address : EURECOM,
#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) {
......@@ -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
//-----------------------------------------------------------------------------
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) {
......@@ -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) {
......@@ -103,117 +108,3 @@ signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP)
}
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)
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));
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 = (rlc_am_tx_sdu_management_t*)((rlc_pP->input_sdus_alloc)->data);
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);
rlc_pP->input_sdus = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
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)));
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));
......@@ -79,11 +77,10 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
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",
frameP,
LOG_I(RLC, "[FRAME ?????][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n",
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
......@@ -100,26 +97,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP, frame_t frameP)
rlc_pP->output_sdu_in_construction = NULL;
}
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++) {
if (rlc_pP->input_sdus[i].mem_block != NULL) {
free_mem_block(rlc_pP->input_sdus[i].mem_block);
rlc_pP->input_sdus[i].mem_block = NULL;
}
}
free_mem_block(rlc_pP->input_sdus_alloc);
rlc_pP->input_sdus_alloc = NULL;
free(rlc_pP->input_sdus);
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++) {
if (rlc_pP->pdu_retrans_buffer[i].mem_block != NULL) {
free_mem_block(rlc_pP->pdu_retrans_buffer[i].mem_block);
rlc_pP->pdu_retrans_buffer[i].mem_block = NULL;
}
}
free_mem_block(rlc_pP->pdu_retrans_buffer_alloc);
rlc_pP->pdu_retrans_buffer_alloc = NULL;
free(rlc_pP->pdu_retrans_buffer);
rlc_pP->pdu_retrans_buffer = NULL;
}
memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
......@@ -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,
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,
rb_type_t rb_typeP)
rb_id_t rb_idP)
//-----------------------------------------------------------------------------
{
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,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
......@@ -176,15 +171,15 @@ void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP,
enb_module_idP,
ue_module_idP,
rb_idP,
rb_typeP);
(srb_flagP) ? "TRUE" : "FALSE");
rlc_pP->enb_module_id = enb_module_idP;
rlc_pP->ue_module_id = ue_module_idP;
rlc_pP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) {
rlc_pP->is_data_plane = 1;
} else {
if (srb_flagP) {
rlc_pP->is_data_plane = 0;
} else {
rlc_pP->is_data_plane = 1;
}
rlc_pP->is_enb = eNB_flagP;
}
......@@ -88,12 +88,11 @@ typedef volatile struct {
*/
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.
* \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)
* \brief Set RLC AM protocol parameters.
......@@ -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_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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame 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] enb_module_idP eNB Virtualization variable, module identifier.
* \param[in] ue_module_idP UE Virtualization variable, module 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
......@@ -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_in_construction);
#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
rlc_pP->output_sdu_in_construction = NULL;
} else {
......
......@@ -45,7 +45,7 @@ Address : EURECOM,
//#define DEBUG_RLC_AM_DISPLAY_TB_DATA
//#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));
......@@ -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;
......@@ -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)
//-----------------------------------------------------------------------------
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;
......@@ -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)
//-----------------------------------------------------------------------------
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;
......@@ -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
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;
int16_t tb_size_in_bytes;
sdu_size_t tb_size_in_bytes;
while ((tb_p = list_remove_head (&data_indP.data))) {
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_
} // 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
......
......@@ -59,7 +59,7 @@ Address : EURECOM,
# define public_rlc_am_receiver(x) extern x
# 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.
* \param[in] frame Frame index.
* \param[in] headerP RLC AM header PDU pointer.
......@@ -67,44 +67,44 @@ Address : EURECOM,
* \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;
*/
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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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).
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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)
*/
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).
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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)
*/
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).
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0).
* \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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
......@@ -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] 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
......@@ -43,7 +43,12 @@ Address : EURECOM,
//#define TRACE_RLC_AM_NACK
//#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
......@@ -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.
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 sdu_index;
if (mb_pP != NULL) {
if (mb_p != NULL) {
rlc_pP->num_nack_sn += 1;
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
}
}
//-----------------------------------------------------------------------------
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 sdu_index;
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) {
free_mem_block(mb_pP);
free_mem_block(mb_p);
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",
frameP,
......@@ -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) &&
(rlc_pP->input_sdus[sdu_index].sdu_remaining_size == 0)) {
#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
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
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)
rlc_pP->ue_module_id,
rlc_pP->rb_id,
snP);
if (mb_pP != NULL) {
free_mem_block(mb_pP);
if (mb_p != NULL) {
free_mem_block(mb_p);
rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL;
}
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)
}
}
//-----------------------------------------------------------------------------
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;
......@@ -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
&rlc_pP->pdu_retrans_buffer[snP].payload[start_offset],
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
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
}
}
//-----------------------------------------------------------------------------
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;
......@@ -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");
}
//-----------------------------------------------------------------------------
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;
......
......@@ -69,7 +69,12 @@ Address : EURECOM,
* \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.
*/
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)
* \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,
* \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.
*/
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)
* \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,
* \param[in] snP Sequence number of the PDU to be copied.
* \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)
* \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
* \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.
*/
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)
* \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] 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)
* \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
* \param[in] frameP Frame index.
* \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
......@@ -45,7 +45,11 @@ Address : EURECOM,
#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
......@@ -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;
signed int pdu_remaining_size = 0;
signed int test_pdu_remaining_size = 0;
sdu_size_t 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;
struct mac_tb_req *pdu_tb_req_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)
rlc_am_tx_sdu_management_t *sdu_mngt_p = NULL;
rlc_am_tx_data_pdu_management_t *pdu_mngt_p = NULL;
unsigned int li_length_in_bytes = 0;
unsigned int test_li_length_in_bytes = 0;
unsigned int test_remaining_size_to_substract= 0;
sdu_size_t li_length_in_bytes = 0;
sdu_size_t test_li_length_in_bytes = 0;
sdu_size_t test_remaining_size_to_substract= 0;
unsigned int test_remaining_num_li_to_substract = 0;
unsigned int continue_fill_pdu_with_sdu = 0;
unsigned int num_fill_sdu = 0;
unsigned int test_num_li = 0;
unsigned int fill_num_li = 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_last_byte_pdu_is_last_byte_sdu = 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",
frameP,
......
......@@ -38,13 +38,18 @@ Address : EURECOM,
#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;
}
//-----------------------------------------------------------------------------
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;
......@@ -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;
}
//-----------------------------------------------------------------------------
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
......@@ -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);
}
//-----------------------------------------------------------------------------
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;
......@@ -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);
}
//-----------------------------------------------------------------------------
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) {
......@@ -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;
......
......@@ -66,9 +66,11 @@ Address : EURECOM,
* \param[in] rlcP RLC AM protocol instance pointer.
* \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].
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
......@@ -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_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.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
......@@ -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_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].
* \param[in] rlcP RLC AM protocol instance pointer.
* \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
* \param[in,out] so_startP Start 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
......@@ -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));
......@@ -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) {
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;
}
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;
}
}
*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 {
*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)
}
}
//-----------------------------------------------------------------------------
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;
sdu_ssize_t initial_pdu_size = *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;
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) {
......
......@@ -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] 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.
* \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,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)
* \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
* \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.
*/
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)
* \brief Remove all marked holes for PDU with sequence number "snP".
......
......@@ -110,21 +110,21 @@ typedef struct pdu_management_flags {
*/
typedef struct rlc_am_tx_data_pdu_management {
mem_block_t *mem_block; /*!< \brief PDU embedded in a mem_block_t struct */
uint8_t *first_byte; /*!< \brief Pointer on the PDU including header, LIs, data */
uint8_t *payload; /*!< \brief Pointer on the PDU payload */
int16_t sdus_index[RLC_AM_MAX_SDU_IN_PDU]; /*!< \brief Index of SDU(s) having segments in this pdu (index in rlc_am_entity.input_sdus[]) */
frame_t last_nack_time; /*!< \brief Last frame this PDU was negative acknowledged, for not nacking several times in the same frame */
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. */
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_ssize_t payload_size; /*!< \brief Size of the PDU payload in bytes. */
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_ssize_t nack_so_stop; /*!< \brief Highest NACK stop segment offset, must be set to data_size if global NACK */
uint8_t *first_byte; /*!< \brief Pointer on the PDU including header, LIs, data */
uint8_t *payload; /*!< \brief Pointer on the PDU payload */
int16_t sdus_index[RLC_AM_MAX_SDU_IN_PDU]; /*!< \brief Index of SDU(s) having segments in this pdu (index in rlc_am_entity.input_sdus[]) */
frame_t last_nack_time; /*!< \brief Last frame this PDU was negative acknowledged, for not nacking several times in the same frame */
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. */
uint8_t num_holes; /*!< \brief Number of registereg holes in hole_so_start[], hole_so_stop[]. */
sdu_size_t header_and_payload_size; /*!< \brief Size of the PDU in bytes, including header and payload. */
sdu_size_t payload_size; /*!< \brief Size of the PDU payload in bytes. */
rlc_sn_t sn; /*!< \brief Sequence number of the PDU. */
sdu_size_t nack_so_start; /*!< \brief Lowest NACK start segment offset, must be set to 0 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 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 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. */
pdu_management_flags_t flags; /*!< \brief PDU variables related to its retransmission. */
} rlc_am_tx_data_pdu_management_t;
......
......@@ -40,7 +40,9 @@ Address : EURECOM,
#include "LAYER2/MAC/extern.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
......@@ -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->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;
}
}
}
//-----------------------------------------------------------------------------
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;
}
//-----------------------------------------------------------------------------
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",
......@@ -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;
}
//-----------------------------------------------------------------------------
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;
......@@ -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);
}
//-----------------------------------------------------------------------------
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;
......
......@@ -66,34 +66,42 @@ Address : EURECOM,
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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)
* \brief Boolean function, check if timer Poll-retransmit has timed-out.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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)
* \brief Stop and reset the timer Poll-retransmit.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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)
* \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] 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)
* \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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
......@@ -40,7 +40,9 @@ Address : EURECOM,
#include "LAYER2/MAC/extern.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) {
......@@ -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->ue_module_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_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)
}
}
//-----------------------------------------------------------------------------
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) {
......@@ -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) {
......@@ -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;
......
This diff is collapsed.
......@@ -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.
* \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] error_indicationP Error indicated by lower layers for this SDU.
* \param[in] srcP SDU data pointer.
* \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)
* \brief Schedule a SDU to be transmited by lower layers.
* \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.
* \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.
*/
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.
* \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] 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.
*/
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.
* \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.
*/
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.
* \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] 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)
......
......@@ -35,34 +35,52 @@ Address : EURECOM,
#include "rlc_tm.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;
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,
( eNB_flagP > 0) ? "eNB":"UE",
enb_module_idP,
ue_module_idP,
config_tmP->is_uplink_downlink,
enb_module_idP,
ue_module_idP,
rb_idP);
if (eNB_flagP) {
rlc = &rlc_array_eNB[enb_module_idP][ue_module_idP][rb_idP].rlc.tm;
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",
frameP,
( eNB_flagP > 0) ? "eNB":"UE",
enb_module_idP,
ue_module_idP,
config_tmP->is_uplink_downlink,
enb_module_idP,
ue_module_idP,
rb_idP);
rlc_tm_init(rlc_p);
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 {
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;
......@@ -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;
......@@ -101,7 +119,7 @@ void rlc_tm_reset_state_variables (struct rlc_tm_entity *rlcP)
}
//-----------------------------------------------------------------------------
void
rlc_tm_cleanup (rlc_tm_entity_t *rlcP)
rlc_tm_cleanup (rlc_tm_entity_t * const rlcP)
{
//-----------------------------------------------------------------------------
int index;
......@@ -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;
......@@ -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",
frame,
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",
frameP,
(eNB_flagP) ? "eNB" : "UE",
enb_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
enb_module_idP,
ue_module_idP,
rb_idP,
rb_typeP);
srb_flagP);
rlcP->enb_module_id = enb_module_idP;
rlcP->ue_module_id = ue_module_idP;
rlcP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) {
rlcP->is_data_plane = 1;
} else {
if (srb_flagP) {
rlcP->is_data_plane = 0;
} else {
rlcP->is_data_plane = 1;
}
rlcP->is_enb = eNB_flagP;
}
......@@ -68,59 +68,82 @@ Address : EURECOM,
# endif
# endif
typedef volatile struct {
typedef volatile struct rlc_tm_info_s{
uint8_t is_uplink_downlink;
} 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.
* \param[in] frame Frame index.
* \param[in] frameP Frame index.
* \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] ue_module_idP UE Virtualized module identifier.
* \param[in] config_tmP Configuration parameters for RLC TM instance.
* \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)
* \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.
*/
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)
* \brief Reset protocol variables and state variables to initial values.
* \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)
* \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance.
* \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.
* \param[in] rlcP RLC TM protocol instance pointer.
* \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY,
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.
* \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] 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_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
......@@ -47,7 +47,12 @@ Address : EURECOM,
//#define TRACE_RLC_UM_RX 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;
......
......@@ -74,7 +74,12 @@ Address : EURECOM,
* \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;
*/
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)
* \brief Reset protocol variables and state variables to initial values.
......
......@@ -73,10 +73,10 @@ typedef struct rlc_um_entity_s {
//-----------------------------
// PROTOCOL VARIABLES
//-----------------------------
rlc_usn_t vt_us; /*!< \brief This state variable holds the value of the SN to be assigned for the next newly generated UMD PDU. It is initially set to 0, and is updated whenever the UM RLC entity delivers an UMD PDU with SN = VT(US). */
rlc_usn_t vr_ur; /*!< \brief UM receive state variable. This state variable holds the value of the SN of the earliest UMD PDU that is still considered for reordering. It is initially set to 0. */
rlc_usn_t vr_ux; /*!< \brief UM t-Reordering state variable. This state variable holds the value of the SN following the SN of the UMD PDU which triggered t-Reordering. */
rlc_usn_t vr_uh; /*!< \brief UM highest received state variable. This state variable holds the value of the SN following the SN of the UMD PDU with the highest SN among received UMD PDUs, and it serves as the higher edge of the reordering window. It is initially set to 0. */
rlc_usn_t vt_us; /*!< \brief This state variable holds the value of the SN to be assigned for the next newly generated UMD PDU. It is initially set to 0, and is updated whenever the UM RLC entity delivers an UMD PDU with SN = VT(US). */
rlc_usn_t vr_ur; /*!< \brief UM receive state variable. This state variable holds the value of the SN of the earliest UMD PDU that is still considered for reordering. It is initially set to 0. */
rlc_usn_t vr_ux; /*!< \brief UM t-Reordering state variable. This state variable holds the value of the SN following the SN of the UMD PDU which triggered t-Reordering. */
rlc_usn_t vr_uh; /*!< \brief UM highest received state variable. This state variable holds the value of the SN following the SN of the UMD PDU with the highest SN among received UMD PDUs, and it serves as the higher edge of the reordering window. It is initially set to 0. */
//-----------------------------
// TIMERS
//-----------------------------
......@@ -88,23 +88,22 @@ typedef struct rlc_um_entity_s {
uint8_t rx_sn_length; /*!< \brief Length of sequence number in bits, can be 5 or 10. */
uint8_t tx_header_min_length_in_bytes; /*!< \brief Length of PDU header, can be 1 or 2 bytes. */
uint8_t rx_header_min_length_in_bytes; /*!< \brief Length of PDU header, can be 1 or 2 bytes. */
rlc_sn_t tx_sn_modulo; /*!< \brief Module of the sequence number of PDU, can be RLC_UM_SN_5_BITS_MODULO or RLC_UM_SN_10_BITS_MODULO. */
rlc_sn_t rx_sn_modulo; /*!< \brief Module of the sequence number of PDU, can be RLC_UM_SN_5_BITS_MODULO or RLC_UM_SN_10_BITS_MODULO. */
rlc_sn_t rx_um_window_size;
rlc_sn_t tx_um_window_size;
rlc_sn_t tx_sn_modulo; /*!< \brief Module of the sequence number of PDU, can be RLC_UM_SN_5_BITS_MODULO or RLC_UM_SN_10_BITS_MODULO. */
rlc_sn_t rx_sn_modulo; /*!< \brief Module of the sequence number of PDU, can be RLC_UM_SN_5_BITS_MODULO or RLC_UM_SN_10_BITS_MODULO. */
rlc_sn_t rx_um_window_size;
rlc_sn_t tx_um_window_size;
//-----------------------------
// tranmission
//-----------------------------
// 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_alloc; /*!< \brief Allocated memory for the input SDU buffer (for SDUs coming from upper layers). */
mem_block_t **input_sdus; /*!< \brief Input SDU buffer (for SDUs coming from upper layers). Should be accessed as an array. */
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 next_sdu_index; /*!< \brief Next SDU index for a new incomin SDU in input_sdus[]. */
uint16_t current_sdu_index; /*!< \brief Current SDU index in input_sdus array to be segmented. */
rlc_buffer_occupancy_t buffer_occupancy; /*!< \brief Number of bytes contained in input_sdus buffer.*/
uint32_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. */
//*****************************************************************************
// RECEIVER
//*****************************************************************************
......@@ -112,7 +111,6 @@ typedef struct rlc_um_entity_s {
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_alloc; /*!< \brief Allocated memory for the DAR buffer. */
list_t pdus_from_mac_layer; /*!< \brief Not Used. */
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)
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
// 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
rlc_pP->output_sdu_in_construction = NULL;
} else {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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
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 @@
#define OAI_NW_DRV_PROTOCOL_UDP IPPROTO_UDP
#define OAI_NW_DRV_PROTOCOL_ICMP4 IPPROTO_ICMP
#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_PORT_DEFAULT __constant_htons(65535)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment