From 04a0fa58317a508620ac41f5f8e3af769971b1dc Mon Sep 17 00:00:00 2001 From: Calvin HSU Date: Tue, 17 Jul 2018 14:33:55 +0200 Subject: [PATCH] UE: linked IF module, ready for testing --- .../nfapi/public_inc/fapi_nr_ue_interface.h | 2 +- openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c | 6 +++ openair1/PHY/defs_nr_UE.h | 1 + openair1/SCHED_NR_UE/fapi_nr_ue_l1.c | 52 +++++++++++++++++++ openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 6 ++- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 19 +++---- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h | 4 +- 7 files changed, 77 insertions(+), 13 deletions(-) mode change 100755 => 100644 nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h mode change 100755 => 100644 openair1/SCHED_NR_UE/fapi_nr_ue_l1.c diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h old mode 100755 new mode 100644 index 66e10e8491..0c4dc43897 --- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h @@ -389,7 +389,7 @@ typedef struct { uint8_t dmrs_type_a_position; uint8_t pdcch_config_sib1; uint8_t cell_barred; - uint8_t intra_frquency_reselection; + uint8_t intra_frequency_reselection; uint16_t system_frame_number; uint8_t ssb_index; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c index 3c062dbfa7..a0b3a67268 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c @@ -624,4 +624,10 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue, // printf("[PBCH] decoder_output[%d] = %x\n",i,decoded_output[i]); //#endif + + ue->dl_indication.rx_ind.rx_request_body.pdu_index = FAPI_NR_RX_PDU_BCCH_BCH_TYPE; + ue->dl_indication.rx_ind.rx_request_body.pdu_length = 3; + ue->dl_indication.rx_ind.rx_request_body.pdu = &pbch_a[0]; + ue->if_inst->dl_indication(&ue->dl_indication); + } diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h index 0096fa2e3d..f81c847c1f 100644 --- a/openair1/PHY/defs_nr_UE.h +++ b/openair1/PHY/defs_nr_UE.h @@ -992,6 +992,7 @@ typedef struct { NR_UE_COMMON common_vars; nr_ue_if_module_t *if_inst; + nr_downlink_indication_t dl_indication; // point to the current rxTx thread index uint8_t current_thread_id[10]; diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c old mode 100755 new mode 100644 index 04c2c3c361..f0e6a9b6bc --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -30,14 +30,66 @@ * \warning */ +#include + #include "fapi_nr_ue_interface.h" #include "fapi_nr_ue_l1.h" int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ + + if(scheduled_response != NULL){ + if(scheduled_response->dl_config != NULL){ + + } + + if(scheduled_response->ul_config != NULL){ + + } + + if(scheduled_response->tx_request != NULL){ + + } + } + return 0; } int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){ + + if(phy_config != NULL){ + if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_PBCH){ + printf("[L1][IF module][PHY CONFIG]\n"); + printf("subcarrier spacing: %d\n", phy_config->config_req.pbch_config.subcarrier_spacing_common); + printf("ssb carrier offset: %d\n", phy_config->config_req.pbch_config.ssb_subcarrier_offset); + printf("dmrs type A position: %d\n", phy_config->config_req.pbch_config.dmrs_type_a_position); + printf("pdcch config sib1: %d\n", phy_config->config_req.pbch_config.pdcch_config_sib1); + printf("cell barred: %d\n", phy_config->config_req.pbch_config.cell_barred); + printf("intra frequcney reselection: %d\n", phy_config->config_req.pbch_config.intra_frequency_reselection); + printf("system frame number: %d\n", phy_config->config_req.pbch_config.system_frame_number); + printf("ssb index: %d\n", phy_config->config_req.pbch_config.ssb_index); + printf("half frame bit: %d\n", phy_config->config_req.pbch_config.half_frame_bit); + printf("-------------------------------\n"); + } + + if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_COMMON){ + + } + + if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_COMMON){ + + } + + if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_DL_BWP_DEDICATED){ + + } + + if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_UL_BWP_DEDICATED){ + + } + } + + + return 0; } \ No newline at end of file diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 4dbeff40c6..dc3b57ddc1 100755 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -33,6 +33,8 @@ #include "proto.h" #include "RRC/NR_UE/rrc_proto.h" +#include + int8_t nr_ue_decode_mib( module_id_t module_id, int CC_id, @@ -44,6 +46,8 @@ int8_t nr_ue_decode_mib( void *pduP, // encoded MIB uint16_t pdu_len){ + printf("[L2][MAC] decode mib\n"); + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, @@ -79,7 +83,7 @@ int8_t nr_ue_decode_mib( mac->phy_config.config_req.pbch_config.dmrs_type_a_position = mac->mib->dmrs_TypeA_Position; mac->phy_config.config_req.pbch_config.pdcch_config_sib1 = mac->mib->pdcch_ConfigSIB1; mac->phy_config.config_req.pbch_config.cell_barred = mac->mib->cellBarred; - mac->phy_config.config_req.pbch_config.intra_frquency_reselection = mac->mib->intraFreqReselection; + mac->phy_config.config_req.pbch_config.intra_frequency_reselection = mac->mib->intraFreqReselection; mac->phy_config.config_req.pbch_config.half_frame_bit = half_frame_bit; mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index ff191fdce6..75341d3569 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -33,7 +33,7 @@ #include "NR_IF_Module.h" #include "LAYER2/NR_MAC_UE/proto.h" - +#include #define MAX_IF_MODULES 100 @@ -50,7 +50,7 @@ int8_t handle_bcch_bch(uint32_t pdu_len, uint8_t *pduP){ extra_bits, 0, // Lssb = 64 is not support pduP, - 3 ); + pdu_len ); @@ -69,23 +69,24 @@ int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){ // clean up scheduled_response structure - if(dl_info->rx_ind != NULL){ - switch(dl_info->rx_ind->rx_request_body.pdu_index){ + //if(dl_info->rx_ind != NULL){ + printf("[L2][IF MODULE][DL INDICATION][RX_IND]\n"); + switch(dl_info->rx_ind.rx_request_body.pdu_index){ case FAPI_NR_RX_PDU_BCCH_BCH_TYPE: - handle_bcch_bch(dl_info->rx_ind->rx_request_body.pdu_length, dl_info->rx_ind->rx_request_body.pdu); + handle_bcch_bch(dl_info->rx_ind.rx_request_body.pdu_length, dl_info->rx_ind.rx_request_body.pdu); break; case FAPI_NR_RX_PDU_BCCH_DLSCH_TYPE: - handle_bcch_dlsch(dl_info->rx_ind->rx_request_body.pdu_length, dl_info->rx_ind->rx_request_body.pdu); + handle_bcch_dlsch(dl_info->rx_ind.rx_request_body.pdu_length, dl_info->rx_ind.rx_request_body.pdu); break; default: break; } - } + //} - if(dl_info->dci_ind != NULL){ + //if(dl_info->dci_ind != NULL){ - } + //} if(nr_ue_if_module_inst[module_id] != NULL){ nr_ue_if_module_inst[module_id]->scheduled_response(&mac->scheduled_response); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h index 0da7ddc118..426255e9f3 100755 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h @@ -50,10 +50,10 @@ typedef struct { /// NR UE FAPI-like P7 message, direction: L1 to L2 /// data reception indication structure - fapi_nr_rx_indication_t *rx_ind; + fapi_nr_rx_indication_t rx_ind; /// dci reception indication structure - fapi_nr_dci_indication_t *dci_ind; + fapi_nr_dci_indication_t dci_ind; } nr_downlink_indication_t;