Commit c1f14990 authored by Lionel Gauthier's avatar Lionel Gauthier

Old rev code


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7372 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 0bd3c9ec
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
*******************************************************************************/
/***************************************************************************
rlc_am_constant.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_CONSTANT_H__
# define __RLC_AM_CONSTANT_H__
# define RLC_AM_LOCATION_UTRAN 0xBA
# define RLC_AM_LOCATION_UE 0x01
//----------------------------------------------------------
// AMD DATA, CONTROL PDU parameters
//----------------------------------------------------------
# define NB_MAX_SUFI 30
# define SUFI_MAX_SIZE 40
// SUFI field (4 bits)
# define RLC_AM_SUFI_NO_MORE 0x0
# define RLC_AM_SUFI_WINDOW 0x1
# define RLC_AM_SUFI_ACK 0x2
# define RLC_AM_SUFI_LIST 0x3
# define RLC_AM_SUFI_BITMAP 0x4
# define RLC_AM_SUFI_RLIST 0x5
# define RLC_AM_SUFI_MRW 0x6
# define RLC_AM_SUFI_MRW_ACK 0x7
# define RLC_AM_SUFI_NO_MORE_SIZE 4
//in bits
# define RLC_AM_SUFI_ACK_SIZE 16
//in bits
# define RLC_AM_SUFI_LIST_SIZE_MIN 24
//in bits
# define RLC_AM_SUFI_BITMAP_SIZE_MIN 28
//in bits
//----------------------------------------------------------
// values for ack field of struct rlc_am_tx_pdu_management
// this struct is mapped on the misc field of each pdu
# define RLC_AM_PDU_ACK_NO_EVENT 0
# define RLC_AM_PDU_ACK_EVENT 1
# define RLC_AM_PDU_NACK_EVENT -1
//----------------------------------------------------------
# define RLC_AM_SEND_MRW_OFF 0x0F
# define RLC_AM_SEND_MRW_ON 0xF0
//----------------------------------------------------------
// SN Field
# define RLC_AM_SN_1ST_PART_MASK 0x7F
# define RLC_AM_SN_2ND_PART_MASK 0xF8
//----------------------------------------------------------
// Polling bit (values shifted 2 bits left)
# define RLC_AM_P_STATUS_REPORT_NOT_REQUESTED 0
# define RLC_AM_P_STATUS_REPORT_REQUESTED 4
# define RLC_AM_P_STATUS_REPORT_MASK 4
//----------------------------------------------------------
// li field (values shifted 1 bit left)
# define RLC_AM_SEGMENT_NB_MAX_LI_PER_PDU 32
//----------------------------------------------------------
// shifted 3 bits left
# define RLC_AM_RESET_SEQUENCE_NUMBER_MASK 0x08
# define RLC_AM_TIMER_POLL_TIME_OUT_EVENT 0x001
# define RLC_AM_TIMER_POLL_PROHIBIT_TIME_OUT_EVENT 0x002
# define RLC_AM_TIMER_EPC_TIME_OUT_EVENT 0x004
# define RLC_AM_TIMER_DISCARD_TIME_OUT_EVENT 0x008
# define RLC_AM_TIMER_POLL_PERIODIC_TIME_OUT_EVENT 0x010
# define RLC_AM_TIMER_STATUS_PROHIBIT_TIME_OUT_EVENT 0x020
# define RLC_AM_TIMER_STATUS_PERIODIC_TIME_OUT_EVENT 0x040
# define RLC_AM_TIMER_RST_TIME_OUT_EVENT 0x080
# define RLC_AM_TIMER_MRW_TIME_OUT_EVENT 0x100
//----------------------------------------------------------
# define RLC_AM_SDU_SEGMENTS_SUBMITTED_TO_LOWER_LAYER 0xFF
// for sdu_header_copy
# define RLC_AM_SN_INVALID 0xFFFF
// PDU transmission
# define RLC_AM_PDU_COPY_LOCATION_RETRANSMISSION_BUFFER_TO_SEND 0x10
# define RLC_AM_PDU_COPY_LOCATION_PDUS_TO_MAC_LAYER 0x20
# define RLC_AM_PDU_COPY_LOCATION_MASK 0xF0
//----------------------------------------------------------
// Events defined for state model of the acknowledged mode entity
# define RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT 0x00
# define RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT 0x01
# define RLC_AM_RECEIVE_CRLC_SUSPEND_REQ_EVENT 0x10
# define RLC_AM_TRANSMIT_CRLC_SUSPEND_CNF_EVENT 0x11
# define RLC_AM_RECEIVE_CRLC_RESUME_REQ_EVENT 0x12
# define RLC_AM_RECEIVE_RESET_EVENT 0x20
# define RLC_AM_TRANSMIT_RESET_EVENT 0x21
# define RLC_AM_RECEIVE_RESET_ACK_EVENT 0x22
# define RLC_AM_TRANSMIT_RESET_ACK_EVENT 0x23
//----------------------------------------------------------
# define RLC_AM_TRAFFIC_NOT_ALLOWED 0x00
# define RLC_AM_TRAFFIC_ALLOWED_FOR_STATUS 0xC0
// mutual exclusion of set bits with next value
# define RLC_AM_TRAFFIC_ALLOWED_FOR_DATA 0x0D
// mutual exclusion of set bits with previous value
# define RLC_AM_DCCH_ID 0xC0
// mutual exclusion of set bits with next value
# define RLC_AM_DTCH_ID 0x0D
// mutual exclusion of set bits with previous value
//----------------------------------------------------------
// for status report of transmission by MAC layer
# define RLC_AM_STATUS_PDU_TYPE 0x0001
# define RLC_AM_FIRST_STATUS_PDU_TYPE 0x0011
# define RLC_AM_LAST_STATUS_PDU_TYPE 0x0021
# define RLC_AM_MRW_STATUS_PDU_TYPE 0x0040
# define RLC_AM_RESET_PDU_TYPE 0x0080
# define RLC_AM_RESET_ACK_PDU_TYPE 0x0100
# define RLC_AM_DATA_POLL_PDU_TYPE 0x1800
# define RLC_AM_DATA_PDU_TYPE 0x1000
//----------------------------------------------------------
// TIMER EPC
# define TIMER_EPC_STATE_IDLE 0x00
# define TIMER_EPC_STATE_TIMER_ARMED 0x01
# define TIMER_EPC_STATE_TIMED_OUT 0x02
# define TIMER_EPC_STATE_VR_EP_COUNTING_DOWN 0x04
# define TIMER_EPC_STATE_VR_EP_EQUAL_ZERO 0x08
# define TIMER_EPC_PDU_STATUS_SUBMITTED_LOWER_LAYER_EVENT 0x01
# define TIMER_EPC_PDU_STATUS_TRANSMITED_EVENT 0x02
# define TIMER_EPC_TIMER_TIMED_OUT_EVENT 0x04
# define TIMER_EPC_VR_EP_EQUAL_ZERO_EVENT 0x08
# 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
*******************************************************************************/
/***************************************************************************
rlc_am_control_primitives_proto_extern.h -
-------------------
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_CONTROL_PRIMITIVES_H__
# define __RLC_AM_CONTROL_PRIMITIVES_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "mem_block.h"
# include "rrm_config_structs.h"
//-----------------------------------------------------------------------------
extern void config_req_rlc_am (struct rlc_am_entity *rlcP, module_id_t module_idP, rlc_am_info_t * config_amP, uint8_t rb_idP, rb_type_t rb_typeP);
extern void send_rlc_am_control_primitive (struct rlc_am_entity *rlcP, module_id_t module_idP, mem_block_t * cprimitiveP);
extern void init_rlc_am (struct rlc_am_entity *rlcP);
extern void rlc_am_reset_state_variables (struct rlc_am_entity *rlcP);
extern void rlc_am_alloc_buffers_after_establishment (struct rlc_am_entity *rlcP);
extern void rlc_am_discard_all_pdus (struct rlc_am_entity *rlcP);
extern void rlc_am_stop_all_timers (struct rlc_am_entity *rlcP);
extern void rlc_am_free_all_resources (struct rlc_am_entity *rlcP);
extern void rlc_am_set_configured_parameters (struct rlc_am_entity *rlcP, mem_block_t * cprimitiveP);
//extern void rlc_am_probing_get_buffer_occupancy_measurements (struct rlc_am_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
*******************************************************************************/
/***************************************************************************
rlc_am_demux.c -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
//#include "mac_log_interface_struct.h"
#include "LAYER2/RLC/rlc.h"
#include "mac_primitives.h"
#include "list.h"
#include "rlc_am_entity.h"
#include "rlc_am_structs.h"
#include "rlc_am_constants.h"
#include "rlc_am_receiver_proto_extern.h"
#include "rlc_am_reset_proto_extern.h"
#include "rlc_am_status_proto_extern.h"
#include "rlc_am_timers_proto_extern.h"
#include "LAYER2/MAC/extern.h"
#define DEBUG_DEMUX_RESET
#define DEBUG_DEMUX
//-----------------------------------------------------------------------------
void
rlc_am_demux_routing (struct rlc_am_entity *rlcP, unsigned int traffic_typeP, struct mac_data_ind data_indP)
{
//-----------------------------------------------------------------------------
struct rlc_am_pdu_header *data;
struct rlc_am_reset_header *control;
mem_block_t *tb;
uint8_t *first_byte;
uint16_t tb_size_in_bytes;
uint8_t first_bit;
uint8_t bits_to_shift;
uint8_t bits_to_shift_last_loop;
uint8_t data_received;
int index;
//-------------------------------------------------------
// D A T A P D U
//-------------------------------------------------------
data_received = 0;
while ((tb = list_remove_head (&data_indP.data))) {
if (!(((struct mac_tb_ind *) (tb->data))->error_indication)) {
first_byte = ((struct mac_tb_ind *) (tb->data))->data_ptr;
tb_size_in_bytes = data_indP.tb_size >> 3;
first_bit = ((struct mac_tb_ind *) (tb->data))->first_bit;
if (first_bit > 0) {
// shift data of transport_block TO CHECK
bits_to_shift_last_loop = 0;
while ((tb_size_in_bytes)) {
bits_to_shift = first_byte[tb_size_in_bytes] >> (8 - first_bit);
first_byte[tb_size_in_bytes] = (first_byte[tb_size_in_bytes] << first_bit) | (bits_to_shift_last_loop);
tb_size_in_bytes -= 1;
bits_to_shift_last_loop = bits_to_shift;
}
first_byte[0] = (first_byte[0] << first_bit) | (bits_to_shift_last_loop);
}
((struct rlc_am_rx_pdu_management *) (tb->data))->first_byte = first_byte;
data = (struct rlc_am_pdu_header *) (first_byte);
if ((data->byte1 & RLC_DC_MASK) == RLC_DC_DATA_PDU) {
#ifdef DEBUG_DEMUX
msg ("[RLC_AM][RB %d][DEMUX] RX AMD PDU Frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
for (index=0; index < rlcP->pdu_size ; index++) {
msg("%02X.",first_byte[index]);
}
msg("\n");
#endif
rlcP->stat_rx_data_pdu += 1;
if (traffic_typeP & RLC_AM_TRAFFIC_ALLOWED_FOR_DATA) {
((struct rlc_am_rx_pdu_management *) (tb->data))->piggybacked_processed = 0;
receiver_retransmission_management (rlcP, tb, data);
// pdu is data;
data_received = 1;
} else {
#ifdef DEBUG_DEMUX
msg ("[RLC_AM][RB %d][DEMUX] DROP DATA TB NOT ALLOWED IN PROTOCOL STATE 0x%02X\n", rlcP->rb_id, rlcP->protocol_state);
#endif
free_mem_block (tb);
}
} else {
rlcP->stat_rx_control_pdu += 1;
control = (struct rlc_am_reset_header *) first_byte;
if ((control->byte1 & RLC_PDU_TYPE_MASK) == RLC_PDU_TYPE_STATUS) {
if (traffic_typeP & RLC_AM_TRAFFIC_ALLOWED_FOR_DATA) {
#ifdef DEBUG_DEMUX
msg ("[RLC_AM][RB %d][DEMUX] RX STATUS PDU ON DTCH Frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlc_am_process_status_info (rlcP, &(control->byte1));
}
} else if ((control->byte1 & RLC_PDU_TYPE_MASK) == RLC_PDU_TYPE_RESET) {
#ifdef DEBUG_DEMUX_RESET
msg ("[RLC_AM][RB %d][DEMUX] RX RESET PDU Frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
process_reset (tb, control, rlcP);
} else if ((control->byte1 & RLC_PDU_TYPE_MASK) == RLC_PDU_TYPE_RESET_ACK) {
#ifdef DEBUG_DEMUX_RESET
msg ("[RLC_AM][RB %d][DEMUX] RX RESET ACK PDU Frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
process_reset_ack (tb, control, rlcP);
#ifndef USER_MODE
rlc_info_t Rlc_info_am_config1;
Rlc_info_am_config1.rlc_mode=RLC_AM;
Rlc_info_am_config1.rlc.rlc_am_info.sdu_discard_mode = SDU_DISCARD_MODE_RESET;//SDU_DISCARD_MODE_MAX_DAT_RETRANSMISSION;//
Rlc_info_am_config1.rlc.rlc_am_info.timer_poll = 0;
Rlc_info_am_config1.rlc.rlc_am_info.timer_poll_prohibit = 0;
Rlc_info_am_config1.rlc.rlc_am_info.timer_discard = 500;
Rlc_info_am_config1.rlc.rlc_am_info.timer_poll_periodic = 0;
Rlc_info_am_config1.rlc.rlc_am_info.timer_status_prohibit = 250;
Rlc_info_am_config1.rlc.rlc_am_info.timer_status_periodic = 500;
Rlc_info_am_config1.rlc.rlc_am_info.timer_rst = 250;//250
Rlc_info_am_config1.rlc.rlc_am_info.max_rst = 500;//500
Rlc_info_am_config1.rlc.rlc_am_info.timer_mrw = 0;
Rlc_info_am_config1.rlc.rlc_am_info.pdu_size = 32; //416; // in bits
//Rlc_info_am.rlc.rlc_am_info.in_sequence_delivery = 1;//boolean
Rlc_info_am_config1.rlc.rlc_am_info.max_dat = 32;//127;
Rlc_info_am_config1.rlc.rlc_am_info.poll_pdu = 0;
Rlc_info_am_config1.rlc.rlc_am_info.poll_sdu = 0;//256;/
Rlc_info_am_config1.rlc.rlc_am_info.poll_window = 80;//128
Rlc_info_am_config1.rlc.rlc_am_info.tx_window_size = 512;
Rlc_info_am_config1.rlc.rlc_am_info.rx_window_size = 512;
Rlc_info_am_config1.rlc.rlc_am_info.max_mrw = 8;
Rlc_info_am_config1.rlc.rlc_am_info.last_transmission_pdu_poll_trigger = 1;//boolean
Rlc_info_am_config1.rlc.rlc_am_info.last_retransmission_pdu_poll_trigger = 1;//boolean
Rlc_info_am_config1.rlc.rlc_am_info.send_mrw = 1;//boolean*
Mac_rlc_xface->rrc_rlc_config_req(0,CONFIG_ACTION_REMOVE,rlcP->rb_id,RADIO_ACCESS_BEARER,Rlc_info_am_config1);
Mac_rlc_xface->rrc_rlc_config_req(0,CONFIG_ACTION_ADD,rlcP->rb_id,RADIO_ACCESS_BEARER,Rlc_info_am_config1);
#endif
}
free_mem_block (tb);
}
} else {
#ifdef BENCH_QOS_L2
fprintf (bench_l2, "[PDU RX ERROR] FRAME %d RLC-AM %p\n", Mac_rlc_xface->frame, rlcP);
#endif
#ifdef DEBUG_DEMUX
msg ("[RLC_AM][RB %d][DEMUX] RX PDU WITH ERROR INDICATION\n", rlcP->rb_id);
#endif
rlcP->stat_rx_error_pdu += 1;
free_mem_block (tb);
}
}
if ((data_received)) { //avoid call
if (traffic_typeP & RLC_AM_TRAFFIC_ALLOWED_FOR_DATA) {
if (rlcP->pdu_size <= 126) {
#ifdef DEBUG_DEMUX
msg("[RLC_AM][RB %d] Calling process_receiver_buffer_7\n",rlcP->rb_id);
#endif
process_receiver_buffer_7 (rlcP);
} else {
#ifdef DEBUG_DEMUX
msg("[RLC_AM][RB %d] Calling process_receiver_buffer_15\n",rlcP->rb_id);
#endif
process_receiver_buffer_15 (rlcP);
}
}
}
}
/*******************************************************************************
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
*******************************************************************************/
/***************************************************************************
rlc_am_demux_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_DEMUX_PROTO_EXTERN_H__
# define __RLC_AM_DEMUX_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "mac_primitives.h"
//-----------------------------------------------------------------------------
extern void rlc_am_demux_routing (struct rlc_am_entity *rlcP, unsigned int traffic_typeP, 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
*******************************************************************************/
/***************************************************************************
rlc_am_discard_notif_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_DISCARD_NOTIF_PROTO_EXTERN_H__
# define __RLC_AM_DISCARD_NOTIF_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "rlc_am_structs.h"
# include "rlc_am_constants.h"
# include "mem_block.h"
//-----------------------------------------------------------------------------
extern void rlc_am_discard_notify_mrw_ack_time_out (struct rlc_am_entity *rlcP, mem_block_t * discard_procedureP);
extern void rlc_am_discard_check_sdu_time_out (struct rlc_am_entity *rlcP);
extern void rlc_am_discard_notify_max_dat_pdu (struct rlc_am_entity *rlcP, mem_block_t * pduP);
# 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
*******************************************************************************/
/***************************************************************************
rlc_am_discard_rx_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_DISCARD_RX_PROTO_EXTERN_H__
# define __RLC_AM_DISCARD_RX_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "mem_block.h"
//-----------------------------------------------------------------------------
extern void rlc_am_received_sufi_ack_check_discard_procedures (struct rlc_am_entity *rlcP);
extern void rlc_am_free_discard_procedure (mem_block_t * mb_current_procedureP);
extern inline void rlc_am_discard_free_receiver_buffer (struct rlc_am_entity *rlcP, uint16_t sn_mrw_iP, uint8_t nlengthP);
extern uint8_t *retransmission_buffer_management_mrw (struct rlc_am_entity *rlcP, uint8_t * byte1P, uint8_t * byte_alignedP);
extern uint8_t *retransmission_buffer_management_mrw_ack (struct rlc_am_entity *rlcP, uint8_t * byte1P, uint8_t * byte_alignedP);
# 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
*******************************************************************************/
/***************************************************************************
rlc_am_discard_tx_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_DISCARD_TX_PROTO_EXTERN_H__
# define __RLC_AM_DISCARD_TX_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "rlc_am_structs.h"
# include "mem_block.h"
//-----------------------------------------------------------------------------
extern void rlc_am_schedule_procedure (struct rlc_am_entity *rlcP);
extern void rlc_am_process_sdu_discarded (struct rlc_am_entity *rlcP);
extern void rlc_am_sdu_discard_with_explicit_signalling_procedure_send_mrw_configured (struct rlc_am_entity *rlcP);
extern void rlc_am_sdu_discard_with_explicit_signalling_procedure_send_mrw_not_configured (struct rlc_am_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
*******************************************************************************/
# ifndef __RLC_AM_ERRNO_H__
# define __RLC_AM_ERRNO_H__
# endif
# define RLC_AM_OUT_OF_MEMORY_ERROR 1
# define RLC_AM_VT_S_OVERFLOW_ERROR 2
# define RLC_AM_RETRANS_REQ_PDU_NULL 3
# define RLC_AM_RETRANS_REQ_PDU_DONE_BEFORE 4
/*******************************************************************************
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
*******************************************************************************/
/***************************************************************************
rlc_am_fsm.c -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc_am_entity.h"
#include "rlc_am_constants.h"
#include "rlc_def.h"
#include "LAYER2/MAC/extern.h"
//-----------------------------------------------------------------------------
int
rlc_am_fsm_notify_event (struct rlc_am_entity* rlcP, uint8_t eventP)
{
//-----------------------------------------------------------------------------
switch (rlcP->protocol_state) {
//-------------------------------
// RLC_NULL_STATE
//-------------------------------
case RLC_NULL_STATE:
switch (eventP) {
case RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_NULL_STATE -> RLC_DATA_TRANSFER_READY_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
return 1;
break;
default:
msg ("[RLC_AM][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT %02X hex NOT EXPECTED FROM NULL_STATE frame %d\n", rlcP->rb_id, eventP, Mac_rlc_xface->frame);
return 0;
}
break;
//-------------------------------
// RLC_DATA_TRANSFER_READY_STATE
//-------------------------------
case RLC_DATA_TRANSFER_READY_STATE:
switch (eventP) {
case RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_DATA_TRANSFER_READY_STATE -> RLC_NULL_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_AM_RECEIVE_RESET_EVENT:
case RLC_AM_TRANSMIT_RESET_ACK_EVENT:
return 1;
break;
case RLC_AM_TRANSMIT_RESET_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_DATA_TRANSFER_READY_STATE -> RLC_RESET_PENDING_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_RESET_PENDING_STATE;
return 1;
break;
case RLC_AM_RECEIVE_CRLC_SUSPEND_REQ_EVENT:
case RLC_AM_TRANSMIT_CRLC_SUSPEND_CNF_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_DATA_TRANSFER_READY_STATE -> RLC_LOCAL_SUSPEND_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_LOCAL_SUSPEND_STATE;
return 1;
break;
default:
msg ("[RLC_AM][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT 0x%02X NOT EXPECTED FROM DATA_TRANSFER_READY_STATE frame %d\n", rlcP->rb_id, eventP,
Mac_rlc_xface->frame);
return 0;
}
break;
//-------------------------------
// RLC_RESET_PENDING_STATE
//-------------------------------
case RLC_RESET_PENDING_STATE:
switch (eventP) {
case RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_PENDING_STATE -> RLC_NULL_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_AM_RECEIVE_RESET_EVENT:
case RLC_AM_TRANSMIT_RESET_ACK_EVENT:
case RLC_AM_TRANSMIT_RESET_EVENT: // WARNING: THIS EVENT IS NOT IN SPECS BUT MAY BE AN OMISSION ????
return 1;
break;
case RLC_AM_RECEIVE_RESET_ACK_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_PENDING_STATE -> RLC_DATA_TRANSFER_READY_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
return 1;
break;
case RLC_AM_RECEIVE_CRLC_SUSPEND_REQ_EVENT:
case RLC_AM_TRANSMIT_CRLC_SUSPEND_CNF_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_PENDING_STATE -> RLC_RESET_AND_SUSPEND_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_RESET_AND_SUSPEND_STATE;
return 1;
break;
default:
msg ("[RLC_AM][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT 0x%02X NOT EXPECTED FROM RLC_RESET_PENDING_STATE frame %d\n", rlcP->rb_id, eventP,
Mac_rlc_xface->frame);
return 0;
}
break;
//-------------------------------
// RLC_RESET_AND_SUSPEND_STATE
//-------------------------------
case RLC_RESET_AND_SUSPEND_STATE:
switch (eventP) {
case RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_AND_SUSPEND_STATE -> RLC_NULL_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_AM_RECEIVE_RESET_ACK_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_AND_SUSPEND_STATE -> RLC_LOCAL_SUSPEND_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_LOCAL_SUSPEND_STATE;
return 1;
break;
case RLC_AM_RECEIVE_CRLC_RESUME_REQ_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_RESET_AND_SUSPEND_STATE -> RLC_RESET_PENDING_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_RESET_PENDING_STATE;
return 1;
break;
default:
msg ("[RLC_AM][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT 0x%02X NOT EXPECTED FROM RLC_RESET_AND_SUSPEND_STATE frame %d\n", rlcP->rb_id, eventP,
Mac_rlc_xface->frame);
return 0;
}
break;
//-------------------------------
// RLC_LOCAL_SUSPEND_STATE
//-------------------------------
case RLC_LOCAL_SUSPEND_STATE:
switch (eventP) {
case RLC_AM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_LOCAL_SUSPEND_STATE -> RLC_NULL_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_NULL_STATE;
return 1;
break;
case RLC_AM_RECEIVE_CRLC_RESUME_REQ_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_LOCAL_SUSPEND_STATE -> RLC_DATA_TRANSFER_READY_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
return 1;
break;
case RLC_AM_TRANSMIT_RESET_EVENT:
#ifdef DEBUG_RLC_AM_FSM
msg ("[RLC_AM][RB %d][FSM] RLC_LOCAL_SUSPEND_STATE -> RLC_RESET_AND_SUSPEND_STATE frame %d\n", rlcP->rb_id, Mac_rlc_xface->frame);
#endif
rlcP->protocol_state = RLC_RESET_AND_SUSPEND_STATE;
return 1;
break;
default:
msg ("[RLC_AM][RB %d][FSM] WARNING PROTOCOL ERROR - EVENT 0x%02X NOT EXPECTED FROM RLC_LOCAL_SUSPEND_STATE frame %d\n", rlcP->rb_id, eventP,
Mac_rlc_xface->frame);
return 0;
}
break;
default:
msg ("[RLC_AM][RB %d][FSM] ERROR UNKNOWN STATE %d\n", rlcP->rb_id, 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
*******************************************************************************/
/***************************************************************************
rlc_am_fsm_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_FSM_PROTO_EXTERN_H__
# define __RLC_AM_FSM_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "platform_types.h"
# include "rlc_am_entity.h"
//-----------------------------------------------------------------------------
extern int rlc_am_fsm_notify_event (struct rlc_am_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
*******************************************************************************/
/***************************************************************************
rlc_am_mac_status.c -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc_am_entity.h"
#include "rlc_am_timers_proto_extern.h"
#include "rlc_am_discard_notif_proto_extern.h"
#include "rlc_am_reset_proto_extern.h"
#include "rlc_am_fsm_proto_extern.h"
#include "umts_timer_proto_extern.h"
//-----------------------------------------------------------------------------
void
rlc_am_status_report_from_mac (void* rlcP, uint16_t eventP)
{
//-----------------------------------------------------------------------------
struct rlc_am_entity* rlc = (struct rlc_am_entity*) rlcP;
//----------------------------------------
// STATUS
//----------------------------------------
if ((eventP & RLC_AM_FIRST_STATUS_PDU_TYPE) == RLC_AM_FIRST_STATUS_PDU_TYPE) {
#ifdef DEBUG_RLC_AM_MAC_STATUS
msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_FIRST_STATUS_PDU_TYPE\n", rlcP);
#endif
return;
}
//----------------------------------------
// DISCARD
//----------------------------------------
if ((eventP & RLC_AM_MRW_STATUS_PDU_TYPE)) {
#ifdef DEBUG_RLC_AM_MAC_STATUS
msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_MRW_STATUS_PDU_TYPE\n", rlcP);
#endif
// rearm the timer
if (!(rlc->timer_mrw) && (rlc->discard_procedures.head)) {
rlc->timer_mrw = umts_add_timer_list_up (&rlc->rlc_am_timer_list, rlc_am_discard_notify_mrw_ack_time_out, rlc,
rlc->discard_procedures.head, (uint32_t) rlc->timer_mrw_init, *rlc->frame_tick_milliseconds);
}
return;
}
//----------------------------------------
// RESET
//----------------------------------------
if ((eventP & RLC_AM_RESET_PDU_TYPE)) {
#ifdef DEBUG_RESET
msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_RESET_PDU_TYPE SENT ARMING RESET TIMER %d frames frame %d\n", rlcP, (uint32_t) rlc->timer_rst_init,
*rlc->frame_tick_milliseconds);
#endif
rlc->timer_rst = umts_add_timer_list_up (&rlc->rlc_am_timer_list, rlc_am_reset_time_out, rlcP, NULL, (uint32_t) rlc->timer_rst_init,
*rlc->frame_tick_milliseconds);
return;
}
//----------------------------------------
// RESET ACK
//----------------------------------------
if ((eventP & RLC_AM_RESET_ACK_PDU_TYPE)) {
#ifdef DEBUG_RLC_AM_MAC_STATUS
msg ("[RLC_AM %p][MAC_STATUS] EVENT RLC_AM_RESET_ACK_PDU_TYPE\n", rlcP);
#endif
rlc_am_fsm_notify_event (rlc, RLC_AM_TRANSMIT_RESET_ACK_EVENT);
return;
}
}
/*******************************************************************************
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
*******************************************************************************/
/***************************************************************************
rlc_am_mac_status_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_MAC_STATUS_PROTO_EXTERN_H__
# define __RLC_AM_MAC_STATUS_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "platform_types.h"
//-----------------------------------------------------------------------------
extern void rlc_am_status_report_from_mac (void *rlcP, uint16_t eventP);
# 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
*******************************************************************************/
/***************************************************************************
rlc_am_mux_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_MUX_PROTO_EXTERN_H__
# define __RLC_AM_MUX_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "rlc_am_structs.h"
# include "rlc_am_constants.h"
//-----------------------------------------------------------------------------
# ifdef NODE_MT
extern void rlc_am_mux_ue (struct rlc_am_entity *rlcP, unsigned int traffic_typeP);
# endif
# ifdef NODE_RG
extern void rlc_am_mux_rg (struct rlc_am_entity *rlcP, unsigned int traffic_typeP);
# endif
# 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
*******************************************************************************/
/***************************************************************************
rlc_am_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_PROTO_EXTERN_H__
# define __RLC_AM_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "platform_types.h"
# include "platform_constants.h"
# include "list.h"
# include "rlc_am_entity.h"
# include "mac_primitives.h"
# include "mem_block.h"
//-----------------------------------------------------------------------------
extern void display_protocol_vars_rlc_am (struct rlc_am_entity *rlcP);
extern uint32_t rlc_am_get_buffer_occupancy (struct rlc_am_entity *rlcP, uint8_t logical_channelsP);
extern void init_rlc_am (struct rlc_am_entity *rlcP);
extern void *rlc_am_tx (void *argP);
extern void rlc_am_rx (void *argP, struct mac_data_ind data_indP);
extern void *init_code_rlc_am (void *t);
extern void send_rlc_am_control_primitive (struct rlc_am_entity *rlcP, module_id_t module_idP, mem_block_t * cprimitiveP);
extern void rlc_am_send_mac_data_request (void *macP, uint8_t logical_channel_identityP, list_t * pduP);
extern struct mac_status_resp rlc_am_mac_status_indication (void *rlcP, uint16_t no_tbP, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);
extern struct mac_status_resp rlc_am_mac_status_indication_on_first_channel (void *rlcP, uint16_t no_tbP, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);
extern struct mac_status_resp rlc_am_mac_status_indication_on_second_channel (void *rlcP, uint16_t no_tbP, uint16_t tb_sizeP, struct mac_status_ind tx_statusP);
extern struct mac_data_req rlc_am_mac_data_request (void *rlcP);
extern struct mac_data_req rlc_am_mac_data_request_on_first_channel (void *rlcP);
extern struct mac_data_req rlc_am_mac_data_request_on_second_channel (void *rlcP);
extern void rlc_am_mac_data_indication (void *rlcP, struct mac_data_ind data_indP);
extern void rlc_am_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
*******************************************************************************/
/***************************************************************************
rlc_am_reassembly.c -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#define RLC_AM_C
#include "rtos_header.h"
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "rlc.h"
#include "rlc_am_entity.h"
#include "rlc_am_structs.h"
#include "rlc_primitives.h"
#include "rlc_am_constants.h"
#include "list.h"
#include "LAYER2/MAC/extern.h"
#define DEBUG_RLC_AM_SEND_SDU
//#define DEBUG_REASSEMBLY
//#define DEBUG_RLC_AM_DISPLAY_ASCII_DATA
//-----------------------------------------------------------------------------
void
reassembly (uint8_t* srcP, uint16_t lengthP, struct rlc_am_entity* rlcP)
{
//-----------------------------------------------------------------------------
int sdu_max_size_allowed;
#ifdef DEBUG_RLC_AM_DISPLAY_ASCII_DATA
int index;
#endif
#ifdef DEBUG_REASSEMBLY
msg ("[RLC_AM][RB %d][REASSEMBLY] reassembly() %d bytes\n", rlcP->rb_id, lengthP);
#endif
if ((rlcP->data_plane)) {
sdu_max_size_allowed = RLC_SDU_MAX_SIZE_DATA_PLANE;
} else {
sdu_max_size_allowed = RLC_SDU_MAX_SIZE_CONTROL_PLANE;
}
if (rlcP->output_sdu_in_construction == NULL) {
rlcP->output_sdu_in_construction = get_free_mem_block (sdu_max_size_allowed);
rlcP->output_sdu_size_to_write = 0;
}
#ifdef DEBUG_REASSEMBLY
msg ("[RLC_AM][RB %d][REASSEMBLY] reassembly() %d bytes sdu_max_size allowed %d\n", rlcP->rb_id, lengthP, sdu_max_size_allowed);
#endif
if ((rlcP->output_sdu_in_construction)) {
#ifdef DEBUG_RLC_AM_DISPLAY_ASCII_DATA
msg ("[RLC_AM][RB %d][REASSEMBLY] DATA :", rlcP->rb_id);
for (index = 0; index < lengthP; index++) {
//msg ("%c", srcP[index]);
msg ("%02X.", srcP[index]);
}
msg ("\n");
#endif
// OOOPS
if ((lengthP + rlcP->output_sdu_size_to_write) <= sdu_max_size_allowed) {
memcpy (&rlcP->output_sdu_in_construction->data[rlcP->output_sdu_size_to_write], srcP, lengthP);
rlcP->output_sdu_size_to_write += lengthP;
} else {
rlcP->output_sdu_size_to_write = 0;
#ifdef DEBUG_REASSEMBLY
msg ("[RLC_AM %p][REASSEMBLY] ERROR SDU IN CONSTRUCTION TOO BIG %d Bytes MAX SIZE ALLOWED %d\n", rlcP, lengthP + rlcP->output_sdu_size_to_write,
sdu_max_size_allowed);
#endif
}
}
#ifdef DEBUG_REASSEMBLY
else {
msg ("[RLC_AM %p][REASSEMBLY] ERROR OUTPUT SDU IS NULL\n", rlcP);
}
#endif
}
//-----------------------------------------------------------------------------
void
send_sdu (struct rlc_am_entity* rlcP)
{
//-----------------------------------------------------------------------------
if ((rlcP->output_sdu_in_construction) && (rlcP->output_sdu_size_to_write)) {
#ifdef DEBUG_RLC_AM_SEND_SDU
msg ("[RLC_AM][RB %d][SEND_SDU] send_SDU() %d bytes\n", rlcP->rb_id, rlcP->output_sdu_size_to_write);
#endif
#ifdef BENCH_QOS_L2
fprintf (bench_l2, "[SDU DELIVERY] FRAME %d SIZE %d RB %d RLC-AM %p\n", Mac_rlc_xface->frame, rlcP->output_sdu_size_to_write, rlcP->rb_id, rlcP);
#endif
rlc_data_ind (rlcP->module_id, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction, rlcP->data_plane);
rlcP->output_sdu_in_construction = NULL;
rlcP->output_sdu_size_to_write = 0;
rlcP->stat_rx_sdu += 1;
}
}
/*******************************************************************************
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
*******************************************************************************/
/***************************************************************************
rlc_am_reassembly_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_REASSEMBLY_PROTO_EXTERN_H__
# define __RLC_AM_REASSEMBLY_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
//-----------------------------------------------------------------------------
extern void reassembly (uint8_t * srcP, uint16_t lengthP, struct rlc_am_entity *rlcP);
extern void send_sdu (struct rlc_am_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
*******************************************************************************/
/***************************************************************************
rlc_am_receiver_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_RECEIVER_PROTO_EXTERN_H__
# define __RLC_AM_RECEIVER_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "rlc_am_structs.h"
# include "mem_block.h"
//-----------------------------------------------------------------------------
extern void receiver_retransmission_management (struct rlc_am_entity *rlcP, mem_block_t * pduP, struct rlc_am_pdu_header *rlc_headerP);
extern void free_receiver_buffer (struct rlc_am_entity *rlcP, uint16_t indexP);
extern void insert_into_receiver_buffer (struct rlc_am_entity *rlcP, uint16_t indexP, mem_block_t * pduP);
extern void process_receiver_buffer_15 (struct rlc_am_entity *rlcP);
extern void process_receiver_buffer_7 (struct rlc_am_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
*******************************************************************************/
/***************************************************************************
rlc_am_reset_proto_extern.h -
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
# ifndef __RLC_AM_RESET_PROTO_EXTERN_H__
# define __RLC_AM_RESET_PROTO_EXTERN_H__
//-----------------------------------------------------------------------------
# include "rlc_am_entity.h"
# include "rlc_am_structs.h"
//-----------------------------------------------------------------------------
extern void rlc_am_reset_time_out (struct rlc_am_entity *rlcP, mem_block_t * not_usedP);
extern void send_reset_ack_pdu (uint8_t rsnP, struct rlc_am_entity *rlcP);
extern void send_reset_pdu (struct rlc_am_entity *rlcP);
extern void reset_rlc_am (struct rlc_am_entity *rlcP);
extern void process_reset_ack (mem_block_t * pduP, struct rlc_am_reset_header *controlP, struct rlc_am_entity *rlcP);
extern void process_reset (mem_block_t * pduP, struct rlc_am_reset_header *controlP, struct rlc_am_entity *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.
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