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 @@ ...@@ -23,7 +23,8 @@
#endif #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, inline NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr,
...@@ -60,7 +61,8 @@ NwGtpv1uRcT gtpv1u_process_stack_req( ...@@ -60,7 +61,8 @@ NwGtpv1uRcT gtpv1u_process_stack_req(
GTPU_DEBUG("Received T-PDU from gtpv1u stack %u with size %d", GTPU_DEBUG("Received T-PDU from gtpv1u stack %u with size %d",
pUlpApi->apiInfo.recvMsgInfo.teid, buffer_len); pUlpApi->apiInfo.recvMsgInfo.teid, buffer_len);
pdcp_data_req(0, // module_id, pdcp_data_req(0, // eNB_idx,
0, // UE idx
0, // frame 0, // frame
1, // enb flag 1, // enb flag
5, // rb id 5, // rb id
......
...@@ -24,6 +24,8 @@ typedef struct RrcDcchDataReq_s { ...@@ -24,6 +24,8 @@ typedef struct RrcDcchDataReq_s {
uint32_t sdu_size; uint32_t sdu_size;
uint8_t *sdu_p; uint8_t *sdu_p;
uint8_t mode; uint8_t mode;
uint8_t ue_index;
uint8_t eNB_index;
} RrcDcchDataReq; } RrcDcchDataReq;
typedef struct RrcDcchDataInd_s { typedef struct RrcDcchDataInd_s {
...@@ -32,6 +34,7 @@ typedef struct RrcDcchDataInd_s { ...@@ -32,6 +34,7 @@ typedef struct RrcDcchDataInd_s {
uint32_t sdu_size; uint32_t sdu_size;
uint8_t *sdu_p; uint8_t *sdu_p;
uint8_t ue_index; uint8_t ue_index;
uint8_t eNB_index;
} RrcDcchDataInd; } RrcDcchDataInd;
#endif /* PDCP_MESSAGES_TYPES_H_ */ #endif /* PDCP_MESSAGES_TYPES_H_ */
...@@ -52,20 +52,21 @@ ...@@ -52,20 +52,21 @@
# define MAX_RG 2 # define MAX_RG 2
#endif #endif
# define MAX_MANAGED_RG_PER_MOBILE 2 #define MAX_MANAGED_RG_PER_MOBILE 2
# define DEFAULT_RAB_ID 3 #define DEFAULT_RAB_ID 3
# define NB_RB_MAX 11 #define NB_RB_MAX 11
# define NB_RAB_MAX 8 // 4 #define NB_RAB_MAX 8
# define RAB_SHIFT1 9 #define RAB_SHIFT1 9
# define RAB_SHIFT2 3 #define RAB_SHIFT2 3
# define RAB_OFFSET 0x0007 #define RAB_OFFSET 0x0007
# define RAB_OFFSET1 0x7E00 #define RAB_OFFSET1 0x7E00
# define RAB_OFFSET2 0x01F8 #define RAB_OFFSET2 0x01F8
# define DIR_OFFSET 0x8000 #define DIR_OFFSET 0x8000
# define DIR_SHIFT 15 #define DIR_SHIFT 15
# define CH_OFFSET 0x0004 #define CH_OFFSET 0x0004
# define CH_SHIFT 2 #define CH_SHIFT 2
#ifdef MESH #ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 ) # define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
......
...@@ -69,6 +69,8 @@ ...@@ -69,6 +69,8 @@
# include "intertask_interface.h" # include "intertask_interface.h"
#endif #endif
#include "assertions.h"
#define DEBUG_HEADER_PARSING 1 #define DEBUG_HEADER_PARSING 1
#define ENABLE_MAC_PAYLOAD_DEBUG #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) { ...@@ -209,6 +211,8 @@ u32 ue_get_SR(u8 Mod_id,u32 frame,u8 eNB_id,u16 rnti, u8 subframe) {
int T=0; int T=0;
// int sfn=0; // int sfn=0;
DevCheck(Mod_id < NB_UE_INST, Mod_id, NB_UE_INST, 0);
// determin the measurement gap // 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", 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, 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 ...@@ -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 dcch_header_len_tmp=0, dtch_header_len_tmp=0;
u8 bsr_header_len=0, bsr_ce_len=0, bsr_len=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; u8 phr_header_len=0, phr_ce_len=0,phr_len=0;
u16 sdu_lengths[8]; u16 sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
u8 sdu_lcids[8],payload_offset=0,num_sdus=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]; u8 ulsch_buff[MAX_ULSCH_PAYLOAD_BYTES];
u16 sdu_length_total=0; u16 sdu_length_total=0;
BSR_SHORT bsr_short; 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 ...@@ -237,7 +237,8 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None * \note None
* @ingroup _pdcp * @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*) /*! \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 * \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 ...@@ -253,8 +254,8 @@ public_pdcp(BOOL pdcp_data_req (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None * \note None
* @ingroup _pdcp * @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, \ 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);) mem_block_t* sdu_buffer, u8 is_data_plane));
#endif // PDCP_UNIT_TEST #endif // PDCP_UNIT_TEST
/*! \fn void rrc_pdcp_config_req(module_id_t, rb_id_t,u8) /*! \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 ...@@ -268,8 +269,7 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \note None * \note None
* @ingroup _pdcp * @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) /*! \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. * \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 ...@@ -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. * \return A status about the processing, OK or error code.
*/ */
public_pdcp( 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, SRB_ToAddModList_t* srb2add_list,
DRB_ToAddModList_t* drb2add_list, DRB_ToAddModList_t* drb2add_list,
DRB_ToReleaseList_t* drb2release_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 ...@@ -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 * \param[in] kUPenc User-Plane encryption key
* \return A status about the processing, OK or error code. * \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, 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, 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 rb_sn, u8 rb_report, u16 header_compression_profile,
u8 security_mode, u8 security_mode,
u8 *kRRCenc, u8 *kRRCenc,
u8 *kRRCint, u8 *kRRCint,
u8 *kUPenc)); u8 *kUPenc));
/*! \fn void rrc_pdcp_config_release(module_id_t, rb_id_t) /*! \fn void rrc_pdcp_config_release(module_id_t, rb_id_t)
* \brief This functions is unused * \brief This functions is unused
* \param[in] module_id Module ID of relevant PDCP entity * \param[in] module_id Module ID of relevant PDCP entity
...@@ -351,7 +351,7 @@ public_pdcp(int pdcp_netlink_init(void);) ...@@ -351,7 +351,7 @@ public_pdcp(int pdcp_netlink_init(void);)
#define PDCP2NAS_FIFO 21 #define PDCP2NAS_FIFO 21
#define NAS2PDCP_FIFO 22 #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_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(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);) 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 { ...@@ -404,7 +404,8 @@ typedef struct pdcp_missing_pdu_info_t {
#define PDCP_MAX_SN_12BIT 4095 // 2^12-1 #define PDCP_MAX_SN_12BIT 4095 // 2^12-1
protected_pdcp(signed int pdcp_2_nas_irq;) 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 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_sdu_bytes_to_write;)
protected_pdcp(sdu_size_t pdcp_output_header_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) { ...@@ -202,8 +202,8 @@ void *pdcp_netlink_thread_fct(void *arg) {
new_data->pdcp_read_header.data_size); new_data->pdcp_read_header.data_size);
} else { } else {
LOG_E(PDCP, "[NETLINK] WRONG size %d should be sizeof " LOG_E(PDCP, "[NETLINK] WRONG size %d should be sizeof "
"(pdcp_data_req_header_t) + sizeof(struct nlmsghdr)\n", "%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
nas_nlh_rx->nlmsg_len); nas_nlh_rx->nlmsg_len, sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
} }
} else { } else {
pdcp_read_state = 0; pdcp_read_state = 0;
......
...@@ -156,7 +156,7 @@ BOOL pdcp_serialize_control_pdu_for_pdcp_status_report(unsigned char* pdu_buffer ...@@ -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, int pdcp_netlink_dequeue_element(uint8_t eNB_flag, uint8_t UE_index, uint8_t eNB_index,
struct pdcp_netlink_element_s **data); 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); u16 lc_id, u8 security_mode, u8 *kRRCenc, u8 *kRRCint, u8 *kUPenc);
#if defined(ENABLE_SECURITY) #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) ...@@ -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)) { 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); 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) { 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_sdu += 1;
rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write; rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write;
#ifdef TEST_RLC_AM #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) ...@@ -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_size_to_write,
rlcP->output_sdu_in_construction); rlcP->output_sdu_in_construction);
#else #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 #endif
rlcP->output_sdu_in_construction = NULL; rlcP->output_sdu_in_construction = NULL;
} else { } 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 ...@@ -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); rlcP->output_sdu_in_construction = get_free_mem_block (length_in_bytes);
} }
if ((rlcP->output_sdu_in_construction)) { 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 #ifdef DEBUG_RLC_TM_DISPLAY_ASCII_DATA
msg ("[RLC_TM %p][SEND_SDU] DATA :", rlcP); msg ("[RLC_TM %p][SEND_SDU] DATA :", rlcP);
for (index = 0; index < length_in_bytes; index++) { 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 ...@@ -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); 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; rlcP->output_sdu_in_construction = NULL;
} else { } else {
msg ("[RLC_TM %p][SEND_SDU] ERROR OUTPUT SDU IS NULL\n", rlcP); 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) ...@@ -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); 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) { 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_sdu += 1;
rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write; rlcP->stat_rx_pdcp_bytes += rlcP->output_sdu_size_to_write;
#ifdef TEST_RLC_UM #ifdef TEST_RLC_UM
...@@ -120,7 +129,7 @@ rlc_um_send_sdu (rlc_um_entity_t *rlcP,u32_t frame, u8_t eNB_flag) ...@@ -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); 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 #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); // 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 #endif
rlcP->output_sdu_in_construction = NULL; rlcP->output_sdu_in_construction = NULL;
} else { } else {
......
...@@ -32,7 +32,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis ...@@ -32,7 +32,10 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#include "mem_block.h" #include "mem_block.h"
#include "../MAC/extern.h" #include "../MAC/extern.h"
#include "UTIL/LOG/log.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 //#define DEBUG_RLC_PDCP_INTERFACE
...@@ -54,7 +57,7 @@ void rlc_util_print_hex_octets(comp_name_t componentP, unsigned char* dataP, uns ...@@ -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++) { for (octet_index = 0; octet_index < sizeP; octet_index++) {
if ((octet_index % 16) == 0){ if ((octet_index % 16) == 0){
if (octet_index != 0) { if (octet_index != 0) {
LOG_T(componentP, " |\n"); LOG_T(componentP, " |\n");
} }
LOG_T(componentP, " %04d |", octet_index); 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_ ...@@ -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; rb_id_t mbms_rb_id = 0;
#endif #endif
#ifdef DEBUG_RLC_DATA_REQ #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 #endif
if ((module_idP >= 0) && (module_idP < MAX_MODULES) && (MBMS_flagP == 0)) { #ifdef Rel10
if ((rb_idP >= 0) && (rb_idP < MAX_RAB)) { DevCheck((module_idP < MAX_MODULES), module_idP, MAX_MODULES, MBMS_flagP);
if (sduP != NULL) { #else
if (sdu_sizeP > 0) { 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", LOG_D(RLC, "[FRAME %05d][RLC][MOD %02d][RB %02d] Display of rlc_data_req:\n",
frame, module_idP, rb_idP); frame, module_idP, rb_idP);
rlc_util_print_hex_octets(RLC, (unsigned char*)sduP->data, sdu_sizeP); 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_ ...@@ -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) { switch (rlc[module_idP].m_rlc_pointer[rb_idP].rlc_type) {
case RLC_NONE: case RLC_NONE:
free_mem_block(sduP); 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; return RLC_OP_STATUS_BAD_PARAMETER;
break;
case RLC_AM: case RLC_AM:
#ifdef DEBUG_RLC_DATA_REQ #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_ ...@@ -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; 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 #ifdef Rel10
} else if ((module_idP >= 0) && (module_idP < MAX_MODULES) && (MBMS_flagP == 1)) { } else { /* MBMS_flag != 0 */
if (rb_idP < (maxSessionPerPMCH * maxServiceCount)) { if (rb_idP < (maxSessionPerPMCH * maxServiceCount)) {
if (eNB_flagP) { if (eNB_flagP) {
mbms_rb_id = rb_idP + (maxDRB + 3) * MAX_MOBILES_PER_RG; 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_ ...@@ -480,22 +480,41 @@ rlc_op_status_t rlc_data_req (module_id_t module_idP, u32_t frame, u8_t eNB_
} else { } else {
return RLC_OP_STATUS_BAD_PARAMETER; return RLC_OP_STATUS_BAD_PARAMETER;
} }
#endif }
} else { #else
} else {/* MBMS_flag != 0 */
free_mem_block(sduP); 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); //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; 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); 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); rlc_util_print_hex_octets(RLC, (unsigned char*)sduP->data, sdu_sizeP);
//check_mem_area(); //check_mem_area();
// now demux is done at PDCP // now demux is done at PDCP
// if ((is_data_planeP)) { // if ((is_data_planeP)) {
#ifdef DEBUG_RLC_PDCP_INTERFACE #ifdef DEBUG_RLC_PDCP_INTERFACE
msg("[RLC] TTI %d, INST %d : Receiving SDU (%p) of size %d bytes to Rb_id %d\n", msg("[RLC] TTI %d, INST %d : Receiving SDU (%p) of size %d bytes to Rb_id %d\n",
frame, module_idP, 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 ...@@ -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 #endif //DEBUG_RLC_PDCP_INTERFACE
switch (rlc[module_idP].m_rlc_pointer[rb_idP].rlc_type) { switch (rlc[module_idP].m_rlc_pointer[rb_idP].rlc_type) {
case RLC_AM: 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; break;
case RLC_UM: 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; break;
case RLC_TM: 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; 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) { 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 ...@@ -540,7 +562,7 @@ void rlc_data_conf (module_id_t module_idP, u32_t frame, u8_t eNB_flag, rb_i
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int int
rlc_module_init () rlc_module_init (void)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int i; int i;
...@@ -557,19 +579,19 @@ rlc_module_init () ...@@ -557,19 +579,19 @@ rlc_module_init ()
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_module_cleanup () rlc_module_cleanup (void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_layer_init () rlc_layer_init (void)
{ {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rlc_layer_cleanup () rlc_layer_cleanup (void)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
} }
......
...@@ -174,8 +174,10 @@ typedef struct { ...@@ -174,8 +174,10 @@ typedef struct {
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_RG) #define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_RG)
#endif #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 );) 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 /*! \struct rlc_pointer_t
* \brief Structure helping finding the right RLC protocol instance in a rlc_t structure. * \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, ...@@ -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_indP Pointer on RRC data indicate function.
* \param[in] rrc_data_confP Pointer on RRC data confirm callback 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*), public_rlc_rrc(void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP);)
void (*rrc_data_conf) (module_id_t , rb_id_t , mui_t, rlc_tx_status_t) );)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// PUBLIC INTERFACE WITH MAC // 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 ...@@ -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] sduP SDU.
* \param[in] is_data_planeP Boolean, is data radio bearer or not. * \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) /*! \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 ...@@ -265,7 +265,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
#ifdef Rel10 #ifdef Rel10
if (pmch_info_listP != NULL) { 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++) { for (cnt=0;cnt<pmch_info_listP->list.count;cnt++) {
pmch_info_r9 = pmch_info_listP->list.array[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 ...@@ -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; // lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
// test this one and tell Lionel // test this one and tell Lionel
if (eNB_flagP) { if (eNB_flagP) {
/* SR: (maxDRB = 11 + 3) * 16 = 224... */
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG; lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG;
} else { } else {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3); 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 ...@@ -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; mem_block_t* sdu;
u8_t UE_id = module_idP - NB_eNB_INST;
sdu = get_free_mem_block(sdu_sizeP); sdu = get_free_mem_block(sdu_sizeP);
if (sdu != NULL) { if (sdu != NULL) {
// msg("[RRC_RLC] MEM_ALLOC %p\n",sdu); // msg("[RRC_RLC] MEM_ALLOC %p\n",sdu);
memcpy (sdu->data, sduP, sdu_sizeP); 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 { } else {
return RLC_OP_STATUS_INTERNAL_ERROR; 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_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP) {
void (*rrc_data_confP) (module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP) ) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
rlc_rrc_data_ind = rrc_data_indP; rlc_rrc_data_ind = rrc_data_indP;
rlc_rrc_data_conf = rrc_data_confP; 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 ...@@ -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_SRB0_ID: //CCCH
case RRC_SRB1_ID: //DCCH-UM 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); //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; result = 1;
break; break;
case RRC_SRB2_ID: //DCCH-AM 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; result = 1;
break; break;
case RRC_SRB3_ID: //DCCH-AM - NAS case RRC_SRB3_ID: //DCCH-AM - NAS
...@@ -462,7 +462,7 @@ void rrc_rg_config_LTE_srb1 (unsigned char Mod_id){ ...@@ -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); 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_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_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], protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL, (DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL
...@@ -538,7 +538,7 @@ void rrc_rg_config_LTE_srb2 (unsigned char Mod_id){ ...@@ -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); 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_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_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], protocol_bs->rrc.rg_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL, (DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL
...@@ -628,7 +628,7 @@ void rrc_rg_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -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, // (UE_index * NB_RB_MAX) + (int)*protocol_bs->rrc.rg_rb_asn1.DRB1_config->logicalChannelIdentity,
// RADIO_ACCESS_BEARER,Rlc_info_um); // 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, (SRB_ToAddModList_t*)NULL,
protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index], protocol_bs->rrc.rg_rb_asn1.DRB_configList[UE_index],
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL
......
...@@ -482,7 +482,7 @@ void rrc_ue_config_LTE_srb1 (void){ ...@@ -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); 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_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_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], protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL, (DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL
...@@ -558,7 +558,7 @@ void rrc_ue_config_LTE_srb2 (void){ ...@@ -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); 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_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_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], protocol_ms->rrc.ue_rb_asn1.SRB_configList[UE_index],
(DRB_ToAddModList_t*)NULL, (DRB_ToAddModList_t*)NULL,
(DRB_ToReleaseList_t*)NULL (DRB_ToReleaseList_t*)NULL
...@@ -633,7 +633,7 @@ void rrc_ue_config_LTE_default_drb (unsigned char Mod_id){ ...@@ -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, 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, (UE_index * NB_RB_MAX) + (int)*protocol_ms->rrc.ue_rb_asn1.DRB1_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um);*/ 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, (SRB_ToAddModList_t*)NULL,
protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index], protocol_ms->rrc.ue_rb_asn1.DRB_configList[UE_index],
(DRB_ToReleaseList_t*)NULL (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 ...@@ -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 #ifdef CELLULAR
rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer); rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer);
#else // now this is called from PDCP #else // now this is called from PDCP
//rlcrrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer); //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 #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) { unsigned int sdu_buffer_size, u8* sdu_buffer, u8 mode) {
/********************************************************************************************************************/ /********************************************************************************************************************/
#ifdef CELLULAR #ifdef CELLULAR
return pdcp_data_req( module_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer, mode); return pdcp_data_req( module_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer, mode);
#else #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 #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 #ifdef CELLULAR
rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer); rrc_L2_rlc_data_ind_rx(Mod_id,Srb_id, Sdu_size, Buffer);
#else // now this is called from PDCP #else // now this is called from PDCP
//rlcrrc_lite_data_ind(Mod_id,frame,eNB_flag,Srb_id,Sdu_size,Buffer); //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 #endif //CELLULAR
} }
......
...@@ -50,12 +50,12 @@ void mac_lite_sync_ind(u8 Mod_id, u8 status); ...@@ -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 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); 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); 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){ ...@@ -476,7 +476,7 @@ void mac_lite_sync_ind(u8 Mod_id,u8 Status){
} }
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP, u8 rrc_lite_data_req(u8 eNB_id, u8 UE_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
unsigned int sdu_size, u8* Buffer, u8 mode) { unsigned int sdu_size, u8* Buffer, u8 mode) {
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
...@@ -497,26 +497,33 @@ u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 ...@@ -497,26 +497,33 @@ u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_size; RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_size;
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer; RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_REQ (message_p).mode = mode; RRC_DCCH_DATA_REQ (message_p).mode = mode;
RRC_DCCH_DATA_REQ (message_p).eNB_index = eNB_id;
RRC_DCCH_DATA_REQ (message_p).ue_index = UE_id;
itti_send_msg_to_task (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, Mod_id, message_p); itti_send_msg_to_task (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, eNB_flag ? eNB_id : NB_eNB_INST + UE_id, message_p);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway. return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
} }
#else #else
return pdcp_data_req (Mod_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_size, Buffer, mode); return pdcp_data_req (eNB_id, UE_id, frame, eNB_flag, rb_id, muiP, confirmP, sdu_size, Buffer, mode);
#endif #endif
} }
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u32 sdu_size,u8 *Buffer){ void rrc_lite_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag,u32 Srb_id, u32 sdu_size,u8 *Buffer){
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
u8 UE_index=(Srb_id-1)/NB_RB_MAX;
u8 DCCH_index = Srb_id % NB_RB_MAX; u8 DCCH_index = Srb_id % NB_RB_MAX;
u8_t Mod_id;
LOG_N(RRC,"[%s %d] Frame %d: received a DCCH %d message on SRB %d with Size %d\n",
(eNB_flag == 1)? "eNB": "UE", if (eNB_flag == 0) {
(eNB_flag == 1)? Mod_id : UE_index, Mod_id = UE_id + NB_eNB_INST;
frame, DCCH_index,Srb_id-1,sdu_size); LOG_N(RRC, "[UE %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n",
UE_id, frame, DCCH_index,Srb_id-1,sdu_size, eNB_id);
} else {
Mod_id = eNB_id;
LOG_N(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %d\n",
eNB_id, frame, DCCH_index,Srb_id-1,sdu_size, UE_id);
}
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
{ {
...@@ -532,16 +539,17 @@ void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u3 ...@@ -532,16 +539,17 @@ void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag,u32 Srb_id, u3
RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index; RRC_DCCH_DATA_IND (message_p).dcch_index = DCCH_index;
RRC_DCCH_DATA_IND (message_p).sdu_size = sdu_size; RRC_DCCH_DATA_IND (message_p).sdu_size = sdu_size;
RRC_DCCH_DATA_IND (message_p).sdu_p = message_buffer; RRC_DCCH_DATA_IND (message_p).sdu_p = message_buffer;
RRC_DCCH_DATA_IND (message_p).ue_index = UE_index; RRC_DCCH_DATA_IND (message_p).ue_index = UE_id;
RRC_DCCH_DATA_IND (message_p).eNB_index = eNB_id;
itti_send_msg_to_task ((eNB_flag == 1) ? TASK_RRC_ENB : TASK_RRC_UE, Mod_id, message_p); itti_send_msg_to_task ((eNB_flag == 1) ? TASK_RRC_ENB : TASK_RRC_UE, Mod_id, message_p);
} }
#else #else
if (eNB_flag ==1) { if (eNB_flag ==1) {
rrc_eNB_decode_dcch(Mod_id,frame,DCCH_index,UE_index,Buffer,sdu_size); rrc_eNB_decode_dcch(eNB_id,frame,DCCH_index,UE_id,Buffer,sdu_size);
} }
else { else {
rrc_ue_decode_dcch(Mod_id-NB_eNB_INST,frame,DCCH_index,Buffer,UE_index); rrc_ue_decode_dcch(UE_id,frame,DCCH_index,Buffer,eNB_id);
} }
#endif #endif
} }
......
...@@ -514,7 +514,7 @@ s32 rrc_ue_establish_drb(u8 Mod_id,u32 frame,u8 eNB_index,struct DRB_ToAddMod * ...@@ -514,7 +514,7 @@ s32 rrc_ue_establish_drb(u8 Mod_id,u32 frame,u8 eNB_index,struct DRB_ToAddMod *
\param eNB_index Index of corresponding CH/eNB \param eNB_index Index of corresponding CH/eNB
\param mobilityControlInfo Pointer to mobilityControlInfo \param mobilityControlInfo Pointer to mobilityControlInfo
*/ */
void rrc_ue_process_mobilityControlInfo(u8 Mod_id,u32 frame, u8 eNB_index,struct MobilityControlInfo *mobilityControlInfo); void rrc_ue_process_mobilityControlInfo(u8 eNB_index, u8 UE_id, u32 frame, struct MobilityControlInfo *mobilityControlInfo);
/** \brief Process a measConfig Message and configure PHY/MAC /** \brief Process a measConfig Message and configure PHY/MAC
\param Mod_id Instance of UE on which to act \param Mod_id Instance of UE on which to act
...@@ -594,10 +594,10 @@ s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 *Sdu, ...@@ -594,10 +594,10 @@ s8 mac_rrc_lite_data_ind( u8 Mod_id, u32 frame, unsigned short Srb_id, u8 *Sdu,
void mac_sync_ind( u8 Mod_id, u8 status); void mac_sync_ind( u8 Mod_id, u8 status);
u8 rrc_lite_data_req(u8 Mod_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP, u8 rrc_lite_data_req(u8 eNB_id, u8 UE_id, u32 frame, u8 eNB_flag, unsigned int rb_id, u32 muiP, u32 confirmP,
unsigned int sdu_size, u8* Buffer, u8 mode); unsigned int sdu_size, u8* Buffer, u8 mode);
void rrc_lite_data_ind(module_id_t Mod_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer); void rrc_lite_data_ind(u8_t eNB_id, u8_t UE_id, u32 frame, u8 eNB_flag, u32 Rb_id, u32 sdu_size,u8 *Buffer);
void rrc_lite_in_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index); void rrc_lite_in_sync_ind(u8 Mod_id, u32 frame, u16 eNB_index);
......
This diff is collapsed.
...@@ -303,7 +303,7 @@ void rrc_t310_expiration(u32 frame, u8 Mod_id, u8 eNB_index) { ...@@ -303,7 +303,7 @@ void rrc_t310_expiration(u32 frame, u8 Mod_id, u8 eNB_index) {
if (UE_rrc_inst[Mod_id].Srb2[eNB_index].Active == 1) { if (UE_rrc_inst[Mod_id].Srb2[eNB_index].Active == 1) {
msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", Mod_id, eNB_index, msg ("[RRC Inst %d] eNB_index %d, Remove RB %d\n ", Mod_id, eNB_index,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id);
rrc_pdcp_config_req (Mod_id + NB_eNB_INST, frame, 0, ACTION_REMOVE, rrc_pdcp_config_req (eNB_index, Mod_id, frame, 0, ACTION_REMOVE,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, 0); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, 0);
rrc_rlc_config_req (Mod_id + NB_eNB_INST, frame, 0, ACTION_REMOVE, rrc_rlc_config_req (Mod_id + NB_eNB_INST, frame, 0, ACTION_REMOVE,
UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, SIGNALLING_RADIO_BEARER, Rlc_info_um); UE_rrc_inst[Mod_id].Srb2[eNB_index].Srb_info.Srb_id, SIGNALLING_RADIO_BEARER, Rlc_info_um);
......
...@@ -417,7 +417,7 @@ static void init_MBMS (u8 Mod_id, u32 frame) { ...@@ -417,7 +417,7 @@ static void init_MBMS (u8 Mod_id, u32 frame) {
LOG_D(RRC,"[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", Mod_id, frame); //check the lcid LOG_D(RRC,"[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", Mod_id, frame); //check the lcid
// Configuring PDCP and RLC for MBMS Radio Bearer // Configuring PDCP and RLC for MBMS Radio Bearer
rrc_pdcp_config_asn1_req (Mod_id, frame, 1, 0, rrc_pdcp_config_asn1_req (Mod_id, 0, frame, 1,
NULL, // SRB_ToAddModList NULL, // SRB_ToAddModList
NULL, // DRB_ToAddModList NULL, // DRB_ToAddModList
(DRB_ToReleaseList_t *) NULL, (DRB_ToReleaseList_t *) NULL,
...@@ -475,7 +475,7 @@ uint8_t rrc_eNB_get_next_transaction_identifier(uint8_t Mod_id) ...@@ -475,7 +475,7 @@ uint8_t rrc_eNB_get_next_transaction_identifier(uint8_t Mod_id)
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Functions to handle UE index in eNB UE list */ /* Functions to handle UE index in eNB UE list */
static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint8_t *UE_identity) static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint64_t UE_identity)
{ {
uint8_t i, first_index = UE_INDEX_INVALID, reg = 0; uint8_t i, first_index = UE_INDEX_INVALID, reg = 0;
...@@ -486,14 +486,14 @@ static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint8_t *UE_ident ...@@ -486,14 +486,14 @@ static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint8_t *UE_ident
first_index = i; // save first free position first_index = i; // save first free position
} }
if (memcmp (&eNB_rrc_inst[Mod_id].Info.UE_list[i], UE_identity, sizeof(eNB_rrc_inst[0].Info.UE_list[i])) == 0) { if (eNB_rrc_inst[Mod_id].Info.UE_list[i] == UE_identity) {
// UE_identity already registered // UE_identity already registered
reg = 1; reg = 1;
} }
} }
if (reg == 0) { if (reg == 0) {
LOG_I(RRC, "[eNB %d] Adding UE %d\n", Mod_id, first_index); LOG_I(RRC, "[eNB %d] Adding UE %d with identity "PRIu64"\n", Mod_id, first_index, UE_identity);
return (first_index); return (first_index);
} }
else { else {
...@@ -551,10 +551,9 @@ void rrc_eNB_generate_SecurityModeCommand (u8 Mod_id, u32 frame, u16 UE_index) ...@@ -551,10 +551,9 @@ void rrc_eNB_generate_SecurityModeCommand (u8 Mod_id, u32 frame, u16 UE_index)
LOG_D (RRC, LOG_D (RRC,
"[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", "[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (securityModeCommand to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, DCCH);
(UE_index * NB_RB_MAX) + DCCH);
//rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer); //rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer);
pdcp_rrc_data_req (Mod_id, frame, 1, (UE_index * NB_RB_MAX) + DCCH, pdcp_rrc_data_req (Mod_id, UE_index, frame, 1, DCCH,
rrc_eNB_mui++, 0, size, buffer, 1); rrc_eNB_mui++, 0, size, buffer, 1);
} }
...@@ -575,10 +574,9 @@ void rrc_eNB_generate_UECapabilityEnquiry (u8 Mod_id, u32 frame, u16 UE_index) ...@@ -575,10 +574,9 @@ void rrc_eNB_generate_UECapabilityEnquiry (u8 Mod_id, u32 frame, u16 UE_index)
LOG_D (RRC, LOG_D (RRC,
"[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (UECapabilityEnquiry to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", "[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (UECapabilityEnquiry to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, DCCH);
(UE_index * NB_RB_MAX) + DCCH);
//rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer); //rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer);
pdcp_rrc_data_req (Mod_id, frame, 1, (UE_index * NB_RB_MAX) + DCCH, pdcp_rrc_data_req (Mod_id, UE_index, frame, 1, DCCH,
rrc_eNB_mui++, 0, size, buffer, 1); rrc_eNB_mui++, 0, size, buffer, 1);
} }
...@@ -1083,10 +1081,9 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration (u8 Mod_id, u32 ...@@ -1083,10 +1081,9 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration (u8 Mod_id, u32
Mod_id, frame, size, UE_index); Mod_id, frame, size, UE_index);
LOG_D (RRC,"[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n", LOG_D (RRC,"[MSC_MSG][FRAME %05d][RRC_eNB][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, frame, Mod_id, size, UE_index, rrc_eNB_mui, Mod_id, DCCH);
(UE_index * NB_RB_MAX) + DCCH);
//rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer); //rrc_rlc_data_req(Mod_id,frame, 1,(UE_index*NB_RB_MAX)+DCCH,rrc_eNB_mui++,0,size,(char*)buffer);
pdcp_rrc_data_req (Mod_id, frame, 1, (UE_index * NB_RB_MAX) + DCCH, pdcp_rrc_data_req (Mod_id, UE_index, frame, 1, DCCH,
rrc_eNB_mui++, 0, size, buffer, 1); rrc_eNB_mui++, 0, size, buffer, 1);
} }
...@@ -1186,7 +1183,7 @@ void rrc_eNB_generate_HandoverPreparationInformation (u8 Mod_id, u32 frame, u8 U ...@@ -1186,7 +1183,7 @@ void rrc_eNB_generate_HandoverPreparationInformation (u8 Mod_id, u32 frame, u8 U
if (mod_id_target != 0xFF) { if (mod_id_target != 0xFF) {
//UE_id_target = rrc_find_free_ue_index(modid_target); //UE_id_target = rrc_find_free_ue_index(modid_target);
UE_id_target = rrc_eNB_get_next_free_UE_index(mod_id_target,(u8 *) &eNB_rrc_inst[Mod_id].Info.UE_list[UE_index]); //this should return a new index UE_id_target = rrc_eNB_get_next_free_UE_index(mod_id_target, eNB_rrc_inst[Mod_id].Info.UE_list[UE_index]); //this should return a new index
if (UE_id_target!=0xFF) { if (UE_id_target!=0xFF) {
LOG_N(RRC,"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %d: source UE_id %d target UE_id %d source_modId: %d target_modId: %d\n",Mod_id,frame,eNB_rrc_inst[Mod_id].physCellId,targetPhyId,UE_index,UE_id_target,Mod_id,mod_id_target); LOG_N(RRC,"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %d: source UE_id %d target UE_id %d source_modId: %d target_modId: %d\n",Mod_id,frame,eNB_rrc_inst[Mod_id].physCellId,targetPhyId,UE_index,UE_id_target,Mod_id,mod_id_target);
...@@ -1243,7 +1240,7 @@ void check_handovers(u8 Mod_id, u32 frame) { ...@@ -1243,7 +1240,7 @@ void check_handovers(u8 Mod_id, u32 frame) {
LOG_D(RRC,"[eNB %d] Frame %d: handover Command received for new UE_idx %d current eNB %d target eNB: %d \n", LOG_D(RRC,"[eNB %d] Frame %d: handover Command received for new UE_idx %d current eNB %d target eNB: %d \n",
Mod_id, frame, i,Mod_id,eNB_rrc_inst[Mod_id].handover_info[i]->modid_t); Mod_id, frame, i,Mod_id,eNB_rrc_inst[Mod_id].handover_info[i]->modid_t);
//rrc_eNB_process_handoverPreparationInformation(Mod_id,frame,i); //rrc_eNB_process_handoverPreparationInformation(Mod_id,frame,i);
pdcp_data_req(Mod_id,frame, 1, pdcp_data_req(Mod_id, i, frame, 1,
(i* NB_RB_MAX)+DCCH, (i* NB_RB_MAX)+DCCH,
rrc_eNB_mui++,0, rrc_eNB_mui++,0,
eNB_rrc_inst[Mod_id].handover_info[i]->size, eNB_rrc_inst[Mod_id].handover_info[i]->size,
...@@ -1974,7 +1971,7 @@ void rrc_eNB_generate_RRCConnectionReconfiguration_handover (u8 Mod_id, u32 fram ...@@ -1974,7 +1971,7 @@ void rrc_eNB_generate_RRCConnectionReconfiguration_handover (u8 Mod_id, u32 fram
// rrc_pdcp_config_req (Mod_id, frame, 1, ACTION_ADD, idx, UNDEF_SECURITY_MODE); // rrc_pdcp_config_req (Mod_id, frame, 1, ACTION_ADD, idx, UNDEF_SECURITY_MODE);
// rrc_rlc_config_req(Mod_id,frame,1,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); // rrc_rlc_config_req(Mod_id,frame,1,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
rrc_pdcp_config_asn1_req (Mod_id, frame, 1, UE_index, rrc_pdcp_config_asn1_req (Mod_id, UE_index, frame, 1,
eNB_rrc_inst[Mod_id].SRB_configList[UE_index], eNB_rrc_inst[Mod_id].SRB_configList[UE_index],
(DRB_ToAddModList_t *) NULL, (DRB_ToAddModList_t *) NULL,
(DRB_ToReleaseList_t *) NULL, (DRB_ToReleaseList_t *) NULL,
...@@ -2136,7 +2133,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete (u8 Mod_id, u32 frame, ...@@ -2136,7 +2133,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete (u8 Mod_id, u32 frame,
#endif #endif
// Refresh SRBs/DRBs // Refresh SRBs/DRBs
rrc_pdcp_config_asn1_req (Mod_id, frame, 1, UE_index, rrc_pdcp_config_asn1_req (Mod_id, UE_index, frame, 1,
SRB_configList, SRB_configList,
DRB_configList, (DRB_ToReleaseList_t *) NULL, DRB_configList, (DRB_ToReleaseList_t *) NULL,
eNB_rrc_inst[Mod_id].ciphering_algorithm[UE_index] | eNB_rrc_inst[Mod_id].ciphering_algorithm[UE_index] |
...@@ -2316,10 +2313,14 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete (u8 Mod_id, u32 frame, ...@@ -2316,10 +2313,14 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete (u8 Mod_id, u32 frame,
void rrc_eNB_generate_RRCConnectionSetup (u8 Mod_id, u32 frame, u16 UE_index) { void rrc_eNB_generate_RRCConnectionSetup (u8 Mod_id, u32 frame, u16 UE_index) {
LogicalChannelConfig_t *SRB1_logicalChannelConfig; //,*SRB2_logicalChannelConfig; LogicalChannelConfig_t *SRB1_logicalChannelConfig; //,*SRB2_logicalChannelConfig;
SRB_ToAddModList_t **SRB_configList = &eNB_rrc_inst[Mod_id].SRB_configList[UE_index]; SRB_ToAddModList_t **SRB_configList;
SRB_ToAddMod_t *SRB1_config; SRB_ToAddMod_t *SRB1_config;
int cnt; int cnt;
DevCheck(UE_index < NUMBER_OF_UE_MAX, UE_index, NUMBER_OF_UE_MAX, 0);
SRB_configList = &eNB_rrc_inst[Mod_id].SRB_configList[UE_index];
eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.payload_size = eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.payload_size =
do_RRCConnectionSetup ((u8 *) eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.Payload, do_RRCConnectionSetup ((u8 *) eNB_rrc_inst[Mod_id].Srb0.Tx_buffer.Payload,
mac_xface->get_transmission_mode (Mod_id, mac_xface->get_transmission_mode (Mod_id,
...@@ -2612,9 +2613,12 @@ for (i = 0; i < 8; i++) ...@@ -2612,9 +2613,12 @@ for (i = 0; i < 8; i++)
frame, Mod_id, Mod_id); frame, Mod_id, Mod_id);
rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8; rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8;
UE_index = rrc_eNB_get_next_free_UE_index (Mod_id, {
(u8 *) rrcConnectionRequest->ue_Identity. uint64_t random_value = 0;
choice.randomValue.buf);
memcpy(((u8*)&random_value) + 3, rrcConnectionRequest->ue_Identity.choice.randomValue.buf, rrcConnectionRequest->ue_Identity.choice.randomValue.size);
UE_index = rrc_eNB_get_next_free_UE_index (Mod_id, random_value);
}
if (UE_index != UE_INDEX_INVALID) if (UE_index != UE_INDEX_INVALID)
{ {
...@@ -2678,7 +2682,7 @@ for (i = 0; i < 8; i++) ...@@ -2678,7 +2682,7 @@ for (i = 0; i < 8; i++)
// rrc_rlc_config_req(Mod_id,frame,1,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am_config); // rrc_rlc_config_req(Mod_id,frame,1,ACTION_ADD,Idx,SIGNALLING_RADIO_BEARER,Rlc_info_am_config);
rrc_pdcp_config_asn1_req (Mod_id, frame, 1, UE_index, rrc_pdcp_config_asn1_req (Mod_id, UE_index, frame, 1,
eNB_rrc_inst[Mod_id]. eNB_rrc_inst[Mod_id].
SRB_configList[UE_index], SRB_configList[UE_index],
(DRB_ToAddModList_t *) NULL, (DRB_ToAddModList_t *) NULL,
......
...@@ -164,125 +164,46 @@ def execute(oai, user, pw, logfile,logdir): ...@@ -164,125 +164,46 @@ def execute(oai, user, pw, logfile,logdir):
try: try:
test = '06' test = '06'
name = 'Compile oai.rel10.make' name = 'Compile oai.rel8.itti.make'
conf = 'make Rel10=1' conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1'
trace = logdir + '/log_' + case + test + '.txt;' trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for Rel10' diag = 'check the compilation errors for ITTI Rel8'
oai.send('make clean;') oai.send('make clean;')
oai.send('make cleanall;') oai.send('rm -f ./oaisim.rel8.itti;')
oai.send('make cleanasn1;') oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1 -j4' + tee, makerr1, 1500)
oai.send('rm -f ./oaisim.rel10;') oai.send('cp ./oaisim ./oaisim.rel8.itti;')
oai.send_expect_false('make Rel10=1 -j4' + tee, makerr1, 1500)
oai.send('cp ./oaisim ./oaisim.rel10;')
except log.err, e: except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace) log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else: else:
log.ok(case, test, name, conf, '', logfile) log.ok(case, test, name, conf, '', logfile)
#try:
#test = '07'
#name = 'Compile oai.rel8.cellular.eNB.make'
#conf = 'make rrc_cellular=1 eNB_flag=1'
#tee = ' | tee ' + logdir + '/log_' + case + test + '.txt;'
#diag = 'check the compilation errors for eNB/RG RRC Cellular'
#oai.send('make clean;')
#oai.send('make cleanall;')
#oai.send('make cleanasn1;')
#oai.send('rm -f ./oaisim.rel8.cellular.rg;')
#oai.send_expect_false('make rrc_cellular=1 eNB_flag=1 -j4' + tee, makerr1, 1500)
#oai.send('cp ./oaisim ./oaisim.rel8.cellular.rg;')
#except log.err, e:
#log.fail(case, test, name, conf, e.value, diag, logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#else:
#log.ok(case, test, name, conf, '', logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#try:
#test = '08'
#name = 'Compile oai.rel8.cellular.UE.make'
#conf = 'make rrc_cellular=1 UE_flag=1'
#tee = ' | tee ' + logdir + '/log_' + case + test + '.txt;'
#diag = 'check the compilation errors for UE/MT RRC Cellular'
#oai.send('make clean;')
#oai.send('make cleanall;')
#oai.send('make cleanasn1;')
#oai.send('rm -f ./oaisim.rel8.cellular.mt;')
#oai.send_expect_false('make rrc_cellular=1 UE_flag=1 -j4' + tee, makerr1, 1500)
#oai.send('cp ./oaisim ./oaisim.rel8.cellular.mt;')
#except log.err, e:
#log.fail(case, test, name, conf, e.value, diag, logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#else:
#log.ok(case, test, name, conf, '', logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#try:
#test = '09'
#name = 'Compile oai.rel8.cellular.nas.eNB'
#conf = 'make nas_sim_rg_cellular'
#tee = ' | tee ' + logdir + '/log_' + case + test + '.txt;'
#diag = 'check the compilation errors for NAS SIM RRC Cellular (node RG)'
#oai.send('make clean;')
#oai.send('make cleanall;')
#oai.send('make cleanasn1;')
#oai.send('make cleancell')
#oai.send('rm -f ./nas_sim_rg_cellular;')
#oai.send_expect_false('make nas_sim_rg_cellular -j4' + tee, makerr1, 1500)
#except log.err, e:
#log.fail(case, test, name, conf, e.value, diag, logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#else:
#log.ok(case, test, name, conf, '', logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#try:
#test = '10'
#name = 'Compile oai.rel8.cellular.nas.UE'
#conf = 'make nas_sim_mt_cellular'
#tee = ' | tee ' + logdir + '/log_' + case + test + '.txt;'
#diag = 'check the compilation errors for NAS SIM RRC Cellular (node MT)'
#oai.send('make clean;')
#oai.send('make cleanall;')
#oai.send('make cleanasn1;')
#oai.send('make cleancell')
#oai.send('rm -f ./nas_sim_mt_cellular;')
#oai.send_expect_false('make nas_sim_mt_cellular -j4' + tee, makerr1, 1500)
#except log.err, e:
#log.fail(case, test, name, conf, e.value, diag, logfile)
#log.skip(case, test, name, conf, '', '', logfile)
#else:
#log.ok(case, test, name, conf, '', logfile)
#log.skip(case, test, name, conf, '', '', logfile)
try: try:
test = '11' test = '07'
name = 'Compile oai.rel8.itti.make' name = 'Compile oai.rel10.make'
conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1' conf = 'make Rel10=1'
trace = logdir + '/log_' + case + test + '.txt;' trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for ITTI Rel8' diag = 'check the compilation errors for Rel10'
oai.send('make clean;') oai.send('make clean;')
oai.send('make cleanall;') oai.send('make cleanall;')
oai.send('make cleanasn1;') oai.send('make cleanasn1;')
oai.send('rm -f ./oaisim.rel8.itti;') oai.send('rm -f ./oaisim.rel10;')
oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel8=1 -j4' + tee, makerr1, 1500) oai.send_expect_false('make Rel10=1 -j4' + tee, makerr1, 1500)
oai.send('cp ./oaisim ./oaisim.rel8.itti;') oai.send('cp ./oaisim ./oaisim.rel10;')
except log.err, e: except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace) log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else: else:
log.ok(case, test, name, conf, '', logfile) log.ok(case, test, name, conf, '', logfile)
try: try:
test = '12' test = '08'
name = 'Compile oai.rel10.itti.make' name = 'Compile oai.rel10.itti.make'
conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel10=1' conf = 'make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel10=1'
trace = logdir + '/log_' + case + test + '.txt;' trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for ITTI Rel10' diag = 'check the compilation errors for ITTI Rel10'
oai.send('make clean;')
oai.send('make cleanall;') oai.send('make cleanall;')
oai.send('make cleanasn1;')
oai.send('rm -f ./oaisim.rel10.itti;') oai.send('rm -f ./oaisim.rel10.itti;')
oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel10=1 -j4' + tee, makerr1, 1500) oai.send_expect_false('make DISABLE_XER_PRINT=1 ENABLE_ITTI=1 Rel10=1 -j4' + tee, makerr1, 1500)
oai.send('cp ./oaisim ./oaisim.rel10.itti;') oai.send('cp ./oaisim ./oaisim.rel10.itti;')
......
...@@ -103,29 +103,32 @@ def execute(oai, user, pw, logfile,logdir): ...@@ -103,29 +103,32 @@ def execute(oai, user, pw, logfile,logdir):
test = '03' test = '03'
name = 'Run oai.rel8.abs.ping' name = 'Run oai.rel8.abs.ping'
diag = 'Data-plane is not working normally, check the OAI protocol stack, OAI driver, and normal operation of the OS' diag = 'Data-plane is not working normally, check the OAI protocol stack, OAI driver, and normal operation of the OS'
oai.driver(oai,user,pw) oai.driver(oai,user,pw)
for i in range(NUM_UE) :
for j in range(NUM_eNB) : for i in range(NUM_eNB) :
conf = '-a -A AWGN -l7 -u' + str(i+1) +' -b'+ str(j+1) for j in range(NUM_UE) :
conf = '-a -A AWGN -l6 -u' + str(i+1) +' -b'+ str(j+1)
trace = logdir + '/log_' + case + test + '_' + str(i) + str(j) + '.txt' trace = logdir + '/log_' + case + test + '_' + str(i) + str(j) + '.txt'
trace_ping = logdir + '/log_' + case + test + '_' + str(i) + str(j) + '_ping.txt' tee = ' 2>&1 > ' + trace
tee = ' 2>&1 | tee ' + trace
tee_ping = ' 2>&1 | tee ' + trace_ping
if user == 'root' : if user == 'root' :
oai.send_nowait('./oaisim.rel8.nas ' + conf + tee + ' &') oai.send('./oaisim.rel8.nas ' + conf + ' &')
else : else :
oai.send_nowait('echo '+pw+ ' | sudo -S -E ./oaisim.rel8.nas ' + conf + tee + ' &') oai.send('echo '+pw+ ' | sudo -S -E ./oaisim.rel8.nas ' + conf + tee + ' &')
time.sleep(2) time.sleep(20)
for k in range(NUM_TRIALS) : for k in range(NUM_TRIALS) :
oai.send_expect('ping 10.0.'+str(j+1)+'.'+str(NUM_eNB+i+1) + ' -c ' + str(random.randint(2, 10))+ ' -s ' + str(random.randint(128, 1500)) + tee_ping, ' 0% packet loss', 300) trace_ping = logdir + '/log_' + case + test + '_' + str(i) + str(j) + str(k) + '_ping.txt'
tee_ping = ' 2>&1 | tee ' + trace_ping
oai.send_expect('ping 10.0.'+str(j+1)+'.'+str(NUM_eNB+i+1) + ' -c ' + str(random.randint(2, 10))+ ' -s ' + str(random.randint(128, 1500)) + tee_ping, ' 0% packet loss', 20)
if user == 'root' : if user == 'root' :
oai.send('pkill oaisim;') oai.send('pkill oaisim.rel8.nas;')
oai.send('pkill oaisim.rel8.nas;') oai.send('pkill oaisim.rel8.nas;')
else : else :
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim ;') oai.send('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
time.sleep(1) time.sleep(1)
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;') oai.send('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
oai.rm_driver(oai,user,pw) oai.rm_driver(oai,user,pw)
......
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