Commit 6f5219a6 authored by gauthier's avatar 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) {