Merge branch 'integration_2023_w25' into 'develop'

integration_2023_w25

See merge request oai/openairinterface5g!2184

* !2162 NR UE MAC and RRC handling of RLM
* !2175 no sanitize on generated ldpc code
* !2176 using rotation functions also at UE
* !2177 nr sib1: add mandatory fields for FDD
* !2178 fixing a typo in band 41 sync raster matrix
* !2169 NR CSI-RS configured per BWP
* !2180 bugfix in RAR time domain allocation
* !2187 Avoid segmentation fault when optional IE nAS_PDU is NULL
* !2179 Tutorials: Update docker install to the latest instructions on the official website
This commit is contained in:
Robert Schmidt
2023-06-24 12:11:44 +00:00
58 changed files with 327 additions and 238 deletions
+7 -4
View File
@@ -32,11 +32,14 @@ Minimum hardware requirements:
```bash
sudo apt install -y git net-tools putty
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# https://docs.docker.com/engine/install/ubuntu/
sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker docker-ce
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add your username to the docker group, otherwise you will have to run in sudo mode.
sudo usermod -a -G docker $(whoami)
+2 -2
View File
@@ -14,7 +14,7 @@ rx_func_implem[rx_func]
handle_nr_slot_ind
--> rnti_to_remove-mgmt
--> L1_nr_prach_procedures
--> apply_nr_rotation_ul
--> apply_nr_rotation_RX
end
subgraph phy_procedures_gNB_uespec_RX
fill_ul_rb_mask
@@ -58,7 +58,7 @@ subgraph tx_func
subgraph phy_procedures_gNB_TX
dcitop[nr_generate dci top]
--> nr_generate_csi_rs
--> apply_nr_rotation
--> apply_nr_rotation_TX
-- send_msg --> end_tx_func((L1_tx_out))
end
subgraph tx_reorder_thread
+2 -2
View File
@@ -33,7 +33,7 @@ rx_func_implem[rx_func]
handle_nr_slot_ind
--> rnti_to_remove-mgmt
--> L1_nr_prach_procedures
--> apply_nr_rotation_ul
--> apply_nr_rotation_RX
end
subgraph phy_procedures_gNB_uespec_RX
fill_ul_rb_mask
@@ -67,7 +67,7 @@ subgraph tx
phy_procedures_gNB_TX
--> dcitop[nr_generate dci top]
--> nr_generate_csi_rs
--> apply_nr_rotation
--> apply_nr_rotation_TX
-- send_msg --> end_tx_func((L1_tx_out))
end
subgraph tx_reorder_thread
+9 -6
View File
@@ -231,13 +231,16 @@ void rx_func(void *param)
//WA: comment rotation in tx/rx
if((gNB->num_RU == 1) && (gNB->RU_list[0]->if_south != REMOTE_IF4p5)) {
//apply the rx signal rotation here
int soffset = (slot_rx & 3) * gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size;
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
apply_nr_rotation_ul(&gNB->frame_parms,
gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14,
link_type_ul);
apply_nr_rotation_RX(&gNB->frame_parms,
gNB->common_vars.rxdataF[aa],
gNB->frame_parms.symbol_rotation[1],
slot_rx,
gNB->frame_parms.N_RB_UL,
soffset,
0,
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14);
}
}
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
@@ -49,6 +49,12 @@ typedef struct {
uint32_t sr;
} fapi_nr_uci_pdu_rel15_t;
typedef enum {
RLM_no_monitoring = 0,
RLM_out_of_sync = 1,
RLM_in_sync = 2
} rlm_t;
typedef struct {
uint32_t rsrp;
int rsrp_dBm;
@@ -56,6 +62,7 @@ typedef struct {
uint8_t i1;
uint8_t i2;
uint8_t cqi;
rlm_t radiolink_monitoring;
} fapi_nr_csirs_measurements_t;
typedef struct {
@@ -125,6 +132,7 @@ typedef struct {
uint16_t cell_id;
uint16_t ssb_start_subcarrier;
short rsrp_dBm;
rlm_t radiolink_monitoring; // -1 no monitoring, 0 out_of_sync, 1 in_sync
} fapi_nr_ssb_pdu_t;
typedef struct {
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=104, byte encoding
static inline void ldpc_BG2_Zc104_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc104_byte(uint8_t *c,uint8_t *d) {
__m64 *csimd=(__m64 *)c,*dsimd=(__m64 *)d;
__m64 *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=112, byte encoding
static inline void ldpc_BG2_Zc112_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc112_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=120, byte encoding
static inline void ldpc_BG2_Zc120_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc120_byte(uint8_t *c,uint8_t *d) {
__m64 *csimd=(__m64 *)c,*dsimd=(__m64 *)d;
__m64 *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=128, byte encoding
static inline void ldpc_BG2_Zc128_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc128_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=144, byte encoding
static inline void ldpc_BG2_Zc144_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc144_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=160, byte encoding
static inline void ldpc_BG2_Zc160_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc160_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=16, byte encoding
static inline void ldpc_BG2_Zc16_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc16_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=176, byte encoding
static inline void ldpc_BG2_Zc176_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc176_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=192, byte encoding
static inline void ldpc_BG2_Zc192_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc192_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=208, byte encoding
static inline void ldpc_BG2_Zc208_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc208_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=224, byte encoding
static inline void ldpc_BG2_Zc224_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc224_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=240, byte encoding
static inline void ldpc_BG2_Zc240_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc240_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=256, byte encoding
static inline void ldpc_BG2_Zc256_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc256_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=288, byte encoding
static inline void ldpc_BG2_Zc288_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc288_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,7 +1,7 @@
#include "PHY/sse_intrin.h"
#define scalar_xor(a,b) ((a)^(b))
// generated code for Zc=2, byte encoding
static inline void ldpc_BG2_Zc2_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc2_byte(uint8_t *c,uint8_t *d) {
uint8_t *csimd=(uint8_t *)c,*dsimd=(uint8_t *)d;
uint8_t *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=320, byte encoding
static inline void ldpc_BG2_Zc320_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc320_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=32, byte encoding
static inline void ldpc_BG2_Zc32_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc32_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=352, byte encoding
static inline void ldpc_BG2_Zc352_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc352_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=384, byte encoding
static inline void ldpc_BG2_Zc384_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc384_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,7 +1,7 @@
#include "PHY/sse_intrin.h"
#define scalar_xor(a,b) ((a)^(b))
// generated code for Zc=4, byte encoding
static inline void ldpc_BG2_Zc4_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc4_byte(uint8_t *c,uint8_t *d) {
uint8_t *csimd=(uint8_t *)c,*dsimd=(uint8_t *)d;
uint8_t *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=64, byte encoding
static inline void ldpc_BG2_Zc64_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc64_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=72, byte encoding
static inline void ldpc_BG2_Zc72_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc72_byte(uint8_t *c,uint8_t *d) {
__m64 *csimd=(__m64 *)c,*dsimd=(__m64 *)d;
__m64 *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=80, byte encoding
static inline void ldpc_BG2_Zc80_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc80_byte(uint8_t *c,uint8_t *d) {
__m128i *csimd=(__m128i *)c,*dsimd=(__m128i *)d;
__m128i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=88, byte encoding
static inline void ldpc_BG2_Zc88_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc88_byte(uint8_t *c,uint8_t *d) {
__m64 *csimd=(__m64 *)c,*dsimd=(__m64 *)d;
__m64 *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=8, byte encoding
static inline void ldpc_BG2_Zc8_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc8_byte(uint8_t *c,uint8_t *d) {
__m64i *csimd=(__m64i *)c,*dsimd=(__m64i *)d;
__m64i *c2,*d2;
@@ -1,6 +1,6 @@
#include "PHY/sse_intrin.h"
// generated code for Zc=96, byte encoding
static inline void ldpc_BG2_Zc96_byte(uint8_t *c,uint8_t *d) {
static inline __attribute__ ((no_sanitize("address", "undefined"))) void ldpc_BG2_Zc96_byte(uint8_t *c,uint8_t *d) {
__m256i *csimd=(__m256i *)c,*dsimd=(__m256i *)d;
__m256i *c2,*d2;
+12 -9
View File
@@ -108,23 +108,26 @@ int nr_beam_precoding(c16_t **txdataF,
int offset
);
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
c16_t* txdata,
int slot,
int first_symbol,
int nsymb,
int link_type);
void apply_nr_rotation_TX(NR_DL_FRAME_PARMS *fp,
c16_t *txdataF,
c16_t *symbol_rotation,
int slot,
int nb_rb,
int first_symbol,
int nsymb);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp);
void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms,
c16_t *rxdataF,
c16_t *rot,
int slot,
int nb_rb,
int soffset,
int first_symbol,
int nsymb,
int link_type);
int nsymb);
/*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5
@param[in] datatx_F_precoding, Pointer to n_layers*re data array
+14 -14
View File
@@ -334,17 +334,17 @@ void do_OFDM_mod(c16_t **txdataF, c16_t **txdata, uint32_t frame,uint16_t next_s
}
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
c16_t *txdataF,
int slot,
int first_symbol,
int nsymb,
int link_type)
void apply_nr_rotation_TX(NR_DL_FRAME_PARMS *fp,
c16_t *txdataF,
c16_t *symbol_rotation,
int slot,
int nb_rb,
int first_symbol,
int nsymb)
{
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
int symb_offset = (slot % fp->slots_per_subframe) * fp->symbols_per_slot;
c16_t *symbol_rotation = fp->symbol_rotation[link_type] + symb_offset;
int N_RB = (link_type == link_type_sl) ? fp->N_RB_SL : fp->N_RB_DL;
symbol_rotation += symb_offset;
for (int sidx = first_symbol; sidx < first_symbol + nsymb; sidx++) {
c16_t *this_rotation = symbol_rotation + sidx;
@@ -357,20 +357,20 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
this_rotation->r,
this_rotation->i);
if (N_RB & 1) {
if (nb_rb & 1) {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
(N_RB + 1) * 6, 15);
(nb_rb + 1) * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset - 6,
this_rotation,
this_symbol + fp->first_carrier_offset - 6,
(N_RB + 1) * 6, 15);
(nb_rb + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
N_RB * 6, 15);
nb_rb * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset,
this_rotation,
this_symbol + fp->first_carrier_offset,
N_RB * 6, 15);
nb_rb * 6, 15);
}
}
}
+31 -60
View File
@@ -96,46 +96,14 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
stop_meas(&ue->rx_dft_stats);
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
c16_t rot2 = frame_parms->symbol_rotation[0][symbol+symb_offset];
rot2.i=-rot2.i;
#ifdef DEBUG_FEP
// if (ue->frame <100)
printf("slot_fep: slot %d, symbol %d rx_offset %u, rotation symbol %d %d.%d\n", Ns,symbol, rx_offset,
symbol+symb_offset,rot2.r,rot2.i);
#endif
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *this_symbol = &rxdataF[aa][frame_parms->ofdm_symbol_size*symbol];
if (frame_parms->N_RB_DL & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_DL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_DL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_DL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_DL * 6, 15);
}
apply_nr_rotation_RX(frame_parms,
rxdataF[aa],
frame_parms->symbol_rotation[0],
Ns,
frame_parms->N_RB_DL,
0,
symbol,
1);
}
#ifdef DEBUG_FEP
@@ -311,51 +279,54 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
return 0;
}
void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
void apply_nr_rotation_RX(NR_DL_FRAME_PARMS *frame_parms,
c16_t *rxdataF,
c16_t *rot,
int slot,
int nb_rb,
int soffset,
int first_symbol,
int nsymb,
int link_type)
int nsymb)
{
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
AssertFatal(first_symbol + nsymb <= NR_NUMBER_OF_SYMBOLS_PER_SLOT,
"First symbol %d and number of symbol %d not compatible with number of symbols in a slot %d\n",
first_symbol, nsymb, NR_NUMBER_OF_SYMBOLS_PER_SLOT);
int symb_offset = (slot % frame_parms->slots_per_subframe) * frame_parms->symbols_per_slot;
for (int symbol=first_symbol;symbol<nsymb;symbol++) {
for (int symbol = first_symbol; symbol < first_symbol + nsymb; symbol++) {
c16_t rot2 = frame_parms->symbol_rotation[link_type][symbol + symb_offset];
rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
c16_t rot2 = rot[symbol + symb_offset];
rot2.i = -rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n", slot, symb_offset, rot2.r, rot2.i);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *this_symbol = &rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)];
c16_t *this_symbol = &rxdataF[soffset + (frame_parms->ofdm_symbol_size * symbol)];
if (frame_parms->N_RB_UL & 1) {
if (nb_rb & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_UL + 1) * 6, 15);
(nb_rb + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_UL + 1) * 6, 15);
(nb_rb + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_UL+1) * 6, 15);
1, (nb_rb + 1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_UL+1) * 6, 15);
1, (nb_rb + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_UL * 6, 15);
nb_rb * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_UL * 6, 15);
nb_rb * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_UL * 6, 15);
1, nb_rb * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_UL * 6, 15);
1, nb_rb * 6, 15);
}
}
}
+1
View File
@@ -1006,6 +1006,7 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, c16_t
csirs_measurements.i1 = *i1;
csirs_measurements.i2 = *i2;
csirs_measurements.cqi = cqi;
csirs_measurements.radiolink_monitoring = RLM_no_monitoring; // TODO do be activated in case of RLM based on CSI-RS
nr_downlink_indication_t dl_indication;
fapi_nr_rx_indication_t rx_ind = {0};
nr_fill_dl_indication(&dl_indication, NULL, &rx_ind, proc, ue, NULL);
+14 -36
View File
@@ -592,16 +592,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
uint8_t slot,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t n_antenna_ports) {
int tx_offset, ap;
c16_t **txdata;
c16_t **txdataF;
uint8_t n_antenna_ports)
{
/////////////////////////IFFT///////////////////////
///////////
tx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
int tx_offset = frame_parms->get_samples_slot_timestamp(slot, frame_parms, 0);
// clear the transmit data array for the current subframe
/*for (int aa=0; aa<UE->frame_parms.nb_antennas_tx; aa++) {
@@ -610,38 +606,20 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
}*/
txdata = UE->common_vars.txdata;
txdataF = UE->common_vars.txdataF;
c16_t **txdata = UE->common_vars.txdata;
c16_t **txdataF = UE->common_vars.txdataF;
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
for(ap = 0; ap < n_antenna_ports; ap++) {
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
c16_t *this_symbol = &txdataF[ap][frame_parms->ofdm_symbol_size * s];
c16_t rot=frame_parms->symbol_rotation[link_type_ul][s + symb_offset];
LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
s,
s + symb_offset,
rot.r, rot.i);
if (frame_parms->N_RB_UL & 1) {
rotate_cpx_vector(this_symbol, &rot, this_symbol,
(frame_parms->N_RB_UL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_UL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot, this_symbol,
frame_parms->N_RB_UL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_UL * 6, 15);
}
}
for(int ap = 0; ap < n_antenna_ports; ap++) {
apply_nr_rotation_TX(frame_parms,
txdataF[ap],
frame_parms->symbol_rotation[1],
slot,
frame_parms->N_RB_UL,
0,
NR_NUMBER_OF_SYMBOLS_PER_SLOT);
}
for (ap = 0; ap < n_antenna_ports; ap++) {
for (int ap = 0; ap < n_antenna_ports; ap++) {
if (frame_parms->Ncp == 1) { // extended cyclic prefix
PHY_ofdm_mod((int *)txdataF[ap],
(int *)&txdata[ap][tx_offset],
+7 -1
View File
@@ -222,7 +222,13 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
//apply the OFDM symbol rotation here
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
apply_nr_rotation(fp, &gNB->common_vars.txdataF[aa][txdataF_offset], slot, 0, fp->Ncp == EXTENDED ? 12 : 14, link_type_dl);
apply_nr_rotation_TX(fp,
&gNB->common_vars.txdataF[aa][txdataF_offset],
fp->symbol_rotation[0],
slot,
fp->N_RB_DL,
0,
fp->Ncp == EXTENDED ? 12 : 14);
T(T_GNB_PHY_DL_OUTPUT_SIGNAL, T_INT(0),
T_INT(frame), T_INT(slot),
+5 -2
View File
@@ -164,15 +164,18 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
fapiPbch_t *pbch = (fapiPbch_t *)typeSpecific;
memcpy(ssb_pdu->pdu, pbch->decoded_output, sizeof(pbch->decoded_output));
ssb_pdu->additional_bits = pbch->xtra_byte;
ssb_pdu->ssb_index = (frame_parms->ssb_index)&0x7;
ssb_pdu->ssb_index = (frame_parms->ssb_index) & 0x7;
ssb_pdu->ssb_length = frame_parms->Lmax;
ssb_pdu->cell_id = frame_parms->Nid_cell;
ssb_pdu->ssb_start_subcarrier = frame_parms->ssb_start_subcarrier;
ssb_pdu->rsrp_dBm = ue->measurements.ssb_rsrp_dBm[frame_parms->ssb_index];
ssb_pdu->radiolink_monitoring = RLM_in_sync; // TODO to be removed from here
ssb_pdu->decoded_pdu = true;
}
else
else {
ssb_pdu->radiolink_monitoring = RLM_out_of_sync; // TODO to be removed from here
ssb_pdu->decoded_pdu = false;
}
}
break;
case FAPI_NR_CSIRS_IND:
@@ -28,6 +28,10 @@ int nfapi_nr_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packe
int nfapi_nr_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t* config) { return 0; }
int nfapi_p7_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p7_codec_config_t *config) { return 0; }
void nr_mac_rrc_sync_ind(const module_id_t module_id,
const frame_t frame,
const bool in_sync) {}
void rrc_data_ind(const protocol_ctxt_t *const ctxt_pP,
const rb_id_t Srb_id,
const sdu_size_t sdu_sizeP,
+14 -12
View File
@@ -648,12 +648,13 @@ int main(int argc, char **argv)
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
if (cyclic_prefix_type == 1) {
apply_nr_rotation(frame_parms,
gNB->common_vars.txdataF[aa],
slot,
0,
12,
link_type_dl);
apply_nr_rotation_TX(frame_parms,
gNB->common_vars.txdataF[aa],
frame_parms->symbol_rotation[0],
slot,
frame_parms->N_RB_DL,
0,
12);
PHY_ofdm_mod((int *)gNB->common_vars.txdataF[aa],
(int *)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
@@ -662,12 +663,13 @@ int main(int argc, char **argv)
frame_parms->nb_prefix_samples,
CYCLIC_PREFIX);
} else {
apply_nr_rotation(frame_parms,
gNB->common_vars.txdataF[aa],
slot,
0,
14,
link_type_dl);
apply_nr_rotation_TX(frame_parms,
gNB->common_vars.txdataF[aa],
frame_parms->symbol_rotation[0],
slot,
frame_parms->N_RB_DL,
0,
14);
/*nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
+6 -4
View File
@@ -1259,14 +1259,16 @@ int main(int argc, char **argv)
slot,
0);
}
int offset = (slot & 3) * gNB->frame_parms.symbols_per_slot * gNB->frame_parms.ofdm_symbol_size;
for (int aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
apply_nr_rotation_ul(&gNB->frame_parms,
apply_nr_rotation_RX(&gNB->frame_parms,
gNB->common_vars.rxdataF[aa],
gNB->frame_parms.symbol_rotation[1],
slot,
gNB->frame_parms.N_RB_UL,
offset,
0,
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14,
link_type_ul);
gNB->frame_parms.Ncp == EXTENDED ? 12 : 14);
}
ul_proc_error = phy_procedures_gNB_uespec_RX(gNB, frame, slot);
+1
View File
@@ -30,6 +30,7 @@
// Messages between RRC and MAC layers
MESSAGE_DEF(RRC_MAC_IN_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacInSyncInd, rrc_mac_in_sync_ind)
MESSAGE_DEF(RRC_MAC_OUT_OF_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacOutOfSyncInd, rrc_mac_out_of_sync_ind)
MESSAGE_DEF(NR_RRC_MAC_SYNC_IND, MESSAGE_PRIORITY_MED_PLUS, NRRrcMacSyncInd, nr_rrc_mac_sync_ind)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_REQ, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataReq, rrc_mac_bcch_data_req)
MESSAGE_DEF(RRC_MAC_BCCH_DATA_IND, MESSAGE_PRIORITY_MED_PLUS, RrcMacBcchDataInd, rrc_mac_bcch_data_ind)
+8 -2
View File
@@ -36,13 +36,14 @@
// Defines to access message fields.
#define RRC_MAC_IN_SYNC_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_in_sync_ind
#define RRC_MAC_OUT_OF_SYNC_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_out_of_sync_ind
#define NR_RRC_MAC_SYNC_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_sync_ind
#define RRC_MAC_BCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_req
#define RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_data_ind
#define NR_RRC_MAC_BCCH_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nr_rrc_mac_bcch_data_ind
#define RRC_MAC_BCCH_MBMS_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_req
#define RRC_MAC_BCCH_MBMS_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_ind
#define RRC_MAC_BCCH_MBMS_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_req
#define RRC_MAC_BCCH_MBMS_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_bcch_mbms_data_ind
#define RRC_MAC_CCCH_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_req
#define RRC_MAC_CCCH_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.rrc_mac_ccch_data_cnf
@@ -72,6 +73,11 @@ typedef struct RrcMacInSyncInd_s {
typedef RrcMacInSyncInd RrcMacOutOfSyncInd;
typedef struct NRRrcMacSyncInd_s {
uint32_t frame;
bool in_sync;
} NRRrcMacSyncInd;
typedef struct RrcMacBcchDataReq_s {
uint32_t frame;
uint32_t sdu_size;
+2 -2
View File
@@ -114,7 +114,7 @@ const sync_raster_t sync_raster[] = {
{39, 0, 4706, 1, 4795},
{40, 0, 5756, 1, 5995},
{41, 0, 6246, 3, 6717},
{41, 1, 6254, 3, 6714},
{41, 1, 6252, 3, 6714},
{50, 0, 3584, 1, 3787},
{51, 0, 3572, 1, 3574},
{66, 0, 5279, 1, 5494},
@@ -1162,7 +1162,7 @@ void check_ssb_raster(uint64_t freq, int band, int scs)
gscn, freq, band);
int rel_gscn = gscn - start_gscn;
AssertFatal(rel_gscn % step_gscn == 0,
"GSCN %d corresponding to SSB freqyency %lu not in accordance with GSCN step for band %d\n",
"GSCN %d corresponding to SSB frequency %lu not in accordance with GSCN step for band %d\n",
gscn, freq, band);
}
-3
View File
@@ -367,12 +367,9 @@ typedef struct {
} PUCCH_sched_t;
typedef struct {
uint32_t ssb_index;
/// SSB RSRP in dBm
short ssb_rsrp_dBm;
int consecutive_bch_failures;
} NR_SSB_meas_t;
typedef struct NR_UL_TIME_ALIGNMENT {
+1 -3
View File
@@ -263,8 +263,6 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
AssertFatal(mac->mib != NULL, "nr_ue_decode_mib() mac->mib == NULL\n");
mac->ssb_measurements.consecutive_bch_failures = 0; // resetting decoding failures
uint16_t frame = (mac->mib->systemFrameNumber.buf[0] >> mac->mib->systemFrameNumber.bits_unused);
uint16_t frame_number_4lsb = 0;
@@ -4083,7 +4081,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, int pdu_id)
// MCS
rar_grant.mcs = (unsigned char) (rar->UL_GRANT_4 >> 4);
// time alloc
rar_grant.Msg3_t_alloc = (unsigned char) (rar->UL_GRANT_3 & 0x07);
rar_grant.Msg3_t_alloc = (unsigned char) (rar->UL_GRANT_3 & 0x0f);
// frequency alloc
rar_grant.Msg3_f_alloc = (uint16_t) ((rar->UL_GRANT_3 >> 4) | (rar->UL_GRANT_2 << 4) | ((rar->UL_GRANT_1 & 0x03) << 12));
// frequency hopping
@@ -2224,7 +2224,7 @@ static void nr_fill_rar(uint8_t Mod_idP, NR_RA_t *ra, uint8_t *dlsch_buffer, nfa
int mcs = (unsigned char) (rar->UL_GRANT_4 >> 4);
// time alloc
int Msg3_t_alloc = (unsigned char) (rar->UL_GRANT_3 & 0x07);
int Msg3_t_alloc = (unsigned char) (rar->UL_GRANT_3 & 0x0f);
// frequency alloc
int Msg3_f_alloc = (uint16_t) ((rar->UL_GRANT_3 >> 4) | (rar->UL_GRANT_2 << 4) | ((rar->UL_GRANT_1 & 0x03) << 12));
// frequency hopping
@@ -60,7 +60,7 @@ const int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon
AssertFatal(tdd || nrmac->common_channels->frame_type == FDD, "Dynamic TDD not handled yet\n");
// Use special TDA in case of CSI-RS
if(nrmac->UE_info.sched_csirs)
if(nrmac->UE_info.sched_csirs > 0)
return 1;
if (tdd && tdd->nrofDownlinkSymbols > 1) { // if there is a mixed slot where we can transmit DL
@@ -2552,18 +2552,23 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
uint16_t *vrb_map = gNB_mac->common_channels[CC_id].vrb_map;
UE_info->sched_csirs = false;
UE_info->sched_csirs = 0;
UE_iterator(UE_info->list, UE) {
NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
// CSI-RS is common to all UEs in a given BWP
// therefore we need to schedule only once per BWP
// the following condition verifies if CSI-RS
// has been already scheduled in this BWP
if (UE_info->sched_csirs & (1 << dl_bwp->bwp_id))
continue;
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
if (sched_ctrl->rrc_processing_timer > 0) {
continue;
}
NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP;
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
if (!ul_bwp->csi_MeasConfig) continue;
NR_CSI_MeasConfig_t *csi_measconfig = ul_bwp->csi_MeasConfig;
@@ -2598,8 +2603,9 @@ void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slo
if((frame*n_slots_frame+slot-offset)%period == 0) {
LOG_D(NR_MAC,"Scheduling CSI-RS in frame %d slot %d Resource ID %ld\n",frame,slot,nzpcsi->nzp_CSI_RS_ResourceId);
UE_info->sched_csirs = true;
LOG_D(NR_MAC,"Scheduling CSI-RS in frame %d slot %d Resource ID %ld\n",
frame, slot, nzpcsi->nzp_CSI_RS_ResourceId);
UE_info->sched_csirs |= (1 << dl_bwp->bwp_id);
nfapi_nr_dl_tti_request_pdu_t *dl_tti_csirs_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
memset((void*)dl_tti_csirs_pdu,0,sizeof(nfapi_nr_dl_tti_request_pdu_t));
+2 -1
View File
@@ -691,7 +691,8 @@ typedef struct {
// last element always NULL
pthread_mutex_t mutex;
NR_UE_info_t *list[MAX_MOBILES_PER_GNB+1];
bool sched_csirs;
// bitmap of CSI-RS already scheduled in current slot
int sched_csirs;
uid_allocator_t uid_allocator;
} NR_UEs_t;
+14 -11
View File
@@ -1052,14 +1052,6 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
}
void handle_bch_failure(NR_UE_MAC_INST_t *mac)
{
mac->ssb_measurements.consecutive_bch_failures++;
//TODO handle this properly by scheduling re-synchronization
AssertFatal(mac->ssb_measurements.consecutive_bch_failures < 100,
"Radio link failure caused by 100 consecutive PBCH detection failures.\n");
}
// L2 Abstraction Layer
int handle_bcch_dlsch(module_id_t module_id, int cc_id, unsigned int gNB_index, uint8_t ack_nack, uint8_t *pduP, uint32_t pdu_len){
return nr_ue_decode_BCCH_DL_SCH(module_id, cc_id, gNB_index, ack_nack, pduP, pdu_len);
@@ -1098,7 +1090,17 @@ int8_t handle_dlsch(nr_downlink_indication_t *dl_info, int pdu_id)
return 0;
}
int8_t handle_csirs_measurements(module_id_t module_id, frame_t frame, int slot, fapi_nr_csirs_measurements_t *csirs_measurements) {
void handle_rlm(rlm_t rlm_result, int frame, module_id_t module_id)
{
if (rlm_result == RLM_no_monitoring)
return;
bool is_sync = rlm_result == RLM_in_sync ? true : false;
nr_mac_rrc_sync_ind(module_id, frame, is_sync);
}
int8_t handle_csirs_measurements(module_id_t module_id, frame_t frame, int slot, fapi_nr_csirs_measurements_t *csirs_measurements)
{
handle_rlm(csirs_measurements->radiolink_monitoring, frame, module_id);
return nr_ue_process_csirs_measurements(module_id, frame, slot, csirs_measurements);
}
@@ -1197,6 +1199,9 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
switch(rx_indication_body.pdu_type){
case FAPI_NR_RX_PDU_TYPE_SSB:
handle_rlm(rx_indication_body.ssb_pdu.radiolink_monitoring,
dl_info->frame,
dl_info->module_id);
if(rx_indication_body.ssb_pdu.decoded_pdu) {
handle_ssb_meas(mac,
rx_indication_body.ssb_pdu.ssb_index,
@@ -1209,8 +1214,6 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info)
rx_indication_body.ssb_pdu.ssb_start_subcarrier,
rx_indication_body.ssb_pdu.cell_id)) << FAPI_NR_RX_PDU_TYPE_SSB;
}
else
handle_bch_failure(mac);
break;
case FAPI_NR_RX_PDU_TYPE_SIB:
ret_mask |= (handle_bcch_dlsch(dl_info->module_id,
+25 -8
View File
@@ -140,11 +140,12 @@ static uint64_t get_ssb_bitmap(const NR_ServingCellConfigCommon_t *scc)
return bitmap;
}
static void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, int nb_slots_per_period, int nb_dl_slots_period)
static void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int id, int nb_slots_per_period, int nb_dl_slots_period)
{
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
const int ideal_period = nb_slots_per_period * MAX_MOBILES_PER_GNB;
const int offset = nb_slots_per_period * uid;
// TODO ideal period to be set according to estimation by the gNB on how fast the channel changes
const int ideal_period = 320;
const int offset = nb_slots_per_period * id;
if (ideal_period < 5) {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4;
@@ -184,14 +185,13 @@ static void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0, int uid, in
}
else {
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
AssertFatal(offset / 320 < nb_dl_slots_period, "Cannot allocate %dth UE. Not enough resources for CSI-RS\n", uid);
AssertFatal(offset / 320 < nb_dl_slots_period, "Cannot allocate CSI-RS for BWP %d. Not enough resources for CSI-RS\n", id);
nzpcsi0->periodicityAndOffset->choice.slots320 = (offset % 320) + (offset / 320);
}
}
static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_CSI_MeasConfig_t *csi_MeasConfig,
int uid,
int num_dl_antenna_ports,
int curr_bwp,
int do_csirs,
@@ -266,7 +266,7 @@ static void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigco
nzpcsi0->powerControlOffsetSS = calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
set_csirs_periodicity(nzpcsi0, uid, nb_slots_per_period, nb_dl_slots_period);
set_csirs_periodicity(nzpcsi0, id, nb_slots_per_period, nb_dl_slots_period);
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
*nzpcsi0->qcl_InfoPeriodicCSI_RS = 0;
asn1cSeqAdd(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
@@ -1893,6 +1893,23 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configurati
asn1cCallocOne(UL->frequencyInfoUL.p_Max, *frequencyInfoUL->p_Max);
frame_type_t frame_type =
get_frame_type((int)*configuration->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0],
*configuration->scc->ssbSubcarrierSpacing);
if (frame_type == FDD) {
UL->frequencyInfoUL.absoluteFrequencyPointA = malloc(sizeof(*UL->frequencyInfoUL.absoluteFrequencyPointA));
AssertFatal(UL->frequencyInfoUL.absoluteFrequencyPointA != NULL, "out of memory\n");
*UL->frequencyInfoUL.absoluteFrequencyPointA =
*configuration->scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
UL->frequencyInfoUL.frequencyBandList = calloc(1, sizeof(*UL->frequencyInfoUL.frequencyBandList));
AssertFatal(UL->frequencyInfoUL.frequencyBandList != NULL, "out of memory\n");
for (int i = 0; i < frequencyInfoUL->frequencyBandList->list.count; i++) {
asn1cSequenceAdd(UL->frequencyInfoUL.frequencyBandList->list, struct NR_NR_MultiBandInfo, nrMultiBandInfo);
nrMultiBandInfo->freqBandIndicatorNR = frequencyInfoUL->frequencyBandList->list.array[i];
}
}
UL->initialUplinkBWP.genericParameters = configuration->scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
UL->initialUplinkBWP.rach_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon;
UL->initialUplinkBWP.pusch_ConfigCommon = configuration->scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon;
@@ -2226,7 +2243,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
bwp_id = bwp->bwp_Id;
}
config_csirs(scc, csi_MeasConfig, uid, pdsch_AntennaPorts, curr_bwp, configuration->do_CSIRS, bwp_loop);
config_csirs(scc, csi_MeasConfig, pdsch_AntennaPorts, curr_bwp, configuration->do_CSIRS, bwp_loop);
config_csiim(configuration->do_CSIRS, pdsch_AntennaPorts, curr_bwp, csi_MeasConfig, bwp_loop);
NR_CSI_ResourceConfig_t *csires1 = calloc(1, sizeof(*csires1));
@@ -2780,7 +2797,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[bwp_loop];
int curr_bwp = NRRIV2BW(bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
config_csirs(servingcellconfigcommon, csi_MeasConfig, uid, dl_antenna_ports, curr_bwp, do_csirs, bwp_loop);
config_csirs(servingcellconfigcommon, csi_MeasConfig, dl_antenna_ports, curr_bwp, do_csirs, bwp_loop);
config_csiim(do_csirs, dl_antenna_ports, curr_bwp, csi_MeasConfig, bwp_loop);
if (do_csirs) {
+10
View File
@@ -39,6 +39,16 @@
typedef uint32_t channel_t;
void nr_mac_rrc_sync_ind(const module_id_t module_id,
const frame_t frame,
const bool in_sync)
{
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_SYNC_IND);
NR_RRC_MAC_SYNC_IND (message_p).frame = frame;
NR_RRC_MAC_SYNC_IND (message_p).in_sync = in_sync;
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
}
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
const int CC_id,
const uint8_t gNB_index,
+13 -19
View File
@@ -2249,24 +2249,6 @@ int32_t nr_rrc_ue_establish_drb(module_id_t ue_mod_idP,
return 0;
}
void nr_rrc_handle_timers(unsigned int mod_id)
{
NR_UE_Timers_Constants_t *timers = &NR_UE_rrc_inst[mod_id].timers_and_constants;
// T304
if (timers->T304_active == true) {
timers->T304_cnt += 10;
if(timers->T304_cnt >= timers->T304_k) {
// TODO
// For T304 of MCG, in case of the handover from NR or intra-NR
// handover, initiate the RRC re-establishment procedure;
// In case of handover to NR, perform the actions defined in the
// specifications applicable for the source RAT.
}
}
}
void *rrc_nrue_task(void *args_p)
{
MessageDef *msg_p;
@@ -2293,10 +2275,22 @@ void *rrc_nrue_task(void *args_p)
LOG_D(NR_RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
break;
case NR_RRC_MAC_SYNC_IND:
LOG_D(NR_RRC, "[UE %d] Received %s: frame %d\n",
ue_mod_id,
ITTI_MSG_NAME (msg_p),
NR_RRC_MAC_SYNC_IND (msg_p).frame);
nr_sync_msg_t sync_msg = NR_RRC_MAC_SYNC_IND (msg_p).in_sync ?
IN_SYNC : OUT_OF_SYNC;
NR_UE_Timers_Constants_t *tac = &NR_UE_rrc_inst[ue_mod_id].timers_and_constants;
handle_rlf_sync(tac, sync_msg);
break;
case NRRRC_SLOT_PROCESS:
LOG_D(NR_RRC, "[UE %d] Receided %s: frame %d slot %d\n",
ue_mod_id, ITTI_MSG_NAME (msg_p), NRRRC_SLOT_PROCESS (msg_p).frame, NRRRC_SLOT_PROCESS (msg_p).slot);
nr_rrc_handle_timers(ue_mod_id);
NR_UE_Timers_Constants_t *timers = &NR_UE_rrc_inst[ue_mod_id].timers_and_constants;
nr_rrc_handle_timers(timers);
break;
case NR_RRC_MAC_BCCH_DATA_IND:
+5
View File
@@ -182,6 +182,11 @@ typedef struct NR_UE_Timers_Constants_s {
uint32_t T319_k;
} NR_UE_Timers_Constants_t;
typedef enum {
OUT_OF_SYNC = 0,
IN_SYNC = 1
} nr_sync_msg_t;
typedef struct NR_UE_RRC_INST_s {
NR_MeasConfig_t *meas_config;
NR_CellGroupConfig_t *cell_group_config;
+7 -2
View File
@@ -113,6 +113,10 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
const uint8_t* pduP,
const sdu_size_t pdu_len);
void nr_mac_rrc_sync_ind(const module_id_t module_id,
const frame_t frame,
const bool in_sync);
/**\brief
\param module_id module id
\param CC_id component carrier id
@@ -133,8 +137,7 @@ int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index);
\param void *args_p Pointer on arguments to start the task. */
void *rrc_nrue_task(void *args_p);
/**\brief RRC timers update at UE. */
void *nr_rrc_timers_update();
void nr_rrc_handle_timers(NR_UE_Timers_Constants_t *timers);
/**\brief RRC NSA UE task.
\param void *args_p Pointer on arguments to start the task. */
@@ -162,6 +165,8 @@ void reset_rlf_timers_and_constants(NR_UE_Timers_Constants_t *tac);
void set_default_timers_and_constants(NR_UE_Timers_Constants_t *tac);
void nr_rrc_set_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1);
void nr_rrc_set_T304(NR_UE_Timers_Constants_t *tac, NR_ReconfigurationWithSync_t *reconfigurationWithSync);
void handle_rlf_sync(NR_UE_Timers_Constants_t *tac,
nr_sync_msg_t sync_msg);
void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc,
struct NR_SetupRelease_RLF_TimersAndConstants *rlf_TimersAndConstants);
@@ -21,6 +21,29 @@
#include "openair2/RRC/NR_UE/rrc_proto.h"
void nr_rrc_handle_timers(NR_UE_Timers_Constants_t *timers)
{
// T304
if (timers->T304_active == true) {
timers->T304_cnt += 10;
if(timers->T304_cnt >= timers->T304_k) {
// TODO
// For T304 of MCG, in case of the handover from NR or intra-NR
// handover, initiate the RRC re-establishment procedure;
// In case of handover to NR, perform the actions defined in the
// specifications applicable for the source RAT.
}
}
if (timers->T310_active == true) {
timers->T310_cnt += 10;
if(timers->T310_cnt >= timers->T310_k) {
// TODO
// handle detection of radio link failure
// as described in 5.3.10.3 of 38.331
AssertFatal(false, "Radio link failure! Not handled yet!\n");
}
}
}
void nr_rrc_set_T304(NR_UE_Timers_Constants_t *tac, NR_ReconfigurationWithSync_t *reconfigurationWithSync)
{
@@ -402,6 +425,43 @@ void nr_rrc_handle_SetupRelease_RLF_TimersAndConstants(NR_UE_RRC_INST_t *rrc,
}
}
void handle_rlf_sync(NR_UE_Timers_Constants_t *tac,
nr_sync_msg_t sync_msg)
{
if (sync_msg == IN_SYNC) {
tac->N310_cnt = 0;
if (tac->T310_active) {
tac->N311_cnt++;
// Upon receiving N311 consecutive "in-sync" indications
if (tac->N311_cnt >= tac->N311_k) {
// stop timer T310
tac->T310_active = false;
tac->T310_cnt = 0;
tac->N311_cnt = 0;
}
}
}
else {
// OUT_OF_SYNC
tac->N311_cnt = 0;
if(tac->T300_active ||
tac->T301_active ||
tac->T304_active ||
tac->T310_active ||
tac->T311_active ||
tac->T319_active)
return;
tac->N310_cnt++;
// upon receiving N310 consecutive "out-of-sync" indications
if (tac->N310_cnt >= tac->N310_k) {
// start timer T310
tac->T310_active = true;
tac->T310_cnt = 0;
tac->N310_cnt = 0;
}
}
}
void set_default_timers_and_constants(NR_UE_Timers_Constants_t *tac)
{
// 38.331 9.2.3 Default values timers and constants
+3 -1
View File
@@ -763,7 +763,9 @@ static int ngap_gNB_handle_initial_context_request(uint32_t assoc_id, uint32_t s
NGAP_PDUSessionResourceSetupItemCxtReq_t *item_p = ie->value.choice.PDUSessionResourceSetupListCxtReq.list.array[i];
msg->pdusession_param[i].pdusession_id = item_p->pDUSessionID;
allocCopy(&msg->pdusession_param[i].nas_pdu, *item_p->nAS_PDU);
if (item_p->nAS_PDU) {
allocCopy(&msg->pdusession_param[i].nas_pdu, *item_p->nAS_PDU);
}
allocCopy(&msg->pdusession_param[i].pdusessionTransfer, item_p->pDUSessionResourceSetupRequestTransfer);
}
}