Commit 9a1b5517 authored by Lionel Gauthier's avatar Lionel Gauthier

Old rev code


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7375 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3c6f1e19
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_CONSTANTS_H__
# define __RLC_UM_CONSTANTS_H__
// SN Field
# define RLC_UM_SN_7BITS_MASK 0xFF
// li field (values shifted 1 bit left)
# define RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU 16
//----------------------------------------------------------
// Events defined for state model of the acknowledged mode entity
# define RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT 0x00
# define RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT 0x01
# define RLC_UM_RECEIVE_CRLC_SUSPEND_REQ_EVENT 0x10
# define RLC_UM_TRANSMIT_CRLC_SUSPEND_CNF_EVENT 0x11
# define RLC_UM_RECEIVE_CRLC_RESUME_REQ_EVENT 0x12
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_CONTROL_PRIMITIVES_H__
# define __RLC_UM_CONTROL_PRIMITIVES_H__
//-----------------------------------------------------------------------------
# include "rlc_um_entity.h"
# include "mem_block.h"
# include "rrm_config_structs.h"
//-----------------------------------------------------------------------------
extern void config_req_rlc_um (struct rlc_um_entity *rlcP, module_id_t module_idP, rlc_um_info_t * config_umP, uint8_t rb_idP, rb_type_t rb_typeP);
extern void send_rlc_um_control_primitive (struct rlc_um_entity *rlcP, module_id_t module_idP, mem_block_t *cprimitiveP);
extern void init_rlc_um (struct rlc_um_entity *rlcP);
extern void rlc_um_reset_state_variables (struct rlc_um_entity *rlcP);
extern void rlc_um_free_all_resources (struct rlc_um_entity *rlcP);
extern void rlc_um_set_configured_parameters (struct rlc_um_entity *rlcP, mem_block_t *cprimitiveP);
//extern void rlc_um_probing_get_buffer_occupancy_measurements (struct rlc_um_entity *rlcP, probing_report_traffic_rb_parameters *reportP, int measurement_indexP);
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_ENTITY_H__
# define __RLC_UM_ENTITY_H__
# include "platform_types.h"
# include "platform_constants.h"
# include "list.h"
# include "rlc_primitives.h"
# include "rlc_def.h"
struct rlc_um_entity {
module_id_t module_id;
uint8_t allocation;
uint8_t protocol_state;
// for stats and trace purpose :
uint16_t data_plane; // act as a boolean
uint16_t crc_on_header; // act as a boolean
//*****************************************************************************
// TRANSMITER
//*****************************************************************************
//-----------------------------
// protocol variables
//-----------------------------
uint16_t first_li_in_next_pdu; // indicates :
// value = 000000000000000 that the previous PDU was exactly
// with the last segment of an RLC SDU and there is no LI that
// indicates the end of the SDU in the previous RLC PDU.
// value = 111111111111011 The last segment of an RLC SDU was one octet
// short of exactly filling the previous RLC PDU and there is no LI that
// indicates the end of the SDU in the previous RLC PDU. The remaining one
// octet in the previous RLC PDU is ignored.
// value = 111111111111110 AMD PDU: The rest of the RLC PDU includes a
// piggybacked STATUS PDU.
// value = 111111111111111 The rest of the RLC PDU is padding. The padding
// length can be zero.
uint8_t vt_us;
//-----------------------------
// discard info
//-----------------------------
uint8_t sdu_discard_mode;
//-----------------------------
// timers
//-----------------------------
uint16_t timer_discard_init;
uint32_t *frame_tick_milliseconds; // pointer on this tick variable handled by RRC : READ ONLY
//-----------------------------
// tranmission
//-----------------------------
// sdu communication;
mem_block_t **input_sdus; // should be accessed as an array
mem_block_t *input_sdus_alloc; // allocation of the array
uint16_t size_input_sdus_buffer;
uint16_t nb_sdu;
uint16_t next_sdu_index; // next location of incoming sdu
uint16_t current_sdu_index;
uint32_t buffer_occupancy;
uint16_t data_pdu_size;
uint16_t data_pdu_size_in_bits;
uint16_t nb_pdu_requested_by_mac;
uint8_t li_one_byte_short_to_add_in_next_pdu;
uint8_t li_exactly_filled_to_add_in_next_pdu;
uint8_t li_length_15_was_used_for_previous_pdu;
list_t pdus_to_mac_layer;
//-----------------------------
// C-SAP
//-----------------------------
list_t c_sap;
//-----------------------------
// Mapping info
//-----------------------------
uint8_t logical_channel_identity;
//*****************************************************************************
// RECEIVER
//*****************************************************************************
//-----------------------------
// protocol variables
//-----------------------------
uint8_t vr_us; // Receiver Send Sequence state variable
// The sequence number of the next PDU to be received. It shall be
// set equal to SN+1 upon reception of a PDU. The initial value of
// this state variable is 0;
//-----------------------------
// receiver
//-----------------------------
// the current output sdu is the first in the list
list_t output_sdu_list;
mem_block_t *output_sdu_in_construction;
int32_t output_sdu_size_to_write; // for writing in sdu
//struct rlc_um_data_ind output_rlc_primitive;// for writing header in rt_fifo
list_t pdus_from_mac_layer;
uint8_t last_reassemblied_sn:7;
uint16_t rb_id;
uint32_t tx_sdus;
uint32_t rx_sdus;
uint32_t tx_pdus;
uint32_t rx_pdus;
uint32_t rx_pdus_in_error;
uint8_t first_pdu;
unsigned int tx_pdcp_sdu;
unsigned int tx_pdcp_sdu_discarded;
unsigned int tx_data_pdu;
unsigned int rx_sdu;
unsigned int rx_error_pdu;
unsigned int rx_data_pdu;
unsigned int rx_data_pdu_out_of_window;
};
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc_um_entity.h"
#include "rlc_um_constants.h"
#include "rlc_def.h"
#include "LAYER2/MAC/extern.h"
//-----------------------------------------------------------------------------
#ifdef DEBUG_RLC_UM_FSM
# define PRINT_RLC_UM_FSM msg
#else
# define PRINT_RLC_UM_FSM //
#endif
//-----------------------------------------------------------------------------
int
rlc_um_fsm_notify_event (struct rlc_um_entity *rlcP, uint8_t eventP)
{
//-----------------------------------------------------------------------------
switch (rlcP->protocol_state) {
//-------------------------------
// RLC_NULL_STATE
//-------------------------------
case RLC_NULL_STATE:
switch (eventP) {
case RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT:
PRINT_RLC_UM_FSM ("[RLC_UM_LITE][RB %d][FSM] RLC_NULL_STATE -> RLC_DATA_TRANSFER_READY_STATE\n", rlcP->rb_id);
rlcP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
return 1;
break;
default:
msg ("[RLC_UM_LITE][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE\n", rlcP->rb_id, eventP);
mac_xface->macphy_exit("");
return 0;
}
break;
//-------------------------------
// RLC_DATA_TRANSFER_READY_STATE
//-------------------------------
case RLC_DATA_TRANSFER_READY_STATE:
switch (eventP) {
case RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
PRINT_RLC_UM_FSM ("[RLC_UM_LITE][RB %d][FSM] RLC_DATA_TRANSFER_READY_STATE -> RLC_NULL_STATE\n", rlcP->rb_id);
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_UM_RECEIVE_CRLC_SUSPEND_REQ_EVENT:
case RLC_UM_TRANSMIT_CRLC_SUSPEND_CNF_EVENT:
PRINT_RLC_UM_FSM ("[RLC_UM_LITE][RB %d][FSM] RLC_DATA_TRANSFER_READY_STATE -> RLC_LOCAL_SUSPEND_STATE\n", rlcP->rb_id);
rlcP->protocol_state = RLC_LOCAL_SUSPEND_STATE;
return 1;
break;
default:
msg ("[RLC_UM_LITE][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM DATA_TRANSFER_READY_STATE\n", rlcP->rb_id, eventP);
return 0;
}
break;
//-------------------------------
// RLC_LOCAL_SUSPEND_STATE
//-------------------------------
case RLC_LOCAL_SUSPEND_STATE:
switch (eventP) {
case RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
PRINT_RLC_UM_FSM ("[RLC_UM_LITE %p][FSM] RLC_LOCAL_SUSPEND_STATE -> RLC_NULL_STATE\n", rlcP);
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_UM_RECEIVE_CRLC_RESUME_REQ_EVENT:
PRINT_RLC_UM_FSM ("[RLC_UM_LITE %p][FSM] RLC_LOCAL_SUSPEND_STATE -> RLC_DATA_TRANSFER_READY_STATE\n", rlcP);
rlcP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
return 1;
break;
default:
msg ("[RLC_UM_LITE %p][FSM] WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM RLC_LOCAL_SUSPEND_STATE\n", rlcP, eventP);
return 0;
}
break;
default:
msg ("[RLC_UM_LITE %p][FSM] ERROR UNKNOWN STATE %d\n", rlcP, rlcP->protocol_state);
return 0;
}
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_FSM_PROTO_EXTERN_H__
# define __RLC_UM_FSM_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "platform_types.h"
# include "rlc_um_entity.h"
//-----------------------------------------------------------------------------
extern int rlc_um_fsm_notify_event (struct rlc_um_entity *rlcP, uint8_t eventP);
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_PROTO_EXTERN_H__
# define __RLC_UM_PROTO_EXTERN_H__
# include "rlc_um_entity.h"
# include "mem_block.h"
extern void rlc_um_stat_req (struct rlc_um_entity *rlcP,
unsigned int* tx_pdcp_sdu,
unsigned int* tx_pdcp_sdu_discarded,
unsigned int* tx_data_pdu,
unsigned int* rx_sdu,
unsigned int* rx_error_pdu,
unsigned int* rx_data_pdu,
unsigned int* rx_data_pdu_out_of_window);
extern void rlc_um_get_pdus (void *argP);
extern void rlc_um_rx (void *argP, struct mac_data_ind data_indP);
extern struct mac_status_resp rlc_um_mac_status_indication (void *rlcP, uint16_t no_tbP, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);
extern struct mac_data_req rlc_um_mac_data_request (void *rlcP);
extern void rlc_um_mac_data_indication (void *rlcP, struct mac_data_ind data_indP);
extern void rlc_um_data_req (void *rlcP, mem_block_t *sduP);
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
#define RLC_UM_C
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc.h"
#include "rlc_um_entity.h"
#include "rlc_um_structs.h"
#include "rlc_primitives.h"
#include "rlc_um_constants.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
//#define DEBUG_RLC_UM_REASSEMBLY 1
//#define DEBUG_RLC_UM_DISPLAY_ASCII_DATA 1
//#define DEBUG_RLC_UM_SEND_SDU
void rlc_um_clear_rx_sdu (struct rlc_um_entity *rlcP);
void rlc_um_reassembly (uint8_t * srcP, int32_t lengthP, struct rlc_um_entity *rlcP);
void rlc_um_send_sdu_minus_1_byte (struct rlc_um_entity *rlcP);
void rlc_um_send_sdu (struct rlc_um_entity *rlcP);
//-----------------------------------------------------------------------------
inline void
rlc_um_clear_rx_sdu (struct rlc_um_entity *rlcP)
{
//-----------------------------------------------------------------------------
rlcP->output_sdu_size_to_write = 0;
}
//-----------------------------------------------------------------------------
void
rlc_um_reassembly (uint8_t * srcP, int32_t lengthP, struct rlc_um_entity *rlcP)
{
//-----------------------------------------------------------------------------
int sdu_max_size;
#ifdef DEBUG_RLC_UM_DISPLAY_ASCII_DATA
int index;
#endif
#ifdef DEBUG_RLC_UM_REASSEMBLY
msg ("[RLC_UM_LITE][MOD %d][RB %d][REASSEMBLY] reassembly() %d bytes\n", rlcP->module_id, rlcP->rb_id, lengthP);
#endif
if ((rlcP->data_plane)) {
sdu_max_size = RLC_SDU_MAX_SIZE_DATA_PLANE;
} else {
sdu_max_size = RLC_SDU_MAX_SIZE_CONTROL_PLANE;
}
if (rlcP->output_sdu_in_construction == NULL) {
// msg("[RLC_UM_LITE] Getting mem_block ...\n");
rlcP->output_sdu_in_construction = get_free_mem_block (sdu_max_size);
rlcP->output_sdu_size_to_write = 0;
}
if ((rlcP->output_sdu_in_construction)) {
#ifdef DEBUG_RLC_UM_DISPLAY_ASCII_DATA
msg ("[RLC_UM_LITE][RB %d][REASSEMBLY] DATA :", rlcP->rb_id);
for (index = 0; index < lengthP; index++) {
msg ("%02X.", srcP[index]);
}
msg ("\n");
#endif
// check if no overflow in size
if ((rlcP->output_sdu_size_to_write + lengthP) <= sdu_max_size) {
memcpy (&rlcP->output_sdu_in_construction->data[rlcP->output_sdu_size_to_write], srcP, lengthP);
rlcP->output_sdu_size_to_write += lengthP;
} else {
msg ("[RLC_UM_LITE][RB %d][REASSEMBLY] ERROR SDU SIZE OVERFLOW SDU GARBAGED\n", rlcP->rb_id);
// erase SDU
rlcP->output_sdu_size_to_write = 0;
}
} else {
msg ("[RLC_UM_LITE][RB %d][REASSEMBLY] ERROR OUTPUT SDU IS NULL\n", rlcP->rb_id);
}
}
//-----------------------------------------------------------------------------
inline void
rlc_um_send_sdu_minus_1_byte (struct rlc_um_entity *rlcP)
{
//-----------------------------------------------------------------------------
rlcP->output_sdu_size_to_write -= 1;
rlc_um_send_sdu (rlcP);
}
//-----------------------------------------------------------------------------
void
rlc_um_send_sdu (struct rlc_um_entity *rlcP)
{
//-----------------------------------------------------------------------------
/*#ifndef USER_MODE
unsigned long int rlc_um_time_us;
int min, sec, usec;
#endif*/
if ((rlcP->output_sdu_in_construction)) {
#ifdef DEBUG_RLC_UM_SEND_SDU
msg ("[RLC_UM_LITE][MOD %d][RB %d][SEND_SDU] %d bytes frame %d\n", rlcP->module_id, rlcP->rb_id, rlcP->output_sdu_size_to_write, Mac_rlc_xface->frame);
/*#ifndef USER_MODE
rlc_um_time_us = (unsigned long int)(rt_get_time_ns ()/(RTIME)1000);
sec = (rlc_um_time_us/ 1000000);
min = (sec / 60) % 60;
sec = sec % 60;
usec = rlc_um_time_us % 1000000;
msg ("[RLC_UM_LITE][RB %d] at time %2d:%2d.%6d\n", rlcP->rb_id, min, sec , usec);
#endif*/
#endif
if (rlcP->output_sdu_size_to_write > 0) {
#ifdef DEBUG_RLC_STATS
rlcP->rx_sdus += 1;
#endif
#ifdef BENCH_QOS_L2
fprintf (bench_l2, "[SDU DELIVERY] FRAME %d SIZE %d RB %d RLC-UM %p\n", Mac_rlc_xface->frame, rlcP->output_sdu_size_to_write, rlcP->rb_id, rlcP);
#endif
// msg("[RLC] DATA IND ON MOD_ID %d RB ID %d, size %d\n",rlcP->module_id, rlcP->rb_id,rlcP->output_sdu_size_to_write);
rlc_data_ind (rlcP->module_id, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction, rlcP->data_plane);
} else {
#ifdef DEBUG_RLC_UM_SEND_SDU
msg ("[RLC_UM_LITE][RB %d][SEND_SDU] ERROR SIZE <= 0\n", rlcP->rb_id);
#endif
msg ("[RLC_UM_LITE][RB %d][SEND_SDU] ERROR SIZE <= 0\n", rlcP->rb_id);
msg("[RLC_UM_LITE] Freeing mem_block ...\n");
free_mem_block (rlcP->output_sdu_in_construction);
}
rlcP->output_sdu_in_construction = NULL;
rlcP->output_sdu_size_to_write = 0;
}
}
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_REASSEMBLY_PROTO_EXTERN_H__
# define __RLC_UM_REASSEMBLY_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_um_entity.h"
//-----------------------------------------------------------------------------
extern void rlc_um_send_sdu_minus_1_byte (struct rlc_um_entity *rlcP);
extern void rlc_um_clear_rx_sdu (struct rlc_um_entity *rlcP);
extern void rlc_um_reassembly (uint8_t * srcP, uint16_t lengthP, struct rlc_um_entity *rlcP);
extern void rlc_um_send_sdu (struct rlc_um_entity *rlcP);
# endif
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_RECEIVER_PROTO_EXTERN_H__
# define __RLC_UM_RECEIVER_PROTO_EXTERN_H__
# include "rlc_um_entity.h"
# include "mac_primitives.h"
void rlc_um_receive (struct rlc_um_entity *rlcP, struct mac_data_ind data_indP);
# endif
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_SEGMENT_PROTO_EXTERN_H__
# define __RLC_UM_SEGMENT_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_um_entity.h"
//-----------------------------------------------------------------------------
extern uint8_t rlc_um_crc8_xor (char *mem_areaP, signed int num_bytesP);
extern void rlc_um_segment_15 (struct rlc_um_entity *rlcP);
extern void rlc_um_segment_7 (struct rlc_um_entity *rlcP);
# endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/******************************************************************************
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*******************************************************************************/
# ifndef __RLC_UM_STRUCTS_H__
# define __RLC_UM_STRUCTS_H__
# include "platform_types.h"
# include "list.h"
# include "rlc_am_constants.h"
# include "mac_primitives.h"
# include "rlc_primitives.h"
//#ifdef USER_MODE
# include "mac_rlc_primitives.h"
//#endif //USER_MODE
//-----------------------
struct rlc_um_tx_sdu_management {
uint8_t *first_byte;
int32_t sdu_creation_time;
uint16_t sdu_remaining_size;
uint16_t sdu_segmented_size;
uint16_t sdu_size;
uint8_t use_special_li;
};
//-----------------------
struct rlc_um_tx_pdu_management {
uint8_t *first_byte; // point to first byte of RLC header
uint8_t *payload;
uint16_t data_size; // size of payload (not included byte1, LIs, and padding)
uint8_t dummy[MAC_HEADER_MAX_SIZE]; // optimization for MAC layer : reserve bytes for MAC header
};
//-----------------------
struct rlc_um_rx_pdu_management {
uint8_t *first_byte;
uint8_t sn;
};
//-----------------------
struct rlc_um_tx_data_pdu_management {
union {
struct rlc_um_tx_pdu_management tx_pdu_mngmnt;
struct mac_tb_req tb_req;
struct mac_tx_tb_management tb_mngt;
# ifdef BYPASS_L1
struct rlc_um_rx_pdu_management dummy1;
struct mac_tb_ind dummy2;
struct mac_rx_tb_management dummy3;
struct rlc_indication dummy4;
# endif
} dummy;
};
//-----------------------
struct rlc_um_rx_data_pdu_struct {
uint8_t byte1;
uint8_t li_data_7[1];
};
//-----------------------
struct rlc_um_tx_data_pdu_struct {
uint8_t byte1;
uint8_t li_data_7[1];
};
//-----------------------
struct rlc_um_data_req_alloc { // alloc enought bytes for sdu mngt also
union {
struct rlc_um_data_req dummy1;
struct rlc_um_tx_sdu_management dummy2;
} dummy;
};
# endif
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