Commit 36ecc848 authored by Lionel Gauthier's avatar Lionel Gauthier

Put module identifiers, enb_flag, frame in a struct called protocol_ctxt_t

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6326 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0fca6a23
...@@ -58,12 +58,8 @@ ...@@ -58,12 +58,8 @@
#undef GTP_DUMP_SOCKET #undef GTP_DUMP_SOCKET
extern boolean_t extern boolean_t pdcp_data_req(
pdcp_data_req( const protocol_ctxt_t* const ctxt_pP,
const module_id_t enb_mod_idP,
const module_id_t ue_mod_idP,
const frame_t frameP,
const eNB_flag_t enb_flagP,
const srb_flag_t srb_flagP, const srb_flag_t srb_flagP,
const rb_id_t rb_idP, const rb_id_t rb_idP,
const mui_t muiP, const mui_t muiP,
...@@ -282,6 +278,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( ...@@ -282,6 +278,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
teid_t teid = 0; teid_t teid = 0;
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS; hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL; gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL;
protocol_ctxt_t ctxt;
switch(pUlpApi->apiType) { switch(pUlpApi->apiType) {
/* Here there are two type of messages handled: /* Here there are two type of messages handled:
...@@ -319,12 +316,13 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( ...@@ -319,12 +316,13 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
#endif #endif
#warning "LG eps bearer mapping to DRB id to do (offset -4)" #warning "LG eps bearer mapping to DRB id to do (offset -4)"
ctxt.enb_module_id = gtpv1u_teid_data_p->enb_id;
ctxt.ue_module_id = gtpv1u_teid_data_p->ue_id;
ctxt.frame = 0;
ctxt.enb_flag = ENB_FLAG_YES;
result = pdcp_data_req( result = pdcp_data_req(
gtpv1u_teid_data_p->enb_id, &ctxt,
gtpv1u_teid_data_p->ue_id,
0, // frame TO DO
ENB_FLAG_YES,
SRB_FLAG_NO, SRB_FLAG_NO,
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4, (gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
0, // mui 0, // mui
......
Installation Instructions Installation Instructions
************************* *************************
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc. Inc.
Copying and distribution of this file, with or without modification, Copying and distribution of this file, with or without modification,
...@@ -12,8 +12,8 @@ without warranty of any kind. ...@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation Basic Installation
================== ==================
Briefly, the shell commands `./configure; make; make install' should Briefly, the shell command `./configure && make && make install'
configure, build, and install this package. The following should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented `INSTALL' file but do not implement all of the features documented
...@@ -309,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is ...@@ -309,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script). overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround: an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation `configure' Invocation
====================== ======================
...@@ -367,4 +368,3 @@ operates. ...@@ -367,4 +368,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details. `configure --help' for more details.
...@@ -170,4 +170,16 @@ typedef enum config_action_e { ...@@ -170,4 +170,16 @@ typedef enum config_action_e {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
typedef uint32_t teid_t; // tunnel endpoint identifier typedef uint32_t teid_t; // tunnel endpoint identifier
typedef uint8_t ebi_t; // eps bearer id typedef uint8_t ebi_t; // eps bearer id
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
typedef struct protocol_ctxt_s {
module_id_t enb_module_id; /*!< \brief Virtualized enb module identifier, Not used if eNB_flagP = 0. */
module_id_t ue_module_id; /*!< \brief Virtualized ue module identifier */
frame_t frame; /*!< \brief LTE Frame number.*/
eNB_flag_t enb_flag; /*!< \brief Flag to indicate eNB (1) or UE (0) */
} protocol_ctxt_t;
#endif #endif
...@@ -83,6 +83,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -83,6 +83,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
unsigned int nCCE[MAX_NUM_CCs]; unsigned int nCCE[MAX_NUM_CCs];
int mbsfn_status[MAX_NUM_CCs]; int mbsfn_status[MAX_NUM_CCs];
uint32_t RBalloc[MAX_NUM_CCs]; uint32_t RBalloc[MAX_NUM_CCs];
protocol_ctxt_t ctxt;
#ifdef EXMIMO #ifdef EXMIMO
int ret; int ret;
#endif #endif
...@@ -181,7 +182,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -181,7 +182,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//if (subframeP%5 == 0) //if (subframeP%5 == 0)
//#ifdef EXMIMO //#ifdef EXMIMO
pdcp_run(frameP, 1, 0, module_idP); ctxt.enb_module_id = module_idP;
ctxt.ue_module_id = 0;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_YES;
pdcp_run(&ctxt);
//#endif //#endif
// check HO // check HO
......
...@@ -1321,6 +1321,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su ...@@ -1321,6 +1321,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
// int8_t lcg_id; // int8_t lcg_id;
struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL; struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL;
#ifdef EXMIMO #ifdef EXMIMO
protocol_ctxt_t ctxt;
int ret; int ret;
#endif #endif
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
...@@ -1366,7 +1367,11 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su ...@@ -1366,7 +1367,11 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
//Rrc_xface->Frame_index=Mac_rlc_xface->frameP; //Rrc_xface->Frame_index=Mac_rlc_xface->frameP;
//if (subframe%5 == 0) //if (subframe%5 == 0)
#ifdef EXMIMO #ifdef EXMIMO
pdcp_run(frameP, 0, module_idP, eNB_indexP); ctxt.enb_module_id = eNB_indexP;
ctxt.ue_module_id = module_idP;
ctxt.frame = frameP;
ctxt.enb_flag = ENB_FLAG_NO;
pdcp_run(&ctxt);
#endif #endif
UE_mac_inst[module_idP].frame = frameP; UE_mac_inst[module_idP].frame = frameP;
UE_mac_inst[module_idP].subframe = subframeP; UE_mac_inst[module_idP].subframe = subframeP;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -156,7 +156,7 @@ int pdcp_netlink_init(void) { ...@@ -156,7 +156,7 @@ int pdcp_netlink_init(void) {
* should be avoided if we want a reliable link. * should be avoided if we want a reliable link.
*/ */
if (pthread_create(&pdcp_netlink_thread, &attr, pdcp_netlink_thread_fct, NULL) != 0) { if (pthread_create(&pdcp_netlink_thread, &attr, pdcp_netlink_thread_fct, NULL) != 0) {
LOG_E(PDCP, "[NETLINK]Failed to create new thread for Netlink/PDCP communcation (%d:%s)\n", LOG_E(PDCP, "[NETLINK]Failed to create new thread for Netlink/PDCP communication (%d:%s)\n",
errno, strerror(errno)); errno, strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -164,23 +164,20 @@ int pdcp_netlink_init(void) { ...@@ -164,23 +164,20 @@ int pdcp_netlink_init(void) {
return 0; return 0;
} }
int pdcp_netlink_dequeue_element( int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
eNB_flag_t eNB_flagP,
struct pdcp_netlink_element_s **data_ppP) struct pdcp_netlink_element_s **data_ppP)
{ {
int ret = 0; int ret = 0;
if (eNB_flagP) { if (ctxt_pP->enb_flag) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[enb_mod_idP], (void **)data_ppP); ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->enb_module_id], (void **)data_ppP);
if (ret != 0) { if (ret != 0) {
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", enb_mod_idP); LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->enb_module_id);
} }
} else { } else {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ue_mod_idP], (void **)data_ppP); ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->ue_module_id], (void **)data_ppP);
if (ret != 0) { if (ret != 0) {
LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ue_mod_idP); LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->ue_module_id);
} }
} }
......
...@@ -174,23 +174,29 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char* ...@@ -174,23 +174,29 @@ boolean_t pdcp_serialize_user_plane_data_pdu_with_long_sn_buffer(unsigned char*
boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer, \ boolean_t pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer, \
uint8_t bitmap[512], pdcp_control_pdu_for_pdcp_status_report* pdu); uint8_t bitmap[512], pdcp_control_pdu_for_pdcp_status_report* pdu);
int pdcp_netlink_dequeue_element(module_id_t enb_mod_idP, module_id_t ue_mod_idP, eNB_flag_t eNB_flagP, int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
struct pdcp_netlink_element_s **data_ppP); struct pdcp_netlink_element_s **data_ppP);
void pdcp_config_set_security(pdcp_t *pdcp_pP, module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, rb_id_t rb_idP, void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_idP,
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP); uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP);
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
int pdcp_apply_security(pdcp_t *pdcp_entity, int pdcp_apply_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP, srb_flag_t srb_flagP,
rb_id_t rb_id, rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer, uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size); uint16_t sdu_buffer_size);
int pdcp_validate_security(pdcp_t *pdcp_entity, int pdcp_validate_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP, srb_flag_t srb_flagP,
rb_id_t rb_id, rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer, uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size); uint16_t sdu_buffer_size);
#endif /* defined(ENABLE_SECURITY) */ #endif /* defined(ENABLE_SECURITY) */
......
...@@ -49,12 +49,17 @@ ...@@ -49,12 +49,17 @@
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
static static
uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn); uint32_t pdcp_get_next_count_tx(pdcp_t *const pdcp_entity, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
static static
uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn); uint32_t pdcp_get_next_count_rx(pdcp_t *const pdcp_entity, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
//-----------------------------------------------------------------------------
static static
uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn) uint32_t pdcp_get_next_count_tx(
pdcp_t * const pdcp_entity,
const srb_flag_t srb_flagP,
const uint16_t pdcp_sn
)
{ {
uint32_t count; uint32_t count;
/* For TX COUNT = TX_HFN << length of SN | pdcp SN */ /* For TX COUNT = TX_HFN << length of SN | pdcp SN */
...@@ -73,8 +78,12 @@ uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1 ...@@ -73,8 +78,12 @@ uint32_t pdcp_get_next_count_tx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
return count; return count;
} }
//-----------------------------------------------------------------------------
static static
uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint16_t pdcp_sn) uint32_t pdcp_get_next_count_rx(
pdcp_t * const pdcp_entity,
const srb_flag_t srb_flagP,
const uint16_t pdcp_sn)
{ {
uint32_t count; uint32_t count;
/* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */ /* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */
...@@ -97,13 +106,19 @@ uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1 ...@@ -97,13 +106,19 @@ uint32_t pdcp_get_next_count_rx(pdcp_t *pdcp_entity, srb_flag_t srb_flagP, uint1
return count; return count;
} }
int pdcp_apply_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP, //-----------------------------------------------------------------------------
rb_id_t rb_id, int
uint8_t pdcp_header_len, pdcp_apply_security(
uint16_t current_sn, const protocol_ctxt_t* const ctxtP,
uint8_t *pdcp_pdu_buffer, pdcp_t *const pdcp_entity,
uint16_t sdu_buffer_size) const srb_flag_t srb_flagP,
const rb_id_t rb_id,
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t * const pdcp_pdu_buffer,
const uint16_t sdu_buffer_size
)
{ {
uint8_t *buffer_encrypted = NULL; uint8_t *buffer_encrypted = NULL;
stream_cipher_t encrypt_params; stream_cipher_t encrypt_params;
...@@ -161,13 +176,18 @@ int pdcp_apply_security(pdcp_t *pdcp_entity, ...@@ -161,13 +176,18 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
return 0; return 0;
} }
int pdcp_validate_security(pdcp_t *pdcp_entity, //-----------------------------------------------------------------------------
srb_flag_t srb_flagP, int
rb_id_t rb_id, pdcp_validate_security(
uint8_t pdcp_header_len, const protocol_ctxt_t* const ctxtP,
uint16_t current_sn, pdcp_t * const pdcp_entity,
uint8_t *pdcp_pdu_buffer, const srb_flag_t srb_flagP,
uint16_t sdu_buffer_size) const rb_id_t rb_id,
const uint8_t pdcp_header_len,
const uint16_t current_sn,
uint8_t *const pdcp_pdu_buffer,
const uint16_t sdu_buffer_size
)
{ {
uint8_t *buffer_decrypted = NULL; uint8_t *buffer_decrypted = NULL;
stream_cipher_t decrypt_params; stream_cipher_t decrypt_params;
......
This diff is collapsed.
This diff is collapsed.
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
* \brief Structure containing a RLC AM instance protocol variables, statistic variables, allocation variables, buffers and other miscellaneous variables. * \brief Structure containing a RLC AM instance protocol variables, statistic variables, allocation variables, buffers and other miscellaneous variables.
*/ */
typedef struct rlc_am_entity_s { typedef struct rlc_am_entity_s {
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance. */ //module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance. */
module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */ //module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */ rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */ logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */ boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */ //boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */ rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */
rlc_buffer_occupancy_t retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */ rlc_buffer_occupancy_t retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
#define TRACE_RLC_AM_FREE_SDU #define TRACE_RLC_AM_FREE_SDU
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_free_in_sdu( void rlc_am_free_in_sdu(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const unsigned int index_in_bufferP) const unsigned int index_in_bufferP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
...@@ -69,10 +69,10 @@ void rlc_am_free_in_sdu( ...@@ -69,10 +69,10 @@ void rlc_am_free_in_sdu(
} }
#ifdef TRACE_RLC_AM_FREE_SDU #ifdef TRACE_RLC_AM_FREE_SDU
LOG_D(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][FREE SDU] SDU INDEX %03d current_sdu_index=%d next_sdu_index=%d nb_sdu_no_segmented=%d\n", LOG_D(RLC, "[FRAME %05d][%s][RLC_AM][MOD %u/%u][RB %u][FREE SDU] SDU INDEX %03d current_sdu_index=%d next_sdu_index=%d nb_sdu_no_segmented=%d\n",
frameP, ctxt_pP->frame,
(rlcP->is_enb) ? "eNB" : "UE", (ctxt_pP->enb_flag) ? "eNB" : "UE",
rlcP->enb_module_id, ctxt_pP->enb_module_id,
rlcP->ue_module_id, ctxt_pP->ue_module_id,
rlcP->rb_id, rlcP->rb_id,
index_in_bufferP, index_in_bufferP,
rlcP->current_sdu_index, rlcP->current_sdu_index,
...@@ -82,8 +82,10 @@ void rlc_am_free_in_sdu( ...@@ -82,8 +82,10 @@ void rlc_am_free_in_sdu(
} }
// called when segmentation is done // called when segmentation is done
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_free_in_sdu_data( void
rlc_am_entity_t *const rlcP, rlc_am_free_in_sdu_data(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlcP,
const unsigned int index_in_bufferP) const unsigned int index_in_bufferP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
...@@ -97,7 +99,10 @@ void rlc_am_free_in_sdu_data( ...@@ -97,7 +99,10 @@ void rlc_am_free_in_sdu_data(
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *const rlcP) signed int
rlc_am_in_sdu_is_empty(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlcP->nb_sdu == 0) { if (rlcP->nb_sdu == 0) {
......
...@@ -57,30 +57,32 @@ ...@@ -57,30 +57,32 @@
# define public_rlc_am_in_sdu(x) extern x # define public_rlc_am_in_sdu(x) extern x
# endif # endif
# endif # endif
/*! \fn void rlc_am_free_in_sdu (rlc_am_entity_t *rlcP, frame_t frameP, unsigned int index_in_bufferP) /*! \fn void rlc_am_free_in_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP)
* \brief Free a higher layer SDU stored in input_sdus[] buffer. * \brief Free a higher layer SDU stored in input_sdus[] buffer.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] index_in_bufferP Position index of the SDU. * \param[in] index_in_bufferP Position index of the SDU.
* \note Update also the RLC AM instance variables nb_sdu, current_sdu_index, nb_sdu_no_segmented. * \note Update also the RLC AM instance variables nb_sdu, current_sdu_index, nb_sdu_no_segmented.
*/ */
protected_rlc_am_in_sdu(void rlc_am_free_in_sdu (rlc_am_entity_t *rlcP, frame_t frameP, unsigned int index_in_bufferP);) protected_rlc_am_in_sdu(void rlc_am_free_in_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP);)
/*! \fn void rlc_am_free_in_sdu_data (rlc_am_entity_t *rlcP, unsigned int index_in_bufferP) /*! \fn void rlc_am_free_in_sdu_data (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP)
* \brief Free a higher layer SDU data part, the SDU is stored in input_sdus[] buffer. * \brief Free a higher layer SDU data part, the SDU is stored in input_sdus[] buffer.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] index_in_bufferP Position index of the SDU. * \param[in] index_in_bufferP Position index of the SDU.
* \note This procedure is called when the SDU segmentation is done for this SDU. Update also the RLC AM instance variable nb_sdu_no_segmented. * \note This procedure is called when the SDU segmentation is done for this SDU. Update also the RLC AM instance variable nb_sdu_no_segmented.
*/ */
protected_rlc_am_in_sdu(void rlc_am_free_in_sdu_data (rlc_am_entity_t *rlcP, unsigned int index_in_bufferP);) protected_rlc_am_in_sdu(void rlc_am_free_in_sdu_data (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP);)
/*! \fn signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP) /*! \fn signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP)
* \brief Indicates if the input SDU buffer for incoming higher layer SDUs is empty or not. * \brief Indicates if the input SDU buffer for incoming higher layer SDUs is empty or not.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \return 1 if the buffer is empty, else 0. * \return 1 if the buffer is empty, else 0.
*/ */
protected_rlc_am_in_sdu(signed int rlc_am_in_sdu_is_empty(rlc_am_entity_t *rlcP);) protected_rlc_am_in_sdu(signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP);)
/** @} */ /** @} */
# endif # endif
...@@ -36,13 +36,16 @@ ...@@ -36,13 +36,16 @@
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP) void
rlc_am_init(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->initialized == TRUE) { if (rlc_pP->initialized == TRUE) {
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n", frameP); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION ALREADY DONE, DOING NOTHING\n", ctxt_pP->frame);
} else { } else {
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION: STATE VARIABLES, BUFFERS, LISTS\n", frameP); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] INITIALIZATION: STATE VARIABLES, BUFFERS, LISTS\n", ctxt_pP->frame);
memset(rlc_pP, 0, sizeof(rlc_am_entity_t)); memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
list2_init(&rlc_pP->receiver_buffer, "RX BUFFER"); list2_init(&rlc_pP->receiver_buffer, "RX BUFFER");
...@@ -56,8 +59,8 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -56,8 +59,8 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
#warning "cast the rlc retrans buffer to uint32" #warning "cast the rlc retrans buffer to uint32"
// rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t))); // rlc_pP->pdu_retrans_buffer = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t))); rlc_pP->pdu_retrans_buffer = calloc(1, (uint32_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] input_sdus[] = %p element size=%d\n", ctxt_pP->frame, rlc_pP->input_sdus,sizeof(rlc_am_tx_sdu_management_t));
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", frameP, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t)); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][INIT] pdu_retrans_buffer[] = %p element size=%d\n", ctxt_pP->frame, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t));
// TX state variables // TX state variables
//rlc_pP->vt_a = 0; //rlc_pP->vt_a = 0;
...@@ -81,7 +84,10 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -81,7 +84,10 @@ void rlc_am_init(rlc_am_entity_t *rlc_pP, frame_t frameP)
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_reestablish(rlc_am_entity_t *rlc_pP, frame_t frameP) void
rlc_am_reestablish(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlc_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
/* /*
...@@ -98,7 +104,7 @@ void rlc_am_reestablish(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -98,7 +104,7 @@ void rlc_am_reestablish(rlc_am_entity_t *rlc_pP, frame_t frameP)
* - stop and reset all timers; * - stop and reset all timers;
* - reset all state variables to their initial values. * - reset all state variables to their initial values.
*/ */
LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n", frameP); LOG_D(RLC, "[FRAME %5u][RLC_AM][MOD XX][RB XX][REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n", ctxt_pP->frame);
#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR) #warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
list2_free(&rlc_pP->receiver_buffer); list2_free(&rlc_pP->receiver_buffer);
...@@ -133,13 +139,16 @@ void rlc_am_reestablish(rlc_am_entity_t *rlc_pP, frame_t frameP) ...@@ -133,13 +139,16 @@ void rlc_am_reestablish(rlc_am_entity_t *rlc_pP, frame_t frameP)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_cleanup(rlc_am_entity_t *rlc_pP) void
rlc_am_cleanup(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlc_pP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
LOG_I(RLC, "[FRAME ?????][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n", LOG_I(RLC, "[FRAME ?????][%s][RLC_AM][MOD %u/%u][RB %u][CLEANUP]\n",
(rlc_pP->is_enb) ? "eNB" : "UE", (ctxt_pP->enb_flag) ? "eNB" : "UE",
rlc_pP->enb_module_id, ctxt_pP->enb_module_id,
rlc_pP->ue_module_id, ctxt_pP->ue_module_id,
rlc_pP->rb_id); rlc_pP->rb_id);
list2_free(&rlc_pP->receiver_buffer); list2_free(&rlc_pP->receiver_buffer);
...@@ -177,22 +186,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP) ...@@ -177,22 +186,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP)
memset(rlc_pP, 0, sizeof(rlc_am_entity_t)); memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_configure(rlc_am_entity_t *rlc_pP, void
frame_t frameP, rlc_am_configure(
uint16_t max_retx_thresholdP, const protocol_ctxt_t* const ctxt_pP,
uint16_t poll_pduP, rlc_am_entity_t *const rlc_pP,
uint16_t poll_byteP, const uint16_t max_retx_thresholdP,
uint32_t t_poll_retransmitP, const uint16_t poll_pduP,
uint32_t t_reorderingP, const uint16_t poll_byteP,
uint32_t t_status_prohibitP) const uint32_t t_poll_retransmitP,
const uint32_t t_reorderingP,
const uint32_t t_status_prohibitP)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if (rlc_pP->configured == TRUE) { if (rlc_pP->configured == TRUE) {
LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n", LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][RECONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n",
frameP, ctxt_pP->frame,
(rlc_pP->is_enb) ? "eNB" : "UE", (ctxt_pP->enb_flag) ? "eNB" : "UE",
rlc_pP->enb_module_id, ctxt_pP->enb_module_id,
rlc_pP->ue_module_id, ctxt_pP->ue_module_id,
rlc_pP->rb_id, rlc_pP->rb_id,
max_retx_thresholdP, max_retx_thresholdP,
poll_pduP, poll_pduP,
...@@ -211,10 +222,10 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP, ...@@ -211,10 +222,10 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP,
rlc_pP->t_status_prohibit.time_out = t_status_prohibitP; rlc_pP->t_status_prohibit.time_out = t_status_prohibitP;
} else { } else {
LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][CONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n", LOG_I(RLC, "[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u][CONFIGURE] max_retx_threshold %d poll_pdu %d poll_byte %d t_poll_retransmit %d t_reordering %d t_status_prohibit %d\n",
frameP, ctxt_pP->frame,
(rlc_pP->is_enb) ? "eNB" : "UE", (ctxt_pP->enb_flag) ? "eNB" : "UE",
rlc_pP->enb_module_id, ctxt_pP->enb_module_id,
rlc_pP->ue_module_id, ctxt_pP->ue_module_id,
rlc_pP->rb_id, rlc_pP->rb_id,
max_retx_thresholdP, max_retx_thresholdP,
poll_pduP, poll_pduP,
...@@ -229,42 +240,39 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP, ...@@ -229,42 +240,39 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP,
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE; rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_am_init_timer_poll_retransmit(rlc_pP, t_poll_retransmitP); rlc_am_init_timer_poll_retransmit(ctxt_pP, rlc_pP, t_poll_retransmitP);
rlc_am_init_timer_reordering (rlc_pP, t_reorderingP); rlc_am_init_timer_reordering (ctxt_pP, rlc_pP, t_reorderingP);
rlc_am_init_timer_status_prohibit(rlc_pP, t_status_prohibitP); rlc_am_init_timer_status_prohibit(ctxt_pP, rlc_pP, t_status_prohibitP);
rlc_pP->configured = TRUE; rlc_pP->configured = TRUE;
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_set_debug_infos(rlc_am_entity_t *rlc_pP, void
frame_t frameP, rlc_am_set_debug_infos(
eNB_flag_t eNB_flagP, const protocol_ctxt_t* const ctxt_pP,
srb_flag_t srb_flagP, rlc_am_entity_t *const rlc_pP,
module_id_t enb_module_idP, const srb_flag_t srb_flagP,
module_id_t ue_module_idP, const rb_id_t rb_idP)
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 is SRB %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, ctxt_pP->frame,
(rlc_pP->is_enb) ? "eNB" : "UE", (ctxt_pP->enb_flag) ? "eNB" : "UE",
rlc_pP->enb_module_id, ctxt_pP->enb_module_id,
rlc_pP->ue_module_id, ctxt_pP->ue_module_id,
rb_idP, rb_idP,
enb_module_idP, ctxt_pP->enb_module_id,
ue_module_idP, ctxt_pP->ue_module_id,
rb_idP, rb_idP,
(srb_flagP) ? "TRUE" : "FALSE"); (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; rlc_pP->rb_id = rb_idP;
if (srb_flagP) { if (srb_flagP) {
rlc_pP->is_data_plane = 0; rlc_pP->is_data_plane = 0;
} else { } else {
rlc_pP->is_data_plane = 1; rlc_pP->is_data_plane = 1;
} }
rlc_pP->is_enb = eNB_flagP;
} }
...@@ -78,23 +78,24 @@ typedef volatile struct { ...@@ -78,23 +78,24 @@ typedef volatile struct {
} rlc_am_info_t; } rlc_am_info_t;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \fn void rlc_am_init (rlc_am_entity_t* rlc_pP,frame_t frameP) /*! \fn void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
* \brief Initialize the RLC AM protocol instance, reset variables, allocate buffers, lists, then, the next step in order have a running RLC AM instance is to configure and set debug informations for this RLC instance. * \brief Initialize the RLC AM protocol instance, reset variables, allocate buffers, lists, then, the next step in order have a running RLC AM instance is to configure and set debug informations for this RLC instance.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
*/ */
public_rlc_am_init( void rlc_am_init (rlc_am_entity_t* rlc_pP,frame_t frameP);) public_rlc_am_init( void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);)
/*! \fn void rlc_am_cleanup(rlc_am_entity_t* rlc_pP) /*! \fn void rlc_am_cleanup(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t *const rlc_pP)
* \brief Free all memory resources allocated and kept by this RLC AM instance. * \brief Free all memory resources allocated and kept by this RLC AM instance.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
*/ */
public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP);) public_rlc_am_init( void rlc_am_cleanup(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);)
/*! \fn void rlc_am_configure(rlc_am_entity_t *rlc_pP, frame_t frameP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP) /*! \fn void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP)
* \brief Set RLC AM protocol parameters. * \brief Set RLC AM protocol parameters.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
* \param[in] max_retx_thresholdP Limit the number of retransmissions of an * \param[in] max_retx_thresholdP Limit the number of retransmissions of an
AMD PDU. AMD PDU.
* \param[in] poll_pduP Trigger a poll for every poll_pduP PDUs. * \param[in] poll_pduP Trigger a poll for every poll_pduP PDUs.
...@@ -103,25 +104,22 @@ AMD PDU. ...@@ -103,25 +104,22 @@ AMD PDU.
* \param[in] t_reorderingP This timer is used by the receiving side of an AM RLC entity in order to detect loss of RLC PDUs at lower layer, value in frames. * \param[in] t_reorderingP This timer is used by the receiving side of an AM RLC entity in order to detect loss of RLC PDUs at lower layer, value in frames.
* \param[in] t_status_prohibitP This timer is used by the receiving side of an AM RLC entity in order to prohibit transmission of a STATUS PDU, value in frames. * \param[in] t_status_prohibitP This timer is used by the receiving side of an AM RLC entity in order to prohibit transmission of a STATUS PDU, value in frames.
*/ */
public_rlc_am_init( void rlc_am_configure(rlc_am_entity_t *rlc_pP, public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP,
frame_t frameP, rlc_am_entity_t * const rlc_pP,
uint16_t max_retx_thresholdP, const uint16_t max_retx_thresholdP,
uint16_t poll_pduP, const uint16_t poll_pduP,
uint16_t poll_byteP, const uint16_t poll_byteP,
uint32_t t_poll_retransmitP, const uint32_t t_poll_retransmitP,
uint32_t t_reorderingP, const uint32_t t_reorderingP,
uint32_t t_status_prohibitP);) const 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, srb_flag_t srb_flagP, module_id_t enb_module_idP, module_id_t ue_module_idP, rb_id_t rb_idP) /*! \fn void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
* \brief Set informations that will be displayed in traces, helping the debug process. * \brief Set informations that will be displayed in traces, helping the debug process.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
* \param[in] 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] 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_idP Radio bearer identifier.
*/ */
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);) public_rlc_am_init( void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP);)
/** @} */ /** @} */
#endif #endif
...@@ -56,36 +56,36 @@ ...@@ -56,36 +56,36 @@
# define public_rlc_am_reassembly(x) extern x # define public_rlc_am_reassembly(x) extern x
# endif # endif
# endif # endif
/*! \fn void rlc_am_clear_rx_sdu (rlc_am_entity_t *rlc_pP) /*! \fn void rlc_am_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
* \brief Reset the data cursor index in the output SDU buffer to zero. * \brief Reset the data cursor index in the output SDU buffer to zero.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
*/ */
private_rlc_am_reassembly( void rlc_am_clear_rx_sdu (rlc_am_entity_t *rlc_pP);) private_rlc_am_reassembly( void rlc_am_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);)
/*! \fn void rlc_am_reassembly (uint8_t * srcP, int32_t lengthP, rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pPuint8_t * srcP, int32_t lengthP)
* \brief Concatenate datas at the tail of the output SDU in construction. This SDU in construction will be sent to higher layer. * \brief Concatenate datas at the tail of the output SDU in construction. This SDU in construction will be sent to higher layer.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] srcP Pointer on data to be reassemblied. * \param[in] srcP Pointer on data to be reassemblied.
* \param[in] lengthP Length of data to be reassemblied. * \param[in] lengthP Length of data to be reassemblied.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
*/ */
private_rlc_am_reassembly( void rlc_am_reassembly (uint8_t * srcP, int32_t lengthP, rlc_am_entity_t *rlc_pP,frame_t frameP);) private_rlc_am_reassembly( void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint8_t * srcP, int32_t lengthP);)
/*! \fn void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP)
* \brief Send the output SDU in construction to higher layer. * \brief Send the output SDU in construction to higher layer.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
*/ */
private_rlc_am_reassembly( void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP, eNB_flag_t eNB_flagP);) private_rlc_am_reassembly( void rlc_am_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);)
/*! \fn void rlc_am_reassemble_pdu(rlc_am_entity_t* rlc_pP, frame_t frameP, uint8_t eNB_flagP, mem_block_t* tb_pP) /*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const mem_block_t* const tb_pP)
* \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header. * \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0).
* \param[in] tb_pP RLC AM PDU embedded in a mem_block_t. * \param[in] tb_pP RLC AM PDU embedded in a mem_block_t.
*/ */
protected_rlc_am_reassembly( void rlc_am_reassemble_pdu(rlc_am_entity_t* rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, mem_block_t* tb_pP);) protected_rlc_am_reassembly( void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP);)
/** @} */ /** @} */
#endif #endif
...@@ -56,60 +56,58 @@ ...@@ -56,60 +56,58 @@
# define public_rlc_am_receiver(x) extern x # define public_rlc_am_receiver(x) extern x
# endif # endif
# endif # endif
/*! \fn signed int rlc_am_get_data_pdu_infos(const 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 protocol_ctxt_t* const ctxt_pP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP)
* \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU. * \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU.
* \param[in] frame Frame index. * \param[in] ctxt_pP Running context.
* \param[in] headerP RLC AM header PDU pointer. * \param[in] headerP RLC AM header PDU pointer.
* \param[in] sizeP Size of RLC AM PDU. * \param[in] sizeP Size of RLC AM PDU.
* \param[in] pdu_infoP Structure containing extracted informations from PDU. * \param[in] pdu_infoP Structure containing extracted informations from PDU.
* \return 0 if no error was encountered during the parsing of the PDU, else -1; * \return 0 if no error was encountered during the parsing of the PDU, else -1;
*/ */
protected_rlc_am_receiver( signed int rlc_am_get_data_pdu_infos(const 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 protocol_ctxt_t* const ctxt_pP, 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 * const rlc_pP, const frame_t frameP, rlc_am_pdu_info_t* pdu_infoP) /*! \fn void rlc_am_display_data_pdu_infos(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, rlc_am_pdu_info_t* pdu_infoP)
* \brief Display RLC AM PDU informations. * \brief Display RLC AM PDU informations.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] pdu_infoP Structure containing extracted informations of a PDU. * \param[in] pdu_infoP Structure containing extracted informations of a PDU.
*/ */
protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(rlc_am_entity_t * const rlc_pP, const frame_t frameP, rlc_am_pdu_info_t* pdu_infoP);) protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t * const rlc_pP, rlc_am_pdu_info_t* pdu_infoP);)
/*! \fn void rlc_am_rx_update_vr_ms(rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP) /*! \fn void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP)
* \brief Update RLC AM protocol variable VR(MS). * \brief Update RLC AM protocol variable VR(MS).
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] tb_pP PDU embedded in a mem_block_t struct. * \param[in] tb_pP PDU embedded in a mem_block_t struct.
* \note It is assumed that the sequence number of the transport block is equal to VR(MS) * \note It is assumed that the sequence number of the transport block is equal to VR(MS)
*/ */
protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(rlc_am_entity_t * const rlc_pP,const frame_t frameP, mem_block_t* tb_pP);) protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, 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) /*! \fn void rlc_am_rx_update_vr_r (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP)
* \brief Update RLC AM protocol variable VR(R). * \brief Update RLC AM protocol variable VR(R).
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] tb_pP PDU embedded in a mem_block_t struct. * \param[in] tb_pP PDU embedded in a mem_block_t struct.
* \note It is assumed that the sequence number of the transport block is equal to VR(R) * \note It is assumed that the sequence number of the transport block is equal to VR(R)
*/ */
protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (rlc_am_entity_t * const rlc_pP,const frame_t frameP, mem_block_t* tb_pP);) protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP);)
/*! \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) /*! \fn void rlc_am_receive_routing (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, struct mac_data_ind data_indP)
* \brief Convert transport blocks received from MAC layer into RLC AM PDUs, and dispatch to the right processing block these PDUS upon their type (CONTROL/DATA). * \brief Convert transport blocks received from MAC layer into RLC AM PDUs, and dispatch to the right processing block these PDUS upon their type (CONTROL/DATA).
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0).
* \param[in] data_indP Transport blocks received from MAC layer. * \param[in] data_indP Transport blocks received from MAC layer.
*/ */
protected_rlc_am_receiver( void rlc_am_receive_routing (rlc_am_entity_t * const rlc_pP, const frame_t frameP, const eNB_flag_t eNB_flagP, struct mac_data_ind data_indP)); protected_rlc_am_receiver( void rlc_am_receive_routing (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, struct mac_data_ind data_indP));
/*! \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) /*! \fn void rlc_am_receive_process_data_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP)
* \brief Process an incoming data PDU received from MAC layer. * \brief Process an incoming data PDU received from MAC layer.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] eNB_flagP Flag to indicate eNB (1) or UE (0).
* \param[in] tb_pP PDU embedded in a mem_block_t struct. * \param[in] tb_pP PDU embedded in a mem_block_t struct.
* \param[in] first_byteP Pointer on first byte of the PDU. * \param[in] first_byteP Pointer on first byte of the PDU.
* \param[in] tb_size_in_bytesP Transport block size in bytes (same as PDU size in bytes). * \param[in] tb_size_in_bytesP Transport block size in bytes (same as PDU size in bytes).
*/ */
private_rlc_am_receiver( void rlc_am_receive_process_data_pdu (rlc_am_entity_t * 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)); private_rlc_am_receiver( void rlc_am_receive_process_data_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP));
/** @} */ /** @} */
# endif # endif
...@@ -57,78 +57,78 @@ ...@@ -57,78 +57,78 @@
# define public_rlc_am_retransmit(x) extern x # define public_rlc_am_retransmit(x) extern x
# endif # endif
# endif # endif
/*! \fn void rlc_am_nack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, uint16_t snP, sdu_size_t so_startP, sdu_size_t so_endP) /*! \fn void rlc_am_nack_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, uint16_t snP, sdu_size_t so_startP, sdu_size_t so_endP)
* \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields. * \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] snP Sequence number of the PDU that is negative acknowledged. * \param[in] snP Sequence number of the PDU that is negative acknowledged.
* \param[in] so_startP Start of the segment offset of the PDU that . * \param[in] so_startP Start of the segment offset of the PDU that .
* \param[in] so_endP Transport blocks received from MAC layer. * \param[in] so_endP Transport blocks received from MAC layer.
* \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU. * \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
*/ */
protected_rlc_am_retransmit(void rlc_am_nack_pdu ( protected_rlc_am_retransmit(void rlc_am_nack_pdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP, const rlc_sn_t snP,
const sdu_size_t so_startP, const sdu_size_t so_startP,
const sdu_size_t so_endP);) const sdu_size_t so_endP);)
/*! \fn void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP) /*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] snP Sequence number of the PDU that is acknowledged. * \param[in] snP Sequence number of the PDU that is acknowledged.
* \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU. * \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU.
*/ */
protected_rlc_am_retransmit(void rlc_am_ack_pdu ( protected_rlc_am_retransmit(void rlc_am_ack_pdu (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP);) const rlc_sn_t snP);)
/*! \fn mem_block_t* rlc_am_retransmit_get_copy (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP) /*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] snP Sequence number of the PDU to be copied. * \param[in] snP Sequence number of the PDU to be copied.
* \return A copy of the PDU having sequence number equal to parameter snP. * \return A copy of the PDU having sequence number equal to parameter snP.
*/ */
protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy ( protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP)); const rlc_sn_t snP));
/*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP, sdu_size_t *sizeP) /*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP,rlc_sn_t snP, sdu_size_t *sizeP)
* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. * \brief The RLC AM PDU which have the sequence number snP is marked ACKed.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index
* \param[in] snP Sequence number of the PDU to be copied. * \param[in] snP Sequence number of the PDU to be copied.
* \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment). * \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment).
* \return A copy of a segment of the PDU having sequence number equal to parameter snP. * \return A copy of a segment of the PDU having sequence number equal to parameter snP.
*/ */
protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment ( protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP, const rlc_sn_t snP,
sdu_size_t *const sizeP)); sdu_size_t *const sizeP));
/*! \fn void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,frame_t frameP) /*! \fn void rlc_am_retransmit_any_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* rlcP)
* \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU. * \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
*/ */
protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu( protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(
rlc_am_entity_t* const rlcP, const protocol_ctxt_t* const ctxt_pP,
const frame_t frameP);) rlc_am_entity_t* const rlcP);)
/*! \fn void rlc_am_tx_buffer_display (rlc_am_entity_t* rlcP, frame_t frameP, char* message_pP) /*! \fn void rlc_am_tx_buffer_display (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* rlcP, char* message_pP)
* \brief Display the dump of the retransmission buffer. * \brief Display the dump of the retransmission buffer.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] message_pP Message to be displayed along with the display of the dump of the retransmission buffer. * \param[in] message_pP Message to be displayed along with the display of the dump of the retransmission buffer.
*/ */
protected_rlc_am_retransmit(void rlc_am_tx_buffer_display ( protected_rlc_am_retransmit(void rlc_am_tx_buffer_display (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlcP, rlc_am_entity_t* const rlcP,
const frame_t frameP,
char* const message_pP);) char* const message_pP);)
/** @} */ /** @} */
# endif # endif
...@@ -66,38 +66,37 @@ ...@@ -66,38 +66,37 @@
#include "PHY/defs.h" #include "PHY/defs.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \fn signed int rlc_am_rx_list_insert_pdu(rlc_am_entity_t* rlcP frame_t frameP, mem_block_t* tbP) /*! \fn signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP , mem_block_t* const tbP)
* \brief Insert a PDU in the RX buffer (implemented with a list). * \brief Insert a PDU in the RX buffer (implemented with a list).
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] tbP A PDU embedded in a mem_block_t. * \param[in] tbP A PDU embedded in a mem_block_t.
* \return Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted. * \return Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted.
*/ */
protected_rlc_am_rx_list( signed int rlc_am_rx_list_insert_pdu(rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* tbP);) protected_rlc_am_rx_list( signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP);)
/*! \fn void rlc_am_rx_check_all_byte_segments(rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* tbP) /*! \fn void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP)
* \brief Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure. * \brief Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] tbP A PDU embedded in a mem_block_t. * \param[in] tbP A PDU embedded in a mem_block_t.
*/ */
protected_rlc_am_rx_list( void rlc_am_rx_check_all_byte_segments(rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* tbP);) protected_rlc_am_rx_list( void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP);)
/*! \fn void rlc_am_rx_mark_all_segments_received (rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* first_segment_tbP) /*! \fn void rlc_am_rx_mark_all_segments_received (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const first_segment_tbP)
* \brief Mark all PDUs having the same sequence number as first_segment_tbP with the information that all segments have been received. * \brief Mark all PDUs having the same sequence number as first_segment_tbP with the information that all segments have been received.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] first_segment_tbP A PDU embedded in a mem_block_t, it is the first PDU in the RX buffer (list) that have its sequence number. * \param[in] first_segment_tbP A PDU embedded in a mem_block_t, it is the first PDU in the RX buffer (list) that have its sequence number.
*/ */
protected_rlc_am_rx_list( void rlc_am_rx_mark_all_segments_received(rlc_am_entity_t* rlcP, frame_t frameP, mem_block_t* first_segment_tbP);) protected_rlc_am_rx_list( void rlc_am_rx_mark_all_segments_received(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const first_segment_tbP);)
/*! \fn void rlc_am_rx_list_reassemble_rlc_sdus(rlc_am_entity_t* rlcP,frame_t frameP,uint8_t eNB_flag) /*! \fn void rlc_am_rx_list_reassemble_rlc_sdus(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP)
* \brief Reassembly all SDUS that it is possible to reassembly by parsing the RX buffer and looking for PDUs having the flag 'all segments received'. * \brief Reassembly all SDUS that it is possible to reassembly by parsing the RX buffer and looking for PDUs having the flag 'all segments received'.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \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).
*/ */
protected_rlc_am_rx_list( void rlc_am_rx_list_reassemble_rlc_sdus(rlc_am_entity_t* rlcP,frame_t frameP,uint8_t eNB_flag);) protected_rlc_am_rx_list( void rlc_am_rx_list_reassemble_rlc_sdus(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP);)
/*! \fn mem_block_t* list2_insert_before_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP) /*! \fn mem_block_t* list2_insert_before_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP)
* \brief Insert a PDU embedded in a mem_block_t in a list at a position before a designated element of the list. * \brief Insert a PDU embedded in a mem_block_t in a list at a position before a designated element of the list.
...@@ -115,11 +114,11 @@ public_rlc_am_rx_list( mem_block_t* list2_insert_before_element (mem_block_t * e ...@@ -115,11 +114,11 @@ public_rlc_am_rx_list( mem_block_t* list2_insert_before_element (mem_block_t * e
*/ */
public_rlc_am_rx_list( mem_block_t* list2_insert_after_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP);) public_rlc_am_rx_list( mem_block_t* list2_insert_after_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP);)
/*! \fn void rlc_am_rx_list_display (rlc_am_entity_t* rlcP, char* messageP) /*! \fn void rlc_am_rx_list_display (const rlc_am_entity_t* const rlcP, char* messageP)
* \brief Display the dump of the RX buffer. * \brief Display the dump of the RX buffer.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] messageP Message to be displayed along with the display of the dump of the RX buffer. * \param[in] messageP Message to be displayed along with the display of the dump of the RX buffer.
*/ */
protected_rlc_am_rx_list( void rlc_am_rx_list_display (rlc_am_entity_t* rlcP, char* messageP);) protected_rlc_am_rx_list( void rlc_am_rx_list_display (const rlc_am_entity_t* const rlcP, char* messageP);)
/** @} */ /** @} */
#endif #endif
...@@ -58,20 +58,20 @@ ...@@ -58,20 +58,20 @@
# endif # endif
# endif # endif
/*! \fn void rlc_am_pdu_polling (rlc_am_entity_t *rlcP, frame_t frameP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP) /*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP)
* \brief Set or not the poll bit in the PDU header depending on RLC AM protocol variables. * \brief Set or not the poll bit in the PDU header depending on RLC AM protocol variables.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
* \param[in] pduP Pointer on the header of the PDU in order to be able to set the poll bit if necessary. * \param[in] pduP Pointer on the header of the PDU in order to be able to set the poll bit if necessary.
* \param[in] payload_sizeP Size of the payload of the PDU. * \param[in] payload_sizeP Size of the payload of the PDU.
*/ */
protected_rlc_am_segment(void rlc_am_pdu_polling (rlc_am_entity_t *rlcP, frame_t frameP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP);) protected_rlc_am_segment(void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP);)
/*! \fn void rlc_am_segment_10 (rlc_am_entity_t *rlcP) /*! \fn void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP)
* \brief Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit). * \brief Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit).
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
*/ */
protected_rlc_am_segment(void rlc_am_segment_10 (rlc_am_entity_t *rlcP,frame_t frameP);) protected_rlc_am_segment(void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *const rlcP);)
/** @} */ /** @} */
# endif # endif
...@@ -58,58 +58,60 @@ ...@@ -58,58 +58,60 @@
# define public_rlc_am_segments_holes(x) extern x # define public_rlc_am_segments_holes(x) extern x
# endif # endif
# endif # endif
/*! \fn void rlc_am_clear_holes (rlc_am_entity_t *rlcP, rlc_sn_t snP) /*! \fn void rlc_am_clear_holes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP)
* \brief Remove all marked holes for PDU with sequence number "snP". * \brief Remove all marked holes for PDU with sequence number "snP".
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] snP Sequence number. * \param[in] snP Sequence number.
*/ */
protected_rlc_am_segments_holes(void rlc_am_clear_holes ( protected_rlc_am_segments_holes(void rlc_am_clear_holes (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const rlc_sn_t snP);) const rlc_sn_t snP);)
/*! \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) /*! \fn void rlc_am_remove_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP)
* \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. * \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP].
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
* \param[in] snP Sequence number. * \param[in] snP Sequence number.
* \param[in] so_startP Start of segment offset. * \param[in] so_startP Start of segment offset.
* \param[in] so_stopP End of segment offset. * \param[in] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_remove_hole ( protected_rlc_am_segments_holes(void rlc_am_remove_hole (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP, const rlc_sn_t snP,
const sdu_size_t so_startP, const sdu_size_t so_startP,
const sdu_size_t so_stopP);) 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, sdu_size_t* so_startP, sdu_size_t* so_stopP) /*! \fn void rlc_am_get_next_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t* so_startP, sdu_size_t* so_stopP)
* \brief Get for PDU with sequence number "snP" the first hole start and stop parameters. * \brief Get for PDU with sequence number "snP" the first hole start and stop parameters.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
* \param[in] snP Sequence number. * \param[in] snP Sequence number.
* \param[in,out] so_startP Start of segment offset. * \param[in,out] so_startP Start of segment offset.
* \param[in,out] so_stopP End of segment offset. * \param[in,out] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_get_next_hole ( protected_rlc_am_segments_holes(void rlc_am_get_next_hole (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP, const rlc_sn_t snP,
sdu_size_t* const so_startP, sdu_size_t* const so_startP,
sdu_size_t* const so_stopP);) sdu_size_t* const 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) /*! \fn void rlc_am_add_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP)
* \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. * \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP].
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer. * \param[in] rlcP RLC AM protocol instance pointer.
* \param[in[ frame Frame index.
* \param[in] snP Sequence number. * \param[in] snP Sequence number.
* \param[in,out] so_startP Start of segment offset. * \param[in,out] so_startP Start of segment offset.
* \param[in,out] so_stopP End of segment offset. * \param[in,out] so_stopP End of segment offset.
*/ */
protected_rlc_am_segments_holes(void rlc_am_add_hole ( protected_rlc_am_segments_holes(void rlc_am_add_hole (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP, rlc_am_entity_t *const rlcP,
const frame_t frameP,
const rlc_sn_t snP, const rlc_sn_t snP,
sdu_size_t so_startP, const sdu_size_t so_startP,
sdu_size_t so_stopP);) sdu_size_t so_stopP);)
/** @} */ /** @} */
#endif #endif
...@@ -58,47 +58,55 @@ ...@@ -58,47 +58,55 @@
# endif # endif
# endif # endif
/*! \fn void rlc_am_check_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_check_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP)
* \brief Check if timer Poll-retransmit has timed-out, if so it is stopped and has the status "timed-out". * \brief Check if timer Poll-retransmit has timed-out, if so it is stopped and has the status "timed-out".
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \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( protected_rlc_am_timer_poll_retransmit(void rlc_am_check_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP, const protocol_ctxt_t* const ctxt_pP,
const frame_t frameP)); rlc_am_entity_t* const rlc_pP));
/*! \fn int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *rlc_pP) /*! \fn int rlc_am_is_timer_poll_retransmit_timed_out(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP)
* \brief Boolean function, check if timer Poll-retransmit has timed-out. * \brief Boolean function, check if timer Poll-retransmit has timed-out.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \return 1 if timer Poll-retransmit has timed-out, else 0. * \return 1 if timer Poll-retransmit has timed-out, else 0.
*/ */
protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_timed_out(rlc_am_entity_t *const rlc_pP);) protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_timed_out(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlc_pP);)
/*! \fn void rlc_am_stop_and_reset_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_stop_and_reset_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP)
* \brief Stop and reset the timer Poll-retransmit. * \brief Stop and reset the timer Poll-retransmit.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \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( protected_rlc_am_timer_poll_retransmit(void rlc_am_stop_and_reset_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP, const protocol_ctxt_t* const ctxt_pP,
const frame_t frameP);) rlc_am_entity_t* const rlc_pP);)
/*! \fn void rlc_am_start_timer_poll_retransmit(rlc_am_entity_t *rlc_pP,frame_t frameP) /*! \fn void rlc_am_start_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP)
* \brief Re-arm (based on RLC AM config parameter) and start timer Poll-retransmit. * \brief Re-arm (based on RLC AM config parameter) and start timer Poll-retransmit.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index * \param[in] frame Frame index
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit( protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP, const protocol_ctxt_t* const ctxt_pP,
const frame_t frameP);) rlc_am_entity_t* const rlc_pP);)
/*! \fn void rlc_am_init_timer_poll_retransmit(rlc_am_entity_t *rlc_pP, uint32_t time_outP) /*! \fn void rlc_am_init_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP)
* \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter. * \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] time_outP Time-out in frame units. * \param[in] time_outP Time-out in frame units.
*/ */
protected_rlc_am_timer_poll_retransmit(void rlc_am_init_timer_poll_retransmit( protected_rlc_am_timer_poll_retransmit(void rlc_am_init_timer_poll_retransmit(
rlc_am_entity_t *const rlc_pP, const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlc_pP,
const uint32_t time_outP);) const uint32_t time_outP);)
/** @} */ /** @} */
#endif #endif
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.
...@@ -60,13 +60,13 @@ typedef struct rlc_um_timer_s { ...@@ -60,13 +60,13 @@ typedef struct rlc_um_timer_s {
*/ */
typedef struct rlc_um_entity_s { typedef struct rlc_um_entity_s {
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance. */ //module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance. */
module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */ //module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */
boolean_t initialized; /*!< \brief Boolean for rlc_am_entity_t struct initialization. */ boolean_t initialized; /*!< \brief Boolean for rlc_am_entity_t struct initialization. */
boolean_t is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */ boolean_t is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */
rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */ rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */ boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */ //boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
boolean_t is_mxch; /*!< \brief To know if the RLC belongs to a MBMS bearer. */ boolean_t is_mxch; /*!< \brief To know if the RLC belongs to a MBMS bearer. */
//----------------------------- //-----------------------------
// PROTOCOL VARIABLES // PROTOCOL VARIABLES
......
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.
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