Commit 9d0c70c9 authored by frtabu's avatar frtabu

remove L1L2 task, also remove some call to send messages to UNKNOWN_TASK,...

remove L1L2 task, also remove some call to send messages to UNKNOWN_TASK, removed in new itti. Align LOG in rlc sources with new LOG code (remove DEBUG_RLC...)
parent 24bde5d6
Pipeline #11427 passed with stage
in 0 seconds
......@@ -145,6 +145,7 @@ extern "C" {
#define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11)
#define DEBUG_NAS (1<<12)
#define DEBUG_RLC (1<<13)
#define UE_TIMING (1<<20)
......@@ -162,6 +163,7 @@ extern "C" {
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"UE_TIMING", UE_TIMING},\
{NULL,-1}\
}
......
......@@ -25,46 +25,46 @@
#include <stdint.h>
typedef enum {
MIN_MSC_ENV = 0,
MSC_E_UTRAN = MIN_MSC_ENV,
MSC_E_UTRAN_LIPA,
MSC_MME_GW,
MSC_MME,
MSC_SP_GW,
MAX_MSC_ENV
MIN_MSC_ENV = 0,
MSC_E_UTRAN = MIN_MSC_ENV,
MSC_E_UTRAN_LIPA,
MSC_MME_GW,
MSC_MME,
MSC_SP_GW,
MAX_MSC_ENV
} msc_env_t;
typedef enum {
MIN_MSC_PROTOS = 0,
MSC_IP_UE = MIN_MSC_PROTOS,
MSC_NAS_UE,
MSC_RRC_UE,
MSC_PDCP_UE,
MSC_RLC_UE,
MSC_MAC_UE,
MSC_PHY_UE,
MSC_PHY_ENB,
MSC_MAC_ENB,
MSC_RLC_ENB,
MSC_PDCP_ENB,
MSC_RRC_ENB,
MSC_IP_ENB,
MSC_S1AP_ENB,
MSC_GTPU_ENB,
MSC_GTPU_SGW,
MSC_S1AP_MME,
MSC_MMEAPP_MME,
MSC_NAS_MME,
MSC_NAS_EMM_MME,
MSC_NAS_ESM_MME,
MSC_SP_GWAPP_MME,
MSC_S11_MME,
MSC_S6A_MME,
MSC_HSS,
MAX_MSC_PROTOS,
MSC_X2AP_SRC_ENB,
MSC_X2AP_TARGET_ENB,
MIN_MSC_PROTOS = 0,
MSC_IP_UE = MIN_MSC_PROTOS,
MSC_NAS_UE,
MSC_RRC_UE,
MSC_PDCP_UE,
MSC_RLC_UE,
MSC_MAC_UE,
MSC_PHY_UE,
MSC_PHY_ENB,
MSC_MAC_ENB,
MSC_RLC_ENB,
MSC_PDCP_ENB,
MSC_RRC_ENB,
MSC_IP_ENB,
MSC_S1AP_ENB,
MSC_GTPU_ENB,
MSC_GTPU_SGW,
MSC_S1AP_MME,
MSC_MMEAPP_MME,
MSC_NAS_MME,
MSC_NAS_EMM_MME,
MSC_NAS_ESM_MME,
MSC_SP_GWAPP_MME,
MSC_S11_MME,
MSC_S6A_MME,
MSC_HSS,
MAX_MSC_PROTOS,
MSC_X2AP_SRC_ENB,
MSC_X2AP_TARGET_ENB,
} msc_proto_t;
......@@ -73,22 +73,22 @@ typedef enum {
#define MSC_AS_TIME_FMT "%05u:%02u"
#define MSC_AS_TIME_ARGS(CTXT_Pp) \
(CTXT_Pp)->frame, \
(CTXT_Pp)->subframe
(CTXT_Pp)->frame, \
(CTXT_Pp)->subframe
typedef int(*msc_init_t)(const msc_env_t, const int );
typedef void(*msc_start_use_t)(void );
typedef void(*msc_end_t)(void);
typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...);
typedef void(*msc_log_message_t)(const char * const, const msc_proto_t, const msc_proto_t,
const uint8_t* const, const unsigned int, char * , ...);
typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t,
const uint8_t *const, const unsigned int, char *, ...);
typedef struct msc_interface {
int msc_loaded;
msc_init_t msc_init;
msc_start_use_t msc_start_use;
msc_end_t msc_end;
msc_log_event_t msc_log_event;
msc_log_message_t msc_log_message;
int msc_loaded;
msc_init_t msc_init;
msc_start_use_t msc_start_use;
msc_end_t msc_end;
msc_log_event_t msc_log_event;
msc_log_message_t msc_log_message;
} msc_interface_t;
#ifdef MSC_LIBRARY
......@@ -99,15 +99,17 @@ void msc_end(void);
void msc_log_declare_proto(const msc_proto_t protoP);
void msc_log_event(const msc_proto_t protoP,char *format, ...);
void msc_log_message(
const char * const message_operationP,
const msc_proto_t receiverP,
const msc_proto_t senderP,
const uint8_t* const bytesP,
const unsigned int num_bytes,
char *format, ...);
const char *const message_operationP,
const msc_proto_t receiverP,
const msc_proto_t senderP,
const uint8_t *const bytesP,
const unsigned int num_bytes,
char *format, ...);
#else
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
msc_interface_t msc_interface;
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
......@@ -119,4 +121,4 @@ msc_interface_t msc_interface;
#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
#endif
#endif
#endif
......@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
// Other possible tasks in the process
// Common tasks:
/// Layer 2 and Layer 1 task supporting all the synchronous processing
TASK_DEF(TASK_L2L1, TASK_PRIORITY_MAX_LEAST, 200)
/// Bearers Manager task
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
// eNodeB tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_ENB, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_ENB, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
......@@ -63,11 +56,6 @@ TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
// UE tasks and sub-tasks:
//// Layer 2 and Layer 1 sub-tasks
SUB_TASK_DEF(TASK_L2L1, TASK_PHY_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_MAC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_RLC_UE, 200)
SUB_TASK_DEF(TASK_L2L1, TASK_PDCP_UE, 200)
/// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
......
......@@ -25,9 +25,7 @@
#include "platform_types.h"
#include "platform_constants.h"
//-----------------------------------------------------------------------------
#if ENABLE_ITTI
# include "intertask_interface.h"
#endif
#include "assertions.h"
#include "msc.h"
#include "hashtable.h"
......@@ -46,171 +44,145 @@
//-----------------------------------------------------------------------------
uint32_t
rlc_am_get_status_pdu_buffer_occupancy(
rlc_am_entity_t * const rlc_pP){
//Compute Max Status PDU size according to what has been received and not received in the window [vrR vrMS[
// minimum header size in bits to be transmitted: D/C + CPT + ACK_SN + E1
uint32_t nb_bits_to_transmit = RLC_AM_PDU_D_C_BITS + RLC_AM_STATUS_PDU_CPT_LENGTH + RLC_AM_SN_BITS + RLC_AM_PDU_E_BITS;
mem_block_t *cursor_p = rlc_pP->receiver_buffer.head;
rlc_am_pdu_info_t *pdu_info_cursor_p = NULL;
int waited_so = 0;
rlc_sn_t sn_cursor = rlc_pP->vr_r;
rlc_sn_t sn_prev = rlc_pP->vr_r;
rlc_sn_t sn_end = rlc_pP->vr_ms;
boolean_t segment_loop_end = false;
if (sn_prev != sn_end)
{
while ((RLC_AM_DIFF_SN(sn_prev,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)) && (cursor_p != NULL))
{
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
sn_cursor = pdu_info_cursor_p->sn;
// Add holes between sn_prev and sn_cursor
while ((sn_prev != sn_cursor) && (sn_prev != sn_end))
{
/* Add 1 NACK_SN + E1 + E2 */
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1));
sn_prev = RLC_AM_NEXT_SN(sn_prev);
} //end while (sn_prev != sn_cursor)
/* Handle case sn_cursor is partially received */
/* Each gap will add NACK_SN + E1 + E2 + SOStart + SOEnd */
if ((((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received == 0) && (RLC_AM_DIFF_SN(sn_cursor,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)))
{
/* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1);
/* Fill for [0 SO[ if SO not null */
if (pdu_info_cursor_p->so) {
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size;
}
else {
waited_so = pdu_info_cursor_p->payload_size;
}
/* Go to next segment */
cursor_p = cursor_p->next;
if (cursor_p != NULL)
{
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
}
rlc_am_entity_t *const rlc_pP) {
//Compute Max Status PDU size according to what has been received and not received in the window [vrR vrMS[
// minimum header size in bits to be transmitted: D/C + CPT + ACK_SN + E1
uint32_t nb_bits_to_transmit = RLC_AM_PDU_D_C_BITS + RLC_AM_STATUS_PDU_CPT_LENGTH + RLC_AM_SN_BITS + RLC_AM_PDU_E_BITS;
mem_block_t *cursor_p = rlc_pP->receiver_buffer.head;
rlc_am_pdu_info_t *pdu_info_cursor_p = NULL;
int waited_so = 0;
rlc_sn_t sn_cursor = rlc_pP->vr_r;
rlc_sn_t sn_prev = rlc_pP->vr_r;
rlc_sn_t sn_end = rlc_pP->vr_ms;
boolean_t segment_loop_end = false;
if (sn_prev != sn_end) {
while ((RLC_AM_DIFF_SN(sn_prev,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)) && (cursor_p != NULL)) {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info;
sn_cursor = pdu_info_cursor_p->sn;
// Add holes between sn_prev and sn_cursor
while ((sn_prev != sn_cursor) && (sn_prev != sn_end)) {
/* Add 1 NACK_SN + E1 + E2 */
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1));
sn_prev = RLC_AM_NEXT_SN(sn_prev);
} //end while (sn_prev != sn_cursor)
/* Handle case sn_cursor is partially received */
/* Each gap will add NACK_SN + E1 + E2 + SOStart + SOEnd */
if ((((rlc_am_rx_pdu_management_t *)(cursor_p->data))->all_segments_received == 0) && (RLC_AM_DIFF_SN(sn_cursor,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r))) {
/* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1);
/* Fill for [0 SO[ if SO not null */
if (pdu_info_cursor_p->so) {
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size;
} else {
waited_so = pdu_info_cursor_p->payload_size;
}
/* Go to next segment */
cursor_p = cursor_p->next;
if (cursor_p != NULL) {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info;
}
/* Fill following gaps if any */
while (!segment_loop_end) {
if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor)) {
/* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1);
if (waited_so < pdu_info_cursor_p->so) {
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
} else {
/* contiguous segment: only update waited_so */
/* Assuming so and payload_size updated according to duplication removal done at reception ... */
waited_so += pdu_info_cursor_p->payload_size;
}
/* Go to next received PDU or PDU Segment */
cursor_p = cursor_p->next;
if (cursor_p != NULL) {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info;
}
} else {
/* Fill last gap assuming LSF is not received */
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
segment_loop_end = true;
}
} // end while (!segment_loop_end)
} // end if segments
else {
/* Go to next received PDU or PDU segment with different SN */
do {
cursor_p = cursor_p->next;
} while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info.sn == sn_cursor));
}
/* Fill following gaps if any */
while (!segment_loop_end)
{
if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor))
{
/* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1);
if (waited_so < pdu_info_cursor_p->so) {
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
}
else {
/* contiguous segment: only update waited_so */
/* Assuming so and payload_size updated according to duplication removal done at reception ... */
waited_so += pdu_info_cursor_p->payload_size;
}
/* Go to next received PDU or PDU Segment */
cursor_p = cursor_p->next;
if (cursor_p != NULL)
{
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
}
}
else
{
/* Fill last gap assuming LSF is not received */
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
segment_loop_end = true;
}
} // end while (!segment_loop_end)
} // end if segments
else
{
/* Go to next received PDU or PDU segment with different SN */
do
{
cursor_p = cursor_p->next;
} while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info.sn == sn_cursor));
}
sn_prev = RLC_AM_NEXT_SN(sn_cursor);
}
} // end if (sn_prev != sn_end)
// round up to the greatest byte
return ((nb_bits_to_transmit + 7) >> 3);
sn_prev = RLC_AM_NEXT_SN(sn_cursor);
}
} // end if (sn_prev != sn_end)
// round up to the greatest byte
return ((nb_bits_to_transmit + 7) >> 3);
}
//-----------------------------------------------------------------------------
uint32_t
rlc_am_get_buffer_occupancy_in_bytes (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP) {
// priority of control trafic
rlc_pP->status_buffer_occupancy = 0;
if ((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK)) {
rlc_pP->status_buffer_occupancy = rlc_am_get_status_pdu_buffer_occupancy(rlc_pP);
#if TRACE_RLC_AM_BO
LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : CONTROL PDU %d bytes \n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->status_buffer_occupancy);
#endif
if ((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK)) {
rlc_pP->status_buffer_occupancy = rlc_am_get_status_pdu_buffer_occupancy(rlc_pP);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : CONTROL PDU %d bytes \n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->status_buffer_occupancy);
}
#if TRACE_RLC_AM_BO
if ((rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead) > 0) {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : STATUS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->status_buffer_occupancy);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : RETRANS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->retrans_num_bytes_to_retransmit);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : SDU BUFFER %d bytes + li_overhead %d bytes header_overhead %d bytes (nb sdu not segmented %d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->sdu_buffer_occupancy,
0,
0,
rlc_pP->nb_sdu_no_segmented);
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
if ((rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy ) > 0) {
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : STATUS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->status_buffer_occupancy);
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : RETRANS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->retrans_num_bytes_to_retransmit);
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : SDU BUFFER %d bytes + li_overhead %d bytes header_overhead %d bytes (nb sdu not segmented %d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->sdu_buffer_occupancy,
0,
0,
rlc_pP->nb_sdu_no_segmented);
}
}
#endif
return rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy;
}
//-----------------------------------------------------------------------------
void
rlc_am_release (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP
)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP
) {
// empty
}
//-----------------------------------------------------------------------------
void
config_req_rlc_am (
const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const rlc_am_info_t * config_am_pP,
const rlc_am_info_t *config_am_pP,
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP
)
{
const logical_chan_id_t chan_idP
) {
rlc_union_t *rlc_union_p = NULL;
rlc_am_entity_t *l_rlc_p = NULL;
hash_key_t key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
hashtable_rc_t h_rc;
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
h_rc = hashtable_get(rlc_coll_p, key, (void **)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am;
......@@ -252,18 +224,16 @@ uint32_t t_StatusProhibit_tab[LTE_T_StatusProhibit_spare8]= {0,5,10,15,20,25,30,
//-----------------------------------------------------------------------------
void config_req_rlc_am_asn1 (
const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const struct LTE_RLC_Config__am * const config_am_pP,
const struct LTE_RLC_Config__am *const config_am_pP,
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP)
{
const logical_chan_id_t chan_idP) {
rlc_union_t *rlc_union_p = NULL;
rlc_am_entity_t *l_rlc_p = NULL;
hash_key_t key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
hashtable_rc_t h_rc;
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
h_rc = hashtable_get(rlc_coll_p, key, (void **)&rlc_union_p);
if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am;
......@@ -280,7 +250,6 @@ void config_req_rlc_am_asn1 (
(config_am_pP->dl_AM_RLC.t_Reordering<LTE_T_Reordering_spare1) &&
(config_am_pP->dl_AM_RLC.t_StatusProhibit<LTE_T_StatusProhibit_spare8) ) {
#endif
MSC_LOG_RX_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
......@@ -292,7 +261,6 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
......@@ -301,7 +269,6 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_am_configure(ctxt_pP, l_rlc_p,
......@@ -311,7 +278,8 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
} else {
}
else {
MSC_LOG_RX_DISCARDED_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
......@@ -320,7 +288,6 @@ void config_req_rlc_am_asn1 (
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ",
MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
LOG_D(RLC,
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
......@@ -339,36 +306,35 @@ void config_req_rlc_am_asn1 (
//-----------------------------------------------------------------------------
void rlc_am_stat_req (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP,
unsigned int* stat_tx_pdcp_sdu,
unsigned int* stat_tx_pdcp_bytes,
unsigned int* stat_tx_pdcp_sdu_discarded,
unsigned int* stat_tx_pdcp_bytes_discarded,
unsigned int* stat_tx_data_pdu,
unsigned int* stat_tx_data_bytes,
unsigned int* stat_tx_retransmit_pdu_by_status,
unsigned int* stat_tx_retransmit_bytes_by_status,
unsigned int* stat_tx_retransmit_pdu,
unsigned int* stat_tx_retransmit_bytes,
unsigned int* stat_tx_control_pdu,
unsigned int* stat_tx_control_bytes,
unsigned int* stat_rx_pdcp_sdu,
unsigned int* stat_rx_pdcp_bytes,
unsigned int* stat_rx_data_pdus_duplicate,
unsigned int* stat_rx_data_bytes_duplicate,
unsigned int* stat_rx_data_pdu,
unsigned int* stat_rx_data_bytes,
unsigned int* stat_rx_data_pdu_dropped,
unsigned int* stat_rx_data_bytes_dropped,
unsigned int* stat_rx_data_pdu_out_of_window,
unsigned int* stat_rx_data_bytes_out_of_window,
unsigned int* stat_rx_control_pdu,
unsigned int* stat_rx_control_bytes,
unsigned int* stat_timer_reordering_timed_out,
unsigned int* stat_timer_poll_retransmit_timed_out,
unsigned int* stat_timer_status_prohibit_timed_out)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
unsigned int *stat_tx_pdcp_sdu,
unsigned int *stat_tx_pdcp_bytes,
unsigned int *stat_tx_pdcp_sdu_discarded,
unsigned int *stat_tx_pdcp_bytes_discarded,
unsigned int *stat_tx_data_pdu,
unsigned int *stat_tx_data_bytes,
unsigned int *stat_tx_retransmit_pdu_by_status,
unsigned int *stat_tx_retransmit_bytes_by_status,
unsigned int *stat_tx_retransmit_pdu,
unsigned int *stat_tx_retransmit_bytes,
unsigned int *stat_tx_control_pdu,
unsigned int *stat_tx_control_bytes,
unsigned int *stat_rx_pdcp_sdu,
unsigned int *stat_rx_pdcp_bytes,
unsigned int *stat_rx_data_pdus_duplicate,
unsigned int *stat_rx_data_bytes_duplicate,
unsigned int *stat_rx_data_pdu,
unsigned int *stat_rx_data_bytes,
unsigned int *stat_rx_data_pdu_dropped,
unsigned int *stat_rx_data_bytes_dropped,
unsigned int *stat_rx_data_pdu_out_of_window,
unsigned int *stat_rx_data_bytes_out_of_window,
unsigned int *stat_rx_control_pdu,
unsigned int *stat_rx_control_bytes,
unsigned int *stat_timer_reordering_timed_out,
unsigned int *stat_timer_poll_retransmit_timed_out,
unsigned int *stat_timer_status_prohibit_timed_out) {
*stat_tx_pdcp_sdu = rlc_pP->stat_tx_pdcp_sdu;
*stat_tx_pdcp_bytes = rlc_pP->stat_tx_pdcp_bytes;
*stat_tx_pdcp_sdu_discarded = rlc_pP->stat_tx_pdcp_sdu_discarded;
......@@ -396,15 +362,13 @@ void rlc_am_stat_req (
*stat_timer_reordering_timed_out = rlc_pP->stat_timer_reordering_timed_out;
*stat_timer_poll_retransmit_timed_out = rlc_pP->stat_timer_poll_retransmit_timed_out;
*stat_timer_status_prohibit_timed_out = rlc_pP->stat_timer_status_prohibit_timed_out;
}
//-----------------------------------------------------------------------------
void
rlc_am_get_pdus (
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t * const rlc_pP
)
{
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP
) {
//int display_flag = 0;
// 5.1.3.1 Transmit operations
// 5.1.3.1.1
......@@ -412,31 +376,27 @@ rlc_am_get_pdus (
// The transmitting side of an AM RLC entity shall prioritize transmission of RLC control PDUs over RLC data PDUs.
// The transmitting side of an AM RLC entity shall prioritize retransmission of RLC data PDUs over transmission of new
// AMD PDUs.
switch (rlc_pP->protocol_state) {
case RLC_NULL_STATE:
break;
case RLC_DATA_TRANSFER_READY_STATE:
// TRY TO SEND CONTROL PDU FIRST
if ((rlc_pP->nb_bytes_requested_by_mac >= 2) &&
((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK))) {
// When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall:
// - if t-StatusProhibit is not running:
// - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer;
// - else:
// - at the first transmission opportunity indicated by lower layer after t-StatusProhibit expires, construct a single
// STATUS PDU even if status reporting was triggered several times while t-StatusProhibit was running and
// deliver it to lower layer;
//
// When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall:
// - start t-StatusProhibit.
case RLC_NULL_STATE:
break;
case RLC_DATA_TRANSFER_READY_STATE:
// TRY TO SEND CONTROL PDU FIRST
if ((rlc_pP->nb_bytes_requested_by_mac >= 2) &&
((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK))) {
// When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall:
// - if t-StatusProhibit is not running:
// - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer;
// - else:
// - at the first transmission opportunity indicated by lower layer after t-StatusProhibit expires, construct a single
// STATUS PDU even if status reporting was triggered several times while t-StatusProhibit was running and
// deliver it to lower layer;
//
// When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall:
// - start t-StatusProhibit.
rlc_am_send_status_pdu(ctxt_pP, rlc_pP);
mem_block_t* pdu = list_remove_head(&rlc_pP->control_pdu_list);
mem_block_t *pdu = list_remove_head(&rlc_pP->control_pdu_list);
if (pdu) {
list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer);
......@@ -445,89 +405,81 @@ rlc_am_get_pdus (
rlc_am_start_timer_status_prohibit(ctxt_pP, rlc_pP);
return;
}
}
else {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" DELAYED SENT STATUS PDU (Available MAC Data %u)(T-PROHIBIT %u) (DELAY FLAG %u)\n",
} else {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" DELAYED SENT STATUS PDU (Available MAC Data %u)(T-PROHIBIT %u) (DELAY FLAG %u)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->nb_bytes_requested_by_mac,rlc_pP->t_status_prohibit.ms_time_out,(rlc_pP->status_requested & RLC_AM_STATUS_TRIGGERED_DELAYED));
}
rlc_pP->nb_bytes_requested_by_mac,rlc_pP->t_status_prohibit.ms_time_out,(rlc_pP->status_requested & RLC_AM_STATUS_TRIGGERED_DELAYED));
}
// THEN TRY TO SEND RETRANS PDU
// THEN TRY TO SEND RETRANS PDU
if ((rlc_pP->retrans_num_bytes_to_retransmit) && (rlc_pP->nb_bytes_requested_by_mac > 2)) {
/* Get 1 AM data PDU or PDU segment to retransmit */
mem_block_t *pdu_retx = rlc_am_get_pdu_to_retransmit(ctxt_pP, rlc_pP);
/* Get 1 AM data PDU or PDU segment to retransmit */
mem_block_t* pdu_retx = rlc_am_get_pdu_to_retransmit(ctxt_pP, rlc_pP);
if (pdu_retx != NULL) {
list_add_tail_eurecom (pdu_retx, &rlc_pP->pdus_to_mac_layer);
if (pdu_retx != NULL) {
list_add_tail_eurecom (pdu_retx, &rlc_pP->pdus_to_mac_layer);
return;
}
}
}
// THEN TRY TO SEND NEW DATA PDU