Commit 9ad8d3f2 authored by matzakos's avatar matzakos

Merge with nfapi-L2-emulator branch to support emulations with S1 interface (connection with EPC).

parents acc57964 05d8ca31
......@@ -242,6 +242,7 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
void fill_ulsch_harq_indication_UE_MAC(int Mod_id, int frame,int subframe, UL_IND_t *UL_INFO, nfapi_ul_config_ulsch_harq_information *harq_information, uint16_t rnti)
{
LOG_I(MAC, "Panos-D: fill_ulsch_harq_indication_UE_MAC(), NUM ACK_NAK REL. 10: %d, NUM ACK_NAK REL. 13: %d, SFN/SF: %d/%d", harq_information->harq_information_rel10.harq_size, harq_information->harq_information_rel13.harq_size_2, frame, subframe);
pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
nfapi_harq_indication_pdu_t *pdu = &UL_INFO->harq_ind.harq_indication_body.harq_pdu_list[UL_INFO->harq_ind.harq_indication_body.number_of_harqs];
int i;
......@@ -261,16 +262,20 @@ void fill_ulsch_harq_indication_UE_MAC(int Mod_id, int frame,int subframe, UL_IN
//if (eNB->frame_parms.frame_type == FDD) {
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = harq_information->harq_information_rel10.harq_size;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1; //harq_information->harq_information_rel10.harq_size;
//pdu->harq_indication_fdd_rel13.number_of_ack_nack = harq_information->harq_information_rel10.harq_size;
//Panos: Could this be wrong? Is the number_of_ack_nack field equivalent to O_ACK?
//pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
for (i=0;i<harq_information->harq_information_rel10.harq_size;i++) {
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1;
/*for (i=0;i<harq_information->harq_information_rel10.harq_size;i++) {
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
}
}*/
UL_INFO->harq_ind.harq_indication_body.number_of_harqs++;
pthread_mutex_unlock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
......@@ -287,6 +292,7 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
uint16_t tdd_multiplexing_mask*/) {
LOG_I (MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 1 SFN/SF: %d/%d \n", frame, subframe);
pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
nfapi_harq_indication_t *ind = &UL_INFO->harq_ind;
nfapi_harq_indication_body_t *body = &ind->harq_indication_body;
......@@ -322,6 +328,7 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
//AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
LOG_I (MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 2 SFN/SF: %d/%d, harq_information->harq_information_rel9_fdd.harq_size: %d \n", frame, subframe, harq_information->harq_information_rel9_fdd.harq_size);
}
......@@ -333,6 +340,8 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
pdu->harq_indication_fdd_rel13.harq_tb_n[1] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
LOG_I (MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 3 SFN/SF: %d/%d, harq_information->harq_information_rel9_fdd.harq_size: %d \n", frame, subframe, harq_information->harq_information_rel9_fdd.harq_size);
}
else AssertFatal(1==0,"only format 1a/b for now, received \n");
......
......@@ -478,14 +478,14 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);
//TTN - This is for SIB18
sib_type=SIB_Type_sibType18_v1250;
/*sib_type=SIB_Type_sibType18_v1250;
ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);
//TTN - This is for SIB19
sib_type=SIB_Type_sibType19_v1250;
ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);
ASN_SEQUENCE_ADD(&(*sib1)->schedulingInfoList.list,&schedulingInfo);*/
// ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,NULL);
......
......@@ -579,7 +579,6 @@ char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_
//-----------------------------------------------------------------------------
void rrc_ue_generate_RRCConnectionRequest( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{
uint8_t i=0,rv[6];
if(UE_rrc_inst[ctxt_pP->module_id].Srb0[eNB_index].Tx_buffer.payload_size ==0) {
......@@ -3097,11 +3096,13 @@ int decode_BCCH_DLSCH_Message(
}
}
if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
#if defined(ENABLE_USE_MME)
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
#endif
) {
//printf("Panos-D: decode_BCCH_DLSCH_Message() BEFORE calling rrc_ue_generate_RRCConnectionRequest \n \n");
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
}
......@@ -4961,7 +4962,7 @@ void *rrc_ue_task( void *args_p )
switch (rrc_get_state(ue_mod_id)) {
case RRC_STATE_INACTIVE: {
LOG_I(RRC, "Panos-D: rrc_ue_task() RRC state: RRC_STATE_INACTIVE \n");
//LOG_I(RRC, "Panos-D: rrc_ue_task() RRC state: RRC_STATE_INACTIVE \n");
/* Need to first activate lower layers */
MessageDef *message_p;
......@@ -4974,7 +4975,7 @@ void *rrc_ue_task( void *args_p )
}
case RRC_STATE_IDLE: {
LOG_I(RRC, "Panos-D: rrc_ue_task() RRC state: RRC_STATE_IDLE \n");
//LOG_I(RRC, "Panos-D: rrc_ue_task() RRC state: RRC_STATE_IDLE \n");
/* Ask to layer 1 to find a cell matching the criterion */
MessageDef *message_p;
......
......@@ -86,9 +86,12 @@ UE0:
};
SIM: {
MSIN="0100001111";
USIM_API_K="8baf473f2f8fd09487cccbd7097c6862";
OPC="e734f8734007d6c5ce7a0508809e7e9c";
MSIN="0000000001";
#USIM_API_K="e56e26f5608b8d268f2556e198a0e01b";
#USIM_API_K="8baf473f2f8fd09487cccbd7097c6862"; #initial
USIM_API_K= "11111111111111111111111111111111";
#OPC="e734f8734007d6c5ce7a0508809e7e9c"; #initial
OPC="f47f37e4719a9c379e3447f089b1f10a";
MSISDN="33611123456";
};
......
......@@ -55,7 +55,6 @@ Description Implements the API used by the NAS layer to read/write
//#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
#define USIM_API_K_VALUE "8baf473f2f8fd09487cccbd7097c6862"
/*
* The name of the file where are stored data of the USIM application
*/
......
......@@ -1371,6 +1371,7 @@ static int _emm_as_security_res(const emm_data_t *emm_data, const emm_as_securit
static int _emm_as_establish_req(const emm_data_t *emm_data, const emm_as_establish_t *msg,
nas_establish_req_t *as_msg)
{
LOG_FUNC_IN;
int size = 0;
......@@ -1428,7 +1429,7 @@ static int _emm_as_establish_req(const emm_data_t *emm_data, const emm_as_establ
if (size > 0) {
/* Encode the initial NAS information message */
int bytes = _emm_as_encode(
int bytes = _emm_as_encode(
&as_msg->initialNasMsg,
&nas_msg,
size,
......
......@@ -1007,7 +1007,8 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
//Currently the call to this function creates problems for the RRC Connection establishment for
//if running with more than one UEs
//if(nfapi_mode!=3)
phy_procedures_UE_SL_TX(UE,proc);
if(D2D_en)
phy_procedures_UE_SL_TX(UE,proc);
}
......@@ -1300,6 +1301,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
}
//if (nfapi_mode != 3)
if(D2D_en == 1)
phy_procedures_UE_SL_TX(UE,proc);
}
......@@ -1754,6 +1756,13 @@ void init_UE_single_thread_stub(int nb_inst) {
pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_phy_stub_single_thread_rxn_txnp4, rtd);
}
// Panos: Based on the following only one UE can be supported in S1 mode for now.
#ifdef NAS_UE
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_NAS_UE, UE->Mod_id + NB_eNB_INST, message_p);
#endif
// Panos: Remove thread for UE_sync in phy_stub_UE mode.
//pthread_create(&UE->proc.pthread_synch,NULL,UE_thread_synch,(void*)UE);
}
......
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