Merge remote-tracking branch 'origin/episys-throughput-updates-and-downlink-siso-cm' into integration_2022_wk14
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "NR_SubcarrierSpacing.h"
|
||||
#include "openair1/SCHED_NR_UE/harq_nr.h"
|
||||
|
||||
#define NR_SHORT_BSR_TABLE_SIZE 32
|
||||
#define NR_LONG_BSR_TABLE_SIZE 256
|
||||
@@ -264,14 +265,29 @@ typedef struct {
|
||||
uint8_t nbits;
|
||||
} dci_field_t;
|
||||
|
||||
typedef struct {
|
||||
/* The active harq sfn/slot field was created to save the
|
||||
scheduled SFN/Slot transmission for the ACK/NAK. If we
|
||||
do not save it, then we have to calculate it again as the
|
||||
NRUE MAC layer already does in get_downlink_ack(). */
|
||||
int active_dl_harq_sfn;
|
||||
int active_dl_harq_slot;
|
||||
int active_ul_harq_sfn_slot;
|
||||
bool active;
|
||||
} emul_l1_harq_t;
|
||||
|
||||
typedef struct {
|
||||
bool expected_sib;
|
||||
bool index_has_sib[16];
|
||||
bool index_has_sib[NR_MAX_HARQ_PROCESSES];
|
||||
bool expected_rar;
|
||||
bool index_has_rar[16];
|
||||
bool index_has_rar[NR_MAX_HARQ_PROCESSES];
|
||||
bool expected_dci;
|
||||
bool index_has_dci[16];
|
||||
int active_harq_sfn_slot;
|
||||
bool index_has_dci[NR_MAX_HARQ_PROCESSES];
|
||||
emul_l1_harq_t harq[NR_MAX_HARQ_PROCESSES];
|
||||
int active_uci_sfn_slot;
|
||||
int num_srs;
|
||||
int num_harqs;
|
||||
int num_csi_reports;
|
||||
} nr_emulated_l1_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -432,7 +432,7 @@ typedef struct {
|
||||
|
||||
// Defined for abstracted mode
|
||||
nr_downlink_indication_t dl_info;
|
||||
NR_UE_HARQ_STATUS_t dl_harq_info[16];
|
||||
NR_UE_HARQ_STATUS_t dl_harq_info[NR_MAX_HARQ_PROCESSES];
|
||||
|
||||
nr_emulated_l1_t nr_ue_emul_l1;
|
||||
|
||||
|
||||
@@ -1368,10 +1368,18 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
|
||||
// FIXME k0 != 0 currently not taken into consideration
|
||||
current_harq->dl_frame = frame;
|
||||
current_harq->dl_slot = slot;
|
||||
mac->nr_ue_emul_l1.active_harq_sfn_slot = NFAPI_SFNSLOT2HEX(frame, (slot + data_toul_fb));
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
int scs = get_softmodem_params()->numerology;
|
||||
int slots_per_frame = nr_slots_per_frame[scs];
|
||||
slot += data_toul_fb;
|
||||
if (slot >= slots_per_frame) {
|
||||
frame = (frame + 1) % 1024;
|
||||
slot %= slots_per_frame;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n",
|
||||
harq_id, frame, slot, frame, (slot + data_toul_fb));
|
||||
harq_id, current_harq->dl_frame, current_harq->dl_slot, frame, slot);
|
||||
}
|
||||
|
||||
|
||||
@@ -1853,7 +1861,8 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) {
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList &&
|
||||
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id] != NULL)) {
|
||||
if (uci_size <= 2) {
|
||||
// PUCCH with format0 can be up to 3 bits (2 ack/nacks + 1 sr is 3 max bits)
|
||||
if (uci_size <= 3) {
|
||||
pucch_resource_set_id = 0;
|
||||
return (pucch_resource_set_id);
|
||||
break;
|
||||
@@ -2054,11 +2063,17 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
|
||||
sched_frame = current_harq->dl_frame;
|
||||
if (sched_slot>=slots_per_frame){
|
||||
sched_slot %= slots_per_frame;
|
||||
sched_frame++;
|
||||
sched_frame = (sched_frame + 1) % 1024;
|
||||
}
|
||||
AssertFatal(sched_slot < slots_per_frame, "sched_slot was calculated incorrect %d\n", sched_slot);
|
||||
LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common);
|
||||
/* check if current tx slot should transmit downlink acknowlegment */
|
||||
if (sched_frame == frame && sched_slot == slot) {
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active = true;
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_sfn = frame;
|
||||
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_slot = slot;
|
||||
}
|
||||
|
||||
if (current_harq->dai > NR_DL_MAX_DAI) {
|
||||
LOG_E(MAC,"PUCCH Downlink DAI has an invalid value : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
|
||||
|
||||
@@ -1079,6 +1079,10 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
mac->if_module->scheduled_response(&scheduled_response);
|
||||
}
|
||||
else
|
||||
{
|
||||
dl_config->number_pdus = 0;
|
||||
}
|
||||
}
|
||||
} else if (ul_info) {
|
||||
|
||||
@@ -2251,26 +2255,27 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
int O_CSI = 0;
|
||||
int N_UCI = 0;
|
||||
|
||||
PUCCH_sched_t *pucch = calloc(1,sizeof(*pucch));
|
||||
pucch->resource_indicator = -1;
|
||||
pucch->initial_pucch_id = -1;
|
||||
PUCCH_sched_t pucch = {
|
||||
.resource_indicator = -1,
|
||||
.initial_pucch_id = -1
|
||||
};
|
||||
uint16_t rnti = mac->crnti; //FIXME not sure this is valid for all pucch instances
|
||||
|
||||
// SR
|
||||
if(trigger_periodic_scheduling_request(mac, pucch, frameP, slotP)) {
|
||||
if (trigger_periodic_scheduling_request(mac, &pucch, frameP, slotP)) {
|
||||
O_SR = 1;
|
||||
/* sr_payload = 1 means that this is a positive SR, sr_payload = 0 means that it is a negative SR */
|
||||
pucch->sr_payload = nr_ue_get_SR(module_idP,
|
||||
pucch.sr_payload = nr_ue_get_SR(module_idP,
|
||||
frameP,
|
||||
slotP);
|
||||
}
|
||||
|
||||
// CSI
|
||||
if (mac->ra.ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test == 1)
|
||||
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch);
|
||||
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, &pucch);
|
||||
|
||||
// ACKNACK
|
||||
O_ACK = get_downlink_ack(mac, frameP, slotP, pucch);
|
||||
O_ACK = get_downlink_ack(mac, frameP, slotP, &pucch);
|
||||
|
||||
NR_BWP_Id_t bwp_id = mac->UL_BWP_Id;
|
||||
NR_PUCCH_Config_t *pucch_Config = NULL;
|
||||
@@ -2300,35 +2305,39 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
|
||||
pucch_Config->format2 &&
|
||||
(pucch_Config->format2->choice.setup->simultaneousHARQ_ACK_CSI == NULL)) {
|
||||
O_CSI = 0;
|
||||
pucch->csi_part1_payload = 0;
|
||||
pucch->csi_part2_payload = 0;
|
||||
pucch.csi_part1_payload = 0;
|
||||
pucch.csi_part2_payload = 0;
|
||||
}
|
||||
|
||||
N_UCI = O_SR + O_ACK + O_CSI;
|
||||
mac->nr_ue_emul_l1.num_srs = O_SR;
|
||||
mac->nr_ue_emul_l1.num_harqs = O_ACK;
|
||||
mac->nr_ue_emul_l1.num_csi_reports = O_CSI;
|
||||
|
||||
// do no transmit pucch if only SR scheduled and it is negative
|
||||
if ((O_ACK + O_CSI) == 0 && pucch->sr_payload == 0)
|
||||
if ((O_ACK + O_CSI) == 0 && pucch.sr_payload == 0)
|
||||
return;
|
||||
|
||||
if (N_UCI > 0) {
|
||||
LOG_D(NR_MAC,"%d.%d configure pucch, O_SR %d, O_ACK %d, O_CSI %d\n",frameP,slotP,O_SR,O_ACK,O_CSI);
|
||||
pucch->resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI);
|
||||
select_pucch_resource(mac, pucch);
|
||||
pucch.resource_set_id = find_pucch_resource_set(mac, O_ACK + O_CSI);
|
||||
select_pucch_resource(mac, &pucch);
|
||||
fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP);
|
||||
pthread_mutex_lock(&ul_config->mutex_ul_config);
|
||||
AssertFatal(ul_config->number_pdus<FAPI_NR_UL_CONFIG_LIST_NUM, "ul_config->number_pdus %d out of bounds\n",ul_config->number_pdus);
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pucch_config_pdu;
|
||||
|
||||
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PUCCH);
|
||||
mac->nr_ue_emul_l1.active_uci_sfn_slot = NFAPI_SFNSLOT2HEX(frameP, slotP);
|
||||
pthread_mutex_unlock(&ul_config->mutex_ul_config);
|
||||
|
||||
nr_ue_configure_pucch(mac,
|
||||
slotP,
|
||||
rnti,
|
||||
pucch,
|
||||
&pucch,
|
||||
pucch_pdu,
|
||||
O_SR, O_ACK, O_CSI);
|
||||
LOG_D(NR_MAC,"Configuring pucch, is_common = %d\n",pucch->is_common);
|
||||
LOG_D(NR_MAC, "Configuring pucch, is_common = %d\n", pucch.is_common);
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id);
|
||||
if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL)
|
||||
|
||||
@@ -300,6 +300,8 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
|
||||
(RA_sfn_index + slot_index) * N_t_slot * fdm + td_index * fdm + fdm_index;
|
||||
|
||||
if((prach_occasion_id < cc->total_prach_occasions) && (td_index == 0)){
|
||||
AssertFatal(UL_tti_req->n_pdus < sizeof(UL_tti_req->pdus_list) / sizeof(UL_tti_req->pdus_list[0]),
|
||||
"Invalid UL_tti_req->n_pdus %d\n", UL_tti_req->n_pdus);
|
||||
|
||||
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE;
|
||||
UL_tti_req->pdus_list[UL_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_prach_pdu_t);
|
||||
@@ -803,6 +805,9 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
|
||||
future_ul_tti_req->Slot,
|
||||
sched_frame,
|
||||
sched_slot);
|
||||
AssertFatal(future_ul_tti_req->n_pdus <
|
||||
sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]),
|
||||
"Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus);
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE;
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t);
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu;
|
||||
|
||||
@@ -85,7 +85,9 @@ void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu, int module_id, int CC_id, int
|
||||
void nr_fill_nfapi_srs(int module_id, int CC_id, int UE_id, sub_frame_t slot, NR_SRS_Resource_t *srs_resource) {
|
||||
|
||||
nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][slot];
|
||||
|
||||
AssertFatal(future_ul_tti_req->n_pdus <
|
||||
sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]),
|
||||
"Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus);
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE;
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_srs_pdu_t);
|
||||
nfapi_nr_srs_pdu_t *srs_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].srs_pdu;
|
||||
|
||||
@@ -56,6 +56,9 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
|
||||
future_ul_tti_req->Slot,
|
||||
pucch->frame,
|
||||
pucch->ul_slot);
|
||||
AssertFatal(future_ul_tti_req->n_pdus <
|
||||
sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]),
|
||||
"Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus);
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE;
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pucch_pdu_t);
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pucch_pdu;
|
||||
|
||||
@@ -279,9 +279,18 @@ int nr_process_mac_pdu(module_id_t module_idP,
|
||||
case UL_SCH_LCID_L_TRUNCATED_BSR:
|
||||
//38.321 section 6.1.3.1
|
||||
//variable length
|
||||
/* Several checks have been added to this function to
|
||||
ensure that the casting of the pduP is possible. There seems
|
||||
to be a partial PDU at the end of this buffer, so here
|
||||
we gracefully ignore that by returning 0. See:
|
||||
https://gitlab.eurecom.fr/oai/openairinterface5g/-/issues/534 */
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
|
||||
mac_subheader_len = 2;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
}
|
||||
@@ -358,9 +367,13 @@ int nr_process_mac_pdu(module_id_t module_idP,
|
||||
case UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT:
|
||||
//38.321 section 6.1.3.9
|
||||
// varialbe length
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
|
||||
mac_subheader_len = 2;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
}
|
||||
@@ -370,9 +383,13 @@ int nr_process_mac_pdu(module_id_t module_idP,
|
||||
case UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT:
|
||||
//38.321 section 6.1.3.9
|
||||
// varialbe length
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
|
||||
mac_subheader_len = 2;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
|
||||
return 0;
|
||||
mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
}
|
||||
@@ -386,8 +403,12 @@ int nr_process_mac_pdu(module_id_t module_idP,
|
||||
|
||||
case UL_SCH_LCID_SRB1:
|
||||
case UL_SCH_LCID_SRB2:
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
|
||||
return 0;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
|
||||
//mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
|
||||
return 0;
|
||||
mac_subheader_len = 3;
|
||||
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8)
|
||||
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff);
|
||||
@@ -471,8 +492,12 @@ int nr_process_mac_pdu(module_id_t module_idP,
|
||||
|
||||
case UL_SCH_LCID_DTCH:
|
||||
// check if LCID is valid at current time.
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
|
||||
return 0;
|
||||
if (((NR_MAC_SUBHEADER_SHORT *)pduP)->F) {
|
||||
// mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
|
||||
if (pdu_len < sizeof(NR_MAC_SUBHEADER_LONG))
|
||||
return 0;
|
||||
mac_subheader_len = 3;
|
||||
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L1 & 0x7f) << 8)
|
||||
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *)pduP)->L2 & 0xff);
|
||||
@@ -1777,6 +1802,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
|
||||
future_ul_tti_req->Slot,
|
||||
sched_pusch->frame,
|
||||
sched_pusch->slot);
|
||||
AssertFatal(future_ul_tti_req->n_pdus <
|
||||
sizeof(future_ul_tti_req->pdus_list) / sizeof(future_ul_tti_req->pdus_list[0]),
|
||||
"Invalid future_ul_tti_req->n_pdus %d\n", future_ul_tti_req->n_pdus);
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_type = NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE;
|
||||
future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pdu_size = sizeof(nfapi_nr_pusch_pdu_t);
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &future_ul_tti_req->pdus_list[future_ul_tti_req->n_pdus].pusch_pdu;
|
||||
|
||||
@@ -51,7 +51,12 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
|
||||
|
||||
if (entity->type != NR_PDCP_SRB && !(buffer[0] & 0x80)) {
|
||||
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
/* TODO: This is something of a hack. The most significant bit
|
||||
in buffer[0] should be 1 if the packet is a data packet. We are
|
||||
processing malformed data packets if the most significant bit
|
||||
is 0. Rather than exit(1), this hack allows us to continue for now.
|
||||
We need to investigate why this hack is neccessary. */
|
||||
buffer[0] |= 128;
|
||||
}
|
||||
|
||||
if (entity->sn_size == 12) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,15 +41,44 @@
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
|
||||
#define NR_NUM_MCS 29
|
||||
#define NUM_SINR 100
|
||||
#define NUM_BLER_COL 13
|
||||
#define NUM_NFAPI_SLOT 20
|
||||
#define NR_NUM_LAYER 1
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
typedef struct nr_phy_channel_params_t
|
||||
{
|
||||
uint16_t sfn_slot;
|
||||
float sinr;
|
||||
uint16_t message_id;
|
||||
uint16_t nb_of_sinrs;
|
||||
float sinr[NR_NUM_LAYER];
|
||||
// Incomplete, need all channel parameters
|
||||
} nr_phy_channel_params_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t slot;
|
||||
uint16_t rnti[256];
|
||||
uint8_t mcs[256];
|
||||
uint8_t rvIndex[256];
|
||||
float sinr;
|
||||
uint16_t num_pdus;
|
||||
bool drop_flag[256];
|
||||
bool latest;
|
||||
|
||||
} slot_rnti_mcs_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t length;
|
||||
float bler_table[NUM_SINR][NUM_BLER_COL];
|
||||
} nr_bler_struct;
|
||||
|
||||
extern nr_bler_struct nr_bler_data[NR_NUM_MCS];
|
||||
|
||||
typedef enum {
|
||||
ONLY_PUSCH,
|
||||
NOT_PUSCH,
|
||||
@@ -240,6 +269,8 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
|
||||
nfapi_nr_ul_dci_request_t *ul_dci_request,
|
||||
nfapi_nr_ul_tti_request_t *ul_tti_request);
|
||||
|
||||
bool sfn_slot_matcher(void *wanted, void *candidate);
|
||||
|
||||
/**\brief done free of memory allocation by module_id and release to pointer pool.
|
||||
\param module_id module id*/
|
||||
int nr_ue_if_module_kill(uint32_t module_id);
|
||||
|
||||
@@ -1259,6 +1259,17 @@ void ue_init_standalone_socket(int tx_port, int rx_port)
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t get_message_id(const uint8_t *buffer, ssize_t len)
|
||||
{
|
||||
if (len < 4)
|
||||
return 0;
|
||||
|
||||
// Unpack 2 bytes message_id from buffer.
|
||||
uint16_t v;
|
||||
memcpy(&v, buffer + 2, sizeof(v));
|
||||
return ntohs(v);
|
||||
}
|
||||
|
||||
void *ue_standalone_pnf_task(void *context)
|
||||
{
|
||||
struct sockaddr_in server_address;
|
||||
@@ -1301,7 +1312,7 @@ void *ue_standalone_pnf_task(void *context)
|
||||
abort();
|
||||
}
|
||||
}
|
||||
else if (len == sizeof(phy_channel_params_t))
|
||||
else if (get_message_id((const uint8_t *)buffer, len) == 0x0FFF) // 0x0FFF : channel info identifier.
|
||||
{
|
||||
phy_channel_params_t ch_info;
|
||||
memcpy(&ch_info, buffer, sizeof(phy_channel_params_t));
|
||||
@@ -1314,8 +1325,15 @@ void *ue_standalone_pnf_task(void *context)
|
||||
uint16_t sf = ch_info.sfn_sf & 15;
|
||||
assert(sf < 10);
|
||||
|
||||
sf_rnti_mcs[sf].sinr = ch_info.sinr;
|
||||
LOG_D(MAC, "Received_SINR = %f\n",ch_info.sinr);
|
||||
if (ch_info.nb_of_sinrs > 1)
|
||||
LOG_W(MAC, "Expecting at most one SINR.\n");
|
||||
|
||||
// TODO: Update sinr field of slot_rnti_mcs to be array.
|
||||
for (int i = 0; i < ch_info.nb_of_sinrs; ++i)
|
||||
{
|
||||
sf_rnti_mcs[sf].sinr = ch_info.sinr[i];
|
||||
LOG_D(MAC, "Received_SINR[%d] = %f\n", i, ch_info.sinr[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#define NUM_MCS 28
|
||||
#define NUM_SINR 100
|
||||
#define NUM_BLER_COL 13
|
||||
#define LTE_NUM_LAYER 1
|
||||
|
||||
// this mutex is used to set multiple UE's UL value in L2 FAPI simulator.
|
||||
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
|
||||
@@ -126,7 +127,9 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
typedef struct phy_channel_params_t
|
||||
{
|
||||
uint16_t sfn_sf;
|
||||
float sinr;
|
||||
uint16_t message_id;
|
||||
uint16_t nb_of_sinrs;
|
||||
float sinr[LTE_NUM_LAYER];
|
||||
// Incomplete, need all channel parameters
|
||||
} phy_channel_params_t;
|
||||
|
||||
|
||||
@@ -2795,7 +2795,6 @@ void start_oai_nrue_threads()
|
||||
init_queue(&nr_tx_req_queue);
|
||||
init_queue(&nr_ul_dci_req_queue);
|
||||
init_queue(&nr_ul_tti_req_queue);
|
||||
init_queue(&nr_wait_ul_tti_req_queue);
|
||||
|
||||
if (sem_init(&sfn_slot_semaphore, 0, 0) != 0)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,6 @@ extern queue_t nr_dl_tti_req_queue;
|
||||
extern queue_t nr_tx_req_queue;
|
||||
extern queue_t nr_ul_dci_req_queue;
|
||||
extern queue_t nr_ul_tti_req_queue;
|
||||
extern queue_t nr_wait_ul_tti_req_queue;
|
||||
//
|
||||
// main_rrc.c
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user