merge with develop-nr
This commit is contained in:
@@ -68,6 +68,7 @@ typedef int32_t sdu_size_t;
|
||||
typedef uint32_t frame_t;
|
||||
typedef int32_t sframe_t;
|
||||
typedef uint32_t sub_frame_t;
|
||||
typedef uint32_t slot_t;
|
||||
typedef uint8_t module_id_t;
|
||||
typedef uint8_t slice_id_t;
|
||||
typedef uint8_t eNB_index_t;
|
||||
|
||||
@@ -19,22 +19,25 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file config.c
|
||||
/* \file config_ue.c
|
||||
* \brief UE and eNB configuration performed by RRC or as a consequence of RRC procedures
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "defs.h"
|
||||
#include "proto.h"
|
||||
|
||||
int
|
||||
nr_rrc_mac_config_req_ue(
|
||||
//#include "mac_defs.h"
|
||||
#include "mac_proto.h"
|
||||
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
|
||||
int nr_rrc_mac_config_req_ue(
|
||||
module_id_t module_id,
|
||||
int CC_idP,
|
||||
int cc_idP,
|
||||
uint8_t gNB_index,
|
||||
NR_MIB_t *mibP,
|
||||
NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
|
||||
@@ -52,7 +55,18 @@ nr_rrc_mac_config_req_ue(
|
||||
|
||||
if(mac_cell_group_configP != NULL){
|
||||
if(mac_cell_group_configP->drx_Config != NULL ){
|
||||
mac->drx_Config = mac_cell_group_configP->drx_Config;
|
||||
switch(mac_cell_group_configP->drx_Config->present){
|
||||
case NR_SetupRelease_DRX_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_release:
|
||||
mac->drx_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_DRX_Config_PR_setup:
|
||||
mac->drx_Config = mac_cell_group_configP->drx_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->schedulingRequestConfig != NULL ){
|
||||
@@ -68,11 +82,35 @@ nr_rrc_mac_config_req_ue(
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->phr_Config != NULL ){
|
||||
mac->phr_Config = mac_cell_group_configP->phr_Config;
|
||||
switch(mac_cell_group_configP->phr_Config->present){
|
||||
case NR_SetupRelease_PHR_Config_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_release:
|
||||
mac->phr_Config = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_PHR_Config_PR_setup:
|
||||
mac->phr_Config = mac_cell_group_configP->phr_Config->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(mac_cell_group_configP->cs_RNTI != NULL ){
|
||||
mac->cs_RNTI = mac_cell_group_configP->cs_RNTI;
|
||||
switch(mac_cell_group_configP->cs_RNTI->present){
|
||||
case NR_SetupRelease_RNTI_Value_PR_NOTHING:
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_release:
|
||||
mac->cs_RNTI = NULL;
|
||||
break;
|
||||
case NR_SetupRelease_RNTI_Value_PR_setup:
|
||||
mac->cs_RNTI = &mac_cell_group_configP->cs_RNTI->choice.setup;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,125 +0,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 extern.h
|
||||
* \brief mac externs
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MAC_EXTERN_H__
|
||||
#define __MAC_EXTERN_H__
|
||||
|
||||
|
||||
#ifdef USER_MODE
|
||||
//#include "stdio.h"
|
||||
#endif //USER_MODE
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "defs.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#ifdef PHY_EMUL
|
||||
//#include "SIMULATION/simulation_defs.h"
|
||||
#endif //PHY_EMUL
|
||||
//#include "PHY_INTERFACE/defs.h"
|
||||
//#include "RRC/LITE/defs.h"
|
||||
|
||||
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
//extern uint32_t EBSR_Level[63];
|
||||
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
|
||||
//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used
|
||||
|
||||
extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern UE_MAC_INST *UE_mac_inst;
|
||||
extern eNB_MAC_INST *eNB_mac_inst;
|
||||
extern eNB_RRC_INST *eNB_rrc_inst;
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern UE_MAC_INST *ue_mac_inst;
|
||||
extern MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
extern uint8_t Is_rrc_registered;
|
||||
|
||||
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
|
||||
|
||||
|
||||
//#ifndef USER_MODE
|
||||
//extern MAC_xface *mac_xface;
|
||||
extern RRC_XFACE *Rrc_xface;
|
||||
|
||||
extern uint8_t Is_rrc_registered;
|
||||
|
||||
#ifndef PHY_EMUL
|
||||
#ifndef PHYSIM
|
||||
#define NB_INST 1
|
||||
#else
|
||||
extern unsigned char NB_INST;
|
||||
#endif
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern unsigned char NB_UE_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
extern unsigned short NODE_ID[1];
|
||||
extern void* bigphys_malloc(int);
|
||||
#else
|
||||
extern EMULATION_VARS *Emul_vars;
|
||||
#endif //PHY_EMUL
|
||||
|
||||
|
||||
extern int cqi_to_mcs[16];
|
||||
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
extern uint8_t rb_table[33];
|
||||
|
||||
extern DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
|
||||
|
||||
extern DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
|
||||
extern DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
|
||||
extern DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
|
||||
|
||||
extern DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
|
||||
extern DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
|
||||
|
||||
extern DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
|
||||
|
||||
extern DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
|
||||
extern DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
|
||||
extern DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
|
||||
|
||||
extern DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
|
||||
extern DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
|
||||
|
||||
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
|
||||
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
|
||||
extern DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
|
||||
|
||||
#endif //DEF_H
|
||||
|
||||
|
||||
@@ -19,46 +19,27 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file LAYER2/MAC/defs.h
|
||||
* \brief MAC data structures, constant, and function prototype
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2011
|
||||
* \version 0.5
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
|
||||
*/
|
||||
/** @defgroup _oai2 openair2 Reference Implementation
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
/* \file mac.h
|
||||
* \brief MAC data structures, constant, and function prototype
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifndef __LAYER2_NR_UE_MAC_DEFS_H__
|
||||
#define __LAYER2_NR_UE_MAC_DEFS_H__
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/** @defgroup _mac MAC
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!\brief Values of BCCH logical channel (fake)*/
|
||||
#define NR_BCCH_DL_SCH 3 // SI
|
||||
|
||||
/*!\brief Values of PCCH logical channel (fake) */
|
||||
#define NR_BCCH_BCH 5 // MIB
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*!\brief UE layer 2 status */
|
||||
typedef enum {
|
||||
@@ -66,13 +47,7 @@ typedef enum {
|
||||
CONNECTION_LOST,
|
||||
PHY_RESYNCH,
|
||||
PHY_HO_PRACH
|
||||
} UE_L2_STATE_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} NR_UE_L2_STATE_t;
|
||||
|
||||
|
||||
#endif /*__LAYER2_MAC_DEFS_H__ */
|
||||
|
||||
@@ -19,21 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file LAYER2/MAC/defs.h
|
||||
* \brief MAC data structures, constant, and function prototype
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2011
|
||||
* \version 0.5
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
|
||||
*/
|
||||
/** @defgroup _oai2 openair2 Reference Implementation
|
||||
* @ingroup _ref_implementation_
|
||||
* @{
|
||||
/* \file mac_defs.h
|
||||
* \brief MAC data structures, constant, and function prototype
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifndef __LAYER2_NR_MAC_DEFS_H__
|
||||
#define __LAYER2_NR_MAC_DEFS_H__
|
||||
|
||||
@@ -67,15 +63,23 @@
|
||||
typedef struct {
|
||||
|
||||
//// MAC config
|
||||
NR_DRX_Config_t *drx_Config; /* OPTIONAL */
|
||||
NR_SchedulingRequestConfig_t *schedulingRequestConfig; /* OPTIONAL */
|
||||
NR_BSR_Config_t *bsr_Config; /* OPTIONAL */
|
||||
NR_TAG_Config_t *tag_Config; /* OPTIONAL */
|
||||
NR_PHR_Config_t *phr_Config; /* OPTIONAL */
|
||||
|
||||
NR_RNTI_Value_t *cs_RNTI; /* OPTIONAL */
|
||||
NR_DRX_Config_t *drx_Config;
|
||||
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
|
||||
NR_BSR_Config_t *bsr_Config;
|
||||
NR_TAG_Config_t *tag_Config;
|
||||
NR_PHR_Config_t *phr_Config;
|
||||
NR_RNTI_Value_t *cs_RNTI;
|
||||
NR_MIB_t *mib;
|
||||
|
||||
/// Type0-PDCCH seach space coreset
|
||||
fapi_nr_search_space_t type0_pdcch_ss;
|
||||
uint32_t type0_pdcch_ss_mux_pattern;
|
||||
float type0_pdcch_ss_big_o;
|
||||
uint32_t type0_pdcch_ss_number_of_search_space_per_slot;
|
||||
float type0_pdcch_ss_big_m;
|
||||
uint32_t type0_pdcch_ss_first_symbol_index;
|
||||
/// Type0-PDCCH seach space
|
||||
|
||||
NR_MIB_t *mib;
|
||||
|
||||
//// FAPI-like interface
|
||||
fapi_nr_tx_request_t tx_request;
|
||||
@@ -84,9 +88,12 @@ typedef struct {
|
||||
fapi_nr_dci_indication_t dci_indication;
|
||||
fapi_nr_rx_indication_t rx_indication;
|
||||
|
||||
/// Interface module instances
|
||||
nr_ue_if_module_t *if_module;
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
nr_phy_config_t phy_config;
|
||||
|
||||
|
||||
} NR_UE_MAC_INST_t;
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 extern.h
|
||||
* \brief extern variables for MAC layer
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
extern const int32_t table_38213_13_1_c2[16];
|
||||
extern const int32_t table_38213_13_1_c3[16];
|
||||
extern const int32_t table_38213_13_1_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_2_c2[16];
|
||||
extern const int32_t table_38213_13_2_c3[16];
|
||||
extern const int32_t table_38213_13_2_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_3_c2[16];
|
||||
extern const int32_t table_38213_13_3_c3[16];
|
||||
extern const int32_t table_38213_13_3_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_4_c2[16];
|
||||
extern const int32_t table_38213_13_4_c3[16];
|
||||
extern const int32_t table_38213_13_4_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_5_c2[16];
|
||||
extern const int32_t table_38213_13_5_c3[16];
|
||||
extern const int32_t table_38213_13_5_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_6_c2[16];
|
||||
extern const int32_t table_38213_13_6_c3[16];
|
||||
extern const int32_t table_38213_13_6_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_7_c2[16];
|
||||
extern const int32_t table_38213_13_7_c3[16];
|
||||
extern const int32_t table_38213_13_7_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_8_c2[16];
|
||||
extern const int32_t table_38213_13_8_c3[16];
|
||||
extern const int32_t table_38213_13_8_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_9_c2[16];
|
||||
extern const int32_t table_38213_13_9_c3[16];
|
||||
extern const int32_t table_38213_13_9_c4[16];
|
||||
|
||||
extern const int32_t table_38213_13_10_c2[16];
|
||||
extern const int32_t table_38213_13_10_c3[16];
|
||||
extern const int32_t table_38213_13_10_c4[16];
|
||||
|
||||
extern const float table_38213_13_11_c1[16];
|
||||
extern const int32_t table_38213_13_11_c2[16];
|
||||
extern const float table_38213_13_11_c3[16];
|
||||
extern const int32_t table_38213_13_11_c4[16];
|
||||
|
||||
extern const float table_38213_13_12_c1[16];
|
||||
extern const int32_t table_38213_13_12_c2[16];
|
||||
extern const float table_38213_13_12_c3[16];
|
||||
@@ -19,42 +19,97 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file LAYER2/MAC/proto.h
|
||||
/* \file proto.h
|
||||
* \brief MAC functions prototypes for eNB and UE
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \version 1.0
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __LAYER2_MAC_PROTO_H__
|
||||
#define __LAYER2_MAC_PROTO_H__
|
||||
|
||||
#include "mac_defs.h"
|
||||
#include "mac.h"
|
||||
|
||||
/**\brief decode mib pdu in NR_UE, from if_module ul_ind with P7 tx_ind message
|
||||
\param module_id module id
|
||||
\param CC_id component carrier id
|
||||
\param cc_id component carrier id
|
||||
\param gNB_index gNB index
|
||||
\param extra_bits extra bits 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 7.1.1
|
||||
\param pduP pointer to pdu
|
||||
\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, void *pduP, uint16_t pdu_len);
|
||||
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,
|
||||
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)
|
||||
\param module_id module id
|
||||
\param CC_id component carrier id
|
||||
\param cc_id component carrier id
|
||||
\param gNB_index gNB index
|
||||
\param mibP pointer to RRC message MIB
|
||||
\param mac_cell_group_configP pointer to RRC message MAC-related in cell group config
|
||||
\param phy_cell_group_configP pointer to RRC message PHY-related in cell group config
|
||||
\param spcell_configP pointer to RRC message serving cell config*/
|
||||
int nr_rrc_mac_config_req_ue( module_id_t module_id, int CC_id, uint8_t gNB_index, NR_MIB_t *mibP, NR_MAC_CellGroupConfig_t *mac_cell_group_configP, NR_PhysicalCellGroupConfig_t *phy_cell_group_configP, NR_SpCellConfig_t *spcell_configP );
|
||||
|
||||
int nr_rrc_mac_config_req_ue(
|
||||
module_id_t module_id,
|
||||
int cc_id,
|
||||
uint8_t gNB_index,
|
||||
NR_MIB_t *mibP,
|
||||
NR_MAC_CellGroupConfig_t *mac_cell_group_configP,
|
||||
NR_PhysicalCellGroupConfig_t *phy_cell_group_configP,
|
||||
NR_SpCellConfig_t *spcell_configP );
|
||||
|
||||
/**\brief initialization NR UE MAC instance(s), total number of MAC instance based on NB_NR_UE_MAC_INST*/
|
||||
int nr_l2_init_ue(void);
|
||||
|
||||
NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP);
|
||||
/**\brief fetch MAC instance by module_id, within 0 - (NB_NR_UE_MAC_INST-1)
|
||||
\param module_id index of MAC instance(s)*/
|
||||
NR_UE_MAC_INST_t *get_mac_inst(
|
||||
module_id_t module_id);
|
||||
|
||||
/**\brief called at each slot, slot length based on numerology. now use u=0, scs=15kHz, slot=1ms
|
||||
performs BSR/SR/PHR procedures, random access procedure handler and DLSCH/ULSCH procedures.
|
||||
\param module_id module id
|
||||
\param gNB_index corresponding gNB index
|
||||
\param cc_id component carrier id
|
||||
\param rx_frame receive frame number
|
||||
\param rx_slot receive slot number
|
||||
\param tx_frame transmit frame number
|
||||
\param tx_slot transmit slot number*/
|
||||
NR_UE_L2_STATE_t nr_ue_scheduler(
|
||||
const module_id_t module_id,
|
||||
const uint8_t gNB_index,
|
||||
const int cc_id,
|
||||
const frame_t rx_frame,
|
||||
const slot_t rx_slot,
|
||||
const frame_t tx_frame,
|
||||
const slot_t tx_slot);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* \brief Get SR payload (0,1) from UE MAC
|
||||
@param Mod_id Instance id of UE in machine
|
||||
@param CC_id Component Carrier index
|
||||
@param eNB_id Index of eNB that UE is attached to
|
||||
@param rnti C_RNTI of UE
|
||||
@param subframe subframe number
|
||||
@returns 0 for no SR, 1 for SR
|
||||
*/
|
||||
uint32_t ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, rnti_t rnti, sub_frame_t subframe);
|
||||
|
||||
/** @}*/
|
||||
@@ -19,18 +19,72 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file vars.h
|
||||
* \brief mac vars
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
/* \file vars.h
|
||||
* \brief MAC Layer variables
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "mac_defs.h"
|
||||
|
||||
NR_UE_MAC_INST_t UE_mac_inst; //[NB_MODULE_MAX];
|
||||
#define reserved 0xffff
|
||||
|
||||
// specification mapping talbe, table_38$x_$y_$z_c$a
|
||||
// - $x: specification
|
||||
// - $y: subclause-major
|
||||
// - $z: subclause-minor
|
||||
// - $a: ($a)th of column in table, start from zero
|
||||
const int32_t table_38213_13_1_c2[16] = {24, 24, 24, 24, 24, 24, 48, 48, 48, 48, 48, 48, 96, 96, 96, reserved}; // index 15 reserved
|
||||
const int32_t table_38213_13_1_c3[16] = { 2, 2, 2, 3, 3, 3, 1, 1, 2, 2, 3, 3, 1, 2, 3, reserved}; // index 15 reserved
|
||||
const int32_t table_38213_13_1_c4[16] = { 0, 2, 4, 0, 2, 4, 12, 16, 12, 16, 12, 16, 38, 38, 38, reserved}; // index 15 reserved
|
||||
|
||||
const int32_t table_38213_13_2_c2[16] = {24, 24, 24, 24, 24, 24, 24, 24, 48, 48, 48, 48, 48, 48, reserved, reserved}; // index 14-15 reserved
|
||||
const int32_t table_38213_13_2_c3[16] = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 2, 2, 3, 3, reserved, reserved}; // index 14-15 reserved
|
||||
const int32_t table_38213_13_2_c4[16] = { 5, 6, 7, 8, 5, 6, 7, 8, 18, 20, 18, 20, 18, 20, reserved, reserved}; // index 14-15 reserved
|
||||
|
||||
const int32_t table_38213_13_3_c2[16] = {48, 48, 48, 48, 48, 48, 96, 96, 96, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
const int32_t table_38213_13_3_c3[16] = { 1, 1, 2, 2, 3, 3, 1, 2, 3, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
const int32_t table_38213_13_3_c4[16] = { 2, 6, 2, 6, 2, 6, 28, 28, 28, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
|
||||
const int32_t table_38213_13_4_c2[16] = {24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 48, 48, 48, 48, 48, 48};
|
||||
const int32_t table_38213_13_4_c3[16] = { 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 2, 2, 2};
|
||||
const int32_t table_38213_13_4_c4[16] = { 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 12, 14, 16, 12, 14, 16};
|
||||
|
||||
const int32_t table_38213_13_5_c2[16] = {48, 48, 48, 96, 96, 96, 96, 96, 96, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
const int32_t table_38213_13_5_c3[16] = { 1, 2, 3, 1, 1, 2, 2, 3, 3, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
const int32_t table_38213_13_5_c4[16] = { 4, 4, 4, 0, 56, 0, 56, 0, 56, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 09-15 reserved
|
||||
|
||||
const int32_t table_38213_13_6_c2[16] = {24, 24, 24, 24, 48, 48, 48, 48, 48, 48, reserved, reserved, reserved, reserved, reserved, reserved}; // index 10-15 reserved
|
||||
const int32_t table_38213_13_6_c3[16] = { 2, 2, 3, 3, 1, 1, 2, 2, 3, 3, reserved, reserved, reserved, reserved, reserved, reserved}; // index 10-15 reserved
|
||||
const int32_t table_38213_13_6_c4[16] = { 0, 4, 0, 4, 0, 28, 0, 28, 0, 28, reserved, reserved, reserved, reserved, reserved, reserved}; // index 10-15 reserved
|
||||
|
||||
const int32_t table_38213_13_7_c2[16] = {48, 48, 48, 48, 48, 48, 96, 96, 48, 48, 96, 96, reserved, reserved, reserved, reserved}; // index 12-15 reserved
|
||||
const int32_t table_38213_13_7_c3[16] = { 1, 1, 2, 2, 3, 3, 1, 2, 1, 1, 1, 1, reserved, reserved, reserved, reserved}; // index 12-15 reserved
|
||||
const int32_t table_38213_13_7_c4[16] = { 0, 8, 0, 8, 0, 8, 28, 28,-41, 49,-41, 97, reserved, reserved, reserved, reserved}; // index 12-15 reserved, condition A as default
|
||||
|
||||
const int32_t table_38213_13_8_c2[16] = { 1, 1, 1, 1, 3, 3, 3, 3, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 15 reserved
|
||||
const int32_t table_38213_13_8_c3[16] = {24, 24, 48, 48, 24, 24, 48, 48, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 15 reserved
|
||||
const int32_t table_38213_13_8_c4[16] = { 0, 4, 14, 14,-20, 24,-20, 48, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 15 reserved, condition A as default
|
||||
|
||||
const int32_t table_38213_13_9_c2[16] = {96, 96, 96, 96, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 04-15 reserved
|
||||
const int32_t table_38213_13_9_c3[16] = { 1, 1, 2, 2, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 04-15 reserved
|
||||
const int32_t table_38213_13_9_c4[16] = { 0, 16, 0, 16, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 04-15 reserved
|
||||
|
||||
const int32_t table_38213_13_10_c2[16] = {48, 48, 48, 48, 24, 24, 48, 48, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 08-15 reserved
|
||||
const int32_t table_38213_13_10_c3[16] = { 1, 1, 2, 2, 1, 1, 1, 1, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 08-15 reserved
|
||||
const int32_t table_38213_13_10_c4[16] = { 0, 8, 0, 8,-41, 25,-41, 49, reserved, reserved, reserved, reserved, reserved, reserved, reserved, reserved}; // index 08-15 reserved, condition A as default
|
||||
|
||||
const float table_38213_13_11_c1[16] = { 0, 0, 2, 2, 5, 5, 7, 7, 0, 5, 0, 0, 2, 2, 5, 5};
|
||||
const int32_t table_38213_13_11_c2[16] = { 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1};
|
||||
const float table_38213_13_11_c3[16] = { 1, 0.5f, 1, 0.5f, 1, 0.5f, 1, 0.5f, 1, 1, 1, 1, 1, 1, 1, 1};
|
||||
const int32_t table_38213_13_11_c4[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2, 1, 2}; // i is even as default
|
||||
|
||||
const float table_38213_13_12_c1[16] = { 0, 0, 2.5f, 2.5f, 5, 5, 0, 2.5f, 5, 7.5f, 7.5f, 7.5f, 0, 5, reserved, reserved}; // index 14-15 reserved
|
||||
const int32_t table_38213_13_12_c2[16] = { 1, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, reserved, reserved}; // index 14-15 reserved
|
||||
const float table_38213_13_12_c3[16] = { 1, 0.5f, 1, 0.5f, 1, 0.5f, 0.5f, 0.5f, 0.5f, 1, 0.5f, 0.5f, 1, 1, reserved, reserved}; // index 14-15 reserved
|
||||
|
||||
|
||||
@@ -19,18 +19,19 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file main.c
|
||||
/* \file main_ue_nr.c
|
||||
* \brief top init of Layer 2
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "proto.h"
|
||||
//#include "defs.h"
|
||||
#include "mac_proto.h"
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
|
||||
@@ -48,6 +49,6 @@ nr_l2_init_ue(void)
|
||||
return (1);
|
||||
}
|
||||
|
||||
NR_UE_MAC_INST_t *get_mac_inst(module_id_t Mod_idP){
|
||||
return &nr_ue_mac_inst[(int)Mod_idP];
|
||||
NR_UE_MAC_INST_t *get_mac_inst(module_id_t module_id){
|
||||
return &nr_ue_mac_inst[(int)module_id];
|
||||
}
|
||||
|
||||
@@ -19,21 +19,49 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file ue_procedures.c
|
||||
/* \file ue_procedures.c
|
||||
* \brief procedures related to UE
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "proto.h"
|
||||
|
||||
#include "mac_proto.h"
|
||||
#include "mac_extern.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
#include "assertions.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum subcarrier_spacing_e {
|
||||
scs_15kHz = 0x1,
|
||||
scs_30kHz = 0x2,
|
||||
scs_60kHz = 0x4,
|
||||
scs_120kHz = 0x8,
|
||||
scs_240kHz = 0x16
|
||||
} subcarrier_spacing_t;
|
||||
|
||||
typedef enum channel_bandwidth_e {
|
||||
bw_5MHz = 0x1,
|
||||
bw_10MHz = 0x2,
|
||||
bw_20MHz = 0x4,
|
||||
bw_40MHz = 0x8,
|
||||
bw_80MHz = 0x16,
|
||||
bw_100MHz = 0x32
|
||||
} channel_bandwidth_t;
|
||||
|
||||
typedef enum frequency_range_e {
|
||||
FR1 = 0,
|
||||
FR2
|
||||
} frequency_range_t;
|
||||
|
||||
int8_t nr_ue_decode_mib(
|
||||
module_id_t module_id,
|
||||
int CC_id,
|
||||
int cc_id,
|
||||
uint8_t gNB_index,
|
||||
uint8_t extra_bits, // 8bits 38.212 c7.1.1
|
||||
uint32_t l_ssb_equal_64,
|
||||
@@ -42,49 +70,359 @@ 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,
|
||||
nr_mac_rrc_data_ind_ue( module_id, cc_id, gNB_index,
|
||||
NR_BCCH_BCH, (uint8_t *) pduP, pdu_len );
|
||||
|
||||
|
||||
uint32_t frame = mac->mib->systemFrameNumber.buf[0];
|
||||
uint32_t frame_number_4lsb = (uint32_t)(extra_bits & 0xf); // extra bits[0:3]
|
||||
uint32_t half_frame_bit = (uint32_t)(( extra_bits >> 4 ) & 0x1 ); // extra bits[4]
|
||||
uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 5 ) & 0x1 ); // extra bits[5]
|
||||
|
||||
uint32_t ssb_subcarrier_offset = mac->mib->subCarrierSpacingCommon;
|
||||
if(mac->mib != NULL){
|
||||
uint32_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused);
|
||||
uint32_t frame_number_4lsb = (uint32_t)(extra_bits & 0xf); // extra bits[0:3]
|
||||
uint32_t half_frame_bit = (uint32_t)(( extra_bits >> 4 ) & 0x1 ); // extra bits[4]
|
||||
uint32_t ssb_subcarrier_offset_msb = (uint32_t)(( extra_bits >> 5 ) & 0x1 ); // extra bits[5]
|
||||
|
||||
uint32_t ssb_subcarrier_offset = mac->mib->ssb_SubcarrierOffset;
|
||||
|
||||
uint32_t ssb_index;
|
||||
uint32_t ssb_index = 0; // TODO: ssb_index should obtain from L1 in case Lssb != 64
|
||||
|
||||
frame = frame << 4;
|
||||
frame = frame | frame_number_4lsb;
|
||||
frame = frame << 4;
|
||||
frame = frame | frame_number_4lsb;
|
||||
|
||||
if(l_ssb_equal_64){
|
||||
ssb_index = (( extra_bits >> 5 ) & 0x7 ); // extra bits[5:7]
|
||||
mac->phy_config.config_req.pbch_config.ssb_index = ssb_index;
|
||||
}else{
|
||||
if(ssb_subcarrier_offset_msb){
|
||||
ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10;
|
||||
if(l_ssb_equal_64){
|
||||
ssb_index = (( extra_bits >> 5 ) & 0x7 ); // extra bits[5:7]
|
||||
}else{
|
||||
if(ssb_subcarrier_offset_msb){
|
||||
ssb_subcarrier_offset = ssb_subcarrier_offset | 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("system frame number(6 MSB bits): %d\n", mac->mib->systemFrameNumber.buf[0]);
|
||||
printf("system frame number(with LSB): %d\n", (int)frame);
|
||||
printf("subcarrier spacing: %d\n", (int)mac->mib->subCarrierSpacingCommon);
|
||||
printf("ssb carrier offset(with MSB): %d\n", (int)ssb_subcarrier_offset);
|
||||
printf("dmrs type A position: %d\n", (int)mac->mib->dmrs_TypeA_Position);
|
||||
printf("pdcch config sib1: %d\n", (int)mac->mib->pdcch_ConfigSIB1);
|
||||
printf("cell barred: %d\n", (int)mac->mib->cellBarred);
|
||||
printf("intra frequcney reselection: %d\n", (int)mac->mib->intraFreqReselection);
|
||||
printf("half frame bit(extra bits): %d\n", (int)half_frame_bit);
|
||||
printf("ssb index(extra bits): %d\n", (int)ssb_index);
|
||||
#endif
|
||||
|
||||
subcarrier_spacing_t scs_ssb = scs_15kHz; // default for testing
|
||||
subcarrier_spacing_t scs_pdcch = scs_15kHz; // default for testing
|
||||
channel_bandwidth_t min_channel_bw = bw_5MHz; // deafult for testing
|
||||
|
||||
uint32_t is_condition_A = 1;
|
||||
frequency_range_t frequency_range = FR1;
|
||||
uint32_t index_4msb = (mac->mib->pdcch_ConfigSIB1 >> 4) & 0xf;
|
||||
uint32_t index_4lsb = (mac->mib->pdcch_ConfigSIB1 & 0xf);
|
||||
|
||||
int32_t num_rbs = -1;
|
||||
int32_t num_symbols = -1;
|
||||
int32_t rb_offset = -1;
|
||||
|
||||
// type0-pdcch coreset
|
||||
switch( (scs_ssb << 5)|scs_pdcch ){
|
||||
case (scs_15kHz << 5) | scs_15kHz :
|
||||
AssertFatal(index_4msb < 15, "38.213 Table 13-1 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_1_c2[index_4msb];
|
||||
num_symbols = table_38213_13_1_c3[index_4msb];
|
||||
rb_offset = table_38213_13_1_c4[index_4msb];
|
||||
break;
|
||||
|
||||
case (scs_15kHz << 5) | scs_30kHz:
|
||||
AssertFatal(index_4msb < 14, "38.213 Table 13-2 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_2_c2[index_4msb];
|
||||
num_symbols = table_38213_13_2_c3[index_4msb];
|
||||
rb_offset = table_38213_13_2_c4[index_4msb];
|
||||
break;
|
||||
|
||||
case (scs_30kHz << 5) | scs_15kHz:
|
||||
if((min_channel_bw & bw_5MHz) | (min_channel_bw & bw_10MHz)){
|
||||
AssertFatal(index_4msb < 9, "38.213 Table 13-3 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_3_c2[index_4msb];
|
||||
num_symbols = table_38213_13_3_c3[index_4msb];
|
||||
rb_offset = table_38213_13_3_c4[index_4msb];
|
||||
}else if(min_channel_bw & bw_40MHz){
|
||||
AssertFatal(index_4msb < 9, "38.213 Table 13-5 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_5_c2[index_4msb];
|
||||
num_symbols = table_38213_13_5_c3[index_4msb];
|
||||
rb_offset = table_38213_13_5_c4[index_4msb];
|
||||
}else{ ; }
|
||||
|
||||
break;
|
||||
|
||||
case (scs_30kHz << 5) | scs_30kHz:
|
||||
if((min_channel_bw & bw_5MHz) | (min_channel_bw & bw_10MHz)){
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_4_c2[index_4msb];
|
||||
num_symbols = table_38213_13_4_c3[index_4msb];
|
||||
rb_offset = table_38213_13_4_c4[index_4msb];
|
||||
}else if(min_channel_bw & bw_40MHz){
|
||||
AssertFatal(index_4msb < 10, "38.213 Table 13-6 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_6_c2[index_4msb];
|
||||
num_symbols = table_38213_13_6_c3[index_4msb];
|
||||
rb_offset = table_38213_13_6_c4[index_4msb];
|
||||
}else{ ; }
|
||||
break;
|
||||
|
||||
case (scs_120kHz << 5) | scs_60kHz:
|
||||
AssertFatal(index_4msb < 12, "38.213 Table 13-7 4 MSB out of range\n");
|
||||
if(index_4msb & 0x7){
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
}else if(index_4msb & 0x18){
|
||||
mac->type0_pdcch_ss_mux_pattern = 2;
|
||||
}else{ ; }
|
||||
|
||||
num_rbs = table_38213_13_7_c2[index_4msb];
|
||||
num_symbols = table_38213_13_7_c3[index_4msb];
|
||||
if(!is_condition_A && (index_4msb == 8 || index_4msb == 10)){
|
||||
rb_offset = table_38213_13_7_c4[index_4msb] - 1;
|
||||
}else{
|
||||
rb_offset = table_38213_13_7_c4[index_4msb];
|
||||
}
|
||||
break;
|
||||
|
||||
case (scs_120kHz << 5) | scs_120kHz:
|
||||
AssertFatal(index_4msb < 8, "38.213 Table 13-8 4 MSB out of range\n");
|
||||
if(index_4msb & 0x3){
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
}else if(index_4msb & 0x0c){
|
||||
mac->type0_pdcch_ss_mux_pattern = 3;
|
||||
}
|
||||
|
||||
num_rbs = table_38213_13_8_c2[index_4msb];
|
||||
num_symbols = table_38213_13_8_c3[index_4msb];
|
||||
if(!is_condition_A && (index_4msb == 4 || index_4msb == 6)){
|
||||
rb_offset = table_38213_13_8_c4[index_4msb] - 1;
|
||||
}else{
|
||||
rb_offset = table_38213_13_8_c4[index_4msb];
|
||||
}
|
||||
break;
|
||||
|
||||
case (scs_240kHz << 5) | scs_60kHz:
|
||||
AssertFatal(index_4msb < 4, "38.213 Table 13-9 4 MSB out of range\n");
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
num_rbs = table_38213_13_9_c2[index_4msb];
|
||||
num_symbols = table_38213_13_9_c3[index_4msb];
|
||||
rb_offset = table_38213_13_9_c4[index_4msb];
|
||||
break;
|
||||
|
||||
case (scs_240kHz << 5) | scs_120kHz:
|
||||
AssertFatal(index_4msb < 8, "38.213 Table 13-10 4 MSB out of range\n");
|
||||
if(index_4msb & 0x3){
|
||||
mac->type0_pdcch_ss_mux_pattern = 1;
|
||||
}else if(index_4msb & 0x0c){
|
||||
mac->type0_pdcch_ss_mux_pattern = 2;
|
||||
}
|
||||
num_rbs = table_38213_13_10_c2[index_4msb];
|
||||
num_symbols = table_38213_13_10_c3[index_4msb];
|
||||
if(!is_condition_A && (index_4msb == 4 || index_4msb == 6)){
|
||||
rb_offset = table_38213_13_10_c4[index_4msb]-1;
|
||||
}else{
|
||||
rb_offset = table_38213_13_10_c4[index_4msb];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
AssertFatal(num_rbs != -1, "Type0 PDCCH coreset num_rbs undefined");
|
||||
AssertFatal(num_symbols != -1, "Type0 PDCCH coreset num_symbols undefined");
|
||||
AssertFatal(rb_offset != -1, "Type0 PDCCH coreset rb_offset undefined");
|
||||
|
||||
uint32_t cell_id = 0; // obtain from L1 later
|
||||
mac->type0_pdcch_ss.coreset.rb_start = rb_offset;
|
||||
mac->type0_pdcch_ss.coreset.rb_end = rb_offset + num_rbs - 1;
|
||||
mac->type0_pdcch_ss.coreset.duration = num_symbols;
|
||||
mac->type0_pdcch_ss.coreset.cce_reg_mapping_type = CCE_REG_MAPPING_TYPE_INTERLEAVED;
|
||||
mac->type0_pdcch_ss.coreset.cce_reg_interleaved_reg_bundle_size = 6; // L
|
||||
mac->type0_pdcch_ss.coreset.cce_reg_interleaved_interleaver_size = 2; // R
|
||||
mac->type0_pdcch_ss.coreset.cce_reg_interleaved_shift_index = cell_id;
|
||||
mac->type0_pdcch_ss.coreset.precoder_granularity = PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE;
|
||||
mac->type0_pdcch_ss.coreset.pdcch_dmrs_scrambling_id = cell_id;
|
||||
|
||||
|
||||
|
||||
// type0-pdcch search space
|
||||
float big_o;
|
||||
uint32_t number_of_search_space_per_slot;
|
||||
float big_m;
|
||||
uint32_t first_symbol_index;
|
||||
|
||||
/// MUX PATTERN 1
|
||||
if(mac->type0_pdcch_ss_mux_pattern == 1 && frequency_range == FR1){
|
||||
big_o = table_38213_13_11_c1[index_4lsb];
|
||||
number_of_search_space_per_slot = table_38213_13_11_c2[index_4lsb];
|
||||
big_m = table_38213_13_11_c3[index_4lsb];
|
||||
|
||||
if((index_4lsb == 1 || index_4lsb == 3 || index_4lsb == 5 || index_4lsb == 7) && (ssb_index&1)){
|
||||
first_symbol_index = num_symbols;
|
||||
}else{
|
||||
first_symbol_index = table_38213_13_11_c4[index_4lsb];
|
||||
}
|
||||
}
|
||||
|
||||
if(mac->type0_pdcch_ss_mux_pattern == 1 && frequency_range == FR2){
|
||||
big_o = table_38213_13_12_c1[index_4lsb];
|
||||
number_of_search_space_per_slot = table_38213_13_11_c2[index_4lsb];
|
||||
big_m = table_38213_13_12_c3[index_4lsb];
|
||||
|
||||
if((index_4lsb == 1 || index_4lsb == 3 || index_4lsb == 5 || index_4lsb == 10) && (ssb_index&1)){
|
||||
first_symbol_index = 7;
|
||||
}else if((index_4lsb == 6 || index_4lsb == 7 || index_4lsb == 8 || index_4lsb == 11) && (ssb_index&1)){
|
||||
first_symbol_index = num_symbols;
|
||||
}else{
|
||||
first_symbol_index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// MUX PATTERN 2
|
||||
if(mac->type0_pdcch_ss_mux_pattern == 2){
|
||||
if((scs_ssb == scs_120kHz) && (scs_pdcch == scs_60kHz)){
|
||||
// 38.213 Table 13-13
|
||||
AssertFatal(index_4lsb == 0, "38.213 Table 13-13 4 LSB out of range\n");
|
||||
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
|
||||
// TODO Type0SS_frame = SSB_frame
|
||||
// TODO Type0SS_slot = SSB_slot
|
||||
switch(ssb_index & 0x3){ // ssb_index(i) mod 4
|
||||
case 0:
|
||||
first_symbol_index = 0;
|
||||
break;
|
||||
case 1:
|
||||
first_symbol_index = 1;
|
||||
break;
|
||||
case 2:
|
||||
first_symbol_index = 6;
|
||||
break;
|
||||
case 3:
|
||||
first_symbol_index = 7;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
}else if((scs_ssb == scs_240kHz) && (scs_pdcch == scs_120kHz)){
|
||||
// 38.213 Table 13-14
|
||||
AssertFatal(index_4lsb == 0, "38.213 Table 13-14 4 LSB out of range\n");
|
||||
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
|
||||
// TODO Type0SS_frame = SSB_frame
|
||||
switch(ssb_index & 0x7){ // ssb_index(i) mod 8
|
||||
case 0:
|
||||
first_symbol_index = 0;
|
||||
break;
|
||||
case 1:
|
||||
first_symbol_index = 1;
|
||||
break;
|
||||
case 2:
|
||||
first_symbol_index = 2;
|
||||
break;
|
||||
case 3:
|
||||
first_symbol_index = 3;
|
||||
break;
|
||||
case 4:
|
||||
first_symbol_index = 12;
|
||||
// TODO Type0SS_slot = SSB_slot - 1
|
||||
break;
|
||||
case 5:
|
||||
first_symbol_index = 13;
|
||||
// TODO Type0SS_slot = SSB_slot - 1
|
||||
break;
|
||||
case 6:
|
||||
first_symbol_index = 0;
|
||||
break;
|
||||
case 7:
|
||||
first_symbol_index = 1;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}else{ ; }
|
||||
}
|
||||
|
||||
/// MUX PATTERN 3
|
||||
if(mac->type0_pdcch_ss_mux_pattern == 3){
|
||||
if((scs_ssb == scs_120kHz) && (scs_pdcch == scs_120kHz)){
|
||||
// 38.213 Table 13-15
|
||||
AssertFatal(index_4lsb == 0, "38.213 Table 13-15 4 LSB out of range\n");
|
||||
// PDCCH monitoring occasions (SFN and slot number) same as SSB frame-slot
|
||||
// TODO Type0SS_frame = SSB_frame
|
||||
// TODO Type0SS_slot = SSB_slot
|
||||
switch(ssb_index & 0x3){ // ssb_index(i) mod 4
|
||||
case 0:
|
||||
first_symbol_index = 4;
|
||||
break;
|
||||
case 1:
|
||||
first_symbol_index = 8;
|
||||
break;
|
||||
case 2:
|
||||
first_symbol_index = 2;
|
||||
break;
|
||||
case 3:
|
||||
first_symbol_index = 6;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}else{ ; }
|
||||
}
|
||||
|
||||
mac->type0_pdcch_ss_big_o = big_o;
|
||||
mac->type0_pdcch_ss_number_of_search_space_per_slot = number_of_search_space_per_slot;
|
||||
mac->type0_pdcch_ss_big_m = big_m;
|
||||
mac->type0_pdcch_ss_first_symbol_index = first_symbol_index;
|
||||
|
||||
// fill in the elements in config request inside P5 message
|
||||
mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation
|
||||
mac->phy_config.config_req.pbch_config.subcarrier_spacing_common = mac->mib->subCarrierSpacingCommon;
|
||||
mac->phy_config.config_req.pbch_config.ssb_subcarrier_offset = ssb_subcarrier_offset; // after calculation
|
||||
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_frequency_reselection = mac->mib->intraFreqReselection;
|
||||
mac->phy_config.config_req.pbch_config.half_frame_bit = half_frame_bit;
|
||||
mac->phy_config.config_req.pbch_config.ssb_index = ssb_index;
|
||||
mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH;
|
||||
|
||||
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL){
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// fill in the elements in config request inside P5 message
|
||||
mac->phy_config.config_req.pbch_config.system_frame_number = frame; // after calculation
|
||||
mac->phy_config.config_req.pbch_config.subcarrier_spacing_common = mac->mib->subCarrierSpacingCommon;
|
||||
mac->phy_config.config_req.pbch_config.ssb_subcarrier_offset = ssb_subcarrier_offset; // after calculation
|
||||
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.half_frame_bit = half_frame_bit;
|
||||
mac->phy_config.config_req.config_mask |= FAPI_NR_CONFIG_REQUEST_MASK_PBCH;
|
||||
|
||||
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL){
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Performs :
|
||||
// 1. TODO: Call RRC for link status return to PHY
|
||||
// 2. TODO: Perform SR/BSR procedures for scheduling feedback
|
||||
// 3. TODO: Perform PHR procedures
|
||||
|
||||
NR_UE_L2_STATE_t nr_ue_scheduler(
|
||||
const module_id_t module_id,
|
||||
const uint8_t gNB_index,
|
||||
const int cc_id,
|
||||
const frame_t rx_frame,
|
||||
const slot_t rx_slot,
|
||||
const frame_t tx_frame,
|
||||
const slot_t tx_slot){
|
||||
|
||||
|
||||
return CONNECTION_OK;
|
||||
}
|
||||
|
||||
|
||||
uint32_t
|
||||
ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t eNB_id, uint16_t rnti, sub_frame_t subframe)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -19,21 +19,21 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file NR_IF_Module.c
|
||||
/* \file NR_IF_Module.c
|
||||
* \brief functions for NR UE FAPI-like interface
|
||||
* \author R. Knopp
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "NR_IF_Module.h"
|
||||
#include "LAYER2/NR_MAC_UE/proto.h"
|
||||
|
||||
#include "mac_proto.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define MAX_IF_MODULES 100
|
||||
|
||||
@@ -43,14 +43,14 @@ 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];
|
||||
uint8_t extra_bits = pduP[0];
|
||||
nr_ue_decode_mib( (module_id_t)0,
|
||||
0,
|
||||
0,
|
||||
extra_bits,
|
||||
0, // Lssb = 64 is not support
|
||||
pduP,
|
||||
3 );
|
||||
&pduP[1],
|
||||
pdu_len );
|
||||
|
||||
|
||||
|
||||
@@ -62,6 +62,34 @@ int8_t handle_bcch_dlsch(uint32_t pdu_len, uint8_t *pduP){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
|
||||
|
||||
NR_UE_L2_STATE_t ret;
|
||||
|
||||
ret = nr_ue_scheduler(
|
||||
ul_info->module_id,
|
||||
ul_info->gNB_index,
|
||||
ul_info->cc_id,
|
||||
ul_info->frame,
|
||||
ul_info->slot,
|
||||
0, 0); // TODO check tx/rx frame/slot is need for NR version
|
||||
|
||||
switch(ret){
|
||||
case CONNECTION_OK:
|
||||
break;
|
||||
case CONNECTION_LOST:
|
||||
break;
|
||||
case PHY_RESYNCH:
|
||||
break;
|
||||
case PHY_HO_PRACH:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
|
||||
module_id_t module_id = dl_info->module_id;
|
||||
@@ -69,23 +97,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);
|
||||
@@ -98,11 +127,16 @@ int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
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));
|
||||
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);
|
||||
nr_ue_if_module_inst[module_id]->cc_mask=0;
|
||||
nr_ue_if_module_inst[module_id]->current_frame = 0;
|
||||
nr_ue_if_module_inst[module_id]->current_slot = 0;
|
||||
nr_ue_if_module_inst[module_id]->phy_config_request = NULL;
|
||||
nr_ue_if_module_inst[module_id]->scheduled_response = NULL;
|
||||
nr_ue_if_module_inst[module_id]->dl_indication = nr_ue_dl_indication;
|
||||
nr_ue_if_module_inst[module_id]->ul_indication = nr_ue_ul_indication;
|
||||
}
|
||||
|
||||
return nr_ue_if_module_inst[module_id];
|
||||
|
||||
@@ -19,16 +19,17 @@
|
||||
* 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
|
||||
*/
|
||||
/* \file NR_IF_Module.h
|
||||
* \brief data structures for L1/L2 interface modules
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __NR_IF_MODULE_H__
|
||||
#define __NR_IF_MODULE_H__
|
||||
|
||||
@@ -39,23 +40,35 @@ typedef struct {
|
||||
/// module id
|
||||
module_id_t module_id;
|
||||
/// component carrier id
|
||||
int CC_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;
|
||||
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;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// module id
|
||||
module_id_t module_id;
|
||||
/// gNB index
|
||||
uint32_t gNB_index;
|
||||
/// component carrier id
|
||||
int cc_id;
|
||||
/// frame
|
||||
frame_t frame;
|
||||
/// slot
|
||||
uint32_t slot;
|
||||
} nr_uplink_indication_t;
|
||||
|
||||
// Downlink subframe P7
|
||||
|
||||
|
||||
@@ -103,7 +116,7 @@ typedef struct {
|
||||
* -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);
|
||||
typedef int8_t (nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_response);
|
||||
|
||||
|
||||
/*
|
||||
@@ -113,7 +126,7 @@ typedef int8_t(nr_ue_scheduled_response_f)(nr_scheduled_response_t *scheduled_re
|
||||
* -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);
|
||||
typedef int8_t (nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config);
|
||||
|
||||
|
||||
/*
|
||||
@@ -123,18 +136,27 @@ typedef int8_t(nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config);
|
||||
* -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);
|
||||
typedef int8_t (nr_ue_dl_indication_f)(nr_downlink_indication_t *dl_info);
|
||||
|
||||
/*
|
||||
* 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_ul_indication_f)(nr_uplink_indication_t *ul_info);
|
||||
|
||||
// TODO check this stuff can be reuse of need modification
|
||||
typedef struct nr_ue_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;
|
||||
nr_ue_ul_indication_f *ul_indication;
|
||||
|
||||
uint32_t CC_mask;
|
||||
uint16_t current_frame;
|
||||
uint8_t current_subframe;
|
||||
uint32_t cc_mask;
|
||||
uint32_t current_frame;
|
||||
uint32_t current_slot;
|
||||
//pthread_mutex_t nr_if_mutex;
|
||||
} nr_ue_if_module_t;
|
||||
|
||||
|
||||
@@ -1,373 +0,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 PHY_INTERFACE/defs.h
|
||||
* \brief mac phy interface primitives
|
||||
* \author Raymond Knopp and Navid Nikaein
|
||||
* \date 2011
|
||||
* \version 0.5
|
||||
* \mail navid.nikaein@eurecom.fr or openair_tech@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __MAC_PHY_PRIMITIVES_H__
|
||||
# define __MAC_PHY_PRIMITIVES_H__
|
||||
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
|
||||
|
||||
#define MAX_NUMBER_OF_MAC_INSTANCES 16
|
||||
|
||||
#define NULL_PDU 255
|
||||
#define DCI 0
|
||||
#define DLSCH 1
|
||||
#define ULSCH 2
|
||||
|
||||
#define mac_exit_wrapper(sTRING) \
|
||||
do { \
|
||||
char temp[300]; \
|
||||
snprintf(temp, sizeof(temp), "%s in file "__FILE__" at line %d\n", sTRING, __LINE__); \
|
||||
mac_xface->macphy_exit(temp); \
|
||||
} while(0)
|
||||
|
||||
/** @defgroup _phy_if MAC-PHY interface
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
*/
|
||||
/*! \brief MACPHY Interface */
|
||||
/*
|
||||
typedef struct {
|
||||
/// Pointer function that initializes L2
|
||||
int (*macphy_init)(int eMBMS_active, char *uecap_xer, uint8_t CBA_active,uint8_t HO_active);
|
||||
|
||||
/// Pointer function that stops the low-level scheduler due an exit condition
|
||||
void (*macphy_exit)(const char *);
|
||||
|
||||
// eNB functions
|
||||
/// Invoke dlsch/ulsch scheduling procedure for new subframe
|
||||
void (*eNB_dlsch_ulsch_scheduler)(module_id_t Mod_id,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP);//, int calibration_flag);
|
||||
|
||||
/// Fill random access response sdu, passing timing advance
|
||||
uint16_t (*fill_rar)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t *dlsch_buffer,uint16_t N_RB_UL, uint8_t input_buffer_length);
|
||||
|
||||
/// Initiate the RA procedure upon reception (hypothetical) of a valid preamble
|
||||
void (*initiate_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble,int16_t timing_offset,uint8_t sect_id,sub_frame_t subframe,uint8_t f_id);
|
||||
|
||||
/// cancel an ongoing RA procedure
|
||||
void (*cancel_ra_proc)(module_id_t Mod_id,int CC_id,frame_t frameP,uint16_t preamble);
|
||||
|
||||
/// Inform MAC layer that an uplink is scheduled for Msg3 in given subframe.
|
||||
/// This is used so that the MAC scheduler marks as busy the RBs used by the Msg3.
|
||||
void (*set_msg3_subframe)(module_id_t Mod_id,
|
||||
int CC_id,
|
||||
int frame,
|
||||
int subframe,
|
||||
int rnti,
|
||||
int Msg3_frame,
|
||||
int Msg3_subframe);
|
||||
|
||||
/// Get DCI for current subframe from MAC
|
||||
DCI_PDU* (*get_dci_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe);
|
||||
|
||||
/// Get DLSCH sdu for particular RNTI and Transport block index
|
||||
uint8_t* (*get_dlsch_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TB_index);
|
||||
|
||||
/// Send ULSCH sdu to MAC for given rnti
|
||||
void (*rx_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP, sub_frame_t sub_frameP,rnti_t rnti, uint8_t *sdu,uint16_t sdu_len, int harq_pid,uint8_t *msg3_flag);
|
||||
|
||||
/// Indicate failure to synch to external source
|
||||
void (*mrbch_phy_sync_failure) (module_id_t Mod_id,frame_t frameP, uint8_t free_eNB_index);
|
||||
|
||||
/// Indicate Scheduling Request from UE
|
||||
void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
/// Indicate UL Failure to eNodeB MAC
|
||||
void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_mib_eNB)(module_id_t Mod_id,int CC_id,
|
||||
int eutra_band,
|
||||
int N_RB_DL,
|
||||
PHICH_Config_t *phich_Config,
|
||||
int Nid_cell,
|
||||
int Ncp,
|
||||
int p_eNB,
|
||||
uint32_t dl_CarrierFreq,
|
||||
uint32_t ul_CarrierFreq);
|
||||
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id,
|
||||
TDD_Config_t *tdd_config,
|
||||
uint8_t SIwindowsize,
|
||||
uint16_t SIperiod);
|
||||
|
||||
/// Configure Common PHY parameters from SIB2
|
||||
void (*phy_config_sib2_eNB)(module_id_t Mod_id, int CC_id,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Configure Common PHY parameters from SIB13
|
||||
void (*phy_config_sib13_eNB)(module_id_t Mod_id,int CC_id, int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9);
|
||||
|
||||
void (*phy_config_dedicated_scell_eNB)(uint8_t Mod_id,
|
||||
uint16_t rnti,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id);
|
||||
#endif
|
||||
|
||||
/// PHY-Config-Dedicated eNB
|
||||
void (*phy_config_dedicated_eNB)(module_id_t Mod_id,int CC_id,rnti_t rnti,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Get MCH sdu and corresponding MCS for particular MBSFN subframe
|
||||
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, int CC_id, frame_t frameP,sub_frame_t subframe);
|
||||
#endif
|
||||
// configure the cba rnti at the physical layer
|
||||
void (*phy_config_cba_rnti)(module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
|
||||
/// get delta mcs for fast UL AMC
|
||||
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
|
||||
|
||||
int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP);
|
||||
/// UE functions
|
||||
|
||||
/// reset the ue phy
|
||||
void (*phy_reset_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Indicate loss of synchronization of PBCH for this eNB to MAC layer
|
||||
void (*out_of_sync_ind)(module_id_t Mod_id,frame_t frameP,uint16_t eNB_index);
|
||||
|
||||
/// Send a received SI sdu
|
||||
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
|
||||
|
||||
/// Send a received Paging sdu
|
||||
void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
|
||||
|
||||
/// Send a received DLSCH sdu to MAC
|
||||
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Send a received MCH sdu to MAC
|
||||
void (*ue_send_mch_sdu)(module_id_t Mod_id,uint8_t CC_id, frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t eNB_index,uint8_t sync_area);
|
||||
|
||||
/// Function to check if UE PHY needs to decode MCH for MAC
|
||||
/// get the sync area id, and return MCS value if need to decode, otherwise -1
|
||||
int (*ue_query_mch)(module_id_t Mod_id, uint8_t CC_id,frame_t frameP,sub_frame_t subframe,uint8_t eNB_index,uint8_t *sync_area, uint8_t *mcch_active);
|
||||
#endif
|
||||
|
||||
/// Retrieve ULSCH sdu from MAC
|
||||
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
|
||||
|
||||
/// Retrieve RRCConnectionReq from MAC
|
||||
PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
|
||||
|
||||
/// Process Random-Access Response
|
||||
uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index, uint8_t* selected_rar_buffer);
|
||||
|
||||
/// Get SR payload (0,1) from UE MAC
|
||||
uint32_t (*ue_get_SR)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
|
||||
|
||||
/// Indicate synchronization with valid PBCH
|
||||
void (*dl_phy_sync_success) (module_id_t Mod_id,frame_t frameP, uint8_t CH_index,uint8_t first_sync);
|
||||
|
||||
/// Only calls the PDCP for now
|
||||
UE_L2_STATE_t (*ue_scheduler)(module_id_t Mod_id, frame_t rxFrameP,sub_frame_t rxSubframe, frame_t txFrameP,sub_frame_t txSubframe, lte_subframe_t direction, uint8_t eNB_id, int CC_id);
|
||||
|
||||
/// PHY-Config-Dedicated UE
|
||||
void (*phy_config_dedicated_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated);
|
||||
|
||||
/// PHY-Config-harq UE
|
||||
void (*phy_config_harq_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
uint16_t max_harq_tx);
|
||||
/// Configure Common PHY parameters from SIB1
|
||||
void (*phy_config_sib1_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
TDD_Config_t *tdd_config,
|
||||
uint8_t SIwindowsize,
|
||||
uint16_t SIperiod);
|
||||
|
||||
/// Configure Common PHY parameters from SIB2
|
||||
void (*phy_config_sib2_ue)(module_id_t Mod_id,int CC_id,uint8_t CH_index,
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
|
||||
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
|
||||
long *ul_Bandwidth,
|
||||
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
|
||||
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/// Configure Common PHY parameters from SIB13
|
||||
void (*phy_config_sib13_ue)(uint8_t Mod_id,int CC_id, uint8_t eNB_index,int mbsfn_Area_idx,
|
||||
long mbsfn_AreaId_r9);
|
||||
|
||||
void (*phy_config_dedicated_scell_ue)(uint8_t Mod_id,
|
||||
uint8_t eNB_index,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id);
|
||||
#endif
|
||||
/// Configure Common PHY parameters from mobilityControlInfo
|
||||
void (*phy_config_afterHO_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
|
||||
MobilityControlInfo_t *mobilityControlInfo,
|
||||
uint8_t ho_failed);
|
||||
|
||||
/// Function to indicate failure of contention resolution or RA procedure
|
||||
void (*ra_failed)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function to indicate success of contention resolution or RA procedure
|
||||
void (*ra_succeeded)(module_id_t Mod_id,uint8_t CC_id, uint8_t eNB_index);
|
||||
|
||||
/// Function to indicate the transmission of msg1/rach to MAC
|
||||
void (*Msg1_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
|
||||
|
||||
/// Function to indicate Msg3 transmission/retransmission which initiates/reset Contention Resolution Timer
|
||||
void (*Msg3_transmitted)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t eNB_id);
|
||||
|
||||
/// Function to pass inter-cell measurement parameters to PHY (cell Ids)
|
||||
void (*phy_config_meas_ue)(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,uint32_t *adj_cell_id);
|
||||
|
||||
// PHY Helper Functions
|
||||
|
||||
/// RIV computation from PHY
|
||||
uint16_t (*computeRIV)(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
|
||||
|
||||
/// Downlink TBS table lookup from PHY
|
||||
uint32_t (*get_TBS_DL)(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/// Uplink TBS table lookup from PHY
|
||||
uint32_t (*get_TBS_UL)(uint8_t mcs, uint16_t nb_rb);
|
||||
|
||||
/// Function to retrieve the HARQ round index for a particular UL/DLSCH and harq_pid
|
||||
int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
|
||||
|
||||
/// Function to retrieve number of CCE
|
||||
uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
|
||||
|
||||
|
||||
int (*get_nCCE_offset)(int *CCE_table,
|
||||
const unsigned char L,
|
||||
const int nCCE,
|
||||
const int common_dci,
|
||||
const unsigned short rnti,
|
||||
const unsigned char subframe);
|
||||
|
||||
/// Function to retrieve number of PRB in an rb_alloc
|
||||
uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
|
||||
|
||||
/// Function to convert VRB to PRB for distributed allocation
|
||||
uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
|
||||
|
||||
/// Function to retrieve transmission mode for UE
|
||||
uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
|
||||
|
||||
/// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
|
||||
uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
|
||||
|
||||
/// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
|
||||
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve measured Path Loss
|
||||
int16_t (*get_PL)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve the rssi
|
||||
uint32_t (*get_RSSI)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve the total gain
|
||||
uint32_t (*get_rx_total_gain_dB)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve the number of adjustent cells
|
||||
uint8_t (*get_n_adj_cells)(uint8_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
|
||||
uint32_t (*get_RSRP)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to retrieve RSRP/RSRQ measurements
|
||||
uint32_t (*get_RSRQ)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
|
||||
uint8_t (*set_RSRP_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
|
||||
|
||||
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
|
||||
uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
|
||||
|
||||
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD
|
||||
uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
/// Function for UE/eNB MAC to retrieve f_id of particular PRACH resource in TDD
|
||||
uint8_t (*get_fid_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms,uint8_t tdd_map_index);
|
||||
|
||||
/// Function for eNB MAC to retrieve subframe direction
|
||||
lte_subframe_t (*get_subframe_direction)(module_id_t Mod_id, uint8_t CC_id, uint8_t subframe);
|
||||
|
||||
// MAC Helper functions
|
||||
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (Po_NOMINAL_PUSCH parameter)
|
||||
int8_t (*get_Po_NOMINAL_PUSCH)(module_id_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE/PHY to compute PUSCH transmit power in power-control procedure (deltaP_rampup parameter)
|
||||
int8_t (*get_deltaP_rampup)(module_id_t Mod_id,uint8_t CC_id);
|
||||
|
||||
/// Function for UE/PHY to compute PHR
|
||||
int8_t (*get_PHR)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/// Function for UE to process the timing advance command
|
||||
void (*process_timing_advance)(module_id_t Mod_id,uint8_t CC_id, int16_t timing_advance);
|
||||
|
||||
/// Function for MAC to get the UE stats from the PHY
|
||||
LTE_eNB_UE_stats* (*get_eNB_UE_stats)(module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
|
||||
|
||||
/// get the frame parameters from the PHY
|
||||
LTE_DL_FRAME_PARMS* (*get_lte_frame_parms)(module_id_t Mod_id, uint8_t CC_id);
|
||||
|
||||
/// get the Multiuser mimo mode
|
||||
MU_MIMO_mode* (*get_mu_mimo_mode) (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
|
||||
|
||||
/// get the delta TF for Uplink Power Control Calculation
|
||||
int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
|
||||
/// get target PUSCH received power
|
||||
int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id);
|
||||
/// get target PUSCH received power
|
||||
int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id);
|
||||
|
||||
unsigned char is_cluster_head;
|
||||
unsigned char is_primary_cluster_head;
|
||||
unsigned char is_secondary_cluster_head;
|
||||
unsigned char cluster_head_index;
|
||||
|
||||
/// PHY Frame Configuration
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
uint8_t (*get_prach_prb_offset)(LTE_DL_FRAME_PARMS *frame_parms, uint8_t tdd_mapindex, uint16_t Nf);
|
||||
|
||||
int (*is_prach_subframe)(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame, uint8_t subframe);
|
||||
|
||||
/// ICIC algos
|
||||
uint8_t (*get_SB_size)(uint8_t n_rb_dl);
|
||||
///end ALU's algo
|
||||
|
||||
} MAC_xface;
|
||||
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
@@ -1,27 +0,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
|
||||
*/
|
||||
|
||||
#ifndef __PHY_INTERFACE_EXTERN_H__
|
||||
#define __PHY_INTERFACE_EXTERN_H__
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,283 +0,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
|
||||
*/
|
||||
|
||||
/*________________________mac_phy_primitives.c________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
|
||||
//#include "openair_extern.h"
|
||||
|
||||
#ifdef MAC_CONTEXT
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
//#include "extern.h"
|
||||
#include "defs.h"
|
||||
#endif //MAC_CONTEXT
|
||||
|
||||
|
||||
//#define DEBUG_UE_DECODE_SACH
|
||||
//#define DEBUG_NODEB_DECODE_SACH
|
||||
|
||||
#ifdef PHY_CONTEXT
|
||||
#ifdef PHY_EMUL
|
||||
#include "extern.h"
|
||||
#include "SIMULATION/simulation_defs.h"
|
||||
#else //PHY_EMUL
|
||||
#include "MAC_INTERFACE/extern.h"
|
||||
#endif //PHY_EMUL
|
||||
|
||||
void clear_macphy_data_req(unsigned char Mod_id)
|
||||
{
|
||||
//msg("CLEAR DATA_REQ\n");
|
||||
unsigned char i;
|
||||
|
||||
Macphy_req_table[Mod_id].Macphy_req_cnt = 0;
|
||||
|
||||
for (i=0; i<NB_REQ_MAX; i++)
|
||||
Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
unsigned char phy_resources_compare(PHY_RESOURCES *Phy1,PHY_RESOURCES* Phy2 ){
|
||||
|
||||
if(Phy1->Time_alloc==Phy2->Time_alloc && Phy1->Freq_alloc==Phy2->Freq_alloc)// && Phy1->Coding_fmt==Phy2->Coding_fmt && Phy1->Seq_index==Phy2->Seq_index)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
MACPHY_DATA_REQ_TABLE_ENTRY* find_data_req_entry(unsigned char Mod_id,MACPHY_REQ_ENTRY_KEY *Search_key)
|
||||
{
|
||||
|
||||
unsigned char i;
|
||||
|
||||
//msg("[MAC_PHY]MAC_PHY_REQUEST_CNT=%d\n",Macphy_req_table.Macphy_req_cnt);
|
||||
if (Macphy_req_table[Mod_id].Macphy_req_cnt > 0) {
|
||||
#ifdef DEBUG_PHY
|
||||
// msg("[MACPHY_FIND_REQ] SEARCH KEY=%d\n",Search_key->Key_type);
|
||||
#endif //DEBUG_PHY
|
||||
//msg("[MACPHY_FIND_REQ] SEARCH KEY=%d, NB_REQ_MAX=%d\n",Search_key->Key_type,NB_REQ_MAX);
|
||||
|
||||
switch(Search_key->Key_type) {
|
||||
case PDU_TYPE_KEY:
|
||||
for(i=0; i<NB_REQ_MAX; i++) {
|
||||
if ( (Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Pdu_type==Search_key->Key.Pdu_type) &&
|
||||
(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1) ) {
|
||||
//msg("[MACPHY_FIND] MACPHY_req_table_entry=%p,idx=%d,Phy_resources %p", &Macphy_req_table.Macphy_req_table_entry[i],i,Macphy_req_table.Macphy_req_table_entry[i].Macphy_data_req.Phy_Resources_Entry);
|
||||
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i]);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
/*
|
||||
case LCHAN_KEY:
|
||||
for(i=0;i<NB_REQ_MAX;i++){
|
||||
if ((Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Lchan_id.Index==Search_key->Key.Lchan_id->Index) &&
|
||||
(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1) )
|
||||
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i]);
|
||||
}
|
||||
break;
|
||||
|
||||
case PHY_RESOURCES_KEY:
|
||||
for(i=0;i<NB_REQ_MAX;i++){
|
||||
if(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1)
|
||||
if ( ( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Time_alloc ==
|
||||
Search_key->Key.Phy_resources.Time_alloc )
|
||||
&&( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Freq_alloc ==
|
||||
Search_key->Key.Phy_resources.Freq_alloc )
|
||||
&&( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.CH_index ==
|
||||
Search_key->CH_index )
|
||||
&& ( Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Direction == RX))
|
||||
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i]);
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PHY_EMUL
|
||||
// msg("[PHY][PHY_MAC] Frame %d : No data request\n",mac_xface->frame);
|
||||
#endif //PHY_EMUL
|
||||
|
||||
|
||||
return (MACPHY_DATA_REQ_TABLE_ENTRY*)0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void print_active_requests(unsigned char Mod_id)
|
||||
{
|
||||
|
||||
int i;
|
||||
msg("_________________________INST %d , FRAME %d ACTIVE_REQUESTS_________________\n",Mod_id,mac_xface->frame);
|
||||
|
||||
for (i=0; i<NB_REQ_MAX; i++) {
|
||||
|
||||
if (Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Active == 1) {
|
||||
msg("[MACPHY][DATA][REQ] Request %d: Direction %d, Pdu_type %d\n",
|
||||
i,
|
||||
Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Direction,
|
||||
Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Pdu_type);
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Lchan_id.Index);
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources,
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Time_alloc,
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Phy_resources->Freq_alloc);
|
||||
//if(Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Pdu_type==RACH)
|
||||
//msg("[RACH_REQ] Rach_pdu %p, Payload %p\n",Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Dir.Req_rx.Pdu.Rach_pdu,
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i].Macphy_data_req.Dir.Req_rx.Pdu.Rach_pdu->Rach_payload);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*___________________________________________________________________________________________________*/
|
||||
#define RCNT Macphy_req_table[Mod_id].Macphy_req_cnt
|
||||
|
||||
MACPHY_DATA_REQ *new_macphy_data_req(unsigned char Mod_id)
|
||||
{
|
||||
/*___________________________________________________________________________________________________*/
|
||||
unsigned char i;
|
||||
|
||||
|
||||
|
||||
for (i=0; i<NB_REQ_MAX; i++) {
|
||||
if (Macphy_req_table[Mod_id].Macphy_req_table_entry[(i)%NB_REQ_MAX].Active == 0) {
|
||||
Macphy_req_table[Mod_id].Macphy_req_table_entry[(i)%NB_REQ_MAX].Active = 1;
|
||||
RCNT = (RCNT + 1)%NB_REQ_MAX;
|
||||
// msg("[MAC_PHY]NEW MAC_REQUEST_CNT=%d,frame %d, Module %d, entry %d \n",Macphy_req_table[Mod_id].Macphy_req_cnt,mac_xface->frame,Mod_id,i);
|
||||
// Macphy_req_table[Mod_id].Macphy_req_table_entry[i%NB_REQ_MAX].Macphy_data_req.Phy_resources=(PHY_RESOURCES*)malloc16(sizeof(PHY_RESOURCES));
|
||||
return(&Macphy_req_table[Mod_id].Macphy_req_table_entry[i%NB_REQ_MAX].Macphy_data_req);
|
||||
}
|
||||
}
|
||||
|
||||
msg("[OPENAIR][MAC][ERROR] frame %d: No more DATA_REQ !!!!\n",mac_xface->frame);
|
||||
|
||||
print_active_requests(Mod_id);
|
||||
mac_xface->macphy_exit("new_macphy_data_req: no more DATA_REQ");
|
||||
//rt_sleep(nano2count(2000));
|
||||
|
||||
return((MACPHY_DATA_REQ*)0);
|
||||
}
|
||||
|
||||
|
||||
#endif //PHY_CONTEXT
|
||||
|
||||
#ifdef MAC_CONTEXT
|
||||
#include "LAYER2/MAC/extern.h"
|
||||
|
||||
// Function called by PHY to indicate available data/measurements for MAC
|
||||
|
||||
/*___________________________________________________________________________________________________*/
|
||||
void macphy_data_ind(unsigned char Mod_id,unsigned char Pdu_type,void *pdu,unsigned short rnti)
|
||||
{
|
||||
/*___________________________________________________________________________________________________*/
|
||||
//msg("[OPENAIR][MACPHY] Calling mac_resp In\n");
|
||||
|
||||
int i;
|
||||
|
||||
// if (Req_rx->crc_status[0]!= -1) { //CRC_STATUS
|
||||
|
||||
// msg("[OPENAIR][MACPHY] Calling mac_indicate In\n");
|
||||
// Req_rx->Meas.UL_meas=&UL_meas[Mod_id];
|
||||
// Req_rx->Meas.DL_meas=&DL_meas[Mod_id];
|
||||
|
||||
switch (Pdu_type) {
|
||||
case ULSCH:
|
||||
|
||||
// msg("[OPENAIR][MACPHY] Received RACH, Sending to MAC\n");
|
||||
nodeb_decode_ulsch(Mod_id,(ULSCH_PDU *)pdu,rnti);
|
||||
|
||||
break;
|
||||
|
||||
case DLSCH:
|
||||
#ifdef DEBUG_UE_DECODE_SACH
|
||||
msg("[MAC][UE][MAC_PHY] TTI %d Inst %d\n",mac_xface->frame,Mod_id);
|
||||
#endif
|
||||
|
||||
// ue_decode_dlsch(Mod_id-NB_CH_INST,
|
||||
// (DLSCH_PDU *)pdu,rnti);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// msg("Freeing Req %p\n",Macphy_data_req_table_entry);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*PHY_RESOURCES_TABLE_ENTRY *new_phy_resources() {
|
||||
|
||||
|
||||
unsigned char i;
|
||||
|
||||
//msg("[OPENAIR][PHY][MAC Interface] New Phy Resource, cnt %d\n",Phy_resources_table.Phy_resources_cnt);
|
||||
|
||||
for (i=0;i<NB_PHY_RESOURCES_MAX;i++){
|
||||
|
||||
if (Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX].Active == 0) {
|
||||
Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX].Active = 1;
|
||||
Phy_resources_table.Phy_resources_cnt = (Phy_resources_table.Phy_resources_cnt + 1)%NB_PHY_RESOURCES_MAX;
|
||||
// msg("[OPENAIR][PHY][MAC Interface] NEW PHY_RESOURCES: Taking index %d\n\n",(i+Phy_resources_table.Phy_resources_cnt+1)%NB_PHY_RESOURCES_MAX);
|
||||
|
||||
return(&Phy_resources_table.Phy_resources_table_entry[(i+Phy_resources_table.Phy_resources_cnt)%NB_PHY_RESOURCES_MAX]);
|
||||
}
|
||||
}
|
||||
msg("[OPENAIR][MAC][ERROR] No more PHY_RESOURCES !!!!\n");
|
||||
exit(-1);
|
||||
}
|
||||
*/
|
||||
|
||||
#endif //MAC_CONTEXT
|
||||
|
||||
|
||||
// Measurements, etc ..
|
||||
|
||||
//short phy_resource_cnt = 0, macphy_data_req_cnt = 0, macphy_data_ind_cnt = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,232 +0,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
|
||||
*/
|
||||
|
||||
/*________________________mac_phy_primitives.h________________________
|
||||
|
||||
Authors : Hicham Anouar, Raymond Knopp
|
||||
Company : EURECOM
|
||||
Emails : anouar@eurecom.fr, knopp@eurecom.fr
|
||||
________________________________________________________________*/
|
||||
|
||||
|
||||
#ifndef __MAC_PHY_PRIMITIVES_H__
|
||||
# define __MAC_PHY_PRIMITIVES_H__
|
||||
|
||||
#include "../LAYER2/MAC/defs.h"
|
||||
|
||||
|
||||
/**@defgroup _mac_phy_primitives_ MAC Layer Primitives for Communications with PHY
|
||||
*@ingroup w3g4f_mac_layer_
|
||||
*@{
|
||||
|
||||
This subclause describes the primitives for communications between the MAC and PHY sub-layers.
|
||||
|
||||
The primitives for dynamic MAC-PHY PDU exchange (Transport channel interface) are:
|
||||
|
||||
- MACPHY_DATA_REQ: transfers or requests a PDU from PHY. The data is passed along with the dynamic PHY transmission
|
||||
format (coding and modulation, time/freq/space resource allocation)
|
||||
|
||||
- MACPHY_DATA_IND: Function call (by PHY) to deliver a new PDU and corresponding measurements to MAC. This implicitly confirms the MACPHY_DATA_REQ by
|
||||
filling the fields of the request (TX or RX) with the data and measurements.
|
||||
|
||||
One primitive is used for semi-static configuration (during logical channel establishment)
|
||||
relaying the puncturing/repetition patterns for HARQ:
|
||||
|
||||
- MACPHY_CONFIG_SACH_HARQ_REQ (still to be defined...)
|
||||
|
||||
The primitive for static (re)configuration is:
|
||||
- MACPHY_CONFIG_REQ : This primitive transports the initial configuration during the setup phase of equipment, both for CH and UE.
|
||||
Static configuration is used during the initialization phase of the equipment. For a CH, it is done prior to any communication. For a UE, some
|
||||
structures may be set after receiving configuration information from the network via the BCCH/CCCH.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief MACPHY-DATA-REQ_RX structure is used to request transfer a new PDU from PHY corresponding to a particular transport channel*/
|
||||
typedef struct {
|
||||
int crc_status[MAX_NUMBER_TB_PER_LCHAN]; /*!< This field indicates the CRC status of the PDU upon reception from PHY*/
|
||||
unsigned char num_tb; /*!< This field indicates the number of transport blocks to be received*/
|
||||
unsigned short tb_size_bytes; /*!< This field indicates the number of bytes per transpor block*/
|
||||
unsigned int Active_process_map; /*!< HARQ indicator for active processes*/
|
||||
union {
|
||||
CHBCH_PDU *Chbch_pdu; /*!< This is a pointer to CHBCH data*/
|
||||
DL_SACH_PDU *DL_sach_pdu; /*!< This is a pointer to DL_SACH data*/
|
||||
UL_SACH_PDU *UL_sach_pdu; /*!< This is a pointer to UL_SACH data*/
|
||||
RACH_PDU *Rach_pdu; /*!< This is a pointer to RACH data*/
|
||||
MRBCH_PDU *Mrbch_pdu; /*!< This is a pointer to MRBCH data*/
|
||||
} Pdu;
|
||||
union {
|
||||
DL_MEAS *DL_meas; /*!< This is an array of pointers to the current measurements of DL quality at UE (indexed by CH_id) */
|
||||
UL_MEAS *UL_meas; /*!< This is an array of pointers to the current measurements of UL quality at Node-B (indexed by user_id) */
|
||||
} Meas;
|
||||
} MACPHY_DATA_REQ_RX;
|
||||
|
||||
|
||||
/*! \brief MACPHY-DATA-REQ_TX structure is used to transfer a new PDU to PHY corresponding to a particular transport channel*/
|
||||
typedef struct {
|
||||
unsigned char num_tb; /*!< This field indicates the number of transport blocks to be received*/
|
||||
unsigned short tb_size_bytes; /*!< This field indicates the number of bytes per transpor block*/
|
||||
unsigned int Active_process_map; /*!< HARQ indicator for active processes*/
|
||||
unsigned int New_process_map; /*!< HARQ indicator for new processes*/
|
||||
// unsigned char round_indices_tx;
|
||||
union {
|
||||
CHBCH_PDU *Chbch_pdu; /*!< pointer to CHBCH data */
|
||||
DL_SACH_PDU DL_sach_pdu; /*!< pointer to DL_SACH data*/
|
||||
UL_SACH_PDU UL_sach_pdu; /*!< pointer to UL_SACH data*/
|
||||
RACH_PDU Rach_pdu; //H.A /*!< pointer to RACH data */
|
||||
MRBCH_PDU *Mrbch_pdu; /*!< pointer to MRBCH data */
|
||||
} Pdu;
|
||||
} MACPHY_DATA_REQ_TX;
|
||||
|
||||
/*! \brief MACPHY-DATA-REQ primitive is used to transfer a new PDU to PHY corresponding to a particular transport channel*/
|
||||
typedef struct {
|
||||
unsigned char Direction;
|
||||
unsigned char Pdu_type; /*!< This field indicates the type of PDU requested */
|
||||
LCHAN_ID Lchan_id; /*!< This field indicates the flow id of the PDU */
|
||||
PHY_RESOURCES *Phy_resources; /*!< This field indicates to PHY the physical resources */
|
||||
unsigned int format_flag; /*!< This field indicates to PHY something about a SACH, e.g. presense of SACCH*/
|
||||
union {
|
||||
MACPHY_DATA_REQ_RX Req_rx; /*!< This field contains the request corresponding to an RX resource*/
|
||||
MACPHY_DATA_REQ_TX Req_tx; /*!< This field contains the request corresponding to a TX resource*/
|
||||
} Dir;
|
||||
} MACPHY_DATA_REQ;
|
||||
|
||||
/*!\fn void macphy_data_ind(unsigned char Mod_id,MACPHY_DATA_REQ_RX *Req_rx,unsigned char Pdu_type,unsigned short Index);
|
||||
\brief MACPHY_DATA_IND function call. Called by PHY to upload PDU and measurements in response to a MACPHY_DATA_REQ_RX.
|
||||
@param Mod_id MAC instance ID (only useful if multiple MAC instances run in the same machine)
|
||||
@param Req_rx Pointer to MACPHY_DTA_REQ_RX received previously
|
||||
@param Pdu_type Type of PDU (redundant!)
|
||||
@param Index CH Index for CH, UEid for UE
|
||||
*/
|
||||
void macphy_data_ind(unsigned char Mod_id,
|
||||
MACPHY_DATA_REQ_RX *Req_rx,
|
||||
unsigned char Pdu_type,
|
||||
unsigned short Index);
|
||||
|
||||
/*! \brief MACPHY-CONFIG-REQ primitive is used to configure a new instance of OpenAirInterface (static configuration) during initialization*/
|
||||
typedef struct {
|
||||
PHY_FRAMING Phy_framing; /*!< Framing Configuration*/
|
||||
PHY_CHSCH Phy_chsch[8]; /*!< CHSCH Static Configuration*/
|
||||
PHY_CHBCH Phy_chbch; /*!< CHBCH Static Configuration*/
|
||||
PHY_SCH Phy_sch[8]; /*!< SCH Static Configuration*/
|
||||
PHY_SACH Phy_sach; /*!< SACH Statuc Configuration*/
|
||||
} MACPHY_CONFIG_REQ;
|
||||
|
||||
/*! \brief MACPHY-CONFIG-SACH-HARQ-REQ primitive is used to configure a new SACH transport channel (dynamic configuration) during logical channel establishment*/
|
||||
//typedef struct {
|
||||
// LCHAN_ID Lchan_id; /*!< This is the identifier of the SACH, which should simply be the logical channel id*/
|
||||
// HARQ_PARAMS Harq_params; /*!< This is the set of HARQ parameters corresponding to the QoS description of the logical channel*/
|
||||
//} MACPHY_CONFIG_SACH_HARQ_REQ;
|
||||
|
||||
/** @} */
|
||||
|
||||
#define MAX_NUMBER_OF_MAC_INSTANCES 16
|
||||
|
||||
#define NULL_PDU 255
|
||||
#define CHBCH 0
|
||||
#define DL_SACH 1
|
||||
#define UL_SACH 2
|
||||
#define UL_SACCH_SACH 3
|
||||
#define RACH 4
|
||||
#define MRBCH 5
|
||||
|
||||
|
||||
#define NUMBER_OF_SUBBANDS 64
|
||||
#define LCHAN_KEY 0
|
||||
#define PDU_TYPE_KEY 1
|
||||
#define PHY_RESOURCES_KEY 2
|
||||
|
||||
typedef struct Macphy_req_entry_key {
|
||||
unsigned char Key_type;
|
||||
union {
|
||||
LCHAN_ID *Lchan_id; //SACH, EMULATION
|
||||
unsigned char Pdu_type;//CHBCH, RACH, EMULATION
|
||||
PHY_RESOURCES Phy_resources;//REAL PHY
|
||||
} Key;
|
||||
} MACPHY_REQ_ENTRY_KEY;
|
||||
|
||||
/** @ingroup _PHY_TRANSPORT_CHANNEL_PROCEDURES_
|
||||
* @{
|
||||
\var typedef struct Macphy_data_req_table_entry {
|
||||
MACPHY_DATA_REQ Macphy_data_req;
|
||||
unsigned char Active;
|
||||
} MACPHY_DATA_REQ_TABLE_ENTRY;
|
||||
\brief An entry in the MACPHY_DATA_REQ Table.
|
||||
*/
|
||||
|
||||
typedef struct Macphy_data_req_table_entry {
|
||||
/// The MACPHY_DATA_REQ Structure itself
|
||||
MACPHY_DATA_REQ Macphy_data_req;
|
||||
/// Active flag. Active=1 means that the REQ is pending.
|
||||
unsigned char Active;
|
||||
} MACPHY_DATA_REQ_TABLE_ENTRY;
|
||||
|
||||
/*!\var typedef struct {
|
||||
MACPHY_DATA_REQ_TABLE_ENTRY *Macphy_req_table_entry;
|
||||
unsigned int Macphy_req_cnt;
|
||||
} MACPHY_DATA_REQ_TABLE
|
||||
\brief The MACPHY_DATA_REQ interface between MAC and PHY. This table stores the pending requests from MAC which are serviced by PHY. The pointer Macphy_req_table_entry points
|
||||
to an array of idle reqests allocated during initialization of the MAC-layer.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/// Pointer to a MACPHY_DATA_REQ
|
||||
MACPHY_DATA_REQ_TABLE_ENTRY *Macphy_req_table_entry;
|
||||
/// Number of active requests
|
||||
unsigned int Macphy_req_cnt;
|
||||
} MACPHY_DATA_REQ_TABLE;
|
||||
|
||||
/** @} */
|
||||
|
||||
/*typedef struct Tx_Phy_Pdu{ //H.A
|
||||
PHY_RESOURCES *Phy_resources;
|
||||
MACPHY_DATA_IND *Macphy_data_ind;
|
||||
}T_PHY_PDU;
|
||||
|
||||
typedef struct Rx_Phy_Pdu{ //H.A
|
||||
PHY_RESOURCES *Phy_resources;
|
||||
char *Phy_payload;
|
||||
}RX_PHY_PDU;*/
|
||||
|
||||
|
||||
typedef struct GRANTED_LCHAN_TABLE_ENTRY {
|
||||
PHY_RESOURCES *Phy_resources;
|
||||
LCHAN_ID Lchan_id;
|
||||
} GRANTED_LCHAN_TABLE_ENTRY;
|
||||
|
||||
void clear_macphy_data_req(uint8_t);
|
||||
//void clean_macphy_interface(void);
|
||||
unsigned char phy_resources_compare(PHY_RESOURCES *,PHY_RESOURCES*);
|
||||
MACPHY_DATA_REQ_TABLE_ENTRY* find_data_req_entry(uint8_t,MACPHY_REQ_ENTRY_KEY*);
|
||||
void print_active_requests(uint8_t);
|
||||
void mac_process_meas_ul(uint8_t Mod_id,UL_MEAS *UL_meas, uint16_t Index);
|
||||
void mac_process_meas_dl(uint8_t Mod_id,DL_MEAS *DL_meas, uint16_t Index);
|
||||
|
||||
|
||||
|
||||
|
||||
MACPHY_DATA_REQ *new_macphy_data_req(uint8_t);
|
||||
//PHY_RESOURCES_TABLE_ENTRY *new_phy_resources(void);
|
||||
//MACPHY_DATA_IND *new_macphy_data_ind(void);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,44 +0,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
|
||||
*/
|
||||
|
||||
#ifndef __PHY_INTERFACE_VARS_H__
|
||||
#define __PHY_INTERFACE_VARS_H__
|
||||
|
||||
//#include "SIMULATION/PHY_EMULATION/spec_defs.h"
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef PHY_EMUL
|
||||
#include "SIMULATION/PHY_EMULATION/DEVICE_DRIVER/defs.h"
|
||||
#include "SIMULATION/simulation_defs.h"
|
||||
#endif
|
||||
|
||||
|
||||
unsigned int mac_debug;
|
||||
|
||||
//MAC_xface *mac_xface;
|
||||
|
||||
//MACPHY_PARAMS MACPHY_params;
|
||||
|
||||
unsigned int mac_registered;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -19,13 +19,15 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file l2_interface.c
|
||||
/* \file l2_interface_ue.c
|
||||
* \brief layer 2 interface, used to support different RRC sublayer
|
||||
* \author Raymond Knopp and Navid Nikaein
|
||||
* \date 2010-2014
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "rrc_defs.h"
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
/*
|
||||
* 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 main_ue.c
|
||||
* \brief RRC layer top level initialization
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "rrc_proto.h"
|
||||
@@ -8,6 +38,6 @@ int nr_l3_init_ue(void){
|
||||
|
||||
openair_rrc_top_init_ue_nr();
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
+43
-28
@@ -19,23 +19,33 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file rrc_UE.c
|
||||
* \brief rrc procedures for UE
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2011 - 2014
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr and raymond.knopp@eurecom.fr
|
||||
/* \file rrc_UE.c
|
||||
* \brief RRC procedures
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#define RRC_UE
|
||||
#define RRC_UE_C
|
||||
|
||||
#include "NR_DL-DCCH-Message.h" //asn_DEF_NR_DL_DCCH_Message
|
||||
#include "NR_BCCH-BCH-Message.h" //asn_DEF_NR_BCCH_BCH_Message
|
||||
#include "NR_CellGroupConfig.h" //asn_DEF_NR_CellGroupConfig
|
||||
#include "NR_BWP-Downlink.h" //asn_DEF_NR_BWP_Downlink
|
||||
|
||||
#include "rrc_list.h"
|
||||
#include "rrc_defs.h"
|
||||
#include "rrc_proto.h"
|
||||
#include "rrc_vars.h"
|
||||
#include "LAYER2/NR_MAC_UE/proto.h"
|
||||
#include "mac_proto.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
@@ -55,7 +65,6 @@ int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
nr_rrc_ue_process_scg_config(cellGroupConfig);
|
||||
}else{
|
||||
nr_rrc_ue_process_scg_config(cellGroupConfig);
|
||||
//asn_DEF_NR_CellGroupConfig.free_struct(asn_DEF_NR_CellGroupConfig, cellGroupConfig, 0);
|
||||
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0);
|
||||
}
|
||||
|
||||
@@ -94,7 +103,6 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfig
|
||||
}else{
|
||||
// after first time, update it and free the memory after.
|
||||
nr_rrc_ue_process_scg_config(cellGroupConfig);
|
||||
//asn_DEF_NR_CellGroupConfig.free_struct(asn_DEF_NR_CellGroupConfig, cellGroupConfig, 0);
|
||||
SEQUENCE_free(&asn_DEF_NR_CellGroupConfig, (void *)cellGroupConfig, 0);
|
||||
}
|
||||
|
||||
@@ -291,31 +299,38 @@ int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(
|
||||
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)mib, 1 );
|
||||
}
|
||||
|
||||
|
||||
for(i=0; i<buffer_len; ++i){
|
||||
printf("[RRC] MIB PDU : %d\n", bufferP[i]);
|
||||
}
|
||||
|
||||
asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
|
||||
&asn_DEF_NR_BCCH_BCH_Message,
|
||||
(void **)&bcch_message,
|
||||
(const void *)bufferP,
|
||||
buffer_len );
|
||||
buffer_len
|
||||
);
|
||||
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
|
||||
for (i=0; i<buffer_len; i++)
|
||||
printf("%02x ",bufferP[i]);
|
||||
if(bcch_message->message.choice.mib->systemFrameNumber.buf != 0){
|
||||
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
|
||||
|
||||
for (i=0; i<buffer_len; i++)
|
||||
printf("%02x ",bufferP[i]);
|
||||
|
||||
printf("\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)bcch_message, 1 );
|
||||
return -1;
|
||||
printf("\n");
|
||||
// free the memory
|
||||
SEQUENCE_free( &asn_DEF_NR_BCCH_BCH_Message, (void *)bcch_message, 1 );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// link to rrc instance
|
||||
mib = bcch_message->message.choice.mib;
|
||||
//memcpy( (void *)mib,
|
||||
// (void *)&bcch_message->message.choice.mib,
|
||||
// sizeof(NR_MIB_t) );
|
||||
|
||||
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
// link to rrc instance
|
||||
mib = bcch_message->message.choice.mib;
|
||||
//memcpy( (void *)mib,
|
||||
// (void *)&bcch_message->message.choice.mib,
|
||||
// sizeof(NR_MIB_t) );
|
||||
|
||||
nr_rrc_mac_config_req_ue( 0, 0, 0, mib, NULL, NULL, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file RRC/LITE/defs.h
|
||||
* \brief RRC struct definitions and function prototypes
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr, raymond.knopp@eurecom.fr
|
||||
*/
|
||||
/* \file rrc_defs.h
|
||||
* \brief RRC structures/types definition
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __OPENAIR_NR_RRC_DEFS_H__
|
||||
#define __OPENAIR_NR_RRC_DEFS_H__
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
/*
|
||||
* 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 rrc_list.h
|
||||
* \brief linked list implementation for ToAddModList mechanism in RRC layer
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef _RRC_LIST_H_
|
||||
#define _RRC_LIST_H_
|
||||
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file proto.h
|
||||
/* \file proto.h
|
||||
* \brief RRC functions prototypes for eNB and UE
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \version 1.0
|
||||
|
||||
*/
|
||||
/** \addtogroup _rrc
|
||||
* @{
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef _RRC_PROTO_H_
|
||||
#define _RRC_PROTO_H_
|
||||
|
||||
@@ -104,110 +104,4 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, cons
|
||||
|
||||
/** @}*/
|
||||
#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 proto.h
|
||||
* \brief RRC functions prototypes for eNB and UE
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \version 1.0
|
||||
|
||||
*/
|
||||
/** \addtogroup _rrc
|
||||
* @{
|
||||
*/
|
||||
#ifndef _RRC_PROTO_H_
|
||||
#define _RRC_PROTO_H_
|
||||
|
||||
|
||||
#include "rrc_defs.h"
|
||||
#include "NR_RRCReconfiguration.h"
|
||||
#include "NR_MeasConfig.h"
|
||||
#include "NR_CellGroupConfig.h"
|
||||
#include "NR_RadioBearerConfig.h"
|
||||
//
|
||||
// main_rrc.c
|
||||
//
|
||||
/**\brief Layer 3 initialization*/
|
||||
int nr_l3_init_ue(void);
|
||||
|
||||
//
|
||||
// UE_rrc.c
|
||||
//
|
||||
|
||||
/**\brief Initial the top level RRC structure instance*/
|
||||
int8_t openair_rrc_top_init_ue_nr(void);
|
||||
|
||||
|
||||
|
||||
/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config
|
||||
\param buffer encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message.
|
||||
\param size length of buffer*/
|
||||
//TODO check to use which one
|
||||
int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size);
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const uint8_t *buffer, const uint32_t size);
|
||||
|
||||
|
||||
/**\brief Process NR RRC connection reconfiguration via SRB3
|
||||
\param rrcReconfiguration decoded rrc connection reconfiguration*/
|
||||
int8_t nr_rrc_ue_process_rrcReconfiguration(NR_RRCReconfiguration_t *rrcReconfiguration);
|
||||
|
||||
/**\prief Process measurement config from NR RRC connection reconfiguration message
|
||||
\param meas_config measurement configuration*/
|
||||
int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config);
|
||||
|
||||
/**\prief Process secondary cell group config from NR RRC connection reconfiguration message or EN-DC primitives
|
||||
\param cell_group_config secondary cell group configuration*/
|
||||
//TODO check EN-DC function call flow.
|
||||
int8_t nr_rrc_ue_process_scg_config(NR_CellGroupConfig_t *cell_group_config);
|
||||
|
||||
/**\prief Process radio bearer config from NR RRC connection reconfiguration message
|
||||
\param radio_bearer_config radio bearer configuration*/
|
||||
int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config);
|
||||
|
||||
/**\brief decode NR BCCH-BCH (MIB) message
|
||||
\param module_idP module id
|
||||
\param gNB_index gNB index
|
||||
\param sduP pointer to buffer of ASN message BCCH-BCH
|
||||
\param sdu_len length of buffer*/
|
||||
int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len);
|
||||
|
||||
/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3
|
||||
\param module_id module id
|
||||
\param gNB_index gNB index
|
||||
\param buffer encoded DCCH bytes stream message
|
||||
\param size length of buffer*/
|
||||
int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, const uint8_t *buffer, const uint32_t size);
|
||||
|
||||
/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP)
|
||||
\param module_id module id
|
||||
\param CC_id component carrier id
|
||||
\param gNB_index gNB index
|
||||
\param frameP pointer to frame for calculation
|
||||
\param channel indicator for channel of the pdu
|
||||
\param pduP pointer to pdu
|
||||
\param pdu_len data length of pdu*/
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const uint32_t *frameP, const channel_t channel, const uint8_t* pduP, const sdu_size_t pdu_len);
|
||||
|
||||
/** @}*/
|
||||
#endif
|
||||
|
||||
@@ -19,14 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file vars.hles
|
||||
* \brief rrc variables
|
||||
* \author Raymond Knopp and Navid Nikaein
|
||||
* \date 2013
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
/* \file vars.h
|
||||
* \brief RRC layer variables
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __OPENAIR_NR_RRC_VARS_H__
|
||||
|
||||
@@ -388,8 +388,8 @@ static __inline__ uint64_t rdtsc(void) {
|
||||
extern double cpuf;
|
||||
|
||||
static inline uint64_t checkTCPU(int timeout, char * file, int line) {
|
||||
static uint64_t __thread lastCPUTime=0;
|
||||
static uint64_t __thread last=0;
|
||||
static __thread uint64_t lastCPUTime=0;
|
||||
static __thread uint64_t last=0;
|
||||
uint64_t cur=rdtsc();
|
||||
struct timespec CPUt;
|
||||
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &CPUt);
|
||||
@@ -408,7 +408,7 @@ static inline uint64_t checkTCPU(int timeout, char * file, int line) {
|
||||
}
|
||||
|
||||
static inline unsigned long long checkT(int timeout, char * file, int line) {
|
||||
static unsigned long long __thread last=0;
|
||||
static __thread unsigned long long last=0;
|
||||
unsigned long long cur=rdtsc();
|
||||
int microCycles=(int)(cpuf*1000);
|
||||
int duration=(int)((cur-last)/microCycles);
|
||||
|
||||
Reference in New Issue
Block a user