Commit 0bd3c9ec authored by Lionel Gauthier's avatar Lionel Gauthier

Old rev code


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7371 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e1e61893
This diff is collapsed.
This diff is collapsed.
/*
pdcp.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PDCP_H__
# define __PDCP_H__
//-----------------------------------------------------------------------------
# ifdef PDCP_C
# define private_pdcp(x) x
# define protected_pdcp(x) x
# define public_pdcp(x) x
# else
# define private_pdcp(x)
# define public_pdcp(x) extern x
# ifdef PDCP_FIFO_C
# define protected_pdcp(x) extern x
# else
# define protected_pdcp(x)
# endif
# endif
# ifdef PDCP_FIFO_C
# define private_pdcp_fifo(x) x
# define protected_pdcp_fifo(x) x
# define public_pdcp_fifo(x) x
# else
# define private_pdcp_fifo(x)
# define public_pdcp_fifo(x) extern x
# ifdef PDCP_C
# define protected_pdcp_fifo(x) extern x
# else
# define protected_pdcp_fifo(x)
# endif
# endif
//-----------------------------------------------------------------------------
#ifndef NON_ACCESS_STRATUM
//#include "rtos_header.h"
//#include "openair_defs.h"
//#include "platform_types.h"
//#include "platform_constants.h"
#include "UTIL/MEM/mem_block.h"
#include "UTIL/LISTS/list.h"
#include "COMMON/mac_rrc_primitives.h"
#endif //NON_ACCESS_STRATUM
//-----------------------------------------------------------------------------
public_pdcp(unsigned int Pdcp_stats_tx[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_tx_bytes[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_tx_bytes_last[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_tx_rate[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_rx[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_rx_bytes[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_rx_bytes_last[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(unsigned int Pdcp_stats_rx_rate[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MAX]);
public_pdcp(void pdcp_data_req (module_id_t, rb_id_t, sdu_size_t, char*);)
public_pdcp(void pdcp_data_ind (module_id_t, rb_id_t, sdu_size_t, mem_block_t*);)
public_pdcp(void pdcp_config_req (module_id_t, rb_id_t);)
public_pdcp(void pdcp_config_release (module_id_t, rb_id_t);)
public_pdcp(void pdcp_run (void);)
public_pdcp(int pdcp_module_init ();)
public_pdcp(void pdcp_module_cleanup ();)
public_pdcp(void pdcp_layer_init ();)
public_pdcp(void pdcp_layer_cleanup ();)
#define PDCP2NW_DRIVER_FIFO 21
#define NW_DRIVER2PDCP_FIFO 22
protected_pdcp_fifo(int pdcp_fifo_flush_sdus ();)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes ();)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus();)
//-----------------------------------------------------------------------------
typedef struct pdcp_data_req_header_t {
rb_id_t rb_id;
sdu_size_t data_size;
int inst;
} pdcp_data_req_header_t;
typedef struct pdcp_data_ind_header_t {
rb_id_t rb_id;
sdu_size_t data_size;
int inst;
} pdcp_data_ind_header_t;
typedef struct pdcp_t {
char allocation;
// here ROHC variables for header compression/decompression
} pdcp_t;
protected_pdcp(signed int pdcp_2_nas_irq;)
protected_pdcp(pdcp_t pdcp_array[MAX_MODULES][MAX_RAB];)
protected_pdcp(sdu_size_t pdcp_output_sdu_bytes_to_write;)
protected_pdcp(sdu_size_t pdcp_output_header_bytes_to_write;)
protected_pdcp(list_t pdcp_sdu_list;)
protected_pdcp(int pdcp_sent_a_sdu;)
protected_pdcp(pdcp_data_req_header_t pdcp_input_header;)
protected_pdcp(char pdcp_input_sdu_buffer[MAX_IP_PACKET_SIZE];)
protected_pdcp(sdu_size_t pdcp_input_index_header;)
protected_pdcp(sdu_size_t pdcp_input_sdu_size_read;)
protected_pdcp(sdu_size_t pdcp_input_sdu_remaining_size_to_read;)
#endif
/***************************************************************************
pdcp_control_primitives.c
-------------------
begin : Mon Dec 10 2001
copyright : (C) 2001 by EURECOM
email : Lionel.Gauthier@eurecom.fr
-------------------
description
This file contains the functions used for configuration of pdcp
***************************************************************************/
#include "rtos_header.h"
#include "platform.h"
#include "protocol_vars_extern.h"
#include "print.h"
//-----------------------------------------------------------------------------
#include "rlc.h"
#include "pdcp.h"
#include "debug_l2.h"
//-----------------------------------------------------------------------------
void
configure_pdcp_req (struct pdcp_entity *pdcpP, void *rlcP, uint8_t rlc_sap_typeP, uint8_t header_compression_typeP)
{
//-----------------------------------------------------------------------------
mem_block *mb;
mb = get_free_mem_block (sizeof (struct cpdcp_primitive));
((struct cpdcp_primitive *) mb->data)->type = CPDCP_CONFIG_REQ;
((struct cpdcp_primitive *) mb->data)->primitive.config_req.rlc_sap = rlcP;
((struct cpdcp_primitive *) mb->data)->primitive.config_req.rlc_type_sap = rlc_sap_typeP;
((struct cpdcp_primitive *) mb->data)->primitive.config_req.header_compression_type = header_compression_typeP;
send_pdcp_control_primitive (pdcpP, mb);
}
/***************************************************************************
pdcp_control_primitives_proto_extern.h
-------------------
begin : Mon Dec 10 2001
copyright : (C) 2001 by EURECOM
email : Lionel.Gauthier@eurecom.fr
-------------------
description
This file contains the prototypes of functions used for configuration of pdcp
***************************************************************************/
#ifndef PDCP_CONTROL_PRIMITIVES_PROTO_EXTERN_H
# define PDCP_CONTROL_PRIMITIVES_PROTO_EXTERN_H
# include "pdcp.h"
void rrc_configure_pdcp (struct pdcp_entity *pdcpP, void *rlcP, uint8_t rlc_sap_typeP, uint8_t header_compression_typeP);
#endif
/*
pdcp_entity.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PDCP_ENTITY_H__
# define __PDCP_ENTITY_H__
# include "list.h"
struct pdcp_entity {
unsigned short id; // for resource management purpose
unsigned char allocation;
void *rlc_sap;
//-----------------------------
// C-SAP
//-----------------------------
list c_sap;
//-----------------------------
// tranmission
//-----------------------------
list input_sdu_list;
void *rlc;
//-----------------------------
// receiver
//-----------------------------
//struct list output_sdu_list;
#ifdef ROHC
void (*pdcp_process_input_sdus) (struct pdcp_entity *pdcpP, uint16_t data_sizeP, mem_block * sduP);
#else
void (*pdcp_process_input_sdus) (struct pdcp_entity *pdcpP);
#endif
unsigned char rb_id; // for traces
unsigned char rlc_type_sap; // am, um, tr
struct rb_dispatcher *rb_dispatch;
};
#endif
This diff is collapsed.
/*
pdcp_primitives.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PDCP_PRIMITIVES_H__
# define __PDCP_PRIMITIVES_H__
# include "platform.h"
//----------------------------------------------------------
// primitives
//----------------------------------------------------------
# define PDCP_DATA_REQ 0x01
# define PDCP_DATA_IND 0x02
//----------------------------------------------------------
// control primitives
//----------------------------------------------------------
# define CPDCP_CONFIG_REQ 0x04
# define CPDCP_RELEASE_REQ 0x08
# define CPDCP_SN_REQ 0x10
# define CPDCP_RELOC_REQ 0x20
# define CPDCP_RELOC_CNF 0x40
//----------------------------------------------------------
// primitives definition
//----------------------------------------------------------
struct pdcp_data_req {
uint16_t rb_id;
uint16_t data_size;
};
struct pdcp_data_ind {
uint16_t rb_id;
uint16_t data_size;
};
//----------------------------------------------------------
// control primitives definition
//----------------------------------------------------------
// TO DO
struct cpdcp_config_req {
void *rlc_sap;
uint8_t rlc_type_sap; // am, um, tr
uint8_t header_compression_type;
};
struct cpdcp_release_req {
void *rlc_sap;
};
struct cpdcp_sn_req {
uint32_t sn;
};
struct cpdcp_relloc_req {
uint32_t receive_sn;
};
struct cpdcp_relloc_conf {
uint32_t receive_sn;
uint32_t send_sn;
};
struct cpdcp_primitive {
uint8_t type;
union {
struct cpdcp_config_req config_req;
struct cpdcp_release_req release_req;
struct cpdcp_sn_req sn_req;
struct cpdcp_relloc_req relloc_req;
struct cpdcp_relloc_conf relloc_conf;
} primitive;
};
#endif
/*
pdcp_proto_extern.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __PDCP_PROTO_EXTERN_H__
# define __PDCP_PROTO_EXTERN_H__
//# include "pdcp_entity.h"
//# include "rb_mux.h"
# include "mem_block.h"
#ifdef ROHC
extern void pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t * sduP);
extern void pdcp_data_req (struct pdcp_entity *pdcpP, mem_block * sduP);
extern void send_pdcp_control_primitive (struct pdcp_entity *pdcpP, mem_block * cprimitiveP);
extern void control_pdcp (struct pdcp_entity *pdcpP);
extern void pdcp_process_input_sdus_high(struct pdcp_entity *pdcpP);
extern void pdcp_process_input_sdus_am (struct pdcp_entity *pdcpP, uint16_t data_sizeP, mem_block * sduP);
extern void pdcp_process_output_sdus (struct pdcp_entity *pdcpP, mem_block * sduP, uint8_t rb_idP);
extern void pdcp_process_output_sdus_high (struct pdcp_entity *pdcpP, mem_block * sduP, uint16_t data_sizeP, uint16_t rb_idP);
extern void pdcp_process_input_sdus_um (struct pdcp_entity *pdcpP, uint16_t data_sizeP, mem_block * sduP);
extern void pdcp_process_input_sdus_tr (struct pdcp_entity *pdcpP, uint16_t data_sizeP, mem_block * sduP);
extern void init_pdcp (struct pdcp_entity *pdcpP, struct rb_dispatcher *rbP, uint8_t rb_idP);
extern void *pdcp_tx (struct pdcp_entity *pdcpP, uint16_t data_sizeP, mem_block * sduP);
extern int reception_from_rohc_mt(void);
extern int reception_from_rohc_bs(void);
#else
extern void pdcp_data_ind (module_id_t module_idP, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t * sduP);
extern void pdcp_data_req (struct pdcp_entity *pdcpP, mem_block * sduP);
extern void send_pdcp_control_primitive (struct pdcp_entity *pdcpP, mem_block * cprimitiveP);
extern void control_pdcp (struct pdcp_entity *pdcpP);
extern void pdcp_process_input_sdus_am (struct pdcp_entity *pdcpP);
extern void pdcp_process_output_sdus (struct pdcp_entity *pdcpP, mem_block * sduP, uint8_t rb_idP);
extern void pdcp_process_input_sdus_um (struct pdcp_entity *pdcpP);
extern void pdcp_process_input_sdus_tr (struct pdcp_entity *pdcpP);
extern void init_pdcp (struct pdcp_entity *pdcpP, struct rb_dispatcher *rbP, uint8_t rb_idP);
extern void *pdcp_tx (void *argP);
#endif
#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