Commit a62bdf36 authored by Robert Schmidt's avatar Robert Schmidt

Merge branch 'integration_2023_w41' into 'develop'

integration_2023_w41

See merge request oai/openairinterface5g!2394

* !2389 Remove global variable rx_spatial_power
* !2364 NR UE PUCCH2 sanitize errors
* !2352 Break DCI processing function into smaller pieces
* !2391 Remove calloc from L1 at CSIRS_PDU conversion function
* !2393 Fix UE assertion due to PUCCH resource lookup all BWPs
* !2307 Improve documentation for L2sim Readme
* !2310 doc(websvr): how to install properly the dependencies
parents bba14188 5231b977
This diff is collapsed.
......@@ -239,19 +239,6 @@ typedef struct {
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_config_request_t;
typedef enum {
NFAPI_NR_DL_DCI_FORMAT_1_0 = 0,
NFAPI_NR_DL_DCI_FORMAT_1_1,
NFAPI_NR_DL_DCI_FORMAT_2_0,
NFAPI_NR_DL_DCI_FORMAT_2_1,
NFAPI_NR_DL_DCI_FORMAT_2_2,
NFAPI_NR_DL_DCI_FORMAT_2_3,
NFAPI_NR_UL_DCI_FORMAT_0_0,
NFAPI_NR_UL_DCI_FORMAT_0_1
} nfapi_nr_dci_format_e;
typedef enum {
NFAPI_NR_RNTI_new = 0,
NFAPI_NR_RNTI_C,
......
......@@ -216,8 +216,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
ulsch_measurements_gNB *ulsch_measurements = &ulsch->ulsch_measurements;
int rx_power[fp->nb_antennas_rx];
allocCast2D(rx_spatial_power, int, ulsch_measurements->rx_spatial_power, nrOfLayers, fp->nb_antennas_rx, true);
allocCast2D(rx_spatial_power_dB, unsigned short, ulsch_measurements->rx_spatial_power_dB, nrOfLayers, fp->nb_antennas_rx, true);
int rx_spatial_power[nrOfLayers][fp->nb_antennas_rx];
for (int aarx = 0; aarx < fp->nb_antennas_rx; aarx++){
rx_power[aarx] = 0;
......@@ -230,7 +229,6 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB,
rx_spatial_power[aatx][aarx] = 0;
}
rx_spatial_power_dB[aatx][aarx] = (unsigned short)dB_fixed(rx_spatial_power[aatx][aarx]);
rx_power[aarx] += rx_spatial_power[aatx][aarx];
}
LOG_D(PHY, "[RNTI %04x] RX power in antenna %d = %d\n", ulsch->rnti, aarx, rx_power[aarx]);
......
......@@ -25,10 +25,6 @@
#include "PHY/defs_gNB.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
nfapi_nr_rnti_type_e rnti_type,
uint16_t N_RB);
void nr_generate_dci_top(processingData_L1tx_t *msgTx,
int slot,
int32_t *txdataF,
......
......@@ -834,23 +834,23 @@ int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t r
return 0;
}
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *convert_csirs_pdu(fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu)
static nfapi_nr_dl_tti_csi_rs_pdu_rel15_t convert_csirs_pdu(const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu)
{
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *dl_tti_csi_rs_pdu = calloc(1, sizeof(nfapi_nr_dl_tti_csi_rs_pdu_rel15_t));
dl_tti_csi_rs_pdu->subcarrier_spacing = csirs_config_pdu->subcarrier_spacing;
dl_tti_csi_rs_pdu->cyclic_prefix = csirs_config_pdu->cyclic_prefix;
dl_tti_csi_rs_pdu->start_rb = csirs_config_pdu->start_rb;
dl_tti_csi_rs_pdu->nr_of_rbs = csirs_config_pdu->nr_of_rbs;
dl_tti_csi_rs_pdu->csi_type = csirs_config_pdu->csi_type;
dl_tti_csi_rs_pdu->row = csirs_config_pdu->row;
dl_tti_csi_rs_pdu->freq_domain = csirs_config_pdu->freq_domain;
dl_tti_csi_rs_pdu->symb_l0 = csirs_config_pdu->symb_l0;
dl_tti_csi_rs_pdu->symb_l1 = csirs_config_pdu->symb_l1;
dl_tti_csi_rs_pdu->cdm_type = csirs_config_pdu->cdm_type;
dl_tti_csi_rs_pdu->freq_density = csirs_config_pdu->freq_density;
dl_tti_csi_rs_pdu->scramb_id = csirs_config_pdu->scramb_id;
dl_tti_csi_rs_pdu->power_control_offset = csirs_config_pdu->power_control_offset;
dl_tti_csi_rs_pdu->power_control_offset_ss = csirs_config_pdu->power_control_offset_ss;
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t dl_tti_csi_rs_pdu;
dl_tti_csi_rs_pdu.subcarrier_spacing = csirs_config_pdu->subcarrier_spacing;
dl_tti_csi_rs_pdu.cyclic_prefix = csirs_config_pdu->cyclic_prefix;
dl_tti_csi_rs_pdu.start_rb = csirs_config_pdu->start_rb;
dl_tti_csi_rs_pdu.nr_of_rbs = csirs_config_pdu->nr_of_rbs;
dl_tti_csi_rs_pdu.csi_type = csirs_config_pdu->csi_type;
dl_tti_csi_rs_pdu.row = csirs_config_pdu->row;
dl_tti_csi_rs_pdu.freq_domain = csirs_config_pdu->freq_domain;
dl_tti_csi_rs_pdu.symb_l0 = csirs_config_pdu->symb_l0;
dl_tti_csi_rs_pdu.symb_l1 = csirs_config_pdu->symb_l1;
dl_tti_csi_rs_pdu.cdm_type = csirs_config_pdu->cdm_type;
dl_tti_csi_rs_pdu.freq_density = csirs_config_pdu->freq_density;
dl_tti_csi_rs_pdu.scramb_id = csirs_config_pdu->scramb_id;
dl_tti_csi_rs_pdu.power_control_offset = csirs_config_pdu->power_control_offset;
dl_tti_csi_rs_pdu.power_control_offset_ss = csirs_config_pdu->power_control_offset_ss;
return dl_tti_csi_rs_pdu;
}
......@@ -862,7 +862,7 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t
return;
}
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = (fapi_nr_dl_config_csirs_pdu_rel15_t*)&ue->csirs_vars[gNB_id]->csirs_config_pdu;
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &ue->csirs_vars[gNB_id]->csirs_config_pdu;
#ifdef NR_CSIRS_DEBUG
LOG_I(NR_PHY, "csirs_config_pdu->subcarrier_spacing = %i\n", csirs_config_pdu->subcarrier_spacing);
......@@ -906,12 +906,12 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t
uint8_t cqi = 0;
uint8_t i1[3];
uint8_t i2[1];
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = convert_csirs_pdu(csirs_config_pdu);
nr_generate_csi_rs(frame_parms,
ue->nr_csi_info->csi_rs_generated_signal,
AMP,
ue->nr_csi_info,
convert_csirs_pdu((fapi_nr_dl_config_csirs_pdu_rel15_t*)&ue->csirs_vars[gNB_id]->csirs_config_pdu),
&csi_params,
proc->nr_slot_rx,
&N_cdm_groups,
&CDM_group_size,
......
......@@ -759,7 +759,10 @@ void nr_generate_pucch2(const PHY_VARS_NR_UE *ue,
for (int l=0; l<pucch_pdu->nr_of_symbols; l++) {
// c_init calculation according to TS38.211 subclause
x2 = (((1<<17)*((14*nr_slot_tx) + (l+startingSymbolIndex) + 1)*((2*pucch_pdu->dmrs_scrambling_id) + 1)) + (2*pucch_pdu->dmrs_scrambling_id))%(1U<<31);
uint64_t temp_x2 = 1ll << 17;
temp_x2 *= 14UL * nr_slot_tx + l + startingSymbolIndex + 1;
temp_x2 *= 2UL * pucch_pdu->dmrs_scrambling_id + 1;
x2 = (temp_x2 + 2UL * pucch_pdu->dmrs_scrambling_id) % (1UL << 31);
int reset = 1;
for (int ii=0; ii<=(startingPRB>>2); ii++) {
......
......@@ -237,10 +237,6 @@ static inline int crcType(int nbSeg, int len)
}
typedef struct {
//! estimated received spatial signal power (linear)
fourDimArray_t * rx_spatial_power;
//! estimated received spatial signal power (dB)
fourDimArray_t * rx_spatial_power_dB;
//! estimated rssi (dBm)
int rx_rssi_dBm;
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
......
......@@ -447,7 +447,8 @@ typedef enum {
NR_DL_DCI_FORMAT_2_2,
NR_DL_DCI_FORMAT_2_3,
NR_UL_DCI_FORMAT_0_0,
NR_UL_DCI_FORMAT_0_1
NR_UL_DCI_FORMAT_0_1,
NR_DCI_NONE
} nr_dci_format_t;
typedef enum {
......
......@@ -161,12 +161,17 @@ int nr_get_sf_periodicBSRTimer(uint8_t bucketSize);
*/
int nr_get_sf_retxBSRTimer(uint8_t retxBSR_Timer);
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, frame_t frame, int slot, dci_pdu_rel15_t *dci, fapi_nr_dci_indication_pdu_t *dci_ind);
int8_t nr_ue_process_dci(module_id_t module_id,
int cc_id,
frame_t frame,
int slot,
dci_pdu_rel15_t *dci,
fapi_nr_dci_indication_pdu_t *dci_ind);
int nr_ue_process_dci_indication_pdu(module_id_t module_id, int cc_id, int gNB_index, frame_t frame, int slot, fapi_nr_dci_indication_pdu_t *dci);
int8_t nr_ue_process_csirs_measurements(module_id_t module_id, frame_t frame, int slot, fapi_nr_csirs_measurements_t *csirs_measurements);
uint32_t get_ssb_frame(uint32_t test);
int8_t nr_ue_process_csirs_measurements(module_id_t module_id,
frame_t frame,
int slot,
fapi_nr_csirs_measurements_t *csirs_measurements);
void nr_ue_aperiodic_srs_scheduling(NR_UE_MAC_INST_t *mac, long resource_trigger, int frame, int slot);
bool trigger_periodic_scheduling_request(NR_UE_MAC_INST_t *mac,
......@@ -415,6 +420,6 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
dci_pdu_rel15_t *dci,
RAR_grant_t *rar_grant,
uint16_t rnti,
const nr_dci_format_t *dci_format);
const nr_dci_format_t dci_format);
#endif
/** @}*/
......@@ -422,7 +422,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
dci_pdu_rel15_t *dci,
RAR_grant_t *rar_grant,
uint16_t rnti,
const nr_dci_format_t *dci_format)
const nr_dci_format_t dci_format)
{
int f_alloc;
......@@ -534,23 +534,23 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->bwp_size = current_UL_BWP->BWPSize;
/* Transform precoding */
pusch_config_pdu->transform_precoding = get_transformPrecoding(current_UL_BWP, *dci_format, 0);
pusch_config_pdu->transform_precoding = get_transformPrecoding(current_UL_BWP, dci_format, 0);
/*DCI format-related configuration*/
int target_ss;
if (*dci_format == NR_UL_DCI_FORMAT_0_0) {
if (dci_format == NR_UL_DCI_FORMAT_0_0) {
target_ss = NR_SearchSpace__searchSpaceType_PR_common;
if ((pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) &&
pusch_config_pdu->nr_of_symbols < 3)
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 1;
else
pusch_config_pdu->num_dmrs_cdm_grps_no_data = 2;
} else if (*dci_format == NR_UL_DCI_FORMAT_0_1) {
} else if (dci_format == NR_UL_DCI_FORMAT_0_1) {
target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
ul_layers_config(mac, pusch_config_pdu, dci, *dci_format);
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, *dci_format);
ul_layers_config(mac, pusch_config_pdu, dci, dci_format);
ul_ports_config(mac, &dmrslength, pusch_config_pdu, dci, dci_format);
} else {
LOG_E(NR_MAC, "In %s: UL grant from DCI format %d is not handled...\n", __FUNCTION__, *dci_format);
LOG_E(NR_MAC, "In %s: UL grant from DCI format %d is not handled...\n", __FUNCTION__, dci_format);
return -1;
}
......@@ -564,7 +564,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->scid = 0;
pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId;
if(*dci_format == NR_UL_DCI_FORMAT_0_1)
if (dci_format == NR_UL_DCI_FORMAT_0_1)
pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val;
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
......@@ -620,9 +620,15 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
/* MCS TABLE */
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_disabled) {
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_Table : NULL, 0, *dci_format, rnti_type, target_ss, false);
pusch_config_pdu->mcs_table =
get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_Table : NULL, 0, dci_format, rnti_type, target_ss, false);
} else {
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_TableTransformPrecoder : NULL, 1, *dci_format, rnti_type, target_ss, false);
pusch_config_pdu->mcs_table = get_pusch_mcs_table(pusch_Config ? pusch_Config->mcs_TableTransformPrecoder : NULL,
1,
dci_format,
rnti_type,
target_ss,
false);
}
/* NDI */
......
......@@ -87,7 +87,6 @@ int eth_socket_init_raw(openair0_device *device) {
}
/* initialize destination address */
bzero((void *)&(eth->local_addrc_ll), sizeof(struct sockaddr_ll));
bzero((void *)&(eth->local_addrd_ll), sizeof(struct sockaddr_ll));
bzero((void *)&(eth->if_index), sizeof(struct ifreq));
......@@ -98,17 +97,12 @@ int eth_socket_init_raw(openair0_device *device) {
for (int i=0;i<eth->num_fd;i++)
if (ioctl(eth->sockfdd[i], SIOCGIFINDEX, &(eth->if_index)) < 0)
perror("SIOCGIFINDEX");
eth->local_addrc_ll.sll_family = AF_PACKET;
eth->local_addrc_ll.sll_ifindex = eth->if_index.ifr_ifindex;
eth->local_addrd_ll.sll_family = AF_PACKET;
eth->local_addrd_ll.sll_ifindex = eth->if_index.ifr_ifindex;
/* hear traffic from specific protocol*/
eth->local_addrc_ll.sll_protocol = htons((short)device->eth_params->my_portc);
eth->local_addrd_ll.sll_protocol = htons((short)device->eth_params->my_portd);
eth->local_addrc_ll.sll_halen = ETH_ALEN;
eth->local_addrc_ll.sll_pkttype = PACKET_OTHERHOST;
eth->local_addrd_ll.sll_halen = ETH_ALEN;
eth->local_addrd_ll.sll_pkttype = PACKET_OTHERHOST;
eth->addr_len = sizeof(struct sockaddr_ll);
......
......@@ -80,14 +80,6 @@ typedef struct {
struct sockaddr_in local_addrd;
/*!\brief address length for both UDP and RAW socket*/
int addr_len;
/*!\brief destination address (control) for RAW socket*/
struct sockaddr_ll dest_addrc_ll;
/*!\brief local address (control) for RAW socket*/
struct sockaddr_ll local_addrc_ll;
/*!\brief destination address (user) for RAW socket*/
struct sockaddr_ll dest_addrd_ll;
/*!\brief local address (user) for RAW socket*/
struct sockaddr_ll local_addrd_ll;
/*!\brief inteface index for RAW socket*/
struct ifreq if_index;
/*!\brief timeout ms */
......@@ -146,7 +138,9 @@ typedef struct {
/*!\brief precomputed ethernet header (control) */
struct ether_header ehc;
/*!\brief precomputed ethernet header (data) */
struct ether_header ehd;
struct ether_header ehd;
/*!\brief local address (user) for RAW socket*/
struct sockaddr_ll local_addrd_ll;
} eth_state_t;
......
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