Commit d83251d4 authored by Calvin's avatar Calvin

implement rrc list module, declair in rrc_inst and initialization, finish part...

implement rrc list module, declair in rrc_inst and initialization, finish part of l12 FAPI messages, DCI0, DCI1, DCI2 and UCI, part of DCI_IND messages
parent 73cfa6bb
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file fapi_l1.h
* \brief function prototypes for FAPI L1 interface
* \author R. Knopp
* \date 2017
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr
* \note
* \warning
*/
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h"
#include "SCHED/sched_common.h"
#include "nfapi_interface.h"
void fill_uci_harq_indication(PHY_VARS_eNB *eNB,LTE_eNB_UCI *uci,int frame,int subframe,uint8_t *harq_ack,uint8_t tdd_mapping_mode,uint16_t tdd_multiplexing_mask);
void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti, int frame,int subframe,int bundling);
void fill_ulsch_cqi_indication(PHY_VARS_eNB *eNB,uint16_t frame,uint8_t subframe,LTE_UL_eNB_HARQ_t *ulsch_harq,uint16_t rnti);
void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,uint32_t stat);
void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe);
void fill_crc_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag);
void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu);
void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu,
uint8_t codeword_index,
uint8_t *sdu);
void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
nfapi_ul_config_request_pdu_t *ul_config_pdu,
uint16_t frame,uint8_t subframe,uint8_t srs_present);
void handle_ulsch_harq_pdu(
PHY_VARS_eNB *eNB,
int UE_id,
nfapi_ul_config_request_pdu_t *ul_config_pdu,
nfapi_ul_config_ulsch_harq_information *harq_information,
uint16_t frame,
uint8_t subframe);
void handle_ulsch_cqi_ri_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe);
void handle_uci_harq_information(PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci,nfapi_ul_config_harq_information *harq_information);
void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active);
void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active);
void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe,uint8_t srs_active);
void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe);
void schedule_response(Sched_Rsp_t *Sched_INFO);
......@@ -527,6 +527,16 @@ static void dump_dl(Sched_Rsp_t *d)
/* debug utility functions end */
/****************************************************************************/
void DCI_indication(nr_nfapi_dci_indication_t dci_indication){
}
void RX_request(){
}
void UL_indication(UL_IND_t *UL_info)
{
......
......@@ -61,36 +61,35 @@ typedef struct{
sub_frame_t subframe;
/// harq indication list
nfapi_harq_indication_t harq_ind;
//nfapi_harq_indication_t harq_ind;
/// crc indication list
nfapi_crc_indication_t crc_ind;
//nfapi_crc_indication_t crc_ind;
/// SR indication list
nfapi_sr_indication_t sr_ind;
//nfapi_sr_indication_t sr_ind;
/// CQI indication list
nfapi_cqi_indication_body_t cqi_ind;
//nfapi_cqi_indication_body_t cqi_ind;
/// RACH indication list
nfapi_rach_indication_t rach_ind;
//nfapi_rach_indication_t rach_ind;
#ifdef Rel14
/// RACH indication list for BR UEs
nfapi_rach_indication_t rach_ind_br;
#endif
/// SRS indication list
nfapi_srs_indication_body_t srs_ind;
//nfapi_srs_indication_body_t srs_ind;
/// RX indication
nfapi_rx_indication_t rx_ind;
//nfapi_rx_indication_t rx_ind;
} UL_IND_t;
// Downlink subframe P7
typedef struct{
/// Module ID
module_id_t module_id;
......
......@@ -35,6 +35,8 @@
#include <stdlib.h>
#include <string.h>
#include "rrc_list.h"
#include "collection/tree.h"
#include "rrc_types.h"
#include "PHY/defs.h"
......@@ -68,7 +70,6 @@
/* for ImsiMobileIdentity_t */
#include "MobileIdentity.h"
typedef struct NR_UE_RRC_INST_s {
nr_rrc_state_t rrc_state;
nr_rrc_sub_state_t rrc_sub_state;
......@@ -148,9 +149,60 @@ typedef struct NR_UE_RRC_INST_s {
e_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
#endif
MeasConfig_t *meas_config;
CellGroupConfig_t *cell_group_config;
RadioBearerConfig_t *radio_bearer_config;
NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config;
NR_RadioBearerConfig_t *radio_bearer_config;
// lists
// CellGroupConfig.rlc-BearerToAddModList
RRC_LIST_TYPE(NR_RLC_Bearer_Config_t, NR_maxLC_ID) RLC_Bearer_Config_list;
// CellGroupConfig.mac-CellGroupConfig.schedulingrequest
RRC_LIST_TYPE(NR_SchedulingRequestToAddMod_t, NR_maxNrofSR_ConfigPerCellGroup) SchedulingRequest_list;
// CellGroupConfig.mac-CellGroupConfig.TAG
RRC_LIST_TYPE(NR_TAG_ToAddMod_t, NR_maxNrofTAGs) TAG_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated.tdduldlslotconfig
RRC_LIST_TYPE(NR_TDD_UL_DL_SlotConfig_t, NR_maxNrofSlots) TDD_UL_DL_SlotConfig_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated.bwps
RRC_LIST_TYPE(NR_BWP_Downlink_t, NR_maxNrofBWPs) BWP_Downlink_list;
//BWP-DownlinkDedicated 0=INIT-DL-BWP, 1..4 for DL-BWPs
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.controlresourceset
RRC_LIST_TYPE(NR_ControlResourceSet_t, 3) ControlResourceSet_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.searchspace
RRC_LIST_TYPE(NR_SearchSpace_t, 10) SearchSpace_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdcchconfig.slotformatindicator
RRC_LIST_TYPE(NR_SlotFormatCombinationsPerCell_t, NR_maxNrofAggregatedCellsPerCellGroup) SlotFormatCombinationsPerCell_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_TCI_State_t, NR_maxNrofTCI_States) TCI_State_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_RateMatchPattern_t, NR_maxNrofRateMatchPatterns) RateMatchPattern_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_Resource_t, NR_maxNrofZP_CSI_RS_Resources) ZP_CSI_RS_Resource_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) Aperidic_ZP_CSI_RS_ResourceSet_list[5];
// CellGroupConfig.spCellConfig.spCellConfigDedicated.initialdlbwp.pdschconfig
RRC_LIST_TYPE(NR_ZP_CSI_RS_ResourceSet_t, NR_maxNrofZP_CSI_RS_Sets) SP_ZP_CSI_RS_ResourceSet_list[5];
// TODO check the way to implement mutiple list inside bwps
// uplink bwp also
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_NZP_CSI_RS_Resource_t, NR_maxNrofNZP_CSI_RS_Resources) NZP_CSI_RS_Resource_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_NZP_CSI_RS_ResourceSet_t, NR_maxNrofNZP_CSI_RS_ResourceSets) NZP_CSI_RS_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_IM_Resource_t, NR_maxNrofCSI_IM_Resources) CSI_IM_Resource_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_IM_ResourceSet_t, NR_maxNrofCSI_IM_ResourceSets) CSI_IM_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_SSB_ResourceSet_t, NR_maxNrofCSI_SSB_ResourceSets) CSI_SSB_ResourceSet_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_ResourceConfig_t, NR_maxNrofCSI_ResourceConfigurations) CSI_ResourceConfig_list;
// CellGroupConfig.spCellConfig.spCellConfigDedicated
RRC_LIST_TYPE(NR_CSI_ReportConfig_t, NR_maxNrofCSI_ReportConfigurations) CSI_ReportConfig_list;
} NR_UE_RRC_INST_t;
......
This diff is collapsed.
#define RRC_LIST_TYPE(T, N) \
struct { \
T *entries[N]; \
int next[N]; \
int prev[N]; \
int start; \
int count; \
}
// initial function for the certain list, storage number of entry, initial pointer and corresponding links
#define RRC_LIST_INIT(list, c) \
do { \
int iterator; \
(list).count = (c); \
for(iterator=0; iterator<c; ++iterator){ \
(list).entries[iterator] = NULL; \
(list).next[iterator] = -1; \
(list).prev[iterator] = -1; \
(list).start = -1; \
} \
}while(0)
// check the entry by id first then update or create new entry.
#define RRC_LIST_MOD_ADD(list, new, id_name) \
do { \
int iterator; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
if((new)->id_name == (list).entries[iterator]->id_name){ \
(list).entries[iterator] = (new); \
break; \
} \
} \
if(iterator==-1){ \
for(iterator=0; iterator<(list).count; ++iterator){ \
if((list).entries[iterator] == NULL){ \
(list).next[iterator] = (list).start; \
(list).prev[iterator] = -1; \
if((list).start != -1){ \
(list).prev[list.start] = iterator; \
} \
(list).start = iterator; \
(list).entries[iterator] = (new); \
break; \
} \
} \
} \
}while(0)
// search entries by id, unlink from the list and output free pointer for upper function to release memory
#define RRC_LIST_MOD_REL(list, id_name, id, free) \
do{ \
int iterator; \
for(iterator=(list).start; iterator!=-1; iterator=(list).next[iterator]){ \
if(id == (list).entries[iterator]->id_name){ \
if((list).prev[iterator] == -1){ \
(list).start = (list).next[iterator]; \
}else{ \
(list).next[(list).prev[iterator]] = (list).next[iterator]; \
} \
if((list).next[iterator] != -1){ \
(list).prev[(list).next[iterator]] = (list).prev[iterator]; \
} \
(free) = (list).entries[iterator]; \
(list).entries[iterator] = NULL; \
break; \
} \
} \
}while(0)
#define RRC_LIST_FOREACH(list, i) \
for((i)=(list).start; (i) != -1; (i)=(list).next[i])
#define RRC_LIST_ENTRY(list, i) \
list.entries[i]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment