Commit 6f5219a6 authored by Lionel Gauthier's avatar Lionel Gauthier

Did not compiled for itti, stil problem with MBMS, see tomorrow

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5087 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 899c178d
......@@ -376,7 +376,7 @@ typedef struct{
);
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t, logical_chan_id_t, tb_size_t, num_tb_t);
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP, logical_chan_id_t channel_idP, tb_size_t tb_sizeP);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
......
......@@ -48,7 +48,7 @@ typedef int traffic_type_t;
typedef u32_t mbms_session_id_t;
typedef u16_t mbms_service_id_t;
typedef u16_t rnti_t;
typedef u32_t rlc_buffer_occupancy_t;
typedef signed int rlc_op_status_t;
typedef unsigned char crc8_t;
......
......@@ -1453,7 +1453,7 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,frameP,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
//printf("frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",frameP,subframeP, rlc_status.bytes_in_buffer);
......@@ -1461,7 +1461,7 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
module_idP,frameP,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, 1, RLC_MBMS_YES,
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, 1, RLC_MBMS_YES,
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
(char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, RLC_MBMS_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
......@@ -1544,7 +1544,7 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
if (oai_emulation.info.opt_enabled)
trace_pdu(1, (uint8_t *)eNB_mac_inst[module_idP].MCH_pdu.payload,
TBS, module_idP, 6, 0xffff, // M_RNTI = 6 in wirehsark
eNB_mac_inst[module_idP].subframeP,0,0);
eNB_mac_inst[module_idP].subframe,0,0);
LOG_D(OPT,"[eNB %d][MCH] Frame %d : MAC PDU with size %d\n",
module_idP, frameP, TBS);
#endif
......@@ -4324,7 +4324,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,u8 cooperation_flag, frame
case RRC_MAC_BCCH_DATA_REQ:
LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_MAC_BCCH_DATA_REQ (msg_p).frameP, RRC_MAC_BCCH_DATA_REQ (msg_p).enb_index);
RRC_MAC_BCCH_DATA_REQ (msg_p).frame, RRC_MAC_BCCH_DATA_REQ (msg_p).enb_index);
// TODO process BCCH data req.
break;
......@@ -4332,7 +4332,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,u8 cooperation_flag, frame
case RRC_MAC_CCCH_DATA_REQ:
LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_MAC_CCCH_DATA_REQ (msg_p).frameP, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index);
RRC_MAC_CCCH_DATA_REQ (msg_p).frame, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index);
// TODO process CCCH data req.
break;
......@@ -4341,7 +4341,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,u8 cooperation_flag, frame
case RRC_MAC_MCCH_DATA_REQ:
LOG_D(MAC, "Received %s from %s: instance %d, frameP %d, eNB_index %d, mbsfn_sync_area %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_MAC_MCCH_DATA_REQ (msg_p).frameP, RRC_MAC_MCCH_DATA_REQ (msg_p).enb_index, RRC_MAC_MCCH_DATA_REQ (msg_p).mbsfn_sync_area);
RRC_MAC_MCCH_DATA_REQ (msg_p).frame, RRC_MAC_MCCH_DATA_REQ (msg_p).enb_index, RRC_MAC_MCCH_DATA_REQ (msg_p).mbsfn_sync_area);
// TODO process MCCH data req.
break;
......
This diff is collapsed.
......@@ -88,7 +88,6 @@ BOOL pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t fram
u16 current_sn = 0;
mem_block_t *pdcp_pdu_p = NULL;
rlc_op_status_t rlc_status;
rb_id_t rb_id_rlc = 0;
AssertError (enb_mod_idP < NUMBER_OF_eNB_MAX, return FALSE, "eNB id is too high (%u/%d) %u %u!\n", enb_mod_idP, NUMBER_OF_eNB_MAX, ue_mod_idP, rb_idP);
AssertError (ue_mod_idP < NUMBER_OF_UE_MAX, return FALSE, "UE id is too high (%u/%d) %u %u!\n", ue_mod_idP, NUMBER_OF_UE_MAX, enb_mod_idP, rb_idP);
......@@ -279,7 +278,7 @@ BOOL pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t fram
*/
/*
if (rb_id>=DTCH) {
if (eNB_flag == 1) {
if (enb_flagP == 1) {
Pdcp_stats_tx[module_id][(rb_id & RAB_OFFSET2 )>> RAB_SHIFT2][(rb_id & RAB_OFFSET)-DTCH]++;
Pdcp_stats_tx_bytes[module_id][(rb_id & RAB_OFFSET2 )>> RAB_SHIFT2][(rb_id & RAB_OFFSET)-DTCH] += sdu_buffer_size;
} else {
......@@ -326,13 +325,13 @@ BOOL pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t fram
pdcp_p = &pdcp_array_ue[ue_mod_idP][rb_idP];
LOG_I(PDCP, "Data indication notification for PDCP entity from eNB %u to UE %u "
"and radio bearer ID %d rlc sdu size %d eNB_flag %d\n",
"and radio bearer ID %d rlc sdu size %d enb_flagP %d\n",
ue_mod_idP, enb_mod_idP, rb_idP, sdu_buffer_sizeP, enb_flagP);
} else {
pdcp_p = &pdcp_array_eNB[enb_mod_idP][ue_mod_idP][rb_idP];
LOG_I(PDCP, "Data indication notification for PDCP entity from UE %u to eNB %u "
"and radio bearer ID %d rlc sdu size %d eNB_flag %d eNB_id %d\n",
"and radio bearer ID %d rlc sdu size %d enb_flagP %d eNB_id %d\n",
enb_mod_idP, ue_mod_idP, rb_idP, sdu_buffer_sizeP, enb_flagP, enb_mod_idP);
}
sdu_list_p = &pdcp_sdu_list;
......@@ -522,7 +521,7 @@ BOOL pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t fram
}
//-----------------------------------------------------------------------------
void pdcp_run (frame_t frameP, eNB_flag_t eNB_flag, module_id_t ue_mod_idP, module_id_t enb_mod_idP) {
void pdcp_run (frame_t frameP, eNB_flag_t enb_flagP, module_id_t ue_mod_idP, module_id_t enb_mod_idP) {
//-----------------------------------------------------------------------------
#if defined(ENABLE_ITTI)
MessageDef *msg_p;
......@@ -536,7 +535,7 @@ void pdcp_run (frame_t frameP, eNB_flag_t eNB_flag, module_id_t ue_mod_idP, mod
#if defined(ENABLE_ITTI)
do {
// Checks if a message has been sent to PDCP sub-task
itti_poll_msg (eNB_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, &msg_p);
itti_poll_msg (enb_flagP ? TASK_PDCP_ENB : TASK_PDCP_UE, &msg_p);
if (msg_p != NULL) {
msg_name = ITTI_MSG_NAME (msg_p);
......@@ -544,7 +543,7 @@ void pdcp_run (frame_t frameP, eNB_flag_t eNB_flag, module_id_t ue_mod_idP, mod
switch (ITTI_MSG_ID(msg_p)) {
case RRC_DCCH_DATA_REQ:
LOG_I(PDCP, "Received %s from %s: instance %d, frame %d, eNB_flag %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
LOG_I(PDCP, "Received %s from %s: instance %d, frame %d, enb_flagP %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_DCCH_DATA_REQ (msg_p).frame, RRC_DCCH_DATA_REQ (msg_p).enb_flag, RRC_DCCH_DATA_REQ (msg_p).rb_id,
RRC_DCCH_DATA_REQ (msg_p).muip, RRC_DCCH_DATA_REQ (msg_p).confirmp, RRC_DCCH_DATA_REQ (msg_p).mode);
......@@ -595,13 +594,13 @@ void pdcp_run (frame_t frameP, eNB_flag_t eNB_flag, module_id_t ue_mod_idP, mod
# endif
#endif
pdcp_fifo_read_input_sdus_from_otg(frameP, eNB_flag, ue_mod_idP, enb_mod_idP);
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
pdcp_fifo_read_input_sdus(frameP, eNB_flag, ue_mod_idP, enb_mod_idP);
pdcp_fifo_read_input_sdus(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
// PDCP -> NAS/IP traffic: RX
pdcp_fifo_flush_sdus(frameP, eNB_flag, enb_mod_idP, ue_mod_idP);
pdcp_fifo_flush_sdus(frameP, enb_flagP, enb_mod_idP, ue_mod_idP);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_OUT);
}
......@@ -841,32 +840,37 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
}
#ifdef Rel10
if (pmch_InfoList_r9 != NULL) {
for (i=0;i<pmch_InfoList_r9->list.count;i++) {
mbms_SessionInfoList_r9 = &(pmch_InfoList_r9->list.array[i]->mbms_SessionInfoList_r9);
for (j=0;j<mbms_SessionInfoList_r9->list.count;j++) {
MBMS_SessionInfo = mbms_SessionInfoList_r9->list.array[j];
//lc_id = MBMS_SessionInfo->logicalChannelIdentity_r9; // lcid
lc_id = MBMS_SessionInfo->sessionId_r9->buf[0];
mch_id = MBMS_SessionInfo->tmgi_r9.serviceId_r9.buf[2]; //serviceId is 3-octet string
if (pmch_InfoList_r9_pP != NULL) {
for (i=0;i<pmch_InfoList_r9_pP->list.count;i++) {
mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9);
for (j=0;j<mbms_SessionInfoList_r9_p->list.count;j++) {
MBMS_SessionInfo_p = mbms_SessionInfoList_r9_p->list.array[j];
lc_id = MBMS_SessionInfo_p->sessionId_r9->buf[0];
mch_id = MBMS_SessionInfo_p->tmgi_r9.serviceId_r9.buf[2]; //serviceId is 3-octet string
// can set the mch_id = i
if (eNB_flag)
if (enb_flagP) {
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id;
else
if (pdcp_mbms_array_eNB[enb_mod_idP][rb_id].instanciated_instance == module_id + 1)
action = ACTION_MBMS_MODIFY;
else
action = ACTION_MBMS_ADD;
} else {
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id + (maxDRB + 3);
if (pdcp_mbms_array_ue[ue_mod_idP][rb_id].instanciated_instance == module_id + 1)
action = ACTION_MBMS_MODIFY;
else
action = ACTION_MBMS_ADD;
}
if (pdcp_mbms_array[module_id][rb_id].instanciated_instance == module_id + 1)
action = ACTION_MBMS_MODIFY;
else
action = ACTION_MBMS_ADD;
rlc_type = RLC_MODE_UM;
pdcp_config_req_asn1 (NULL,
enb_mod_idP,
ue_mod_idP,
frameP,
eNB_flag,
enb_flagP,
rlc_type,
action,
lc_id,
......@@ -875,10 +879,10 @@ BOOL rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
0, // set to deafult
0,
0,
security_mode,
kRRCenc,
kRRCint,
kUPenc);
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP);
}
}
}
......@@ -1054,7 +1058,7 @@ void pdcp_config_set_security(pdcp_t *pdcp_pP,
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t eNB_flag,
eNB_flag_t enb_flagP,
rb_id_t rb_idP,
u16 lc_idP,
u8 security_modeP,
......@@ -1068,7 +1072,7 @@ void pdcp_config_set_security(pdcp_t *pdcp_pP,
pdcp_pP->cipheringAlgorithm = security_modeP & 0x0f;
pdcp_pP->integrityProtAlgorithm = (security_modeP>>4) & 0xf;
if (eNB_flag == 0) {
if (enb_flagP == 0) {
LOG_D(PDCP,"[UE %d][RB %02d] Set security mode : ACTION_SET_SECURITY_MODE: "
"Frame %d cipheringAlgorithm %d integrityProtAlgorithm %d\n",
ue_mod_idP, rb_idP, frameP, pdcp_pP->cipheringAlgorithm, pdcp_pP->integrityProtAlgorithm);
......
......@@ -709,7 +709,11 @@ rlc_am_mac_data_request (void *rlc_pP, frame_t frameP)
msg_p->ittiMsg.rlc_am_data_pdu_req.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_am_data_pdu_req.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# else
rlc_am_display_data_pdu_infos(l_rlc_p, frameP, &pdu_info);
# endif
......@@ -741,7 +745,11 @@ rlc_am_mac_data_request (void *rlc_pP, frame_t frameP)
msg_p->ittiMsg.rlc_am_status_pdu_req.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_am_status_pdu_req.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# endif
}
}
......@@ -844,7 +852,11 @@ rlc_am_mac_data_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP,
msg_p->ittiMsg.rlc_am_data_pdu_ind.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_am_data_pdu_ind.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# else
rlc_am_display_data_pdu_infos(l_rlc_p, frameP, &pdu_info);
# endif
......@@ -875,7 +887,11 @@ rlc_am_mac_data_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP,
msg_p->ittiMsg.rlc_am_status_pdu_ind.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_am_status_pdu_ind.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# endif
}
}
......
......@@ -48,23 +48,24 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
# include "list.h"
# include "rlc_primitives.h"
# include "rlc_def_lte.h"
# include "rlc_def.h"
# include "rlc_am_structs.h"
# include "rlc_am_constants.h"
//-----------------------------------------------------------------------------
/*! \struct rlc_am_entity_t
* \brief Structure containing a RLC AM instance protocol variables, statistic variables, allocation variables, buffers and other miscellaneous variables.
*/
typedef struct rlc_am_entity {
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance, meaningful if is_enb is set. */
typedef struct rlc_am_entity_s {
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance. */
module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
signed int sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */
signed int retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
signed int status_buffer_occupancy; /*!< \brief Number of bytes of control PDUs waiting for transmission. */
rlc_buffer_occupancy_t sdu_buffer_occupancy; /*!< \brief Number of bytes of unsegmented SDUs. */
rlc_buffer_occupancy_t retransmission_buffer_occupancy; /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
rlc_buffer_occupancy_t status_buffer_occupancy; /*!< \brief Number of bytes of control PDUs waiting for transmission. */
//---------------------------------------------------------------------
// TX BUFFERS
......@@ -96,7 +97,7 @@ typedef struct rlc_am_entity {
//---------------------------------------------------------------------
// PROTOCOL VARIABLES
//---------------------------------------------------------------------
u8_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE. */
rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE. */
//-----------------------------
// TX STATE VARIABLES
//-----------------------------
......@@ -174,18 +175,18 @@ typedef struct rlc_am_entity {
u16_t nb_bytes_requested_by_mac; /*!< \brief Number of bytes requested by lower layer for next transmission. */
list_t pdus_to_mac_layer; /*!< \brief PDUs buffered for transmission to MAC layer. */
list_t control_pdu_list; /*!< \brief Control PDUs buffered for transmission to MAC layer. */
s16_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */
rlc_sn_t first_retrans_pdu_sn; /*!< \brief Lowest sequence number of PDU to be retransmitted. */
list_t segmentation_pdu_list; /*!< \brief List of "freshly" segmented PDUs. */
u32_t status_requested; /*!< \brief Status requested by peer. */
u32_t last_frame_status_indication; /*!< \brief The last frame number a MAC status indication has been received by RLC. */
boolean_t status_requested; /*!< \brief Status requested by peer. */
frame_t last_frame_status_indication; /*!< \brief The last frame number a MAC status indication has been received by RLC. */
//-----------------------------
// buffer occupancy measurements sent to MAC
//-----------------------------
// note occupancy of other buffers is deducted from nb elements in lists
u32_t buffer_occupancy_retransmission_buffer; /*!< \brief Number of PDUs. */
rlc_buffer_occupancy_t buffer_occupancy_retransmission_buffer; /*!< \brief Number of PDUs. */
u8_t allocation; /*!< \brief Boolean for rlc_am_entity_t struct allocation. */
boolean_t allocation; /*!< \brief Boolean for rlc_am_entity_t struct allocation. */
} rlc_am_entity_t;
/** @} */
# endif
......@@ -47,16 +47,16 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void *rlc_tm_tx (void *argP);
void rlc_tm_rx_no_segment (void *argP, struct mac_data_ind data_indP);
void rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP);
void *rlc_tm_tx (void *arg_pP);
void rlc_tm_rx_no_segment (void *arg_pP, struct mac_data_ind data_indP);
void rlc_tm_rx_segment (void *arg_pP, struct mac_data_ind data_indP);
//-----------------------------------------------------------------------------
void
rlc_tm_get_pdus (void *argP)
rlc_tm_get_pdus (void *arg_pP)
{
//-----------------------------------------------------------------------------
struct rlc_tm_entity *rlc = (struct rlc_tm_entity *) argP;
struct rlc_tm_entity *rlc = (struct rlc_tm_entity *) arg_pP;
switch (rlc->protocol_state) {
......@@ -80,12 +80,12 @@ rlc_tm_get_pdus (void *argP)
//-----------------------------------------------------------------------------
void
rlc_tm_rx_no_segment (void *argP, struct mac_data_ind data_indP)
rlc_tm_rx_no_segment (void *arg_pP, struct mac_data_ind data_indP)
{
//-----------------------------------------------------------------------------
struct rlc_tm_entity *rlc = (struct rlc_tm_entity *) argP;
mem_block_t *tb;
struct rlc_tm_entity *rlc = (struct rlc_tm_entity *) arg_pP;
mem_block_t *tb_p;
u8_t *first_byte;
u8_t tb_size_in_bytes;
u8_t first_bit;
......@@ -100,17 +100,17 @@ rlc_tm_rx_no_segment (void *argP, struct mac_data_ind data_indP)
// Upon reception of a CRLC-CONFIG-Req from upper layer indicating establishment, the RLC entity:
// - is created; and
// - enters the DATA_TRANSFER_READY state.
msg ("[RLC_TM %p] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", argP);
msg ("[RLC_TM %p] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", arg_pP);
list_free (&data_indP.data);
break;
case RLC_DATA_TRANSFER_READY_STATE:
rlc->output_sdu_size_to_write = 0; // size of sdu reassemblied
while ((tb = list_remove_head (&data_indP.data))) {
first_byte = ((struct mac_tb_ind *) (tb->data))->data_ptr;
while ((tb_p = list_remove_head (&data_indP.data))) {
first_byte = ((struct mac_tb_ind *) (tb_p->data))->data_ptr;
tb_size_in_bytes = (data_indP.tb_size + 7) >> 3;
first_bit = ((struct mac_tb_ind *) (tb->data))->first_bit;
first_bit = ((struct mac_tb_ind *) (tb_p->data))->first_bit;
if (first_bit > 0) {
// shift data of transport_block TO CHECK
bits_to_shift_last_loop = 0;
......@@ -123,18 +123,18 @@ rlc_tm_rx_no_segment (void *argP, struct mac_data_ind data_indP)
}
}
((struct rlc_tm_rx_pdu_management *) (tb->data))->first_byte = first_byte;
((struct rlc_tm_rx_pdu_management *) (tb_p->data))->first_byte = first_byte;
if (rlc->delivery_of_erroneous_sdu == RLC_TM_DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT) {
rlc_tm_send_sdu_no_segment (rlc, 0, first_byte, data_indP.tb_size);
} else if (rlc->delivery_of_erroneous_sdu == RLC_TM_DELIVERY_OF_ERRONEOUS_SDU_YES) {
rlc_tm_send_sdu_no_segment (rlc, (((struct mac_tb_ind *) (tb->data))->error_indication), first_byte, data_indP.tb_size);
rlc_tm_send_sdu_no_segment (rlc, (((struct mac_tb_ind *) (tb_p->data))->error_indication), first_byte, data_indP.tb_size);
} else { //RLC_TM_DELIVERY_OF_ERRONEOUS_SDU_NO
if (!(((struct mac_tb_ind *) (tb->data))->error_indication)) {
if (!(((struct mac_tb_ind *) (tb_p->data))->error_indication)) {
rlc_tm_send_sdu_no_segment (rlc, 0, first_byte, data_indP.tb_size);
}
}
free_mem_block (tb);
free_mem_block (tb_p);
}
break;
......@@ -145,22 +145,22 @@ rlc_tm_rx_no_segment (void *argP, struct mac_data_ind data_indP)
//-----------------------------------------------------------------------------
void
rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP)
rlc_tm_rx_segment (void *arg_pP, struct mac_data_ind data_indP)
{
//-----------------------------------------------------------------------------
struct rlc_tm_entity *rlc = (struct rlc_tm_entity *) argP;
mem_block_t *tb;
s32_t tb_size_in_bits;
u8_t *first_byte;
u8_t error_in_sdu;
u8_t tb_size_in_bytes;
u8_t first_bit;
u8_t byte;
struct rlc_tm_entity *rlc = (struct rlc_tm_entity_s *) arg_pP;
mem_block_t *tb_p = NULL;
sdu_size_t tb_size_in_bits = 0;
u8_t *first_byte_p = NULL;
u8_t error_in_sdu = 0;
sdu_size_t tb_size_in_bytes= 0;
u8_t first_bit = 0;
u8_t byte = 0;
//just for debug
u8_t *debug;
u8_t *debug = NULL;
switch (rlc->protocol_state) {
......@@ -170,7 +170,7 @@ rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP)
// Upon reception of a CRLC-CONFIG-Req from upper layer indicating establishment, the RLC entity:
// - is created; and
// - enters the DATA_TRANSFER_READY state.
msg ("[RLC_TM %p] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", argP);
msg ("[RLC_TM %p] ERROR MAC_DATA_IND IN RLC_NULL_STATE\n", arg_pP);
list_free (&data_indP.data);
break;
......@@ -183,9 +183,9 @@ rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP)
case RLC_TM_DELIVERY_OF_ERRONEOUS_SDU_YES:
error_in_sdu = 0;
while ((tb = list_remove_head (&data_indP.data))) {
while ((tb_p = list_remove_head (&data_indP.data))) {
if ((((struct mac_tb_ind *) (tb->data))->error_indication)) {
if ((((struct mac_tb_ind *) (tb_p->data))->error_indication)) {
error_in_sdu = 1;
}
}
......@@ -200,16 +200,16 @@ rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP)
}
debug = (u8_t*)&rlc->output_sdu_in_construction->data[0];
while ((tb = list_remove_head (&data_indP.data))) {
while ((tb_p = list_remove_head (&data_indP.data))) {
if ((((struct mac_tb_ind *) (tb->data))->error_indication) && (error_in_sdu)) {
if ((((struct mac_tb_ind *) (tb_p->data))->error_indication) && (error_in_sdu)) {
error_in_sdu = 1;
} else {
first_byte = ((struct mac_tb_ind *) (tb->data))->data_ptr;
first_byte = ((struct mac_tb_ind *) (tb_p->data))->data_ptr;
tb_size_in_bytes = (data_indP.tb_size + 7) >> 3;
tb_size_in_bits = data_indP.tb_size;
first_bit = ((struct mac_tb_ind *) (tb->data))->first_bit;
first_bit = ((struct mac_tb_ind *) (tb_p->data))->first_bit;
while (tb_size_in_bits > 0) {
......@@ -272,7 +272,7 @@ rlc_tm_rx_segment (void *argP, struct mac_data_ind data_indP)
}
}
}
free_mem_block (tb);
free_mem_block (tb_p);
}
if (!(error_in_sdu)) {
rlc_tm_send_sdu_segment (rlc, 0);
......
......@@ -47,16 +47,16 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
* \brief Structure containing a RLC TM instance protocol variables, allocation variables, buffers and other miscellaneous variables.
*/
typedef struct rlc_tm_entity {
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance, meaningful if is_enb is set. */
module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance. */
u8_t allocation; /*!< \brief Boolean for rlc_tm_entity_t struct allocation. */
u8_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */
boolean_t is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
module_id_t enb_module_id; /*!< \brief eNB Virtualization index for this protocol instance, meaningful if is_enb is set. */
module_id_t ue_module_id; /*!< \brief UE Virtualization index for this protocol instance, meaningful if is_enb is set. */
boolean_t allocation; /*!< \brief Boolean for rlc_tm_entity_t struct allocation. */
rlc_protocol_state_t protocol_state; /*!< \brief Protocol state, can be RLC_NULL_STATE, RLC_DATA_TRANSFER_READY_STATE, RLC_LOCAL_SUSPEND_STATE. */
boolean_t is_uplink_downlink; /*!< \brief Is this instance is a transmitter, a receiver or both? */
boolean_t is_data_plane; /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
// for stats and trace purpose :
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
logical_chan_id_t channel_id; /*!< \brief Transport channel identifier. */
rb_id_t rb_id; /*!< \brief Radio bearer identifier, for statistics and trace purpose. */
boolean_t is_enb; /*!< \brief To know if the RLC belongs to a eNB or UE. */
//-----------------------------
// tranmission
//-----------------------------
......@@ -69,7 +69,7 @@ typedef struct rlc_tm_entity {
u16_t current_sdu_index; /*!< \brief Current SDU index in input_sdus array to be segmented. */
list_t pdus_to_mac_layer; /*!< \brief PDUs buffered for transmission to MAC layer. */
sdu_size_t rlc_pdu_size;
u32_t buffer_occupancy; /*!< \brief Number of bytes contained in input_sdus buffer.*/
rlc_buffer_occupancy_t buffer_occupancy; /*!< \brief Number of bytes contained in input_sdus buffer.*/
//-----------------------------
// receiver
//-----------------------------
......
......@@ -318,7 +318,11 @@ rlc_um_rx (void *argP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind
msg_p->ittiMsg.rlc_um_data_pdu_ind.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_um_data_pdu_ind.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# else
LOG_T(RLC, "%s", message_string);
# endif
......@@ -576,7 +580,11 @@ rlc_um_mac_data_request (void *rlc_pP,frame_t frameP)
msg_p->ittiMsg.rlc_um_data_pdu_req.size = message_string_size;
memcpy(&msg_p->ittiMsg.rlc_um_data_pdu_req.text, message_string, message_string_size);
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->module_id + NB_eNB_INST, msg_p);
if (l_rlc_p->is_enb) {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->enb_module_id, msg_p);
} else {
itti_send_msg_to_task(TASK_UNKNOWN, l_rlc_p->ue_module_id + NB_eNB_INST, msg_p);
}
# else
LOG_T(RLC, "%s", message_string);
# endif
......
......@@ -38,7 +38,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
//-----------------------------------------------------------------------------
int
rlc_um_fsm_notify_event (struct rlc_um_entity *rlc_pP, u8_t eventP)
rlc_um_fsm_notify_event (rlc_um_entity_t *rlc_pP, u8_t eventP)
{
//-----------------------------------------------------------------------------
......
......@@ -60,7 +60,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
# include "platform_types.h"
# include "rlc_um_entity.h"
//-----------------------------------------------------------------------------
/*! \fn int rlc_um_fsm_notify_event (struct rlc_um_entity *rlcP, u8_t eventP)
/*! \fn int rlc_um_fsm_notify_event (rlc_um_entity_t *rlcP, u8_t eventP)
* \brief Send an event to the RLC UM finite state machine.
* \param[in] rlcP RLC UM protocol instance pointer.
* \param[in] eventP Event (#RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_NULL_STATE_EVENT,
......@@ -71,6 +71,6 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
* \return 1 if no error was encountered, 0 if the event was not processed.
* \Note This FSM is not LTE 9.3.0 compliant, it has to be modified or removed.
*/
protected_rlc_um_fsm(int rlc_um_fsm_notify_event (struct rlc_um_entity *rlcP, u8_t eventP));
protected_rlc_um_fsm(int rlc_um_fsm_notify_event (rlc_um_entity_t *rlcP, u8_t eventP));
/** @} */
# endif
......@@ -43,7 +43,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#define DEBUG_RLC_UM_RX
//-----------------------------------------------------------------------------
void rlc_um_display_rx_window(struct rlc_um_entity *rlc_pP)
void rlc_um_display_rx_window(rlc_um_entity_t *rlc_pP)
//-----------------------------------------------------------------------------
{
/*
......@@ -145,7 +145,7 @@ void rlc_um_display_rx_window(struct rlc_um_entity *rlc_pP)
//-----------------------------------------------------------------------------
void
rlc_um_receive (struct rlc_um_entity *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP)
rlc_um_receive (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP)
{
//-----------------------------------------------------------------------------
......
......@@ -59,19 +59,19 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
# include "rlc_um_entity.h"
# include "mac_primitives.h"
/*! \fn void rlc_um_display_rx_window(struct rlc_um_entity *rlc_pP)
/*! \fn void rlc_um_display_rx_window(rlc_um_entity_t *rlc_pP)
* \brief Display the content of the RX buffer, the output stream is targeted to TTY terminals because of escape sequences.
* \param[in] rlc_pP RLC UM protocol instance pointer.
*/
protected_rlc_um_receiver( void rlc_um_display_rx_window(struct rlc_um_entity *rlc_pP);)
protected_rlc_um_receiver( void rlc_um_display_rx_window(rlc_um_entity_t *rlc_pP);)
/*! \fn void rlc_um_receive (struct rlc_um_entity *rlc_pP, frame_t frameP, struct mac_data_ind data_indP)
/*! \fn void rlc_um_receive (rlc_um_entity_t *rlc_pP, frame_t frameP, struct mac_data_ind data_indP)
* \brief Handle the MAC data indication, retreive the transport blocks and send them one by one to the DAR process.
* \param[in] rlc_pP RLC UM protocol instance pointer.
* \param[in] frameP Frame index.
* \param[in] eNB_flagP Flag to indicated eNB (1) or UE (0).
* \param[in] data_indP Data indication structure containing transport block received from MAC layer.
*/
protected_rlc_um_receiver( void rlc_um_receive (struct rlc_um_entity *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP));
protected_rlc_um_receiver( void rlc_um_receive (rlc_um_entity_t *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP, struct mac_data_ind data_indP));
/** @} */
# endif
......@@ -45,7 +45,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
//#define TRACE_RLC_UM_SEGMENT 1
//-----------------------------------------------------------------------------
void
rlc_um_segment_10 (struct rlc_um_entity *rlc_pP,frame_t frameP)
rlc_um_segment_10 (rlc_um_entity_t *rlc_pP,frame_t frameP)
{
//-----------------------------------------------------------------------------
list_t pdus;
......@@ -475,7 +475,7 @@ rlc_um_segment_10 (struct rlc_um_entity *rlc_pP,frame_t frameP)
}
//-----------------------------------------------------------------------------
void
rlc_um_segment_5 (struct rlc_um_entity *rlc_pP,frame_t frameP)
rlc_um_segment_5 (rlc_um_entity_t *rlc_pP,frame_t frameP)
{
//-----------------------------------------------------------------------------
list_t pdus;
......
......@@ -62,19 +62,19 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
# define public_rlc_um_segment(x) extern x
# endif
# endif
/*! \fn void rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame)
/*! \fn void rlc_um_segment_10 (rlc_um_entity_t *rlcP,frame_t frame)
* \brief Segmentation procedure with 10 bits sequence number, segment the first SDU in buffer and create a PDU of the size (nb_bytes_to_transmit) requested by MAC if possible and put it in the list "pdus_to_mac_layer".
* \param[in] rlcP RLC UM protocol instance pointer.
* \param[in] frame Frame Index.
*/
protected_rlc_um_segment(void rlc_um_segment_10 (struct rlc_um_entity *rlcP,u32_t frame));
protected_rlc_um_segment(void rlc_um_segment_10 (rlc_um_entity_t *rlcP,frame_t frame));
/*! \fn void rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame)
/*! \fn void rlc_um_segment_5 (rlc_um_entity_t *rlcP,frame_t frame)
* \brief Segmentation procedure with 5 bits sequence number, segment the first SDU in buffer and create a PDU of the size (nb_bytes_to_transmit) requested by MAC if possible and put it in the list "pdus_to_mac_layer".
* \param[in] rlcP RLC UM protocol instance pointer.
* \param[in] frame Frame Index.
*/
protected_rlc_um_segment(void rlc_um_segment_5 (struct rlc_um_entity *rlcP,u32_t frame));
protected_rlc_um_segment(void rlc_um_segment_5 (rlc_um_entity_t *rlcP,frame_t frame));
/** @} */
# endif
This diff is collapsed.
......@@ -2468,7 +2468,7 @@ void rrc_ue_generate_MeasurementReport(u8 eNB_id, u8 UE_id, frame_t frameP) {
}
// Measurement report triggering, described in 36.331 Section 5.5.4.1: called periodically
void ue_measurement_report_triggering(module_id_t Mod_id, u32 frameP,u8 eNB_index) {
void ue_measurement_report_triggering(module_id_t Mod_id, frame_t frameP,u8 eNB_index) {
u8 i,j;
Hysteresis_t hys;
TimeToTrigger_t ttt_ms;
......@@ -2554,7 +2554,7 @@ void ue_measurement_report_triggering(module_id_t Mod_id, u32 frameP,u8 eNB_inde
}
//check_trigger_meas_event(Mod_id, frameP, eNB_index, i,j,ofn,ocn,hys,ofs,ocs,a3_offset,ttt_ms)
u8 check_trigger_meas_event(module_id_t Mod_id,u32 frameP, u8 eNB_index, u8 ue_cnx_index, u8 meas_index,
u8 check_trigger_meas_event(module_id_t Mod_id,frame_t frameP, u8 eNB_index, u8 ue_cnx_index, u8 meas_index,
Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt) {
u8 eNB_offset;
......@@ -2591,7 +2591,7 @@ u8 check_trigger_meas_event(module_id_t Mod_id,u32 frameP, u8 eNB_index, u8 ue_c
}
#ifdef Rel10
int decode_MCCH_Message(module_id_t Mod_id, u32 frameP, u8 eNB_index, u8 *Sdu, u8 Sdu_len,u8 mbsfn_sync_area) {
int decode_MCCH_Message(module_id_t Mod_id, frame_t frameP, u8 eNB_index, u8 *Sdu, u8 Sdu_len,u8 mbsfn_sync_area) {
MCCH_Message_t *mcch=NULL;
MBSFNAreaConfiguration_r9_t **mcch_message=&UE_rrc_inst[Mod_id].mcch_message[eNB_index];
......@@ -2635,7 +2635,7 @@ int decode_MCCH_Message(module_id_t Mod_id, u32 frameP, u8 eNB_index, u8 *Sdu, u
return 0;
}
void decode_MBSFNAreaConfiguration(module_id_t Mod_id, u8 eNB_index, u32 frameP,u8 mbsfn_sync_area) {
void decode_MBSFNAreaConfiguration(module_id_t Mod_id, u8 eNB_index, frame_t frameP,u8 mbsfn_sync_area) {
LOG_D(RRC,"[UE %d] Frame %d : Number of MCH(s) in the MBSFN Sync Area %d is %d\n",
Mod_id, frameP, mbsfn_sync_area, UE_rrc_inst[Mod_id].mcch_message[eNB_index]->pmch_InfoList_r9.list.count);
// store to MAC/PHY necessary parameters for receiving MTCHs
......@@ -2733,7 +2733,7 @@ void *rrc_ue_task(void *args_p) {
/* MAC messages */
case RRC_MAC_IN_SYNC_IND:
LOG_D(RRC, "[UE %d] Received %s: frameP %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_IN_SYNC_IND (msg_p).frameP, RRC_MAC_IN_SYNC_IND (msg_p).enb_index);
RRC_MAC_IN_SYNC_IND (msg_p).frame, RRC_MAC_IN_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_IN_SYNC_IND (msg_p).enb_index].N310_cnt = 0;
if (UE_rrc_inst[Mod_id].Info[RRC_MAC_IN_SYNC_IND (msg_p).enb_index].T310_active == 1)
......@@ -2742,16 +2742,16 @@ void *rrc_ue_task(void *args_p) {
case RRC_MAC_OUT_OF_SYNC_IND:
LOG_I(RRC, "[UE %d] Received %s: frameP %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_OUT_OF_SYNC_IND (msg_p).frameP, RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index);
RRC_MAC_OUT_OF_SYNC_IND (msg_p).frame, RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index].N310_cnt ++;
break;
case RRC_MAC_BCCH_DATA_IND:
LOG_D(RRC, "[UE %d] Received %s: frameP %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_BCCH_DATA_IND (msg_p).frameP, RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
RRC_MAC_BCCH_DATA_IND (msg_p).frame, RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
decode_BCCH_DLSCH_Message (Mod_id, RRC_MAC_BCCH_DATA_IND (msg_p).frameP,
decode_BCCH_DLSCH_Message (Mod_id, RRC_MAC_BCCH_DATA_IND (msg_p).frame,
RRC_MAC_BCCH_DATA_IND (msg_p).enb_index, RRC_MAC_BCCH_DATA_IND (msg_p).sdu,
RRC_MAC_BCCH_DATA_IND (msg_p).sdu_size,
RRC_MAC_BCCH_DATA_IND (msg_p).rsrq, RRC_MAC_BCCH_DATA_IND (msg_p).rsrp);
......@@ -2767,23 +2767,23 @@ void *rrc_ue_task(void *args_p) {
case RRC_MAC_CCCH_DATA_IND:
LOG_I(RRC, "[UE %d] Received %s: frameP %d, eNB %d\n", Mod_id, msg_name,
RRC_MAC_CCCH_DATA_IND (msg_p).frameP, RRC_MAC_CCCH_DATA_IND (msg_p).enb_index);
RRC_MAC_CCCH_DATA_IND (msg_p).frame, RRC_MAC_CCCH_DATA_IND (msg_p).enb_index);
srb_info_p = &UE_rrc_inst[Mod_id].Srb0[RRC_MAC_CCCH_DATA_IND (msg_p).enb_index];
memcpy (srb_info_p->Rx_buffer.Payload, RRC_MAC_CCCH_DATA_IND (msg_p).sdu,
RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size);
srb_info_p->Rx_buffer.payload_size = RRC_MAC_CCCH_DATA_IND (msg_p).sdu_size;
rrc_ue_decode_ccch (Mod_id, RRC_MAC_CCCH_DATA_IND (msg_p).frameP, srb_info_p,
rrc_ue_decode_ccch (Mod_id, RRC_MAC_CCCH_DATA_IND (msg_p).frame, srb_info_p,
RRC_MAC_CCCH_DATA_IND (msg_p).enb_index);
break;
# ifdef Rel10
case RRC_MAC_MCCH_DATA_IND:
LOG_I(RRC, "[UE %d] Received %s: frameP %d, eNB %d, mbsfn SA %d\n", Mod_id, msg_name,
RRC_MAC_MCCH_DATA_IND (msg_p).frameP, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index, RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index, RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
decode_MCCH_Message (Mod_id, RRC_MAC_MCCH_DATA_IND (msg_p).frameP, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index,
decode_MCCH_Message (Mod_id, RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index,
RRC_MAC_MCCH_DATA_IND (msg_p).sdu, RRC_MAC_MCCH_DATA_IND (msg_p).sdu_size,
RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
break;
......@@ -2792,9 +2792,9 @@ void *rrc_ue_task(void *args_p) {
/* PDCP messages */
case RRC_DCCH_DATA_IND:
LOG_I(RRC, "[UE %d] Received %s: frameP %d, DCCH %d, eNB %d\n", Mod_id, msg_name,
RRC_DCCH_DATA_IND (msg_p).frameP, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).eNB_index);
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).eNB_index);
rrc_ue_decode_dcch (Mod_id, RRC_DCCH_DATA_IND (msg_p).frameP,
rrc_ue_decode_dcch (Mod_id, RRC_DCCH_DATA_IND (msg_p).frame,
RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).sdu_p,
RRC_DCCH_DATA_IND (msg_p).eNB_index);
......
......@@ -362,7 +362,7 @@ static Data_Flow_Unit omv_data;
static module_id_t UE_inst = 0;
static module_id_t eNB_inst = 0;
#ifdef Rel10
static module_id_t RN_inst=0;
static module_id_t RN_id = 0;
#endif
Packet_OTG_List *otg_pdcp_buffer;
......@@ -781,21 +781,21 @@ void *l2l1_task(void *args_p) {
if ( oai_emulation.info.frame_type == 0) {
// RN == UE
if (frame>0) {
if (PHY_vars_UE_g[UE_id]->UE_mode[0] != NOT_SYNCHED) {
if (PHY_vars_UE_g[UE_inst]->UE_mode[0] != NOT_SYNCHED) {
LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, UE_id, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_id]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx,
RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_inst]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_inst], 0, abstraction_flag,normal_txrx,
r_type, PHY_vars_RN_g[RN_id]);
}
else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_id],normal_txrx);
initial_sync(PHY_vars_UE_g[UE_inst],normal_txrx);
}
}
// RN == eNB
LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, eNB_id, frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag,
RN_id, eNB_inst, frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_inst], abstraction_flag,
r_type, PHY_vars_RN_g[RN_id]);
}
else {
......
......@@ -1030,7 +1030,7 @@ void update_ocm() {
}
#ifdef OPENAIR2
void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
void update_otg_eNB(module_id_t module_idP, unsigned int ctime) {
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ) {
......@@ -1040,27 +1040,26 @@ void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
for_times += 1;
// generate traffic if the ue is rrc reconfigured state
if (mac_get_rrc_status(module_instP, 1/*eNB_flag*/, dst_id) > 2 /*RRC_CONNECTED*/ ) {
if (mac_get_rrc_status(module_idP, 1/*eNB_flag*/, dst_id) > 2 /*RRC_CONNECTED*/ ) {
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++){
otg_pkt = malloc (sizeof(Packet_otg_elt));
if_times += 1;
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(module_instP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(module_idP, dst_id + NB_eNB_INST, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
otg_times += 1;
(otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH; // app could be binded to a given DRB
(otg_pkt->otg_pkt).module_id = module_instP;
(otg_pkt->otg_pkt).module_id = module_idP;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 0;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
//Adding the packet to the OTG-PDCP buffer
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_instP]));
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_idP]));
LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d for app id %d \n",
(otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id, app_id);
} else {
//LOG_I(EMU, "OTG returns null \n");
free(otg_pkt);
otg_pkt=NULL;
}
......@@ -1078,20 +1077,20 @@ void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
if (pdcp_mbms_array[module_instP][service_id*maxSessionPerPMCH + session_id].instanciated_instance == module_instP + 1){ // this service/session is configured
if (pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].instanciated_instance == module_idP + 1){ // this service/session is configured
otg_pkt = malloc (sizeof(Packet_otg_elt));
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n", service_id, session_id, service_id*maxSessionPerPMCH + session_id);
rb_id = pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].rb_id;
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen_multicast(module_instP, session_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
rb_id = pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].rb_id;
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen_multicast(module_idP, session_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).module_id = module_idP;
(otg_pkt->otg_pkt).dst_id = session_id;
(otg_pkt->otg_pkt).is_ue = 0;
//Adding the packet to the OTG-PDCP buffer
(otg_pkt->otg_pkt).mode = PDCP_TM;
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_instP]));
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_idP]));
LOG_I(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n",
(otg_pkt->otg_pkt).module_id, otg_pkt, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
} else {
......@@ -1108,15 +1107,15 @@ void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
if ((pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance== module_id + 1) && (eNB_flag == 1)){ // this service/session is configured
if ((pdcp_mbms_array[module_idP][service_id*maxSessionPerPMCH + session_id].instanciated_instance== module_idP + 1) && (eNB_flag == 1)){ // this service/session is configured
// LOG_T(OTG,"multicast packet gen for (service/mch %d, session/lcid %d)\n", service_id, session_id);
// Duy add
LOG_I(OTG, "frame %d, multicast packet gen for (service/mch %d, session/lcid %d, rb_id %d)\n",frame, service_id, session_id,service_id*maxSessionPerPMCH + session_id);
// end Duy add
rb_id = pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].rb_id;
otg_pkt=(u8*) packet_gen_multicast(module_id, session_id, ctime, &pkt_size);
otg_pkt=(u8*) packet_gen_multicast(module_idP, session_id, ctime, &pkt_size);
if (otg_pkt != NULL) {
LOG_D(OTG,"[eNB %d] sending a multicast packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", eNB_index, module_id, rb_id, module_id, session_id, pkt_size);
LOG_D(OTG,"[eNB %d] sending a multicast packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n", eNB_index, module_idP, rb_id, module_idP, session_id, pkt_size);
pdcp_data_req(module_id, frame, eNB_flag, rb_id, RLC_MUI_UNDEFINED, RLC_SDU_CONFIRM_NO, pkt_size, otg_pkt,PDCP_TM);
free(otg_pkt);
}
......@@ -1134,7 +1133,7 @@ void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
// } // end multicast traffic
#endif
//LOG_I(EMU, "[eNB %d] update OTG nb_elts = %d \n", module_id, otg_pdcp_buffer[module_id].nb_elements);
//LOG_I(EMU, "[eNB %d] update OTG nb_elts = %d \n", module_id, otg_pdcp_buffer[module_idP].nb_elements);
//free(otg_pkt);
//otg_pkt = NULL;
......@@ -1149,11 +1148,11 @@ void update_otg_eNB(module_id_t module_instP, unsigned int ctime) {
if (otg_pkt != NULL) {
rb_id = dst_id * NB_RB_MAX + DTCH;
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = module_instP;
(otg_pkt->otg_pkt).module_id = module_idP;
(otg_pkt->otg_pkt).is_ue = 0;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
//Adding the packet to the OTG-PDCP buffer
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_instP]));
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_idP]));
LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
} else {
//LOG_I(EMU, "OTG returns null \n");
......
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