Commit 0b0fabaa authored by Cedric Roux's avatar Cedric Roux

- Fix recent issues with ping in pre-ci

- Corrected PDCP layer to manage more than one UE correctly
	* use eNB_id, UE_id as identifiers for connections
	* splitted UE/eNB data
	* Use the real rb_id for index in array (instead of the one used for communication with RLC/IP driver

pre-ci OK, except for the random issue related to Msg3

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4730 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 068807e1
......@@ -23,7 +23,8 @@
#endif
extern unsigned char pdcp_data_req (module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rab_id, u32 muiP, u32 confirmP, sdu_size_t sdu_buffer_size, unsigned char* sdu_buffer, u8 is_data_pdu);
extern unsigned char pdcp_data_req(u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, rb_id_t rb_id, u32 muiP, u32 confirmP, \
sdu_size_t sdu_buffer_size, unsigned char* sdu_buffer, u8 mode);
inline NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr,
......@@ -60,7 +61,8 @@ NwGtpv1uRcT gtpv1u_process_stack_req(
GTPU_DEBUG("Received T-PDU from gtpv1u stack %u with size %d",
pUlpApi->apiInfo.recvMsgInfo.teid, buffer_len);
pdcp_data_req(0, // module_id,
pdcp_data_req(0, // eNB_idx,
0, // UE idx
0, // frame
1, // enb flag
5, // rb id
......
......@@ -24,6 +24,8 @@ typedef struct RrcDcchDataReq_s {
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
uint8_t ue_index;
uint8_t eNB_index;
} RrcDcchDataReq;
typedef struct RrcDcchDataInd_s {
......@@ -32,6 +34,7 @@ typedef struct RrcDcchDataInd_s {
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t ue_index;
uint8_t eNB_index;
} RrcDcchDataInd;
#endif /* PDCP_MESSAGES_TYPES_H_ */
......@@ -52,20 +52,21 @@
# define MAX_RG 2
#endif
# define MAX_MANAGED_RG_PER_MOBILE 2
# define DEFAULT_RAB_ID 3
# define NB_RB_MAX 11
# define NB_RAB_MAX 8 // 4
# define RAB_SHIFT1 9
# define RAB_SHIFT2 3
# define RAB_OFFSET 0x0007
# define RAB_OFFSET1 0x7E00
# define RAB_OFFSET2 0x01F8
# define DIR_OFFSET 0x8000
# define DIR_SHIFT 15
# define CH_OFFSET 0x0004
# define CH_SHIFT 2
#define MAX_MANAGED_RG_PER_MOBILE 2
#define DEFAULT_RAB_ID 3
#define NB_RB_MAX 11
#define NB_RAB_MAX 8
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
#define RAB_OFFSET 0x0007
#define RAB_OFFSET1 0x7E00
#define RAB_OFFSET2 0x01F8
#define DIR_OFFSET 0x8000
#define DIR_SHIFT 15
#define CH_OFFSET 0x0004
#define CH_SHIFT 2
#ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
......
......@@ -69,6 +69,8 @@
# include "intertask_interface.h"
#endif
#include "assertions.h"
#define DEBUG_HEADER_PARSING 1
#define ENABLE_MAC_PAYLOAD_DEBUG
......@@ -209,6 +211,8 @@ u32 ue_get_SR(u8 Mod_id,u32 frame,u8 eNB_id,u16 rnti, u8 subframe) {
int T=0;
// int sfn=0;
DevCheck(Mod_id < NB_UE_INST, Mod_id, NB_UE_INST, 0);
// determin the measurement gap
LOG_D(MAC,"[UE %d][SR %x] Frame %d subframe %d PHY asks for SR (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
Mod_id,rnti,frame,subframe,
......@@ -1011,8 +1015,9 @@ void ue_get_sdu(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index,u8 *ulsch_buffer,u
u8 dcch_header_len_tmp=0, dtch_header_len_tmp=0;
u8 bsr_header_len=0, bsr_ce_len=0, bsr_len=0;
u8 phr_header_len=0, phr_ce_len=0,phr_len=0;
u16 sdu_lengths[8];
u8 sdu_lcids[8],payload_offset=0,num_sdus=0;
u16 sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
u8 sdu_lcids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
u8 payload_offset=0,num_sdus=0;
u8 ulsch_buff[MAX_ULSCH_PAYLOAD_BYTES];
u16 sdu_length_total=0;
BSR_SHORT bsr_short;
......
This diff is collapsed.
......@@ -237,7 +237,8 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None
* @ingroup _pdcp
*/
public_pdcp(BOOL pdcp_data_req (module_id_t module_id, u32_t frame, u8_t eNB_flag, rb_id_t rab_id, u32 muiP, u32 confirmP, sdu_size_t sdu_buffer_size, unsigned char* sdu_buffer, u8 mode);)
public_pdcp(BOOL pdcp_data_req(u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, rb_id_t rb_id, u32 muiP, u32 confirmP, \
sdu_size_t sdu_buffer_size, unsigned char* sdu_buffer, u8 mode));
/*! \fn BOOL pdcp_data_ind(module_id_t, u32_t, u8_t, u8_t, rb_id_t, sdu_size_t, unsigned char*)
* \brief This functions handles data transfer indications coming from RLC
......@@ -253,8 +254,8 @@ public_pdcp(BOOL pdcp_data_req (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None
* @ingroup _pdcp
*/
public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t rab_id, sdu_size_t sdu_buffer_size, \
mem_block_t* sdu_buffer, u8 is_data_plane);)
public_pdcp(BOOL pdcp_data_ind(u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t rb_id, sdu_size_t sdu_buffer_size,
mem_block_t* sdu_buffer, u8 is_data_plane));
#endif // PDCP_UNIT_TEST
/*! \fn void rrc_pdcp_config_req(module_id_t, rb_id_t,u8)
......@@ -268,8 +269,7 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None
* @ingroup _pdcp
*/
public_pdcp(void rrc_pdcp_config_req (module_id_t module_id, u32 frame, u8_t eNB_flag, u32 action, rb_id_t rab_id, u8 security_mode);)
public_pdcp(void rrc_pdcp_config_req (u8 eNB_id, u8 UE_id, u32 frame, u8_t eNB_flag, u32 action, rb_id_t rb_id, u8 security_mode);)
/*! \fn bool rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag, SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
* \brief Function for RRC to configure a Radio Bearer.
......@@ -287,7 +287,7 @@ public_pdcp(void rrc_pdcp_config_req (module_id_t module_id, u32 frame, u8_t eNB
* \return A status about the processing, OK or error code.
*/
public_pdcp(
BOOL rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag, u32_t index,
BOOL rrc_pdcp_config_asn1_req (u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag,
SRB_ToAddModList_t* srb2add_list,
DRB_ToAddModList_t* drb2add_list,
DRB_ToReleaseList_t* drb2release_list,
......@@ -316,13 +316,13 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t module_id, u32_t frame, u8_t eNB_flag
* \param[in] kUPenc User-Plane encryption key
* \return A status about the processing, OK or error code.
*/
public_pdcp(BOOL pdcp_config_req_asn1 (module_id_t module_id, u32 frame, u8_t eNB_flag, u16 index,
rlc_mode_t rlc_mode, u32 action, u16 lc_id,u16 mch_id, rb_id_t rb_id,
u8 rb_sn, u8 rb_report, u16 header_compression_profile,
u8 security_mode,
u8 *kRRCenc,
u8 *kRRCint,
u8 *kUPenc));
public_pdcp(BOOL pdcp_config_req_asn1 (pdcp_t *pdcp, u8 eNB_id, u8 UE_id, u32 frame, u8_t eNB_flag,
rlc_mode_t rlc_mode, u32 action, u16 lc_id, u16 mch_id, rb_id_t rb_id,
u8 rb_sn, u8 rb_report, u16 header_compression_profile,
u8 security_mode,
u8 *kRRCenc,
u8 *kRRCint,
u8 *kUPenc));
/*! \fn void rrc_pdcp_config_release(module_id_t, rb_id_t)
* \brief This functions is unused
* \param[in] module_id Module ID of relevant PDCP entity
......@@ -351,7 +351,7 @@ public_pdcp(int pdcp_netlink_init(void);)
#define PDCP2NAS_FIFO 21
#define NAS2PDCP_FIFO 22
protected_pdcp_fifo(int pdcp_fifo_flush_sdus (u32_t,u8_t);)
protected_pdcp_fifo(int pdcp_fifo_flush_sdus(u32_t frame, u8 eNB_flag, u8 eNB_id, u8 UE_id);)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes (u32_t,u8_t);)
protected_pdcp_fifo(int pdcp_fifo_read_input_sdus (u32_t frame, u8_t eNB_flag, u8_t UE_index, u8_t eNB_index);)
protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg (u32_t frame, u8_t eNB_flag, u8 UE_index, u8 eNB_index);)
......@@ -404,7 +404,8 @@ typedef struct pdcp_missing_pdu_info_t {
#define PDCP_MAX_SN_12BIT 4095 // 2^12-1
protected_pdcp(signed int pdcp_2_nas_irq;)
protected_pdcp(pdcp_t pdcp_array[MAX_MODULES][MAX_MODULES*NB_RB_MAX];)
protected_pdcp(pdcp_t pdcp_array_ue[NUMBER_OF_UE_MAX][NB_RB_MAX];)
protected_pdcp(pdcp_t pdcp_array_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][NB_RB_MAX];)
public_pdcp(pdcp_mbms_t pdcp_mbms_array[MAX_MODULES][16*29];) // MAX_SERVICEx MAX_SESSION
protected_pdcp(sdu_size_t pdcp_output_sdu_bytes_to_write;)
protected_pdcp(sdu_size_t pdcp_output_header_bytes_to_write;)
......
This diff is collapsed.
......@@ -202,8 +202,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
new_data->pdcp_read_header.data_size);
} else {
LOG_E(PDCP, "[NETLINK] WRONG size %d should be sizeof "
"(pdcp_data_req_header_t) + sizeof(struct nlmsghdr)\n",
nas_nlh_rx->nlmsg_len);
"%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
nas_nlh_rx->nlmsg_len, sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
}
} else {
pdcp_read_state = 0;
......
......@@ -156,7 +156,7 @@ BOOL pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer
int pdcp_netlink_dequeue_element(uint8_t eNB_flag, uint8_t UE_index, uint8_t eNB_index,
struct pdcp_netlink_element_s **data);
void pdcp_config_set_security(module_id_t module_id, u32 frame, u8 eNB_flag, rb_id_t rb_id,
void pdcp_config_set_security(pdcp_t *pdcp, u8 eNB_id, u8 UE_id, u32 frame, u8 eNB_flag, rb_id_t rb_id,
u16 lc_id, u8 security_mode, u8 *kRRCenc, u8 *kRRCint, u8 *kUPenc);
#if defined(ENABLE_SECURITY)
......
......@@ -77,6 +77,16 @@ void rlc_am_send_sdu (rlc_am_entity_t *rlcP,u32_t frame, u8_t eNB_flag)
if ((rlcP->output_sdu_in_construction)) {
LOG_D(RLC, "\n\n\n[FRAME %05d][RLC_AM][MOD %02d][RB %02d][SEND_SDU] %d bytes sdu %p\n", frame, rlcP->module_id, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction);
if (rlcP->output_sdu_size_to_write > 0) {
u8_t eNB_id;
u8_t UE_id;
if (eNB_flag == 0) {
/* FIXME: force send on first eNB */
eNB_id = 0;
UE_id = rlcP->module_id - NB_eNB_INST;
} else {
UE_id = rlcP->rb_id / NB_RB_MAX;
eNB_id = rlcP->module_id;
}
rlcP->stat_rx_pdcp_sdu += 1;
rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write;
#ifdef TEST_RLC_AM
......@@ -85,7 +95,7 @@ void rlc_am_send_sdu (rlc_am_entity_t *rlcP,u32_t frame, u8_t eNB_flag)
rlcP->output_sdu_size_to_write,
rlcP->output_sdu_in_construction);
#else
rlc_data_ind (rlcP->module_id, frame, eNB_flag, RLC_MBMS_NO, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction, rlcP->is_data_plane);
rlc_data_ind (rlcP->module_id, eNB_id, UE_id, frame, eNB_flag, RLC_MBMS_NO, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction, rlcP->is_data_plane);
#endif
rlcP->output_sdu_in_construction = NULL;
} else {
......
......@@ -54,6 +54,16 @@ rlc_tm_send_sdu (rlc_tm_entity_t *rlcP, u32_t frame, u8_t eNB_flag, u8_t error_i
rlcP->output_sdu_in_construction = get_free_mem_block (length_in_bytes);
}
if ((rlcP->output_sdu_in_construction)) {
u8_t eNB_id;
u8_t UE_id;
if (eNB_flag == 0) {
/* FIXME: force send on first eNB */
eNB_id = 0;
UE_id = rlcP->module_id - NB_eNB_INST;
} else {
UE_id = rlcP->rb_id / NB_RB_MAX;
eNB_id = rlcP->module_id;
}
#ifdef DEBUG_RLC_TM_DISPLAY_ASCII_DATA
msg ("[RLC_TM %p][SEND_SDU] DATA :", rlcP);
for (index = 0; index < length_in_bytes; index++) {
......@@ -64,7 +74,7 @@ rlc_tm_send_sdu (rlc_tm_entity_t *rlcP, u32_t frame, u8_t eNB_flag, u8_t error_i
memcpy (&rlcP->output_sdu_in_construction->data[rlcP->output_sdu_size_to_write], srcP, length_in_bytes);
rlc_data_ind (rlcP->module_id, frame, eNB_flag, RLC_MBMS_NO, rlcP->rb_id, length_in_bytes, rlcP->output_sdu_in_construction, rlcP->is_data_plane);
rlc_data_ind (rlcP->module_id, eNB_id, UE_id, frame, eNB_flag, RLC_MBMS_NO, rlcP->rb_id, length_in_bytes, rlcP->output_sdu_in_construction, rlcP->is_data_plane);
rlcP->output_sdu_in_construction = NULL;
} else {
msg ("[RLC_TM %p][SEND_SDU] ERROR OUTPUT SDU IS NULL\n", rlcP);
......
......@@ -109,6 +109,15 @@ rlc_um_send_sdu (rlc_um_entity_t *rlcP,u32_t frame, u8_t eNB_flag)
LOG_D(RLC, "\n\n\n[RLC_UM][MOD %d][RB %d][FRAME %05d][SEND_SDU] %d bytes sdu %p\n", rlcP->module_id, rlcP->rb_id, frame, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction);
if (rlcP->output_sdu_size_to_write > 0) {
u8_t UE_id, eNB_id;
if (eNB_flag == 0) {
UE_id = rlcP->module_id - NB_eNB_INST;
/* FIXME: force send on eNB 0 */
eNB_id = 0;
} else {
UE_id = rlcP->rb_id / NB_RB_MAX;
eNB_id = rlcP->module_id;
}
rlcP->stat_rx_pdcp_sdu += 1;
rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write;
#ifdef TEST_RLC_UM
......@@ -120,7 +129,7 @@ rlc_um_send_sdu (rlc_um_entity_t *rlcP,u32_t frame, u8_t eNB_flag)
rlc_um_v9_3_0_test_data_ind (rlcP->module_id, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction);
#else
// msg("[RLC] DATA IND ON MOD_ID %d RB ID %d, size %d\n",rlcP->module_id, rlcP->rb_id, frame,rlcP->output_sdu_size_to_write);
rlc_data_ind (rlcP->module_id, frame, eNB_flag, rlcP->is_mxch, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction,rlcP->is_data_plane);
rlc_data_ind (rlcP->module_id, eNB_id, UE_id, frame, eNB_flag, rlcP->is_mxch, rlcP->rb_id, rlcP->output_sdu_size_to_write, rlcP->output_sdu_in_construction,rlcP->is_data_plane);
#endif
rlcP->output_sdu_in_construction = NULL;
} else {
......
......@@ -32,7 +32,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#include "mem_block.h"
#include "../MAC/extern.h"
#include "UTIL/LOG/log.h"
extern void pdcp_data_ind (module_id_t module_idP, u32_t frame, u8_t eNB_flag, u8_t MBMS_flag, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t * sduP, u8 is_data_plane);
#include "assertions.h"
extern void pdcp_data_ind (u8 eNB_id, u8 UE_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_flag, rb_id_t rab_idP, sdu_size_t data_sizeP, mem_block_t * sduP, u8 is_data_plane);
//#define DEBUG_RLC_PDCP_INTERFACE
......@@ -54,7 +57,7 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, uns
for (octet_index = 0; octet_index < sizeP; octet_index++) {
if ((octet_index % 16) == 0){
if (octet_index != 0) {
LOG_T(componentP, " |\n");
LOG_T(componentP, " |\n");
}
LOG_T(componentP, " %04d |", octet_index);
}
......@@ -284,12 +287,23 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
rb_id_t mbms_rb_id = 0;
#endif
#ifdef DEBUG_RLC_DATA_REQ
LOG_D(RLC,"rlc_data_req: module_idP %d (%d), rb_idP %d (%d), muip %d, confirmP %d, sud_sizeP %d, sduP %p\n",module_idP,MAX_MODULES,rb_idP,MAX_RAB,muiP,confirmP,sdu_sizeP,sduP);
LOG_D(RLC,"rlc_data_req: module_idP %d (%d), rb_idP %d (%d), muip %d, confirmP %d, sud_sizeP %d, sduP %p\n",
module_idP,MAX_MODULES,rb_idP,MAX_RAB,muiP,confirmP,sdu_sizeP,sduP);
#endif
if ((module_idP >= 0) && (module_idP < MAX_MODULES) && (MBMS_flagP == 0)) {
if ((rb_idP >= 0) && (rb_idP < MAX_RAB)) {
if (sduP != NULL) {
if (sdu_sizeP > 0) {
#ifdef Rel10
DevCheck((module_idP < MAX_MODULES), module_idP, MAX_MODULES, MBMS_flagP);
#else
DevCheck((module_idP < MAX_MODULES) && (MBMS_flagP == 0), module_idP, MAX_MODULES, MBMS_flagP);
#endif
DevCheck(rb_idP < MAX_RAB, rb_idP, MAX_RB, 0);
DevAssert(sduP != NULL);
DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
#ifndef Rel10
DevCheck(MBMS_flagP == 0, MBMS_flagP, 0, 0);
#endif
if (MBMS_flagP == 0) {
LOG_D(RLC, "[FRAME %05d][RLC][MOD %02d][RB %02d] Display of rlc_data_req:\n",
frame, module_idP, rb_idP);
rlc_util_print_hex_octets(RLC, (unsigned char*)sduP->data, sdu_sizeP);
......@@ -300,8 +314,8 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
switch (rlc[module_idP].m_rlc_pointer[rb_idP].rlc_type) {
case RLC_NONE:
free_mem_block(sduP);
LOG_E(RLC, "Received RLC_NONE as rlc_type for module_idP %d, rb_id %d, eNB_flag %d\n", module_idP, rb_idP, eNB_flagP);
return RLC_OP_STATUS_BAD_PARAMETER;
break;
case RLC_AM:
#ifdef DEBUG_RLC_DATA_REQ
......@@ -415,23 +429,9 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
return RLC_OP_STATUS_INTERNAL_ERROR;
}
} else {
free_mem_block(sduP);
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : SDU size is 0\n", __FILE__, __LINE__);
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else {
free_mem_block(sduP);
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : SDU is NULL\n", __FILE__, __LINE__);
return RLC_OP_STATUS_BAD_PARAMETER;
}
} else {
free_mem_block(sduP);
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter rb_id out of bounds :%d\n", __FILE__, __LINE__, rb_idP);
return RLC_OP_STATUS_BAD_PARAMETER;
}
#ifdef Rel10
} else if ((module_idP >= 0) && (module_idP < MAX_MODULES) && (MBMS_flagP == 1)) {
} else { /* MBMS_flag != 0 */
if (rb_idP < (maxSessionPerPMCH * maxServiceCount)) {
if (eNB_flagP) {
mbms_rb_id = rb_idP + (maxDRB + 3) * MAX_MOBILES_PER_RG;
......@@ -480,22 +480,41 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
} else {
return RLC_OP_STATUS_BAD_PARAMETER;
}
#endif
} else {
}
#else
} else {/* MBMS_flag != 0 */
free_mem_block(sduP);
LOG_E(RLC, "MBMS_flag != 0 while Rel10 is not defined...\n");
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP);
return RLC_OP_STATUS_BAD_PARAMETER;
}
#endif
}
//-----------------------------------------------------------------------------
void rlc_data_ind (module_id_t module_idP, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t* sduP, boolean_t is_data_planeP) {
void rlc_data_ind (module_id_t module_idP, u8_t eNB_id, u8_t UE_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t rb_idP, sdu_size_t sdu_sizeP, mem_block_t* sduP, boolean_t is_data_planeP) {
//-----------------------------------------------------------------------------
char *from_str;
char *to_str;
u8_t from_value;
u8_t to_value;
if (eNB_flag == 0) {
from_str = "UE";
to_str = "eNB";
from_value = UE_id;
to_value = eNB_id;
} else {
from_str = "eNB";
to_str = "UE";
from_value = eNB_id;
to_value = UE_id;
}
LOG_D(RLC, "[FRAME %05d][RLC][MOD %02d][RB %02d] Display of rlc_data_ind:\n", frame, module_idP, rb_idP);
rlc_util_print_hex_octets(RLC, (unsigned char*)sduP->data, sdu_sizeP);
//check_mem_area();
// now demux is done at PDCP
// if ((is_data_planeP)) {
// now demux is done at PDCP
// if ((is_data_planeP)) {
#ifdef DEBUG_RLC_PDCP_INTERFACE
msg("[RLC] TTI %d, INST %d : Receiving SDU (%p) of size %d bytes to Rb_id %d\n",
frame, module_idP,
......@@ -505,16 +524,19 @@ void rlc_data_ind (module_id_t module_idP, u32_t frame, u8_t eNB_flag, u8_t
#endif //DEBUG_RLC_PDCP_INTERFACE
switch (rlc[module_idP].m_rlc_pointer[rb_idP].rlc_type) {
case RLC_AM:
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_AM][MOD %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][MOD %02d][RB %02d]\n",frame, module_idP,rb_idP,sdu_sizeP, module_idP,rb_idP);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_AM][%s %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][%s %02d][RB %02d]\n",
frame, from_str, from_value, rb_idP, sdu_sizeP, to_str, to_value, rb_idP);
break;
case RLC_UM:
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_UM][MOD %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][MOD %02d][RB %02d]\n",frame, module_idP,rb_idP,sdu_sizeP, module_idP,rb_idP);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_UM][%s %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][%s %02d][RB %02d]\n",
frame, from_str, from_value, rb_idP, sdu_sizeP, to_str, to_value, rb_idP);
break;
case RLC_TM:
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_TM][MOD %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][MOD %02d][RB %02d]\n",frame, module_idP,rb_idP,sdu_sizeP, module_idP,rb_idP);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_TM][%s %02d][RB %02d][--- RLC_DATA_IND/%d Bytes --->][PDCP][%s %02d][RB %02d]\n",
frame, from_str, from_value, rb_idP, sdu_sizeP, to_str, to_value, rb_idP);
break;
}
pdcp_data_ind (module_idP, frame, eNB_flag, MBMS_flagP, rb_idP, sdu_sizeP, sduP, is_data_planeP);
pdcp_data_ind (eNB_id, UE_id, frame, eNB_flag, MBMS_flagP, rb_idP % NB_RB_MAX, sdu_sizeP, sduP, is_data_planeP);
}
//-----------------------------------------------------------------------------
void rlc_data_conf (module_id_t module_idP, u32_t frame, u8_t eNB_flag, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP, boolean_t is_data_planeP) {
......@@ -540,7 +562,7 @@ void rlc_data_conf (module_id_t module_idP, u32_t frame, u8_t eNB_flag, rb_i
}
//-----------------------------------------------------------------------------
int
rlc_module_init ()
rlc_module_init (void)
{
//-----------------------------------------------------------------------------
int i;
......@@ -557,19 +579,19 @@ rlc_module_init ()
}
//-----------------------------------------------------------------------------
void
rlc_module_cleanup ()
rlc_module_cleanup (void)
//-----------------------------------------------------------------------------
{
}
//-----------------------------------------------------------------------------
void
rlc_layer_init ()
rlc_layer_init (void)
{
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
void
rlc_layer_cleanup ()
rlc_layer_cleanup (void)
//-----------------------------------------------------------------------------
{
}
......
......@@ -174,8 +174,10 @@ typedef struct {
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_RG)
#endif
protected_rlc(void (*rlc_rrc_data_ind) (module_id_t , u32_t, u8_t, rb_id_t , sdu_size_t , u8_t* );)
protected_rlc(void (*rlc_rrc_data_ind) (u8_t, u8_t, u32_t, u8_t, rb_id_t , sdu_size_t , u8_t* );)
protected_rlc(void (*rlc_rrc_data_conf) (module_id_t , rb_id_t , mui_t, rlc_tx_status_t );)
typedef void (rrc_data_ind_cb_t)(u8_t eNB_id, u8_t UE_id, u32_t frame, u8_t eNB_flag, rb_id_t rb_idP, sdu_size_t sdu_sizeP, u8_t* sduP);
typedef void (rrc_data_conf_cb_t)(module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP);
/*! \struct rlc_pointer_t
* \brief Structure helping finding the right RLC protocol instance in a rlc_t structure.
......@@ -309,8 +311,7 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_data_req (module_id_t, u32_t, u8_t,
* \param[in] rrc_data_indP Pointer on RRC data indicate function.
* \param[in] rrc_data_confP Pointer on RRC data confirm callback function.
*/
public_rlc_rrc( void rrc_rlc_register_rrc ( void (*rrc_data_indP) (module_id_t , u32_t, u8_t, rb_id_t , sdu_size_t , u8_t*),
void (*rrc_data_conf) (module_id_t , rb_id_t , mui_t, rlc_tx_status_t) );)
public_rlc_rrc(void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP);)
//-----------------------------------------------------------------------------
// PUBLIC INTERFACE WITH MAC
......@@ -409,7 +410,7 @@ public_rlc(rlc_op_status_t rlc_data_req (module_id_t, u32_t, u8_t, u8_t,rb_i
* \param[in] sduP SDU.
* \param[in] is_data_planeP Boolean, is data radio bearer or not.
*/
public_rlc(void rlc_data_ind (module_id_t, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t, sdu_size_t, mem_block_t*, boolean_t);)
public_rlc(void rlc_data_ind (module_id_t module_idP, u8_t eNB_id, u8_t UE_id, u32_t frame, u8_t eNB_flag, u8_t MBMS_flagP, rb_id_t, sdu_size_t, mem_block_t*, boolean_t);)
/*! \fn void rlc_data_conf (module_id_t module_idP, u32_t frameP, u8_t eNB_flagP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP, boolean_t is_data_planeP)
......
......@@ -265,7 +265,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
#ifdef Rel10
if (pmch_info_listP != NULL) {
LOG_I(RRC,"[%s %d] Config RLC instant for MBMS\n", (eNB_flagP) ? "eNB" : "UE", module_idP);
LOG_I(RLC,"[%s %d] Config RLC instance for MBMS\n", (eNB_flagP) ? "eNB" : "UE", (eNB_flagP) ? module_idP : module_idP - NB_eNB_INST);
for (cnt=0;cnt<pmch_info_listP->list.count;cnt++) {
pmch_info_r9 = pmch_info_listP->list.array[cnt];
......@@ -278,6 +278,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
// lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
// test this one and tell Lionel
if (eNB_flagP) {
/* SR: (maxDRB = 11 + 3) * 16 = 224... */
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG;
} else {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3);
......@@ -560,19 +561,19 @@ rlc_op_status_t rrc_rlc_data_req (module_id_t module_idP, u32_t frame, u8_t
//-----------------------------------------------------------------------------
mem_block_t* sdu;
u8_t UE_id = module_idP - NB_eNB_INST;
sdu = get_free_mem_block(sdu_sizeP);
if (sdu != NULL) {
// msg("[RRC_RLC] MEM_ALLOC %p\n",sdu);
memcpy (sdu->data, sduP, sdu_sizeP);
return rlc_data_req(module_idP, frame, eNB_flagP, MBMS_flagP, rb_idP, muiP, confirmP, sdu_sizeP, sdu);
return rlc_data_req(module_idP, frame, eNB_flagP, MBMS_flagP, rb_idP /* + (UE_id * NB_RB_MAX) */, muiP, confirmP, sdu_sizeP, sdu);
} else {
return RLC_OP_STATUS_INTERNAL_ERROR;
}
}
//-----------------------------------------------------------------------------
void rrc_rlc_register_rrc ( void (*rrc_data_indP) (module_id_t module_idP, u32_t frame, u8_t eNB_id, rb_id_t rb_idP, sdu_size_t sdu_sizeP, u8_t* sduP),
void (*rrc_data_confP) (module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP) ) {
void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP) {
//-----------------------------------------------------------------------------
rlc_rrc_data_ind = rrc_data_indP;
rlc_rrc_data_conf = rrc_data_confP;
......
......@@ -132,11 +132,11 @@ int rrc_rg_send_to_srb_rlc (int UE_id, int rb_id, char * data_buffer, int data_l
case RRC_SRB0_ID: //CCCH
case RRC_SRB1_ID: //DCCH-UM
//result = rrc_rlc_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data);
if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,1))
if (pdcp_data_req(0, Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_NO,data_length,tx_data,1))
result = 1;
break;
case RRC_SRB2_ID: //DCCH-AM
if (pdcp_data_req(Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1))
if (pdcp_data_req(0, Mod_id,protocol_bs->rrc.current_SFN, eNB_flag,(UE_id*NB_RB_MAX)+DCCH,protocol_bs->rrc.next_MUI++,RRC_RLC_CONFIRM_YES,data_length,tx_data,1))
result = 1;
break;
case RRC_SRB3_ID: //DCCH-AM - NAS
......@@ -462,7 +462,7 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){
msg("[eNB %d] CALLING PDCP + RLC CONFIG SRB1 (rbid %d) for UE %d\n", Mod_id,srb1,UE_index);
/* rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1);
rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_ADD,srb1,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);*/
rrc_pdcp_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
......@@ -538,7 +538,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){
msg("[eNB %d] CALLING PDCP + RLC CONFIG SRB2 (rbid %d) for UE %d\n", Mod_id,srb2,UE_index);
/* rrc_pdcp_config_req (Mod_id, protocol_bs->rrc.current_SFN, eNB_flag, ACTION_ADD, srb2);
rrc_rlc_config_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,ACTION_ADD,srb2,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);*/
rrc_pdcp_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
......@@ -628,7 +628,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){
// (UE_index * NB_RB_MAX) + (int)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity,
// RADIO_ACCESS_BEARER,Rlc_info_um);
rrc_pdcp_config_asn1_req(Mod_id,protocol_bs->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_bs->rrc.current_SFN,eNB_flag,
(SRB_ToAddModList_t*)NULL,
protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index],
(DRB_ToReleaseList_t*)NULL
......
......@@ -482,7 +482,7 @@ void rrc_ue_config_LTE_srb1 (void){
msg ("[RRC-UE-FRONTEND] Parameters : Mod_id %d, eNB_flag %d, UE_index %d, NB_eNB_INST %d \n",Mod_id, eNB_flag, UE_index, NB_eNB_INST);
// rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1);
// rrc_rlc_config_req(Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb1, SIGNALLING_RADIO_BEARER, Rlc_info_am_config);
rrc_pdcp_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
......@@ -558,7 +558,7 @@ void rrc_ue_config_LTE_srb2 (void){
msg("[UE %d], CONFIG_SRB2 %d corresponding to eNB_index %d\n", Mod_id,srb2,eNB_index);
// rrc_pdcp_config_req (Mod_id+NB_eNB_INST, protocol_ms->rrc.current_SFN, eNB_flag, ACTION_ADD, srb2);
// rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_ADD,srb2,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
rrc_pdcp_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL
......@@ -633,7 +633,7 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){
rrc_rlc_config_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,ACTION_ADD,
(UE_index * NB_RB_MAX) + (int)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um);*/
rrc_pdcp_config_asn1_req(Mod_id+NB_eNB_INST,protocol_ms->rrc.current_SFN,eNB_flag,UE_index,
rrc_pdcp_config_asn1_req(Mod_id,UE_index,protocol_ms->rrc.current_SFN,eNB_flag,
(SRB_ToAddModList_t*)NULL,
protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index],
(DRB_ToReleaseList_t*)NULL
......
......@@ -107,35 +107,35 @@ s8 mac_rrc_data_ind(u8 Mod_id, u32 frame, u16 Srb_id, u8 *Sdu,u16 Sdu_len,u8 eNB
}
/********************************************************************************************************************/
void rlcrrc_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size,u8 *Buffer){
void rlcrrc_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size,u8 *Buffer){
/********************************************************************************************************************/
#ifdef CELLULAR
rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer);
#else // now this is called from PDCP
//rlcrrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
rrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
rrc_lite_data_ind(eNB_id, UE_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
#endif //CELLULAR
}
/********************************************************************************************************************/
u8 pdcp_rrc_data_req(u8 module_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
u8 pdcp_rrc_data_req(u8 eNB_id, u8 UE_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
unsigned int sdu_buffer_size, u8* sdu_buffer, u8 mode) {
/********************************************************************************************************************/
#ifdef CELLULAR
return pdcp_data_req( module_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer, mode);
#else
return rrc_lite_data_req (module_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer, mode);
return rrc_lite_data_req (eNB_id, UE_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer, mode);
#endif
}
/********************************************************************************************************************/
void pdcp_rrc_data_ind( u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size,u8 *Buffer){
void pdcp_rrc_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size,u8 *Buffer){
/********************************************************************************************************************/
#ifdef CELLULAR
rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer);
#else // now this is called from PDCP
//rlcrrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
rrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
rrc_lite_data_ind(eNB_id, UE_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer);
#endif //CELLULAR
}
......
......@@ -50,12 +50,12 @@ void mac_lite_sync_ind(u8 Mod_id, u8 status);
void mac_rrc_meas_ind(u8, MAC_MEAS_REQ_ENTRY*);
void rlcrrc_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag, unsigned int Rb_id, u32 sdu_size, u8 *Buffer);
void rlcrrc_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag, unsigned int Rb_id, u32 sdu_size, u8 *Buffer);
u8 pdcp_rrc_data_req(u8 module_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
u8 pdcp_rrc_data_req(u8 eNB_id, u8 UE_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
unsigned int sdu_buffer_size, u8* sdu_buffer, u8 mode);
void pdcp_rrc_data_ind(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size, u8 *Buffer);
void pdcp_rrc_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag, unsigned int Srb_id, unsigned int Sdu_size, u8 *Buffer);
void mac_out_of_sync_ind(u8 Mod_id, u32 frame, u16 CH_index);
......
......@@ -476,7 +476,7 @@ void mac_lite_sync_ind(u8 Mod_id,u8 Status){
}