Merge remote-tracking branch 'origin/NR_UL_scheduling' into NR_RRC_PDCP
This commit is contained in:
@@ -403,8 +403,9 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
uint16_t mnc[PLMN_LIST_MAX_SIZE];
|
||||
uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE];
|
||||
NR_ServingCellConfigCommon_t *scc;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
int pusch_TargetSNRx10;
|
||||
} gNB_RrcConfigurationReq;
|
||||
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#define GNB_CONFIG_STRING_GNB_LIST "gNBs"
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_PUSCHTARGETPOWX10 "pusch_TargetSNRx10"
|
||||
#define GNB_CONFIG_STRING_SERVINGCELLCONFIGCOMMON "servingCellConfigCommon"
|
||||
#define GNB_CONFIG_STRING_PHYSCELLID "physCellId"
|
||||
#define GNB_CONFIG_STRING_NTIMINGADVANCEOFFSET "n_TimingAdvanceOffset"
|
||||
@@ -225,6 +226,7 @@
|
||||
|
||||
#define SSBPARAMS_DESC {{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET,NULL,0,iptr:&ssb_SubcarrierOffset,defintval:0,TYPE_INT,0}}
|
||||
#define PDSCHANTENNAPARAMS_DESC {{GNB_CONFIG_STRING_PDSCHANTENNAPORTS,NULL,0,iptr:&pdsch_AntennaPorts,defintval:1,TYPE_INT,0}}
|
||||
#define TARGETPOWER_DESC {{GNB_CONFIG_STRING_PUSCHTARGETPOWX10,NULL,0,iptr:&pusch_TargetSNRx10,defintval:200,TYPE_INT,0}}
|
||||
|
||||
#define SCCPARAMS_DESC(scc) { \
|
||||
{GNB_CONFIG_STRING_PHYSCELLID,NULL,0,i64ptr:scc->physCellId,defint64val:0,TYPE_INT64,0/*0*/}, \
|
||||
|
||||
@@ -522,6 +522,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NR_ServingCellConfigCommon_t *scc = calloc(1,sizeof(NR_ServingCellConfigCommon_t));
|
||||
int ssb_SubcarrierOffset = 31;
|
||||
int pdsch_AntennaPorts = 1;
|
||||
int pusch_TargetSNRx10 = 200;
|
||||
uint64_t ssb_bitmap=0xff;
|
||||
memset((void*)scc,0,sizeof(NR_ServingCellConfigCommon_t));
|
||||
prepare_scc(scc);
|
||||
@@ -531,6 +532,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
paramlist_def_t SSBsParamList = {GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0};
|
||||
paramdef_t PDSCHANTENNAParams[] = PDSCHANTENNAPARAMS_DESC;
|
||||
paramlist_def_t PDSCHANTENNAParamList = {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0};
|
||||
paramdef_t PUSCHTARGETPOWParams[] = TARGETPOWER_DESC;
|
||||
paramlist_def_t PUSCHTARGETPOWParamList = {GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0};
|
||||
////////// Physical parameters
|
||||
|
||||
|
||||
@@ -585,6 +588,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
config_getlist(&PDSCHANTENNAParamList, NULL, 0, aprefix);
|
||||
if (PDSCHANTENNAParamList.numelt > 0) config_get(PDSCHANTENNAParams,sizeof(PDSCHANTENNAParams)/sizeof(paramdef_t),aprefix);
|
||||
|
||||
config_getlist(&PUSCHTARGETPOWParamList, NULL, 0, aprefix);
|
||||
if (PUSCHTARGETPOWParamList.numelt > 0) config_get(PUSCHTARGETPOWParams,sizeof(PUSCHTARGETPOWParams)/sizeof(paramdef_t),aprefix);
|
||||
|
||||
config_getlist(&SCCsParamList, NULL, 0, aprefix);
|
||||
if (SCCsParamList.numelt > 0) {
|
||||
@@ -668,6 +673,8 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = ssb_SubcarrierOffset;
|
||||
printf("pdsch_AntennaPorts %d\n",pdsch_AntennaPorts);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = pdsch_AntennaPorts;
|
||||
printf("pusch_TargetSNRx10 %d\n",pusch_TargetSNRx10);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_TargetSNRx10 = pusch_TargetSNRx10;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
|
||||
|
||||
}//
|
||||
|
||||
@@ -328,11 +328,11 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
int pusch_tgt_snrx10,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int add_ue,
|
||||
uint32_t rnti,
|
||||
NR_CellGroupConfig_t *secondaryCellGroup
|
||||
){
|
||||
NR_CellGroupConfig_t *secondaryCellGroup){
|
||||
|
||||
if (scc != NULL ) {
|
||||
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
|
||||
@@ -353,6 +353,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
}
|
||||
}
|
||||
|
||||
RC.nrmac[Mod_idP]->pusch_target_snrx10 = pusch_tgt_snrx10;
|
||||
|
||||
NR_PHY_Config_t phycfg;
|
||||
phycfg.Mod_id = Mod_idP;
|
||||
|
||||
@@ -53,7 +53,10 @@
|
||||
#include "NR_SearchSpace.h"
|
||||
#include "NR_ControlResourceSet.h"
|
||||
|
||||
//#define UL_HARQ_PRINT
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
const uint8_t nr_rv_round_map[4] = {0, 2, 1, 3};
|
||||
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
|
||||
|
||||
//uint8_t mac_pdu[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
||||
@@ -270,7 +273,6 @@ int configure_fapi_dl_pdu(int Mod_idP,
|
||||
int TBS;
|
||||
int bwp_id=1;
|
||||
int UE_id = 0;
|
||||
uint8_t rv_round_map[4] = {0, 2, 3, 1};
|
||||
|
||||
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list;
|
||||
|
||||
@@ -316,7 +318,7 @@ int configure_fapi_dl_pdu(int Mod_idP,
|
||||
pdsch_pdu_rel15->qamModOrder[0] = 2;
|
||||
pdsch_pdu_rel15->mcsIndex[0] = mcs;
|
||||
pdsch_pdu_rel15->mcsTable[0] = 0;
|
||||
pdsch_pdu_rel15->rvIndex[0] = (get_softmodem_params()->phy_test==1) ? 0 : rv_round_map[UE_list->UE_sched_ctrl[UE_id].harq_processes[current_harq_pid].round];
|
||||
pdsch_pdu_rel15->rvIndex[0] = nr_rv_round_map[UE_list->UE_sched_ctrl[UE_id].harq_processes[current_harq_pid].round];
|
||||
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
|
||||
pdsch_pdu_rel15->nrOfLayers = 1;
|
||||
pdsch_pdu_rel15->transmissionScheme = 0;
|
||||
@@ -476,7 +478,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
int *dci_formats, int *rnti_types,
|
||||
int time_domain_assignment,
|
||||
int time_domain_assignment, uint8_t tpc,
|
||||
int n_ubwp, int bwp_id) {
|
||||
|
||||
switch(dci_formats[(pdcch_pdu_rel15->numDlDci)-1]) {
|
||||
@@ -518,7 +520,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
|
||||
// mcs
|
||||
dci_pdu_rel15->mcs = pusch_pdu->mcs_index;
|
||||
// tpc command for pusch
|
||||
dci_pdu_rel15->tpc = 1; //TODO
|
||||
dci_pdu_rel15->tpc = tpc;
|
||||
// SRS resource indicator
|
||||
if (ubwp->bwp_Dedicated->pusch_Config->choice.setup->txConfig != NULL) {
|
||||
if (*ubwp->bwp_Dedicated->pusch_Config->choice.setup->txConfig == NR_PUSCH_Config__txConfig_codebook)
|
||||
@@ -767,6 +769,33 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
|
||||
}
|
||||
|
||||
uint8_t select_ul_harq_pid(NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
uint8_t hrq_id;
|
||||
uint8_t max_ul_harq_pids = 3; // temp: for testing
|
||||
// schedule active harq processes
|
||||
NR_UE_ul_harq_t cur_harq;
|
||||
for (hrq_id=0; hrq_id < max_ul_harq_pids; hrq_id++) {
|
||||
cur_harq = sched_ctrl->ul_harq_processes[hrq_id];
|
||||
if (cur_harq.state==ACTIVE_NOT_SCHED) {
|
||||
#ifdef UL_HARQ_PRINT
|
||||
printf("[SCHED] Found ulharq id %d, scheduling it for retransmission\n",hrq_id);
|
||||
#endif
|
||||
return hrq_id;
|
||||
}
|
||||
}
|
||||
|
||||
// schedule new harq processes
|
||||
for (hrq_id=0; hrq_id < max_ul_harq_pids; hrq_id++) {
|
||||
cur_harq = sched_ctrl->ul_harq_processes[hrq_id];
|
||||
if (cur_harq.state==INACTIVE) {
|
||||
#ifdef UL_HARQ_PRINT
|
||||
printf("[SCHED] Found new ulharq id %d, scheduling it\n",hrq_id);
|
||||
#endif
|
||||
return hrq_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void schedule_fapi_ul_pdu(int Mod_idP,
|
||||
frame_t frameP,
|
||||
@@ -970,10 +999,14 @@ void schedule_fapi_ul_pdu(int Mod_idP,
|
||||
|
||||
//Pusch Allocation in frequency domain [TS38.214, sec 6.1.2.2]
|
||||
//Optional Data only included if indicated in pduBitmap
|
||||
// TODO from harq function as in pdsch
|
||||
pusch_pdu->pusch_data.rv_index = 0;
|
||||
pusch_pdu->pusch_data.harq_process_id = 0;
|
||||
pusch_pdu->pusch_data.new_data_indicator = 1;
|
||||
uint8_t harq_id = select_ul_harq_pid(&UE_list->UE_sched_ctrl[UE_id]);
|
||||
NR_UE_ul_harq_t *cur_harq = &UE_list->UE_sched_ctrl[UE_id].ul_harq_processes[harq_id];
|
||||
pusch_pdu->pusch_data.harq_process_id = harq_id;
|
||||
pusch_pdu->pusch_data.new_data_indicator = cur_harq->ndi;
|
||||
pusch_pdu->pusch_data.rv_index = nr_rv_round_map[cur_harq->round];
|
||||
|
||||
cur_harq->state = ACTIVE_SCHED;
|
||||
cur_harq->last_tx_slot = pusch_sched->slot;
|
||||
|
||||
uint8_t num_dmrs_symb = 0;
|
||||
|
||||
@@ -1060,7 +1093,7 @@ void schedule_fapi_ul_pdu(int Mod_idP,
|
||||
}
|
||||
else {
|
||||
dci_pdu_rel15_t *dci_pdu_rel15 = calloc(MAX_DCI_CORESET,sizeof(dci_pdu_rel15_t));
|
||||
config_uldci(ubwp,pusch_pdu,pdcch_pdu_rel15,&dci_pdu_rel15[0],dci_formats,rnti_types,time_domain_assignment,n_ubwp,bwp_id);
|
||||
config_uldci(ubwp,pusch_pdu,pdcch_pdu_rel15,&dci_pdu_rel15[0],dci_formats,rnti_types,time_domain_assignment,UE_list->UE_sched_ctrl[UE_id].tpc0,n_ubwp,bwp_id);
|
||||
fill_dci_pdu_rel15(scc,secondaryCellGroup,pdcch_pdu_rel15,dci_pdu_rel15,dci_formats,rnti_types,pusch_pdu->bwp_size,bwp_id);
|
||||
free(dci_pdu_rel15);
|
||||
}
|
||||
|
||||
@@ -1485,6 +1485,18 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
|
||||
// al values passed to this function are x10
|
||||
|
||||
int snrx10 = (cqi*5) - 640;
|
||||
if (snrx10 > target + incr) return 0; // decrease 1dB
|
||||
if (snrx10 < target - incr) return 2; // increase 1dB
|
||||
if (snrx10 < target - (3*incr)) return 3; // increase 3dB
|
||||
return 1; // no change
|
||||
}
|
||||
|
||||
|
||||
void get_pdsch_to_harq_feedback(int Mod_idP,
|
||||
int UE_id,
|
||||
NR_SearchSpace__searchSpaceType_PR ss_type,
|
||||
|
||||
@@ -285,6 +285,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti);
|
||||
gNB_mac = RC.nrmac[gnb_mod_idP];
|
||||
UE_list = &gNB_mac->UE_list;
|
||||
int target_snrx10 = gNB_mac->pusch_target_snrx10;
|
||||
|
||||
if (UE_id != -1) {
|
||||
UE_scheduling_control = &(UE_list->UE_sched_ctrl[UE_id]);
|
||||
@@ -300,17 +301,19 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
ul_cqi);
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_I(MAC, "Printing received UL MAC payload at gNB side: %d \n");
|
||||
for (int i = 0; i < sdu_lenP ; i++) {
|
||||
LOG_I(MAC, "Printing received UL MAC payload at gNB side: %d \n");
|
||||
for (int i = 0; i < sdu_lenP ; i++) {
|
||||
//harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
printf("%02x ",(unsigned char)sduP[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
if (sduP != NULL){
|
||||
UE_scheduling_control->tpc0 = nr_get_tpc(target_snrx10,ul_cqi,30);
|
||||
UE_scheduling_control->ta_update = timing_advance;
|
||||
LOG_I(MAC, "[UE %d] PUSCH TPC %d and TA %d\n",UE_id,UE_scheduling_control->tpc0,UE_scheduling_control->ta_update);
|
||||
LOG_D(MAC, "Received PDU at MAC gNB \n");
|
||||
nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ void config_common(int Mod_idP,
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
int tgt_snrx10,
|
||||
NR_ServingCellConfigCommon_t *scc,
|
||||
int nsa_flag,
|
||||
uint32_t rnti,
|
||||
@@ -137,7 +138,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
|
||||
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
|
||||
dci_pdu_rel15_t *dci_pdu_rel15,
|
||||
int *dci_formats, int *rnti_types,
|
||||
int time_domain_assignment,
|
||||
int time_domain_assignment, uint8_t tpc,
|
||||
int n_ubwp, int bwp_id);
|
||||
|
||||
void configure_fapi_dl_Tx(module_id_t Mod_idP,
|
||||
@@ -228,6 +229,8 @@ void find_aggregation_candidates(uint8_t *aggregation_level,
|
||||
uint8_t *nr_of_candidates,
|
||||
NR_SearchSpace_t *ss);
|
||||
|
||||
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr);
|
||||
|
||||
int get_spf(nfapi_nr_config_request_scf_t *cfg);
|
||||
|
||||
int to_absslot(nfapi_nr_config_request_scf_t *cfg,int frame,int slot);
|
||||
|
||||
@@ -118,6 +118,9 @@ void mac_top_init_gNB(void)
|
||||
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].round = 0;
|
||||
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].ndi = 0;
|
||||
UE_list->UE_sched_ctrl[list_el].harq_processes[list_harq].is_waiting = 0;
|
||||
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].round = 0;
|
||||
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].ndi = 0;
|
||||
UE_list->UE_sched_ctrl[list_el].ul_harq_processes[list_harq].state = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +267,19 @@ typedef struct NR_UE_harq {
|
||||
uint16_t feedback_slot;
|
||||
} NR_UE_harq_t;
|
||||
|
||||
typedef enum {
|
||||
INACTIVE = 0,
|
||||
ACTIVE_NOT_SCHED,
|
||||
ACTIVE_SCHED
|
||||
} NR_UL_harq_states_t;
|
||||
|
||||
typedef struct NR_UE_ul_harq {
|
||||
uint8_t ndi;
|
||||
uint8_t round;
|
||||
uint16_t last_tx_slot;
|
||||
NR_UL_harq_states_t state;
|
||||
} NR_UE_ul_harq_t;
|
||||
|
||||
/*! \brief scheduling control information set through an API */
|
||||
typedef struct {
|
||||
uint64_t dlsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains dlsch
|
||||
@@ -275,8 +288,11 @@ typedef struct {
|
||||
NR_sched_pusch *sched_pusch;
|
||||
uint16_t ta_timer;
|
||||
int16_t ta_update;
|
||||
uint8_t tpc0;
|
||||
uint8_t tpc1;
|
||||
uint8_t current_harq_pid;
|
||||
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
|
||||
NR_UE_ul_harq_t ul_harq_processes[NR_MAX_NB_HARQ_PROCESSES];
|
||||
int dummy;
|
||||
NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information
|
||||
} NR_UE_sched_ctrl_t;
|
||||
@@ -321,6 +337,8 @@ typedef struct gNB_MAC_INST_s {
|
||||
NR_TAG_t *tag;
|
||||
/// Pointer to IF module instance for PHY
|
||||
NR_IF_Module_t *if_inst;
|
||||
/// Pusch target SNR
|
||||
int pusch_target_snrx10;
|
||||
/// TA command
|
||||
int ta_command;
|
||||
/// MAC CE flag indicating TA length
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "executables/softmodem-common.h"
|
||||
|
||||
#define MAX_IF_MODULES 100
|
||||
//#define UL_HARQ_PRINT
|
||||
|
||||
NR_IF_Module_t *if_inst[MAX_IF_MODULES];
|
||||
NR_Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
|
||||
@@ -88,7 +89,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
case NFAPI_NR_UCI_PDCCH_PDU_TYPE: break;
|
||||
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
if (get_softmodem_params()->phy_test == 0) {
|
||||
//if (get_softmodem_params()->phy_test == 0) {
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
|
||||
// handle harq
|
||||
int harq_idx_s = 0;
|
||||
@@ -120,7 +121,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -131,8 +132,43 @@ void handle_nr_uci(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
}
|
||||
|
||||
void handle_nr_ul_harq(uint16_t slot, NR_UE_sched_ctrl_t *sched_ctrl, uint8_t crc_status) {
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
int max_harq_rounds = 4; // TODO define macro
|
||||
for (uint8_t hrq_id = 0; hrq_id < NR_MAX_NB_HARQ_PROCESSES; hrq_id++) {
|
||||
NR_UE_ul_harq_t *cur_harq = &sched_ctrl->ul_harq_processes[hrq_id];
|
||||
if ((cur_harq->last_tx_slot == slot-1) && cur_harq->state==ACTIVE_SCHED) {
|
||||
if (!crc_status) {
|
||||
cur_harq->ndi ^= 1;
|
||||
cur_harq->round = 0;
|
||||
cur_harq->state = INACTIVE; // passed -> make inactive. can be used by scheduder for next grant
|
||||
#ifdef UL_HARQ_PRINT
|
||||
printf("[HARQ HANDLER] Ulharq id %d crc passed, freeing it for scheduler\n",hrq_id);
|
||||
#endif
|
||||
} else {
|
||||
cur_harq->round++;
|
||||
cur_harq->state = ACTIVE_NOT_SCHED;
|
||||
#ifdef UL_HARQ_PRINT
|
||||
printf("[HARQ HANDLER] Ulharq id %d crc failed, requesting retransmission\n",hrq_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!(cur_harq->round<max_harq_rounds)) {
|
||||
cur_harq->ndi ^= 1;
|
||||
cur_harq->state = INACTIVE; // failed after 4 rounds -> make inactive
|
||||
cur_harq->round = 0;
|
||||
#ifdef UL_HARQ_PRINT
|
||||
printf("[HARQ HANDLER] Ulharq id %d crc failed in all round, freeing it for scheduler\n",hrq_id);
|
||||
#endif
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void handle_nr_ulsch(NR_UL_IND_t *UL_info, NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
if(nfapi_mode == 1) {
|
||||
if (UL_info->crc_ind.number_crcs>0) {
|
||||
//LOG_D(PHY,"UL_info->crc_ind.crc_indication_body.number_of_crcs:%d CRC_IND:SFN/SF:%d\n", UL_info->crc_ind.crc_indication_body.number_of_crcs, NFAPI_SFNSF2DEC(UL_info->crc_ind.sfn_sf));
|
||||
@@ -159,6 +195,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
UL_info->rx_ind.pdu_list[i].rnti) {
|
||||
LOG_D(PHY, "UL_info->crc_ind.crc_indication_body.crc_pdu_list[%d].crc_indication_rel8.crc_flag:%d\n", j, UL_info->crc_ind.crc_list[j].tb_crc_status);
|
||||
|
||||
handle_nr_ul_harq(UL_info->slot, sched_ctrl, UL_info->crc_ind.crc_list[j].tb_crc_status);
|
||||
|
||||
if (UL_info->crc_ind.crc_list[j].tb_crc_status == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
|
||||
@@ -233,7 +271,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
handle_nr_uci(UL_info, &mac->UE_list.UE_sched_ctrl[0]);
|
||||
// clear HI prior to handling ULSCH
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
handle_nr_ulsch(UL_info, &mac->UE_list.UE_sched_ctrl[0]);
|
||||
|
||||
if (nfapi_mode != 1) {
|
||||
if (ifi->CC_mask == ((1<<MAX_NUM_CCs)-1)) {
|
||||
|
||||
@@ -379,6 +379,7 @@ typedef struct {
|
||||
NR_BCCH_BCH_Message_t mib;
|
||||
int ssb_SubcarrierOffset;
|
||||
int pdsch_AntennaPorts;
|
||||
int pusch_TargetSNRx10;
|
||||
NR_BCCH_DL_SCH_Message_t *siblock1;
|
||||
NR_ServingCellConfigCommon_t *servingcellconfigcommon;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS];
|
||||
|
||||
@@ -186,6 +186,7 @@ static void init_NR_SI(gNB_RRC_INST *rrc) {
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
rrc->carrier.pusch_TargetSNRx10,
|
||||
(NR_ServingCellConfigCommon_t *)rrc->carrier.servingcellconfigcommon,
|
||||
0,
|
||||
0, // WIP hardcoded rnti
|
||||
@@ -265,6 +266,7 @@ char openair_rrc_gNB_configuration(const module_id_t gnb_mod_idP, gNB_RrcConfigu
|
||||
rrc->carrier.servingcellconfigcommon = configuration->scc;
|
||||
rrc->carrier.ssb_SubcarrierOffset = configuration->ssb_SubcarrierOffset;
|
||||
rrc->carrier.pdsch_AntennaPorts = configuration->pdsch_AntennaPorts;
|
||||
rrc->carrier.pusch_TargetSNRx10 = configuration->pusch_TargetSNRx10;
|
||||
/// System Information INIT
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_FMT" Checking release \n",PROTOCOL_NR_RRC_CTXT_ARGS(&ctxt));
|
||||
init_NR_SI(rrc);
|
||||
|
||||
@@ -261,6 +261,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
rrc_mac_config_req_gNB(rrc->module_id,
|
||||
rrc->carrier.ssb_SubcarrierOffset,
|
||||
rrc->carrier.pdsch_AntennaPorts,
|
||||
rrc->carrier.pusch_TargetSNRx10,
|
||||
NULL,
|
||||
1, // add_ue flag
|
||||
ue_context_p->ue_id_rnti,
|
||||
|
||||
Reference in New Issue
Block a user