Commit 4a058413 authored by Calvin HSU's avatar Calvin HSU

ue add IF module, calculation of system frame and ssb_index

parent 966b3a05
...@@ -1296,6 +1296,7 @@ set(PHY_SRC_UE ...@@ -1296,6 +1296,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c ${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c ${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
#${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c #${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
${PHY_POLARSRC} ${PHY_POLARSRC}
) )
...@@ -1321,6 +1322,7 @@ add_library(PHY_RU ${PHY_SRC_RU}) ...@@ -1321,6 +1322,7 @@ add_library(PHY_RU ${PHY_SRC_RU})
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE) set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE)
set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE) set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
set(NR_UE_PHY_INTERFACE_DIR ${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE)
set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC) set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC)
set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0) set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0)
set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0) set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0)
...@@ -1440,6 +1442,7 @@ set (MAC_SRC ...@@ -1440,6 +1442,7 @@ set (MAC_SRC
${MAC_DIR}/config_ue.c ${MAC_DIR}/config_ue.c
) )
set (MAC_SRC_UE set (MAC_SRC_UE
${MAC_DIR}/main_ue.c ${MAC_DIR}/main_ue.c
${MAC_DIR}/ue_procedures.c ${MAC_DIR}/ue_procedures.c
...@@ -1447,11 +1450,16 @@ set (MAC_SRC_UE ...@@ -1447,11 +1450,16 @@ set (MAC_SRC_UE
${MAC_DIR}/l1_helpers.c ${MAC_DIR}/l1_helpers.c
${MAC_DIR}/rar_tools_ue.c ${MAC_DIR}/rar_tools_ue.c
${MAC_DIR}/config_ue.c ${MAC_DIR}/config_ue.c
)
set (MAC_NR_SRC_UE
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_UE_MAC_DIR}/config_ue.c ${NR_UE_MAC_DIR}/config_ue.c
${NR_UE_MAC_DIR}/mac_vars.c ${NR_UE_MAC_DIR}/mac_vars.c
${NR_UE_MAC_DIR}/main_ue_nr.c ${NR_UE_MAC_DIR}/main_ue_nr.c
${NR_UE_MAC_DIR}/nr_ue_procedures.c ${NR_UE_MAC_DIR}/nr_ue_procedures.c
) )
set (ENB_APP_SRC set (ENB_APP_SRC
${OPENAIR2_DIR}/ENB_APP/enb_app.c ${OPENAIR2_DIR}/ENB_APP/enb_app.c
...@@ -1468,8 +1476,10 @@ add_library(L2 ...@@ -1468,8 +1476,10 @@ add_library(L2
add_library(L2_UE add_library(L2_UE
${L2_SRC_UE} ${L2_SRC_UE}
${MAC_SRC_UE} ${MAC_SRC_UE}
${MAC_NR_SRC_UE}
) )
include_directories(${NR_UE_PHY_INTERFACE_DIR})
include_directories(${NFAPI_USER_DIR}) include_directories(${NFAPI_USER_DIR})
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file fapi_nr_ue_l1.c
* \brief functions for NR UE FAPI-like interface
* \author R. Knopp
* \date 2018
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include "fapi_nr_ue_interface.h"
#include "fapi_nr_ue_l1.h"
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
return 0;
}
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
return 0;
}
\ No newline at end of file
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file fapi_nr_ue_l1.c
* \brief functions for FAPI L1 interface
* \author R. Knopp
* \date 2018
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __FAPI_NR_UE_L1_H__
#define __FAPI_NR_UE_L1_H__
#include "NR_IF_Module.h"
/**\brief NR UE FAPI-like P7 messages, scheduled response from L2 indicating L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response);
/**\brief NR UE FAPI-like P5 message, physical configuration from L2 to configure L1
\param scheduled_response including transmission config(dl_config, ul_config) and data transmission (tx_req)*/
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config);
#endif
\ No newline at end of file
...@@ -48,7 +48,7 @@ nr_rrc_mac_config_req_ue( ...@@ -48,7 +48,7 @@ nr_rrc_mac_config_req_ue(
// TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc. // TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc.
if(mibP != NULL){ if(mibP != NULL){
; mac->mib = mibP; // update by every reception
} }
if(mac_cell_group_configP != NULL){ if(mac_cell_group_configP != NULL){
......
...@@ -65,13 +65,15 @@ ...@@ -65,13 +65,15 @@
typedef struct { typedef struct {
//// MAC config //// MAC config
NR_DRX_Config_t *drx_Config; /* OPTIONAL */ NR_DRX_Config_t *drx_Config; /* OPTIONAL */
NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */ NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */
NR_BSR_Config_t *bsr_Config; /* OPTIONAL */ NR_BSR_Config_t *bsr_Config; /* OPTIONAL */
NR_TAG_Config_t *tag_Config; /* OPTIONAL */ NR_TAG_Config_t *tag_Config; /* OPTIONAL */
NR_PHR_Config_t *phr_Config; /* OPTIONAL */ NR_PHR_Config_t *phr_Config; /* OPTIONAL */
NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */ NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */
NR_MIB_t *mib;
} NR_UE_MAC_INST_t; } NR_UE_MAC_INST_t;
......
...@@ -31,19 +31,37 @@ ...@@ -31,19 +31,37 @@
#include "proto.h" #include "proto.h"
#include "RRC/NR_UE/rrc_proto.h" #include "RRC/NR_UE/rrc_proto.h"
void int8_t nr_ue_decode_mib(
nr_ue_decode_mib(
module_id_t module_id, module_id_t module_id,
int CC_id, int CC_id,
uint8_t gNB_index, uint8_t gNB_index,
uint8_t extra_bits, uint8_t extra_bits, // 8bits 38.212 c7.1.1
uint32_t ssb_index, uint32_t l_ssb_equal_64,
uint32_t *frameP, uint32_t *ssb_index, // from decoded MIB
void *pduP, uint32_t *frameP, // 10 bits = 6(in decoded MIB)+4(in extra bits from L1)
void *pduP, // encoded MIB
uint16_t pdu_len){ uint16_t pdu_len){
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, frameP, nr_mac_rrc_data_ind_ue( module_id, CC_id, gNB_index, frameP,
NR_BCCH_BCH, (uint8_t *) pduP, pdu_len ); NR_BCCH_BCH, (uint8_t *) pduP, pdu_len );
// frame calculation
uint32_t frame = mac->mib->systemFrameNumber.buf[0];
uint32_t frame_number_4lsb = (uint32_t)(extra_bits & 0xf);
uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 4 ) & 0x1 );
frame = frame << 4;
frame = frame | frame_number_4lsb;
*frameP = frame;
if(l_ssb_equal_64){
*ssb_index = (( extra_bits >> 4 ) & 0x7 );
}
return 0;
} }
...@@ -32,15 +32,16 @@ ...@@ -32,15 +32,16 @@
#include "defs.h" #include "defs.h"
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message /**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
\param module_id module id \param module_id module id
\param CC_id component carrier id \param CC_id component carrier id
\param gNB_index gNB index \param gNB_index gNB index
\param extra_bits extra bits for frame calculation \param extra_bits extra bits for frame calculation
\param ssb_index SSB index for frame calculation \param l_ssb_equal_64 check if ssb number of candicate is equal 64, 1=equal; 0=non equal. Reference 38.212 c7.1.1
\param frameP pointer to frame for revising after frame calculation \param ssb_index SSB index for frame calculation
\param pduP pointer to pdu \param frameP pointer to frame for revising after frame calculation
\param pdu_length length of pdu*/ \param pduP pointer to pdu
void nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len); \param pdu_length length of pdu*/
int8_t nr_ue_decode_mib(module_id_t module_id, int CC_id, uint8_t gNB_index, uint8_t extra_bits, uint32_t l_ssb_equal_64, uint32_t *ssb_index, uint32_t *frameP, void *pduP, uint16_t pdu_len);
/**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config) /**\brief primitive from RRC layer to MAC layer for configuration L1/L2, now supported 4 rrc messages: MIB, cell_group_config for MAC/PHY, spcell_config(serving cell config)
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __IF_MODULE__H__
#define __IF_MODULE__H__
#include <stdint.h>
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "nfapi_interface.h"
#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// harq indication list
nfapi_harq_indication_t harq_ind;
/// crc indication list
nfapi_crc_indication_t crc_ind;
/// SR indication list
nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
/// RACH indication list
nfapi_rach_indication_t rach_ind;
#ifdef Rel14
/// RACH indication list for BR UEs
nfapi_rach_indication_t rach_ind_br;
#endif
/// SRS indication list
nfapi_srs_indication_body_t srs_ind;
/// RX indication
nfapi_rx_indication_t rx_ind;
} UL_IND_t;
// Downlink subframe P7
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
uint8_t CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// nFAPI DL Config Request
nfapi_dl_config_request_t *DL_req;
/// nFAPI UL Config Request
nfapi_ul_config_request_t *UL_req;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_t *HI_DCI0_req;
/// Pointers to DL SDUs
nfapi_tx_request_t *TX_req;
}Sched_Rsp_t;
typedef struct {
uint8_t Mod_id;
int CC_id;
nfapi_config_request_t *cfg;
}PHY_Config_t;
typedef struct IF_Module_s{
//define the function pointer
void (*UL_indication)(UL_IND_t *UL_INFO);
void (*schedule_response)(Sched_Rsp_t *Sched_INFO);
void (*PHY_config_req)(PHY_Config_t* config_INFO);
uint32_t CC_mask;
uint16_t current_frame;
uint8_t current_subframe;
pthread_mutex_t if_mutex;
}IF_Module_t;
/*Initial */
IF_Module_t *IF_Module_init(int Mod_id);
void IF_Module_kill(int Mod_id);
/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler)
*/
void UL_indication(UL_IND_t *UL_INFO);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void Schedule_Response(Sched_Rsp_t *Sched_INFO);
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file NR_IF_Module.c
* \brief functions for NR UE FAPI-like interface
* \author R. Knopp
* \date 2018
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include "NR_IF_Module.h"
#include "LAYER2/NR_MAC_UE/proto.h"
#define MAX_IF_MODULES 100
static nr_ue_if_module_t *nr_ue_if_module_inst[MAX_IF_MODULES];
int8_t handle_bcch_bch(uint32_t pdu_len, uint8_t *pduP){
// pdu_len = 4, 32bits
uint8_t extra_bits = pduP[3];
uint32_t ssb_index;
uint32_t frame;
nr_ue_decode_mib( (module_id_t)0,
0,
0,
extra_bits,
0, // Lssb = 64 is not support
&ssb_index,
&frame,
pduP,
3 );
return 0;
}
int8_t handle_bcch_dlsch(uint32_t pdu_len, uint8_t *pduP){
return 0;
}
int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
if(dl_info->rx_ind != NULL){
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);
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);
break;
default:
break;
}
}
if(dl_info->dci_ind != NULL){
}
return 0;
}
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){
if (nr_ue_if_module_inst[module_id] == NULL) {
nr_ue_if_module_inst[module_id] = (nr_ue_if_module_t*)malloc(sizeof(nr_ue_if_module_t));
memset((void*)nr_ue_if_module_inst[module_id],0,sizeof(nr_ue_if_module_t));
nr_ue_if_module_inst[module_id]->CC_mask=0;
nr_ue_if_module_register_dl_indication(module_id, nr_ue_dl_indication);
}
return nr_ue_if_module_inst[module_id];
}
int8_t nr_ue_if_module_register_dl_indication(uint32_t module_id, nr_ue_dl_indication_f *f){
if (nr_ue_if_module_inst[module_id] == NULL) {
nr_ue_if_module_inst[module_id]->dl_indication = f;
}else{
return -1;
}
return 0;
}
int8_t nr_ue_if_module_register_phy_config_request(uint32_t module_id, nr_ue_phy_config_request_f *f){
if (nr_ue_if_module_inst[module_id] == NULL) {
nr_ue_if_module_inst[module_id]->phy_config_request = f;
}else{
return -1;
}
return 0;
}
int8_t nr_ue_if_module_register_scheduled_response(uint32_t module_id, nr_ue_scheduled_response_f *f){
if (nr_ue_if_module_inst[module_id] == NULL) {
nr_ue_if_module_inst[module_id]->scheduled_response = f;
}else{
return -1;
}
return 0;
}
int8_t nr_ue_if_module_kill(uint32_t module_id) {
if (nr_ue_if_module_inst[module_id] != NULL){
free(nr_ue_if_module_inst[module_id]);
}
return 0;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __NR_IF_MODULE_H__
#define __NR_IF_MODULE_H__
#include "platform_types.h"
#include "fapi_nr_ue_interface.h"
typedef struct {
/// module id
module_id_t module_id;
/// component carrier id
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// slot
uint8_t slot;
/// NR UE FAPI-like P7 message, direction: L1 to L2
/// data reception indication structure
fapi_nr_rx_indication_t *rx_ind;
/// dci reception indication structure
fapi_nr_dci_indication_t *dci_ind;
} nr_downlink_indication_t;
// Downlink subframe P7
typedef struct {
/// module id
module_id_t module_id;
/// component carrier id
uint8_t CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// slot
uint8_t slot;
/// NR UE FAPI-like P7 message, direction: L2 to L1
/// downlink transmission configuration request structure
fapi_nr_dl_config_request_t *dl_config;
/// uplink transmission configuration request structure
fapi_nr_ul_config_request_t *ul_config;
/// data transmission request structure
fapi_nr_tx_request_t *tx_request;
} nr_scheduled_response_t;
typedef struct {
/// module id
uint8_t Mod_id;
/// component carrier id
uint8_t CC_id;
/// NR UE FAPI-like P5 message
/// physical layer configuration request structure
fapi_nr_config_request_t *config_req;
} nr_phy_config_t;
/*
* Generic type of an application-defined callback to return various
* types of data to the application.
* EXPECTED RETURN VALUES:
* -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored.
*/
typedef int8_t(nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_response);
/*
* Generic type of an application-defined callback to return various
* types of data to the application.
* EXPECTED RETURN VALUES:
* -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored.
*/
typedef int8_t(nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config);
/*
* Generic type of an application-defined callback to return various
* types of data to the application.
* EXPECTED RETURN VALUES:
* -1: Failed to consume bytes. Abort the mission.
* Non-negative return values indicate success, and ignored.
*/
typedef int8_t(nr_ue_dl_indication_f)(nr_downlink_indication_t *dl_info);
// TODO check this stuff can be reuse of need modification
typedef struct IF_Module_s {
nr_ue_scheduled_response_f *scheduled_response;
nr_ue_phy_config_request_f *phy_config_request;
nr_ue_dl_indication_f *dl_indication;
uint32_t CC_mask;
uint16_t current_frame;
uint8_t current_subframe;
//pthread_mutex_t nr_if_mutex;
} nr_ue_if_module_t;
/**\brief reserved one of the interface(if) module instantce from pointer pool and done memory allocation by module_id.
\param module_id module id*/
nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id);
/**\brief done free of memory allocation by module_id and release to pointer pool.
\param module_id module id*/
int8_t nr_ue_if_module_kill(uint32_t module_id);
/**\brief interface between L1/L2, indicating the downlink related information, like dci_ind and rx_req
\param dl_info including dci_ind and rx_request messages*/
int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info);
/**\brief register dl_indication into certain if_module_inst by module_id
\param f function pointer to dl_indication*/
int8_t nr_ue_if_module_register_dl_indication(uint32_t module_id, nr_ue_dl_indication_f *f);
/**\brief register phy_config_request into certain if_module_inst by module_id
\param f function pointer to phy_config_request*/
int8_t nr_ue_if_module_register_phy_config_request(uint32_t module_id, nr_ue_phy_config_request_f *f);
/**\brief register scheduled_response into certain if_module_inst by module_id
\param f function pointer to scheduled_response*/
int8_t nr_ue_if_module_register_scheduled_response(uint32_t module_id, nr_ue_scheduled_response_f *f);
/**\brief handle BCCH-BCH message from dl_indication
\param pdu_len length(bytes) of pdu
\param pduP pointer to pdu*/
int8_t handle_bcch_bch(uint32_t pdu_len, uint8_t *pduP);
/**\brief handle BCCH-DL-SCH message from dl_indication
\param pdu_len length(bytes) of pdu
\param pduP pointer to pdu*/
int8_t handle_bcch_dlsch(uint32_t pdu_len, uint8_t *pduP);
#endif
...@@ -287,6 +287,10 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( ...@@ -287,6 +287,10 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
NR_BCCH_BCH_Message_t *bcch_message = NULL; NR_BCCH_BCH_Message_t *bcch_message = NULL;
NR_MIB_t *mib = NR_UE_rrc_inst->mib; NR_MIB_t *mib = NR_UE_rrc_inst->mib;
if(mib != NULL){
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)mib, 1 );
}
asn_dec_rval_t dec_rval = uper_decode_complete( NULL, asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
&asn_DEF_NR_BCCH_BCH_Message, &asn_DEF_NR_BCCH_BCH_Message,
(void **)&bcch_message, (void **)&bcch_message,
...@@ -307,10 +311,11 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message( ...@@ -307,10 +311,11 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
return -1; return -1;
} }
// copy into rrc instance // link to rrc instance
memcpy( (void *)mib, mib = &bcch_message->message.choice.mib;
(void *)&bcch_message->message.choice.mib, //memcpy( (void *)mib,
sizeof(NR_MIB_t) ); // (void *)&bcch_message->message.choice.mib,
// sizeof(NR_MIB_t) );
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL); nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL);
......
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