first version of pusch power control
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;
|
||||
|
||||
@@ -477,7 +477,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]) {
|
||||
@@ -519,7 +519,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)
|
||||
@@ -1101,7 +1101,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,
|
||||
|
||||
@@ -276,6 +276,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]);
|
||||
@@ -291,17 +292,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, 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);
|
||||
|
||||
@@ -288,6 +288,8 @@ 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];
|
||||
@@ -335,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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -238,6 +238,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