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
...@@ -145,6 +145,7 @@ extern "C" { ...@@ -145,6 +145,7 @@ extern "C" {
#define DEBUG_CTRLSOCKET (1<<10) #define DEBUG_CTRLSOCKET (1<<10)
#define DEBUG_SECURITY (1<<11) #define DEBUG_SECURITY (1<<11)
#define DEBUG_NAS (1<<12) #define DEBUG_NAS (1<<12)
#define DEBUG_RLC (1<<13)
#define UE_TIMING (1<<20) #define UE_TIMING (1<<20)
...@@ -162,6 +163,7 @@ extern "C" { ...@@ -162,6 +163,7 @@ extern "C" {
{"CTRLSOCKET", DEBUG_CTRLSOCKET},\ {"CTRLSOCKET", DEBUG_CTRLSOCKET},\
{"SECURITY", DEBUG_SECURITY},\ {"SECURITY", DEBUG_SECURITY},\
{"NAS", DEBUG_NAS},\ {"NAS", DEBUG_NAS},\
{"RLC", DEBUG_RLC},\
{"UE_TIMING", UE_TIMING},\ {"UE_TIMING", UE_TIMING},\
{NULL,-1}\ {NULL,-1}\
} }
......
...@@ -80,8 +80,8 @@ typedef int(*msc_init_t)(const msc_env_t, const int ); ...@@ -80,8 +80,8 @@ typedef int(*msc_init_t)(const msc_env_t, const int );
typedef void(*msc_start_use_t)(void ); typedef void(*msc_start_use_t)(void );
typedef void(*msc_end_t)(void); typedef void(*msc_end_t)(void);
typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...); 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, 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 * , ...); const uint8_t *const, const unsigned int, char *, ...);
typedef struct msc_interface { typedef struct msc_interface {
int msc_loaded; int msc_loaded;
msc_init_t msc_init; msc_init_t msc_init;
...@@ -99,15 +99,17 @@ void msc_end(void); ...@@ -99,15 +99,17 @@ void msc_end(void);
void msc_log_declare_proto(const msc_proto_t protoP); void msc_log_declare_proto(const msc_proto_t protoP);
void msc_log_event(const msc_proto_t protoP,char *format, ...); void msc_log_event(const msc_proto_t protoP,char *format, ...);
void msc_log_message( void msc_log_message(
const char * const message_operationP, const char *const message_operationP,
const msc_proto_t receiverP, const msc_proto_t receiverP,
const msc_proto_t senderP, const msc_proto_t senderP,
const uint8_t* const bytesP, const uint8_t *const bytesP,
const unsigned int num_bytes, const unsigned int num_bytes,
char *format, ...); char *format, ...);
#else #else
#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
msc_interface_t msc_interface; msc_interface_t msc_interface;
#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2) #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 #define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
......
...@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10) ...@@ -25,18 +25,11 @@ TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
// Other possible tasks in the process // Other possible tasks in the process
// Common tasks: // 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 /// Bearers Manager task
TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
// eNodeB tasks and sub-tasks: // 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 /// Radio Resource Control task
TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
...@@ -63,11 +56,6 @@ TASK_DEF(TASK_ENB_APP, 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) TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
// UE tasks and sub-tasks: // 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 /// Radio Resource Control task
TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200) TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
......
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "platform_types.h" #include "platform_types.h"
#include "platform_constants.h" #include "platform_constants.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if ENABLE_ITTI
# include "intertask_interface.h"
#endif
#include "assertions.h" #include "assertions.h"
#include "msc.h" #include "msc.h"
#include "hashtable.h" #include "hashtable.h"
...@@ -46,32 +44,25 @@ ...@@ -46,32 +44,25 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
uint32_t uint32_t
rlc_am_get_status_pdu_buffer_occupancy( rlc_am_get_status_pdu_buffer_occupancy(
rlc_am_entity_t * const rlc_pP){ 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[ //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 // 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; 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; mem_block_t *cursor_p = rlc_pP->receiver_buffer.head;
rlc_am_pdu_info_t *pdu_info_cursor_p = NULL; rlc_am_pdu_info_t *pdu_info_cursor_p = NULL;
int waited_so = 0; int waited_so = 0;
rlc_sn_t sn_cursor = rlc_pP->vr_r; rlc_sn_t sn_cursor = rlc_pP->vr_r;
rlc_sn_t sn_prev = rlc_pP->vr_r; rlc_sn_t sn_prev = rlc_pP->vr_r;
rlc_sn_t sn_end = rlc_pP->vr_ms; rlc_sn_t sn_end = rlc_pP->vr_ms;
boolean_t segment_loop_end = false; boolean_t segment_loop_end = false;
if (sn_prev != sn_end) {
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;
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; sn_cursor = pdu_info_cursor_p->sn;
// Add holes between sn_prev and sn_cursor // Add holes between sn_prev and sn_cursor
while ((sn_prev != sn_cursor) && (sn_prev != sn_end)) while ((sn_prev != sn_cursor) && (sn_prev != sn_end)) {
{
/* Add 1 NACK_SN + E1 + E2 */ /* Add 1 NACK_SN + E1 + E2 */
nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1)); nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1));
sn_prev = RLC_AM_NEXT_SN(sn_prev); sn_prev = RLC_AM_NEXT_SN(sn_prev);
...@@ -79,8 +70,7 @@ rlc_am_get_status_pdu_buffer_occupancy( ...@@ -79,8 +70,7 @@ rlc_am_get_status_pdu_buffer_occupancy(
/* Handle case sn_cursor is partially received */ /* Handle case sn_cursor is partially received */
/* Each gap will add NACK_SN + E1 + E2 + SOStart + SOEnd */ /* 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))) 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 */ /* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1); segment_loop_end = (pdu_info_cursor_p->lsf == 1);
...@@ -88,30 +78,26 @@ rlc_am_get_status_pdu_buffer_occupancy( ...@@ -88,30 +78,26 @@ rlc_am_get_status_pdu_buffer_occupancy(
if (pdu_info_cursor_p->so) { 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)); 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; waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size;
} } else {
else {
waited_so = pdu_info_cursor_p->payload_size; waited_so = pdu_info_cursor_p->payload_size;
} }
/* Go to next segment */ /* Go to next segment */
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
if (cursor_p != NULL)
{ if (cursor_p != NULL) {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info;
} }
/* Fill following gaps if any */ /* Fill following gaps if any */
while (!segment_loop_end) while (!segment_loop_end) {
{ if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor)) {
if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor))
{
/* Check lsf */ /* Check lsf */
segment_loop_end = (pdu_info_cursor_p->lsf == 1); segment_loop_end = (pdu_info_cursor_p->lsf == 1);
if (waited_so < pdu_info_cursor_p->so) { 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)); nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
} } else {
else {
/* contiguous segment: only update waited_so */ /* contiguous segment: only update waited_so */
/* Assuming so and payload_size updated according to duplication removal done at reception ... */ /* Assuming so and payload_size updated according to duplication removal done at reception ... */
waited_so += pdu_info_cursor_p->payload_size; waited_so += pdu_info_cursor_p->payload_size;
...@@ -119,26 +105,22 @@ rlc_am_get_status_pdu_buffer_occupancy( ...@@ -119,26 +105,22 @@ rlc_am_get_status_pdu_buffer_occupancy(
/* Go to next received PDU or PDU Segment */ /* Go to next received PDU or PDU Segment */
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
if (cursor_p != NULL)
{ if (cursor_p != NULL) {
pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info; pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t *)(cursor_p->data))->pdu_info;
}
} }
else } else {
{
/* Fill last gap assuming LSF is not received */ /* 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)); 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; segment_loop_end = true;
} }
} // end while (!segment_loop_end) } // end while (!segment_loop_end)
} // end if segments } // end if segments
else else {
{
/* Go to next received PDU or PDU segment with different SN */ /* Go to next received PDU or PDU segment with different SN */
do do {
{
cursor_p = cursor_p->next; cursor_p = cursor_p->next;
} while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info.sn == sn_cursor)); } 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); sn_prev = RLC_AM_NEXT_SN(sn_cursor);
...@@ -147,70 +129,60 @@ rlc_am_get_status_pdu_buffer_occupancy( ...@@ -147,70 +129,60 @@ rlc_am_get_status_pdu_buffer_occupancy(
// round up to the greatest byte // round up to the greatest byte
return ((nb_bits_to_transmit + 7) >> 3); return ((nb_bits_to_transmit + 7) >> 3);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
uint32_t uint32_t
rlc_am_get_buffer_occupancy_in_bytes ( rlc_am_get_buffer_occupancy_in_bytes (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t * const rlc_pP) rlc_am_entity_t *const rlc_pP) {
{
// priority of control trafic // priority of control trafic
rlc_pP->status_buffer_occupancy = 0; rlc_pP->status_buffer_occupancy = 0;
if ((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK)) { 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); rlc_pP->status_buffer_occupancy = rlc_am_get_status_pdu_buffer_occupancy(rlc_pP);
#if TRACE_RLC_AM_BO LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : CONTROL PDU %d bytes \n",
LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : CONTROL PDU %d bytes \n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->status_buffer_occupancy); rlc_pP->status_buffer_occupancy);
#endif
} }
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
#if TRACE_RLC_AM_BO 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);
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_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_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_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",
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), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->sdu_buffer_occupancy, rlc_pP->sdu_buffer_occupancy,
0, 0,
0, 0,
rlc_pP->nb_sdu_no_segmented); 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; return rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_release ( rlc_am_release (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t * const rlc_pP rlc_am_entity_t *const rlc_pP
) ) {
{
// empty // empty
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
config_req_rlc_am ( 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 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 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_union_t *rlc_union_p = NULL;
rlc_am_entity_t *l_rlc_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); 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; 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) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; 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, ...@@ -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 ( 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 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 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_union_t *rlc_union_p = NULL;
rlc_am_entity_t *l_rlc_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); 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; 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) { if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am; l_rlc_p = &rlc_union_p->rlc.am;
...@@ -280,7 +250,6 @@ void config_req_rlc_am_asn1 ( ...@@ -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_Reordering<LTE_T_Reordering_spare1) &&
(config_am_pP->dl_AM_RLC.t_StatusProhibit<LTE_T_StatusProhibit_spare8) ) { (config_am_pP->dl_AM_RLC.t_StatusProhibit<LTE_T_StatusProhibit_spare8) ) {
#endif #endif
MSC_LOG_RX_MESSAGE( 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_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
...@@ -292,7 +261,6 @@ void config_req_rlc_am_asn1 ( ...@@ -292,7 +261,6 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
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", 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), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold], maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
...@@ -301,7 +269,6 @@ void config_req_rlc_am_asn1 ( ...@@ -301,7 +269,6 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
rlc_am_init(ctxt_pP, l_rlc_p); 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_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_am_configure(ctxt_pP, l_rlc_p, rlc_am_configure(ctxt_pP, l_rlc_p,
...@@ -311,7 +278,8 @@ void config_req_rlc_am_asn1 ( ...@@ -311,7 +278,8 @@ void config_req_rlc_am_asn1 (
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit], PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering], am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]); t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
} else { }
else {
MSC_LOG_RX_DISCARDED_MESSAGE( 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_RLC_ENB:MSC_RLC_UE,
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
...@@ -320,7 +288,6 @@ void config_req_rlc_am_asn1 ( ...@@ -320,7 +288,6 @@ void config_req_rlc_am_asn1 (
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ", MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ",
MSC_AS_TIME_ARGS(ctxt_pP), MSC_AS_TIME_ARGS(ctxt_pP),
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p)); PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
LOG_D(RLC, 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_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), PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
...@@ -339,36 +306,35 @@ void config_req_rlc_am_asn1 ( ...@@ -339,36 +306,35 @@ void config_req_rlc_am_asn1 (
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void rlc_am_stat_req ( void rlc_am_stat_req (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t * const rlc_pP, rlc_am_entity_t *const rlc_pP,
unsigned int* stat_tx_pdcp_sdu, unsigned int *stat_tx_pdcp_sdu,
unsigned int* stat_tx_pdcp_bytes, unsigned int *stat_tx_pdcp_bytes,
unsigned int* stat_tx_pdcp_sdu_discarded, unsigned int *stat_tx_pdcp_sdu_discarded,
unsigned int* stat_tx_pdcp_bytes_discarded, unsigned int *stat_tx_pdcp_bytes_discarded,
unsigned int* stat_tx_data_pdu, unsigned int *stat_tx_data_pdu,
unsigned int* stat_tx_data_bytes, unsigned int *stat_tx_data_bytes,
unsigned int* stat_tx_retransmit_pdu_by_status, unsigned int *stat_tx_retransmit_pdu_by_status,
unsigned int* stat_tx_retransmit_bytes_by_status, unsigned int *stat_tx_retransmit_bytes_by_status,
unsigned int* stat_tx_retransmit_pdu, unsigned int *stat_tx_retransmit_pdu,
unsigned int* stat_tx_retransmit_bytes, unsigned int *stat_tx_retransmit_bytes,
unsigned int* stat_tx_control_pdu, unsigned int *stat_tx_control_pdu,
unsigned int* stat_tx_control_bytes, unsigned int *stat_tx_control_bytes,
unsigned int* stat_rx_pdcp_sdu, unsigned int *stat_rx_pdcp_sdu,
unsigned int* stat_rx_pdcp_bytes, unsigned int *stat_rx_pdcp_bytes,
unsigned int* stat_rx_data_pdus_duplicate, unsigned int *stat_rx_data_pdus_duplicate,
unsigned int* stat_rx_data_bytes_duplicate, unsigned int *stat_rx_data_bytes_duplicate,
unsigned int* stat_rx_data_pdu, unsigned int *stat_rx_data_pdu,
unsigned int* stat_rx_data_bytes, unsigned int *stat_rx_data_bytes,
unsigned int* stat_rx_data_pdu_dropped, unsigned int *stat_rx_data_pdu_dropped,
unsigned int* stat_rx_data_bytes_dropped, unsigned int *stat_rx_data_bytes_dropped,
unsigned int* stat_rx_data_pdu_out_of_window, unsigned int *stat_rx_data_pdu_out_of_window,
unsigned int* stat_rx_data_bytes_out_of_window, unsigned int *stat_rx_data_bytes_out_of_window,
unsigned int* stat_rx_control_pdu, unsigned int *stat_rx_control_pdu,
unsigned int* stat_rx_control_bytes, unsigned int *stat_rx_control_bytes,
unsigned int* stat_timer_reordering_timed_out, unsigned int *stat_timer_reordering_timed_out,
unsigned int* stat_timer_poll_retransmit_timed_out, unsigned int *stat_timer_poll_retransmit_timed_out,
unsigned int* stat_timer_status_prohibit_timed_out) unsigned int *stat_timer_status_prohibit_timed_out) {
{
*stat_tx_pdcp_sdu = rlc_pP->stat_tx_pdcp_sdu; *stat_tx_pdcp_sdu = rlc_pP->stat_tx_pdcp_sdu;
*stat_tx_pdcp_bytes = rlc_pP->stat_tx_pdcp_bytes; *stat_tx_pdcp_bytes = rlc_pP->stat_tx_pdcp_bytes;
*stat_tx_pdcp_sdu_discarded = rlc_pP->stat_tx_pdcp_sdu_discarded; *stat_tx_pdcp_sdu_discarded = rlc_pP->stat_tx_pdcp_sdu_discarded;
...@@ -396,15 +362,13 @@ void rlc_am_stat_req ( ...@@ -396,15 +362,13 @@ void rlc_am_stat_req (
*stat_timer_reordering_timed_out = rlc_pP->stat_timer_reordering_timed_out; *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_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; *stat_timer_status_prohibit_timed_out = rlc_pP->stat_timer_status_prohibit_timed_out;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_get_pdus ( rlc_am_get_pdus (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t * const rlc_pP rlc_am_entity_t *const rlc_pP
) ) {
{
//int display_flag = 0; //int display_flag = 0;
// 5.1.3.1 Transmit operations // 5.1.3.1 Transmit operations
// 5.1.3.1.1 // 5.1.3.1.1
...@@ -412,10 +376,7 @@ rlc_am_get_pdus ( ...@@ -412,10 +376,7 @@ 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 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 // The transmitting side of an AM RLC entity shall prioritize retransmission of RLC data PDUs over transmission of new
// AMD PDUs. // AMD PDUs.
switch (rlc_pP->protocol_state) { switch (rlc_pP->protocol_state) {
case RLC_NULL_STATE: case RLC_NULL_STATE:
break; break;
...@@ -434,9 +395,8 @@ rlc_am_get_pdus ( ...@@ -434,9 +395,8 @@ rlc_am_get_pdus (
// //
// When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall: // When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall:
// - start t-StatusProhibit. // - start t-StatusProhibit.
rlc_am_send_status_pdu(ctxt_pP, rlc_pP); 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) { if (pdu) {
list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer); list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer);
...@@ -445,8 +405,7 @@ rlc_am_get_pdus ( ...@@ -445,8 +405,7 @@ rlc_am_get_pdus (
rlc_am_start_timer_status_prohibit(ctxt_pP, rlc_pP); rlc_am_start_timer_status_prohibit(ctxt_pP, rlc_pP);
return; return;
} }
} } else {
else {
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" DELAYED SENT STATUS PDU (Available MAC Data %u)(T-PROHIBIT %u) (DELAY FLAG %u)\n", 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), 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));
...@@ -454,13 +413,11 @@ rlc_am_get_pdus ( ...@@ -454,13 +413,11 @@ rlc_am_get_pdus (
// 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)) { 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 */ /* 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); mem_block_t *pdu_retx = rlc_am_get_pdu_to_retransmit(ctxt_pP, rlc_pP);
if (pdu_retx != NULL) { if (pdu_retx != NULL) {
list_add_tail_eurecom (pdu_retx, &rlc_pP->pdus_to_mac_layer); list_add_tail_eurecom (pdu_retx, &rlc_pP->pdus_to_mac_layer);
return; return;
} }
} }
...@@ -472,12 +429,11 @@ rlc_am_get_pdus ( ...@@ -472,12 +429,11 @@ rlc_am_get_pdus (
if (rlc_pP->pdus_to_mac_layer.head != NULL) { if (rlc_pP->pdus_to_mac_layer.head != NULL) {
rlc_pP->stat_tx_data_pdu += 1; rlc_pP->stat_tx_data_pdu += 1;
rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req*)(rlc_pP->pdus_to_mac_layer.head->data))->tb_size); rlc_pP->stat_tx_data_bytes += (((struct mac_tb_req *)(rlc_pP->pdus_to_mac_layer.head->data))->tb_size);
return; return;
} }
} }
break; break;
default: default:
...@@ -489,15 +445,13 @@ rlc_am_get_pdus ( ...@@ -489,15 +445,13 @@ rlc_am_get_pdus (
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_am_rx ( rlc_am_rx (
const protocol_ctxt_t* const ctxt_pP, const protocol_ctxt_t *const ctxt_pP,
void * const arg_pP,