Commit 9370f5f8 authored by Wolfgang A. Mozart's avatar Wolfgang A. Mozart

forward to RLC

parent 76865935
......@@ -107,6 +107,16 @@ void eNB_dlsch_ulsch_scheduler_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t ab
common_flags = 0;
uint32_t h,f,sf,a;
mac_inst->current_subframe = abs_subframe;
protocol_ctxt_t ctxt;
convert_system_number(abs_subframe, &h, &f, &sf);
//printf("*************************RUN PDCP****************************\n");
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_YES, NOT_A_RNTI, f, sf, 0);
pdcp_run(&ctxt);
//printf("*************************************************************\n");
eNB_scheduler_computing_flag_NB_IoT(mac_inst, abs_subframe, &scheduler_flags, &common_flags, &max_subframe);
if(scheduler_flags > 0){
......
......@@ -76,6 +76,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
uint32_t search_space_end_sf, h_temp, f_temp, sf_temp;
mac_rlc_status_resp_t rlc_status; //Declare rlc_status
I_mcs = get_I_mcs(UE_info->CE_level);
I_tbs = I_mcs;
......@@ -101,7 +102,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
{
//Get RLC status
/*
rlc_status = mac_rlc_status_ind_NB_IoT(
rlc_status = mac_rlc_status_ind(
module_id,
UE_info->rnti,
module_id,
......@@ -113,7 +114,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
0);
data_size = rlc_status.bytes_in_buffer;
*/
//data_size = 200;
data_size = 200;
data_size=0;
int ue_index;
for(ue_index=0;ue_index<UE_NUM_SIM;++ue_index)
......@@ -212,7 +213,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
UE_info->I_mcs_dl = I_mcs;
/*.......
//Request data from RLC layer
rlc_status = mac_rlc_status_ind_NB_IoT(
rlc_status = mac_rlc_status_ind(
module_id,
UE_info->rnti,
module_id,
......
......@@ -50,6 +50,7 @@
#include "platform_constants.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "msc.h"
#include "openair2/LAYER2/MAC/proto_NB_IoT.h"
#if defined(ENABLE_SECURITY)
# include "UTIL/OSA/osa_defs.h"
......@@ -139,7 +140,7 @@ boolean_t pdcp_data_req(
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti);
} else {
if (srb_flagP) {
AssertError (rb_idP < 3, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, 3, ctxt_pP->module_id, ctxt_pP->rnti);
AssertError (rb_idP < 4, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, 3, ctxt_pP->module_id, ctxt_pP->rnti);
} else {
AssertError (rb_idP < maxDRB, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, maxDRB, ctxt_pP->module_id, ctxt_pP->rnti);
}
......@@ -929,7 +930,9 @@ pdcp_run (
instance = ITTI_MSG_INSTANCE (msg_p);
switch (ITTI_MSG_ID(msg_p)) {
case RRC_DCCH_DATA_REQ:
PROTOCOL_CTXT_SET_BY_MODULE_ID(
&ctxt,
RRC_DCCH_DATA_REQ (msg_p).module_id,
......@@ -948,7 +951,7 @@ pdcp_run (
RRC_DCCH_DATA_REQ (msg_p).confirmp,
RRC_DCCH_DATA_REQ (msg_p).mode);
result = pdcp_data_req (&ctxt,
result = pdcp_data_req_NB_IoT(&ctxt,
SRB_FLAG_YES,
RRC_DCCH_DATA_REQ (msg_p).rb_id,
RRC_DCCH_DATA_REQ (msg_p).muip,
......@@ -956,12 +959,14 @@ pdcp_run (
RRC_DCCH_DATA_REQ (msg_p).sdu_size,
RRC_DCCH_DATA_REQ (msg_p).sdu_p,
RRC_DCCH_DATA_REQ (msg_p).mode);
if (result != TRUE)
LOG_E(PDCP, "PDCP data request failed!\n");
// Message buffer has been processed, free it now.
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ (msg_p).sdu_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
break;
default:
......
......@@ -212,11 +212,6 @@ config_req_rlc_am (
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
/***************************************/
printf("hashtable_get in comfig_req_rlc_am\n");
/***************************************/
if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am;
LOG_D(RLC,
......@@ -270,10 +265,6 @@ void config_req_rlc_am_asn1 (
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
/***************************************/
printf("hashtable_get in config_req_rlc_am_asn1\n");
/***************************************/
if (h_rc == HASH_TABLE_OK) {
l_rlc_p = &rlc_union_p->rlc.am;
......@@ -521,6 +512,31 @@ rlc_am_rx (
}
}
//-----------------------------------------------------------------------------
/*
extern mac_status_resp *rlc_state;
struct mac_status_resp rlc_am_mac_status_indication_NB_IoT(const uint32_t tb_sizeP)
{
struct mac_status_resp status_resp;
//rlc_tb_sizeP = tb_sizeP;
status_resp.buffer_occupancy_in_bytes = rlc_state->buffer_occupancy_in_bytes;
status_resp.buffer_occupancy_in_pdus = rlc_state->buffer_occupancy_in_pdus;
status_resp.head_sdu_creation_time = rlc_state->head_sdu_creation_time;
status_resp.head_sdu_is_segmented = rlc_state->head_sdu_is_segmented;
status_resp.head_sdu_remaining_size_to_send = rlc_state->head_sdu_remaining_size_to_send;
// status_resp.rlc_info
return status_resp;
}
*/
//-----------------------------------------------------------------------------
struct mac_status_resp
rlc_am_mac_status_indication (
......
......@@ -278,6 +278,9 @@ protected_rlc_am( void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void *
*/
public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);)
public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication_NB_IoT(uint32_t tbs_sizeP);)
/*! \fn void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP)
* \brief Set available TBS for RLC Tx just before am_mac_data_request. Used for UE only.
* \param[in] rlc_pP RLC AM protocol instance pointer.
......
......@@ -155,6 +155,7 @@ typedef struct {
} mac_rlc_status_resp_t;
/*! \struct mac_rlc_max_rx_header_size_t
* \brief Usefull only for debug scenario where we connect 2 RLC protocol instances without the help of the MAC .
*/
......
......@@ -36,6 +36,7 @@
#include "hashtable.h"
#include "assertions.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "LAYER2/MAC/defs_NB_IoT.h"
//#define DEBUG_MAC_INTERFACE 1
......@@ -284,19 +285,7 @@ void mac_rlc_data_ind (
return;
}
} else {
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
/*
printf("*******RLC_COLL_KEY_LCID_VALUE*********\n");
printf("module_id : %d\n",module_idP);
printf("rnti : %d\n",rntiP);
printf("enb_flag : %d\n",enb_flagP );
printf("channel_id : %d\n",channel_idP );
printf("srb_flag : %d\n",srb_flag);
printf("***************************************\n");
*/
}
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
......@@ -337,7 +326,8 @@ void mac_rlc_data_ind (
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_IND,VCD_FUNCTION_OUT);
}
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------------
mac_rlc_status_resp_t mac_rlc_status_ind(
const module_id_t module_idP,
const rnti_t rntiP,
......@@ -361,6 +351,8 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
srb_flag_t srb_flag = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO;
protocol_ctxt_t ctxt;
printf("*************************get into mac_rlc_status_ind (in rlc_mac.c)*****************************\n");
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, subframeP, eNB_index);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_STATUS_IND,VCD_FUNCTION_IN);
......
......@@ -506,7 +506,7 @@ rlc_op_status_t rrc_rlc_remove_rlc (
rlc_union_t *rlc_union_p = NULL;
#if defined(Rel10) || defined(Rel14)
rlc_mbms_id_t *mbms_id_p = NULL;
#endif rrc_rlc_remove_rlc
#endif
#ifdef OAI_EMU
CHECK_CTXT_ARGS(ctxt_pP)
......
......@@ -536,6 +536,8 @@ rrc_data_req(
#if defined(ENABLE_ITTI)
{
//rlc_data_req(ctxt_pP, rb_idP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, sdu_sizeP, buffer_pP);
MessageDef *message_p;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t *message_buffer;
......@@ -565,7 +567,6 @@ rrc_data_req(
ctxt_pP->instance,
message_p);
return TRUE; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
#else
return pdcp_data_req (
......
......@@ -59,6 +59,9 @@
# include "intertask_interface.h"
#endif
//#define RLC_DATA_REQ_DEBUG
#define DEBUG_RLC_DATA_REQ 1
//#define RRC_DATA_REQ_DEBUG
#define DEBUG_RRC 1
......@@ -2566,7 +2569,7 @@ rlc_op_status_t rlc_data_req_NB_IoT (const protocol_ctxt_t* const ctxt_pP,
case RLC_MODE_AM:
#ifdef DEBUG_RLC_DATA_REQ
msg("RLC_MODE_AM\n");
LOG_D(RLC,"RLC_MODE_AM\n");
#endif
new_sdu_p = get_free_mem_block (sdu_sizeP + sizeof (struct rlc_am_data_req_alloc), __func__);
......
......@@ -793,6 +793,56 @@ rrc_eNB_get_next_transaction_identifier(
// return (i);
//}
//***************************************************For NB-IoT*************************************************//
//-----------------------------------------------------------------------------
void rrc_eNB_free_mem_UE_context_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
struct rrc_eNB_ue_context_NB_IoT_s* const ue_context_pP
)
//-----------------------------------------------------------------------------
{
LOG_T(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" Clearing UE context 0x%p (free internal structs)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context_pP);
//no Scell in NB-IoT --> no DC (Dual Connectivity)
if (ue_context_pP->ue_context.SRB_configList) {
ASN_STRUCT_FREE(asn_DEF_SRB_ToAddModList_NB_r13, ue_context_pP->ue_context.SRB_configList);
ue_context_pP->ue_context.SRB_configList = NULL;
}
if (ue_context_pP->ue_context.DRB_configList) {
ASN_STRUCT_FREE(asn_DEF_DRB_ToAddModList_NB_r13, ue_context_pP->ue_context.DRB_configList);
ue_context_pP->ue_context.DRB_configList = NULL;
}
memset(ue_context_pP->ue_context.DRB_active, 0, sizeof(ue_context_pP->ue_context.DRB_active));
if (ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT) {
ASN_STRUCT_FREE(asn_DEF_PhysicalConfigDedicated_NB_r13, ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT);
ue_context_pP->ue_context.physicalConfigDedicated_NB_IoT = NULL;
}
if (ue_context_pP->ue_context.mac_MainConfig_NB_IoT) {
ASN_STRUCT_FREE(asn_DEF_MAC_MainConfig_NB_r13, ue_context_pP->ue_context.mac_MainConfig_NB_IoT);
ue_context_pP->ue_context.mac_MainConfig_NB_IoT = NULL;
}
//no sps in NB_IoT
//no meas object
//no report config
//no quantity config
//no meas gap config
//no measConfig
}
//***************************************************For NB-IoT*************************************************//
//-----------------------------------------------------------------------------
// return the ue context if there is already an UE with ue_identityP, NULL otherwise
......@@ -1163,7 +1213,6 @@ void rrc_eNB_process_RRCConnectionSetupComplete_NB_IoT(
if (EPC_MODE_ENABLED == 1) {
// Forward message to S1AP layer we don't have S1AP functions for the moment
printf("*********************Get into S1AP*********************\n");
rrc_eNB_send_S1AP_NAS_FIRST_REQ(
ctxt_pP,
ue_context_pP,
......@@ -1395,6 +1444,7 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size);
}
//-----------------------------------------------------------------------------
void
rrc_eNB_generate_RRCConnectionRelease(
......@@ -5821,10 +5871,12 @@ rrc_enb_task(
break;
case S1AP_UE_CONTEXT_RELEASE_REQ:
printf("Do S1AP_UE_CONTEXT_RELEASE_REQ--------------\n");
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance);
break;
case S1AP_UE_CONTEXT_RELEASE_COMMAND:
printf("Do S1AP_UE_CONTEXT_RELEASE_COMMAND--------------\n");
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance);
break;
......
......@@ -822,7 +822,8 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
} else {
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
srb_id = ue_context_p->ue_context.Srb2.Srb_info.Srb_id;
//srb_id = ue_context_p->ue_context.Srb1bis.Srb_info.Srb_id;
srb_id = 3;
/* Is it the first income from S1AP ? */
......@@ -842,7 +843,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
/* Create message for PDCP (DLInformationTransfer_t) */
length = do_DLInformationTransfer (
length = do_DLInformationTransfer_NB_IoT (
instance,
&buffer,
rrc_eNB_get_next_transaction_identifier (instance),
......@@ -870,7 +871,7 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
SDU_CONFIRM_NO,
length,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
PDCP_TRANSMISSION_MODE_TRANSPARENT); //use pdcp transparent mode
return (0);
}
......
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