UE: modify pdcch config common, config_ue.c to compatiable RRC setup/release mechanism
deleted files not use
This commit is contained in:
@@ -1518,7 +1518,7 @@ add_library(L2_UE
|
||||
)
|
||||
|
||||
include_directories(${NR_UE_PHY_INTERFACE_DIR})
|
||||
|
||||
include_directories(${OPENAIR1_DIR}/SCHED_NR_UE)
|
||||
include_directories(${NFAPI_USER_DIR})
|
||||
|
||||
# L3 Libs
|
||||
@@ -2293,7 +2293,7 @@ add_executable(nr-uesoftmodem
|
||||
|
||||
target_link_libraries (nr-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS L2_UE
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_NR_UE PHY_COMMON PHY_UE PHY_RU LFDS L2_UE
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -319,7 +319,7 @@ typedef struct {
|
||||
fapi_nr_search_space_t search_space_sib1;
|
||||
fapi_nr_search_space_t search_space_others_sib;
|
||||
fapi_nr_search_space_t search_space_paging;
|
||||
fapi_nr_coreset_t coreset_ra; // common coreset
|
||||
//fapi_nr_coreset_t coreset_ra; // common coreset
|
||||
fapi_nr_search_space_t search_space_ra;
|
||||
} fapi_nr_pdcch_config_common_t;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
|
||||
|
||||
#include "NR_IF_Module.h"
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
typedef struct {
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
#define PUCCH
|
||||
#endif
|
||||
|
||||
#include "LAYER2/NR_MAC_UE/extern.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_defs.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
|
||||
|
||||
@@ -33,8 +33,9 @@
|
||||
#include "defs.h"
|
||||
#include "proto.h"
|
||||
|
||||
int
|
||||
nr_rrc_mac_config_req_ue(
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
|
||||
int nr_rrc_mac_config_req_ue(
|
||||
module_id_t module_id,
|
||||
int CC_idP,
|
||||
uint8_t gNB_index,
|
||||
@@ -54,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 ){
|
||||
@@ -70,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,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
|
||||
|
||||
@@ -33,12 +33,20 @@
|
||||
#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"
|
||||
|
||||
|
||||
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(
|
||||
const uint8_t *buffer,
|
||||
@@ -57,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);
|
||||
}
|
||||
|
||||
@@ -96,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ void init_UE(int nb_inst)
|
||||
LOG_I(PHY,"Initializing memory for UE instance %d (%p)\n",inst,PHY_vars_UE_g[inst]);
|
||||
PHY_vars_UE_g[inst][0] = init_nr_ue_vars(NULL,inst,0);
|
||||
|
||||
AssertFatal((UE->if_inst = IF_Module_init(inst)) != NULL,"Can't register interface module\n");
|
||||
AssertFatal((UE->if_inst = nr_ue_if_module_init(inst)) != NULL,"Can't register interface module\n");
|
||||
UE->if_inst->scheduled_response = nr_ue_scheduled_response;
|
||||
UE->if_inst->phy_config_request = nr_ue_phy_config_request;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user