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,19 +58,15 @@
#undef GTP_DUMP_SOCKET
extern boolean_t
pdcp_data_req(
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 rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP);
extern boolean_t pdcp_data_req(
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_idP,
const mui_t muiP,
const confirm_t confirmP,
const sdu_size_t sdu_buffer_sizeP,
unsigned char *const sdu_buffer_pP,
const pdcp_transmission_mode_t modeP);
static int
......@@ -282,6 +278,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
teid_t teid = 0;
hashtable_rc_t hash_rc = HASH_TABLE_KEY_NOT_EXISTS;
gtpv1u_teid_data_t *gtpv1u_teid_data_p = NULL;
protocol_ctxt_t ctxt;
switch(pUlpApi->apiType) {
/* Here there are two type of messages handled:
......@@ -319,12 +316,13 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
#endif
#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(
gtpv1u_teid_data_p->enb_id,
gtpv1u_teid_data_p->ue_id,
0, // frame TO DO
ENB_FLAG_YES,
&ctxt,
SRB_FLAG_NO,
(gtpv1u_teid_data_p->eps_bearer_id) ? gtpv1u_teid_data_p->eps_bearer_id - 4: 5-4,
0, // mui
......
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.
Copying and distribution of this file, with or without modification,
......@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`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
overridden in the site shell script).
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
======================
......@@ -367,4 +368,3 @@ operates.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
......@@ -170,4 +170,16 @@ typedef enum config_action_e {
//-----------------------------------------------------------------------------
typedef uint32_t teid_t; // tunnel endpoint identifier
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
......@@ -83,6 +83,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
unsigned int nCCE[MAX_NUM_CCs];
int mbsfn_status[MAX_NUM_CCs];
uint32_t RBalloc[MAX_NUM_CCs];
protocol_ctxt_t ctxt;
#ifdef EXMIMO
int ret;
#endif
......@@ -181,14 +182,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//if (subframeP%5 == 0)
//#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
// check HO
rrc_rx_tx(module_idP,
frameP,
1,
module_idP,
frameP,
1,
module_idP,
CC_id);
#ifdef Rel10
......
......@@ -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;
struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL;
#ifdef EXMIMO
protocol_ctxt_t ctxt;
int ret;
#endif
#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
//Rrc_xface->Frame_index=Mac_rlc_xface->frameP;
//if (subframe%5 == 0)
#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
UE_mac_inst[module_idP].frame = frameP;
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) {
* should be avoided if we want a reliable link.
*/
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));
exit(EXIT_FAILURE);
}
......@@ -164,23 +164,20 @@ int pdcp_netlink_init(void) {
return 0;
}
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)
{
int ret = 0;
if (eNB_flagP) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[enb_mod_idP], (void **)data_ppP);
if (ctxt_pP->enb_flag) {
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->enb_module_id], (void **)data_ppP);
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 {
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) {
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);
}
}
......@@ -219,7 +216,7 @@ void *pdcp_netlink_thread_fct(void *arg) {
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
NLMSG_OK(nas_nlh_rx, (unsigned int)len);
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, len)) {
start_meas(&ip_pdcp_stats_tmp);
start_meas(&ip_pdcp_stats_tmp);
/* There is no need to check for nlmsg_type because
* the header is not set in our drivers.
*/
......@@ -272,8 +269,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[new_data_p->pdcp_read_header.inst], new_data_p);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&eNB_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&eNB_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
} else {
if (pdcp_netlink_nb_element_ue[new_data_p->pdcp_read_header.inst]
> PDCP_QUEUE_NB_ELEMENTS) {
......@@ -285,8 +282,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
/* Enqueue the element in the right queue */
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[new_data_p->pdcp_read_header.inst], new_data_p);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&UE_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
stop_meas(&ip_pdcp_stats_tmp);
copy_meas(&UE_pdcp_stats[new_data_p->pdcp_read_header.inst].pdcp_ip,&ip_pdcp_stats_tmp);
}
}
}
......
......@@ -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, \
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);
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);
#if defined(ENABLE_SECURITY)
int pdcp_apply_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
int pdcp_validate_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len, uint16_t current_sn, uint8_t *pdcp_pdu_buffer,
int pdcp_apply_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
int pdcp_validate_security(const protocol_ctxt_t* const ctxt_pP,
pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size);
#endif /* defined(ENABLE_SECURITY) */
......
......@@ -49,12 +49,17 @@
#if defined(ENABLE_SECURITY)
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
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
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;
/* 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
return count;
}
//-----------------------------------------------------------------------------
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;
/* 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
return count;
}
int pdcp_apply_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size)
//-----------------------------------------------------------------------------
int
pdcp_apply_security(
const protocol_ctxt_t* const ctxtP,
pdcp_t *const pdcp_entity,
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;
stream_cipher_t encrypt_params;
......@@ -161,13 +176,18 @@ int pdcp_apply_security(pdcp_t *pdcp_entity,
return 0;
}
int pdcp_validate_security(pdcp_t *pdcp_entity,
srb_flag_t srb_flagP,
rb_id_t rb_id,
uint8_t pdcp_header_len,
uint16_t current_sn,
uint8_t *pdcp_pdu_buffer,
uint16_t sdu_buffer_size)
//-----------------------------------------------------------------------------
int
pdcp_validate_security(
const protocol_ctxt_t* const ctxtP,
pdcp_t * const pdcp_entity,
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_decrypted = NULL;
stream_cipher_t decrypt_params;
......
This diff is collapsed.
This diff is collapsed.
......@@ -57,12 +57,12 @@
* \brief Structure containing a RLC AM instance protocol variables, statistic variables, allocation variables, buffers and other miscellaneous variables.
*/
typedef struct rlc_am_entity_s {
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 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. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
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_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 retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
......
......@@ -43,9 +43,9 @@
#define TRACE_RLC_AM_FREE_SDU
//-----------------------------------------------------------------------------
void rlc_am_free_in_sdu(
rlc_am_entity_t *const rlcP,
const frame_t frameP,
const unsigned int index_in_bufferP)
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
const unsigned int index_in_bufferP)
//-----------------------------------------------------------------------------
{
if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
......@@ -69,10 +69,10 @@ void rlc_am_free_in_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",
frameP,
(rlcP->is_enb) ? "eNB" : "UE",
rlcP->enb_module_id,
rlcP->ue_module_id,
ctxt_pP->frame,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rlcP->rb_id,
index_in_bufferP,
rlcP->current_sdu_index,
......@@ -82,9 +82,11 @@ void rlc_am_free_in_sdu(
}
// called when segmentation is done
//-----------------------------------------------------------------------------
void rlc_am_free_in_sdu_data(
rlc_am_entity_t *const rlcP,
const unsigned int index_in_bufferP)
void
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)
//-----------------------------------------------------------------------------
{
if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
......@@ -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) {
......
......@@ -57,30 +57,32 @@
# define public_rlc_am_in_sdu(x) extern x
# 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.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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.
*/
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.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \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.
*/
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.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \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
......@@ -36,13 +36,16 @@
#include "LAYER2/MAC/extern.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) {
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 {
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));
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)
#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, (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] 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] 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", ctxt_pP->frame, rlc_pP->pdu_retrans_buffer,sizeof(rlc_am_tx_data_pdu_management_t));
// TX state variables
//rlc_pP->vt_a = 0;
......@@ -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)
* - stop and reset all timers;
* - 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)
list2_free(&rlc_pP->receiver_buffer);
......@@ -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",
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rlc_pP->rb_id);
list2_free(&rlc_pP->receiver_buffer);
......@@ -177,22 +186,24 @@ void rlc_am_cleanup(rlc_am_entity_t *rlc_pP)
memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
}
//-----------------------------------------------------------------------------
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)
void
rlc_am_configure(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const uint16_t max_retx_thresholdP,
const uint16_t poll_pduP,
const uint16_t poll_byteP,
const uint32_t t_poll_retransmitP,
const uint32_t t_reorderingP,
const uint32_t t_status_prohibitP)
//-----------------------------------------------------------------------------
{
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",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
ctxt_pP->frame,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rlc_pP->rb_id,
max_retx_thresholdP,
poll_pduP,
......@@ -211,10 +222,10 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP,
rlc_pP->t_status_prohibit.time_out = t_status_prohibitP;
} 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",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
ctxt_pP->frame,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rlc_pP->rb_id,
max_retx_thresholdP,
poll_pduP,
......@@ -229,42 +240,39 @@ void rlc_am_configure(rlc_am_entity_t *rlc_pP,
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_am_init_timer_poll_retransmit(rlc_pP, t_poll_retransmitP);
rlc_am_init_timer_reordering (rlc_pP, t_reorderingP);
rlc_am_init_timer_status_prohibit(rlc_pP, t_status_prohibitP);
rlc_am_init_timer_poll_retransmit(ctxt_pP, rlc_pP, t_poll_retransmitP);
rlc_am_init_timer_reordering (ctxt_pP, rlc_pP, t_reorderingP);
rlc_am_init_timer_status_prohibit(ctxt_pP, rlc_pP, t_status_prohibitP);
rlc_pP->configured = TRUE;
}
}
//-----------------------------------------------------------------------------
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)
void
rlc_am_set_debug_infos(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const srb_flag_t srb_flagP,
const 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",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
ctxt_pP->frame,
(ctxt_pP->enb_flag) ? "eNB" : "UE",
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP,
enb_module_idP,
ue_module_idP,
ctxt_pP->enb_module_id,
ctxt_pP->ue_module_id,
rb_idP,
(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 (srb_flagP) {
rlc_pP->is_data_plane = 0;
} else {
rlc_pP->is_data_plane = 1;
}
rlc_pP->is_enb = eNB_flagP;
}
......@@ -78,23 +78,24 @@ typedef volatile struct {
} 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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
*/
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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] ctxtP Running context.
* \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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] max_retx_thresholdP Limit the number of retransmissions of an
AMD PDU.
* \param[in] poll_pduP Trigger a poll for every poll_pduP PDUs.
......@@ -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_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,
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);)
public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP,
rlc_am_entity_t * const rlc_pP,
const uint16_t max_retx_thresholdP,
const uint16_t poll_pduP,
const uint16_t poll_byteP,
const uint32_t t_poll_retransmitP,
const uint32_t t_reorderingP,
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.
* \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] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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.
*/
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
......@@ -56,36 +56,36 @@
# define public_rlc_am_reassembly(x) extern x
# 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.
* \param[in] ctxtP Running context.
* \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.
* \param[in] srcP Pointer on data to be reassemblied.
* \param[in] lengthP Length of data to be reassemblied.
* \param[in] ctxtP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] srcP Pointer on data to be reassemblied.
* \param[in] lengthP Length of data to be reassemblied.
*/
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)
* \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] 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.
* \param[in] ctxtP Running context.
* \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.
*/
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
......@@ -56,60 +56,58 @@
# define public_rlc_am_receiver(x) extern x
# 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.
* \param[in] frame Frame index.
* \param[in] ctxt_pP Running context.
* \param[in] headerP RLC AM header PDU pointer.
* \param[in] sizeP Size of RLC AM 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;
*/
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.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \param[in] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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).
* \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] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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 * 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).
* \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] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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 * 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).
* \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] ctxt_pP Running context.
* \param[in] rlc_pP RLC AM protocol instance pointer.
* \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.
* \param[in] ctxt_pP Running context.
* \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] 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 * 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
......@@ -57,78 +57,78 @@
# define public_rlc_am_retransmit(x) extern x
# 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.
* \param[in] ctxtP Running context.
* \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] so_startP Start of the segment offset of the PDU that .
* \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 *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_endP);)
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
const rlc_sn_t snP,
const sdu_size_t so_startP,
const sdu_size_t so_endP);)
/*! \fn void rlc_am_ack_pdu (rlc_am_entity_t *rlcP, frame_t frameP, rlc_sn_t snP)
/*! \fn void rlc_am_ack_pdu (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.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \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 *const rlcP,
const frame_t frameP,
const rlc_sn_t snP);)
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
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.
* \param[in] ctxtP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frameP Frame index.
* \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 *const rlcP,
const frame_t frameP,
const rlc_sn_t snP));
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
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.
* \param[in] ctxtP Running context.
* \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,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 *const rlcP,
const frame_t frameP,
const rlc_sn_t snP,
sdu_size_t *const sizeP));
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlcP,
const rlc_sn_t snP,
sdu_size_t *const sizeP));
/*! \fn void rlc_am_retransmit_any_pdu(rlc_am_entity_t* rlcP,frame_t frameP)
/*! \fn void rlc_am_retransmit_any_pdu(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.
* \param[in] ctxtP Running context.
* \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* const rlcP,
const frame_t frameP);)
const protocol_ctxt_t* const ctxt_pP,
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.
* \param[in] ctxtP Running context.
* \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.
*/
protected_rlc_am_retransmit(void rlc_am_tx_buffer_display (
rlc_am_entity_t* const rlcP,
const frame_t frameP,
char* const message_pP);)
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t* const rlcP,
char* const message_pP);)
/** @} */
# endif
......@@ -66,38 +66,37 @@
#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).
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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.
*/
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.
* \param[in] ctxt_pP Running context.
* \param[in] rlcP RLC AM protocol instance pointer.
* \param[in] frame Frame index.
* \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.
* \param[in] ctxt_pP Running context.
* \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.
*/
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'.
* \param[in] ctxt_pP Running context.
* \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)
* \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
*/
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.
* \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.
*/
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
......@@ -58,20 +58,20 @@
# 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.
* \param[in] ctxt_pP Running context.
* \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] 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).
* \param[in] ctxt_pP Running context.
* \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
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.
This diff is collapsed.
This diff is collapsed.
......@@ -51,7 +51,7 @@ void mac_lite_sync_ind(module_id_t module_idP, uint8_t statusP);
void mac_rrc_meas_ind(module_id_t, MAC_MEAS_REQ_ENTRY*);
void rlcrrc_data_ind(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, sdu_size_t sdu_sizeP, uint8_t *buffer_pP);
void rlcrrc_data_ind(const protocol_ctxt_t* const ctxt_pP, rb_id_t rb_idP, sdu_size_t sdu_sizeP, uint8_t *buffer_pP);
uint8_t pdcp_rrc_data_req(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, mui_t muiP, boolean_t confirmP,
sdu_size_t sdu_buffer_size, uint8_t* sdu_buffer, uint8_t mode);
......
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