Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
3804e04e
Commit
3804e04e
authored
Apr 23, 2024
by
malik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge NRRPA_proceudre_SRS and NRPPA_procedures
parent
2945cfcd
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
233 additions
and
23 deletions
+233
-23
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+1
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+2
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c
+175
-5
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+27
-3
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-0
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
+4
-3
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
+11
-5
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+10
-6
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+1
-1
No files found.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
3804e04e
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include "openair1/PHY/defs_gNB.h"
#include "openair1/PHY/defs_gNB.h"
#include "NR_MIB.h"
#include "NR_MIB.h"
#include "RRC/NR/nr_rrc_config.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "../../../../nfapi/oai_integration/vendor_ext.h"
#include "../../../../nfapi/oai_integration/vendor_ext.h"
/* Softmodem params */
/* Softmodem params */
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
View file @
3804e04e
...
@@ -276,6 +276,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_
...
@@ -276,6 +276,8 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, sub_frame_
nr_csi_meas_reporting
(
module_idP
,
frame
,
slot
);
nr_csi_meas_reporting
(
module_idP
,
frame
,
slot
);
nr_schedule_srs
(
module_idP
,
frame
,
slot
);
nr_schedule_srs
(
module_idP
,
frame
,
slot
);
nr_schedule_srs_secondary
(
module_idP
,
frame
,
slot
);
// This schedule RA procedure if not in phy_test mode
// This schedule RA procedure if not in phy_test mode
// Otherwise consider 5G already connected
// Otherwise consider 5G already connected
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_srs.c
View file @
3804e04e
...
@@ -476,13 +476,81 @@ static void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu,
...
@@ -476,13 +476,81 @@ static void nr_configure_srs(nfapi_nr_srs_pdu_t *srs_pdu,
vrb_map_UL
[
i
+
srs_pdu
->
bwp_start
]
|=
mask
;
vrb_map_UL
[
i
+
srs_pdu
->
bwp_start
]
|=
mask
;
}
}
static
void
nr_configure_srs_f1ap
(
nfapi_nr_srs_pdu_t
*
srs_pdu
,
int
slot
,
int
module_id
,
int
CC_id
,
NR_UE_info_t
*
UE
,
f1ap_srs_resource_set_t
*
srs_resource_set
,
f1ap_srs_resource_t
*
srs_resource
,
int
buffer_index
)
{
NR_UE_UL_BWP_t
*
current_BWP
=
&
UE
->
current_UL_BWP
;
srs_pdu
->
rnti
=
UE
->
rnti
;
srs_pdu
->
handle
=
0
;
srs_pdu
->
bwp_size
=
current_BWP
->
BWPSize
;
srs_pdu
->
bwp_start
=
current_BWP
->
BWPStart
;
srs_pdu
->
subcarrier_spacing
=
current_BWP
->
scs
;
srs_pdu
->
cyclic_prefix
=
0
;
srs_pdu
->
num_ant_ports
=
srs_resource
->
nrofSRS_Ports
;
srs_pdu
->
num_symbols
=
srs_resource
->
nrofSymbols
;
srs_pdu
->
num_repetitions
=
srs_resource
->
repetitionFactor
;
srs_pdu
->
time_start_position
=
srs_resource
->
startPosition
;
srs_pdu
->
config_index
=
srs_resource
->
c_SRS
;
srs_pdu
->
sequence_id
=
srs_resource
->
sequenceId
;
srs_pdu
->
bandwidth_index
=
srs_resource
->
b_SRS
;
srs_pdu
->
comb_size
=
srs_resource
->
transmissionComb
.
present
;
switch
(
srs_resource
->
transmissionComb
.
present
)
{
case
f1ap_transmission_comb_pr_n2
:
srs_pdu
->
comb_offset
=
srs_resource
->
transmissionComb
.
choice
.
n2
.
combOffset_n2
;
srs_pdu
->
cyclic_shift
=
srs_resource
->
transmissionComb
.
choice
.
n2
.
cyclicShift_n2
;
break
;
case
f1ap_transmission_comb_pr_n4
:
srs_pdu
->
comb_offset
=
srs_resource
->
transmissionComb
.
choice
.
n4
.
combOffset_n4
;
srs_pdu
->
cyclic_shift
=
srs_resource
->
transmissionComb
.
choice
.
n4
.
cyclicShift_n4
;
break
;
default:
LOG_W
(
NR_MAC
,
"Invalid or not implemented comb_size!
\n
"
);
}
srs_pdu
->
frequency_position
=
srs_resource
->
freqDomainPosition
;
srs_pdu
->
frequency_shift
=
srs_resource
->
freqDomainShift
;
srs_pdu
->
frequency_hopping
=
srs_resource
->
b_hop
;
srs_pdu
->
group_or_sequence_hopping
=
srs_resource
->
groupOrSequenceHopping
;
srs_pdu
->
resource_type
=
srs_resource
->
resourceType
.
present
;
srs_pdu
->
t_srs
=
srs_period
[
srs_resource
->
resourceType
.
choice
.
periodic
.
periodicity
];
srs_pdu
->
t_offset
=
srs_resource
->
resourceType
.
choice
.
periodic
.
offset
;
// TODO: This should be completed
srs_pdu
->
srs_parameters_v4
.
srs_bandwidth_size
=
m_SRS
[
srs_pdu
->
config_index
];
srs_pdu
->
srs_parameters_v4
.
usage
=
1
;
//codebook - to be checked
srs_pdu
->
srs_parameters_v4
.
report_type
[
0
]
=
1
;
srs_pdu
->
srs_parameters_v4
.
iq_representation
=
1
;
srs_pdu
->
srs_parameters_v4
.
prg_size
=
1
;
srs_pdu
->
srs_parameters_v4
.
num_total_ue_antennas
=
1
<<
srs_pdu
->
num_ant_ports
;
if
(
/*usage==*/
1
)
{
srs_pdu
->
beamforming
.
trp_scheme
=
0
;
srs_pdu
->
beamforming
.
num_prgs
=
m_SRS
[
srs_pdu
->
config_index
];
srs_pdu
->
beamforming
.
prg_size
=
1
;
}
uint16_t
*
vrb_map_UL
=
&
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
vrb_map_UL
[
buffer_index
*
MAX_BWP_SIZE
];
uint64_t
mask
=
SL_to_bitmap
(
13
-
srs_pdu
->
time_start_position
,
srs_pdu
->
num_symbols
);
for
(
int
i
=
0
;
i
<
srs_pdu
->
bwp_size
;
++
i
)
vrb_map_UL
[
i
+
srs_pdu
->
bwp_start
]
|=
mask
;
}
static
void
nr_fill_nfapi_srs
(
int
module_id
,
static
void
nr_fill_nfapi_srs
(
int
module_id
,
int
CC_id
,
int
CC_id
,
NR_UE_info_t
*
UE
,
NR_UE_info_t
*
UE
,
int
frame
,
int
frame
,
int
slot
,
int
slot
,
NR_SRS_ResourceSet_t
*
srs_resource_set
,
void
*
srs_resource_set
,
NR_SRS_Resource_t
*
srs_resource
)
void
*
srs_resource
,
int
is_f1ap
)
{
{
int
index
=
ul_buffer_index
(
frame
,
slot
,
UE
->
current_UL_BWP
.
scs
,
RC
.
nrmac
[
module_id
]
->
UL_tti_req_ahead_size
);
int
index
=
ul_buffer_index
(
frame
,
slot
,
UE
->
current_UL_BWP
.
scs
,
RC
.
nrmac
[
module_id
]
->
UL_tti_req_ahead_size
);
...
@@ -496,7 +564,26 @@ static void nr_fill_nfapi_srs(int module_id,
...
@@ -496,7 +564,26 @@ static void nr_fill_nfapi_srs(int module_id,
memset
(
srs_pdu
,
0
,
sizeof
(
nfapi_nr_srs_pdu_t
));
memset
(
srs_pdu
,
0
,
sizeof
(
nfapi_nr_srs_pdu_t
));
future_ul_tti_req
->
n_pdus
+=
1
;
future_ul_tti_req
->
n_pdus
+=
1
;
index
=
ul_buffer_index
(
frame
,
slot
,
UE
->
current_UL_BWP
.
scs
,
RC
.
nrmac
[
module_id
]
->
vrb_map_UL_size
);
index
=
ul_buffer_index
(
frame
,
slot
,
UE
->
current_UL_BWP
.
scs
,
RC
.
nrmac
[
module_id
]
->
vrb_map_UL_size
);
nr_configure_srs
(
srs_pdu
,
slot
,
module_id
,
CC_id
,
UE
,
srs_resource_set
,
srs_resource
,
index
);
//LOG_I(MAC,"nr_fill_nfapi_srs: is_f1ap %d, num_pdu %d\n",is_f1ap,future_ul_tti_req->n_pdus);
if
(
is_f1ap
)
nr_configure_srs_f1ap
(
srs_pdu
,
slot
,
module_id
,
CC_id
,
UE
,
(
f1ap_srs_resource_set_t
*
)
srs_resource_set
,
(
f1ap_srs_resource_t
*
)
srs_resource
,
index
);
else
nr_configure_srs
(
srs_pdu
,
slot
,
module_id
,
CC_id
,
UE
,
(
NR_SRS_ResourceSet_t
*
)
srs_resource_set
,
(
NR_SRS_Resource_t
*
)
srs_resource
,
index
);
}
}
/*******************************************************************
/*******************************************************************
...
@@ -584,8 +671,8 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
...
@@ -584,8 +671,8 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
// Check if UE will transmit the SRS in this frame
// Check if UE will transmit the SRS in this frame
if
((
sched_frame
*
n_slots_frame
+
sched_slot
-
offset
)
%
period
==
0
)
{
if
((
sched_frame
*
n_slots_frame
+
sched_slot
-
offset
)
%
period
==
0
)
{
LOG_D
(
NR_MAC
,
" %d.%d Scheduling SRS reception for %d.%d
\n
"
,
frame
,
slot
,
sched_frame
,
sched_slot
);
//LOG_I
(NR_MAC," %d.%d Scheduling SRS reception for %d.%d\n", frame, slot, sched_frame, sched_slot);
nr_fill_nfapi_srs
(
module_id
,
CC_id
,
UE
,
sched_frame
,
sched_slot
,
srs_resource_set
,
srs_resource
);
nr_fill_nfapi_srs
(
module_id
,
CC_id
,
UE
,
sched_frame
,
sched_slot
,
srs_resource_set
,
srs_resource
,
0
);
sched_ctrl
->
sched_srs
.
frame
=
sched_frame
;
sched_ctrl
->
sched_srs
.
frame
=
sched_frame
;
sched_ctrl
->
sched_srs
.
slot
=
sched_slot
;
sched_ctrl
->
sched_srs
.
slot
=
sched_slot
;
sched_ctrl
->
sched_srs
.
srs_scheduled
=
true
;
sched_ctrl
->
sched_srs
.
srs_scheduled
=
true
;
...
@@ -593,3 +680,86 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
...
@@ -593,3 +680,86 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
}
}
}
}
}
}
/*******************************************************************
*
* NAME : nr_schedule_srs_secondary
*
* PARAMETERS : module id
* frame number for possible SRS reception
*
* DESCRIPTION : It informs the PHY layer that has an SRS to receive.
* To be used at secondary gNB (where UE is not connected).
* Only for periodic scheduling yet.
*
*********************************************************************/
void
nr_schedule_srs_secondary
(
int
module_id
,
frame_t
frame
,
int
slot
)
{
const
int
CC_id
=
0
;
// lets configure SRS on the initial BWP. This will only work for cell sizes of 60MHz or lower.
// for anything else this needs to be adapted to use the dedicated BWP.
NR_ServingCellConfigCommon_t
*
scc
=
RC
.
nrmac
[
module_id
]
->
common_channels
[
CC_id
].
ServingCellConfigCommon
;
//NR_SRS_Config_t *srs_config = RC.nrmac[module_id]->setup_srs_config[0]->choice.setup;
if
(
!
scc
)
{
LOG_W
(
MAC
,
"no scc, returning
\n
"
);
return
;
}
f1ap_measurement_req_t
*
f1ap_meas_req
=
RC
.
nrmac
[
module_id
]
->
f1ap_meas_req
;
if
(
!
f1ap_meas_req
)
{
LOG_D
(
MAC
,
"No F1AP Measurement Request, skipping SRS measurement
\n
"
);
return
;
}
LOG_D
(
MAC
,
"Got F1AP Measurement Request, programming SRS measurement
\n
"
);
f1ap_srs_configuration_t
*
srs_configuration
=
&
f1ap_meas_req
->
srs_configuration
;
if
(
!
srs_configuration
)
{
LOG_I
(
MAC
,
"no srs configuration in F1AP measurement reuqest, skipping
\n
"
);
return
;
}
for
(
int
srs_idx
=
0
;
srs_idx
<
srs_configuration
->
srs_carrier_list
.
srs_carrier_list_length
;
srs_idx
++
)
{
f1ap_srs_config_t
*
sRSConfig
=
&
srs_configuration
->
srs_carrier_list
.
srs_carrier_list_item
[
srs_idx
].
active_ul_bwp
.
sRSConfig
;
if
(
sRSConfig
->
sRSResource_List
.
srs_resource_list_length
!=
1
||
sRSConfig
->
sRSResourceSet_List
.
srs_resource_set_list_length
!=
1
)
{
LOG_I
(
MAC
,
"Need exactly 1 SRS Resoure and 1 SRS Resource set in F1AP measurment request
\n
"
);
return
;
}
f1ap_srs_resource_t
*
srs_resource
=
sRSConfig
->
sRSResource_List
.
srs_resource
;
f1ap_srs_resource_set_t
*
srs_resource_set
=
sRSConfig
->
sRSResourceSet_List
.
srs_resource_set
;
if
(
srs_resource
==
NULL
||
srs_resource_set
==
NULL
)
{
LOG_I
(
MAC
,
"SRS resource or resource set is Null
\n
"
);
return
;
}
NR_BWP_t
ubwp
=
scc
->
uplinkConfigCommon
->
initialUplinkBWP
->
genericParameters
;
//we have to add 1 here since the first entry of the field srs_period corresponds to the RRC enmum NR_SRS_PeriodicityAndOffset_PR_NOTHING which does not exist in the NRPPA or F1AP structure.
uint16_t
period
=
srs_period
[
srs_resource
->
resourceType
.
choice
.
periodic
.
periodicity
+
1
];
uint16_t
offset
=
srs_resource
->
resourceType
.
choice
.
periodic
.
offset
;
LOG_D
(
MAC
,
"nr_schedule_srs_secondary: period %d, offset %d
\n
"
,
period
,
offset
);
int
n_slots_frame
=
nr_slots_per_frame
[
ubwp
.
subcarrierSpacing
];
NR_UE_info_t
dummy_ue_info
;
dummy_ue_info
.
current_UL_BWP
.
BWPSize
=
NRRIV2BW
(
ubwp
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
dummy_ue_info
.
current_UL_BWP
.
BWPStart
=
NRRIV2PRBOFFSET
(
ubwp
.
locationAndBandwidth
,
MAX_BWP_SIZE
);
dummy_ue_info
.
current_UL_BWP
.
scs
=
ubwp
.
subcarrierSpacing
;
dummy_ue_info
.
rnti
=
NON_UE_ASSOCIATED_SRS_DUMMY_RNTI
;
// Check if UE will transmit the SRS in this frame
//if ( ((frame - offset/n_slots_frame)*n_slots_frame)%period == 0) {
if
(
(
frame
*
n_slots_frame
+
slot
)
%
period
==
offset
)
{
LOG_I
(
NR_MAC
,
"Scheduling non-ue associated SRS measurement for %d.%d
\n
"
,
frame
,
offset
%
n_slots_frame
);
nr_fill_nfapi_srs
(
module_id
,
CC_id
,
&
dummy_ue_info
,
frame
,
offset
%
n_slots_frame
,
srs_resource_set
,
srs_resource
,
1
);
//RC.nrmac[module_id]->f1ap_meas_req = NULL;
}
}
}
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
3804e04e
...
@@ -1242,6 +1242,33 @@ void handle_nr_srs_measurements(const module_id_t module_id,
...
@@ -1242,6 +1242,33 @@ void handle_nr_srs_measurements(const module_id_t module_id,
LOG_I
(
NR_MAC
,
"srs_ind->report_type = %i
\n
"
,
srs_ind
->
report_type
);
LOG_I
(
NR_MAC
,
"srs_ind->report_type = %i
\n
"
,
srs_ind
->
report_type
);
#endif
#endif
if
(
srs_ind
->
rnti
==
NON_UE_ASSOCIATED_SRS_DUMMY_RNTI
)
{
LOG_I
(
NR_MAC
,
"Received Non-UE associated SRS with ToA %d (ns)
\n
"
,
srs_ind
->
timing_advance_offset_nsec
);
nrmac
->
meas_pos_info
.
toa_ns
=
srs_ind
->
timing_advance_offset_nsec
;
f1ap_measurement_req_t
*
req
=
nrmac
->
f1ap_meas_req
;
/* response has same type as request... */
f1ap_measurement_resp_t
resp
=
{
.
transaction_id
=
req
->
transaction_id
,
.
lmf_measurement_id
=
req
->
lmf_measurement_id
,
.
ran_measurement_id
=
req
->
ran_measurement_id
,
.
nrppa_msg_info
.
nrppa_transaction_id
=
req
->
nrppa_msg_info
.
nrppa_transaction_id
,
.
nrppa_msg_info
.
instance
=
req
->
nrppa_msg_info
.
instance
,
.
nrppa_msg_info
.
gNB_ue_ngap_id
=
req
->
nrppa_msg_info
.
gNB_ue_ngap_id
,
.
nrppa_msg_info
.
amf_ue_ngap_id
=
req
->
nrppa_msg_info
.
amf_ue_ngap_id
,
.
nrppa_msg_info
.
ue_rnti
=
req
->
nrppa_msg_info
.
ue_rnti
,
.
nrppa_msg_info
.
routing_id_buffer
=
req
->
nrppa_msg_info
.
routing_id_buffer
,
.
nrppa_msg_info
.
routing_id_length
=
req
->
nrppa_msg_info
.
routing_id_length
,
};
//call the response handler
nrmac
->
mac_rrc
.
positioning_measurement_response
(
&
resp
);
//for the moment this is all we need so return
return
;
}
NR_UE_info_t
*
UE
=
find_nr_UE
(
&
RC
.
nrmac
[
module_id
]
->
UE_info
,
srs_ind
->
rnti
);
NR_UE_info_t
*
UE
=
find_nr_UE
(
&
RC
.
nrmac
[
module_id
]
->
UE_info
,
srs_ind
->
rnti
);
if
(
!
UE
)
{
if
(
!
UE
)
{
LOG_W
(
NR_MAC
,
"Could not find UE for RNTI %04x
\n
"
,
srs_ind
->
rnti
);
LOG_W
(
NR_MAC
,
"Could not find UE for RNTI %04x
\n
"
,
srs_ind
->
rnti
);
...
@@ -1255,9 +1282,6 @@ void handle_nr_srs_measurements(const module_id_t module_id,
...
@@ -1255,9 +1282,6 @@ void handle_nr_srs_measurements(const module_id_t module_id,
return
;
return
;
}
}
UE
->
ue_pos_info
.
toa_ns
=
srs_ind
->
timing_advance_offset_nsec
;
UE
->
ue_pos_info
.
frame
=
frame
;
UE
->
ue_pos_info
.
slot
=
slot
;
gNB_MAC_INST
*
nr_mac
=
RC
.
nrmac
[
module_id
];
gNB_MAC_INST
*
nr_mac
=
RC
.
nrmac
[
module_id
];
NR_mac_stats_t
*
stats
=
&
UE
->
mac_stats
;
NR_mac_stats_t
*
stats
=
&
UE
->
mac_stats
;
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
3804e04e
...
@@ -164,6 +164,8 @@ int get_pucch_resourceid(NR_PUCCH_Config_t *pucch_Config, int O_uci, int pucch_r
...
@@ -164,6 +164,8 @@ int get_pucch_resourceid(NR_PUCCH_Config_t *pucch_Config, int O_uci, int pucch_r
void
nr_schedule_srs
(
int
module_id
,
frame_t
frame
,
int
slot
);
void
nr_schedule_srs
(
int
module_id
,
frame_t
frame
,
int
slot
);
void
nr_schedule_srs_secondary
(
int
module_id
,
frame_t
frame
,
int
UE_id
);
void
nr_csirs_scheduling
(
int
Mod_idP
,
frame_t
frame
,
sub_frame_t
slot
,
int
n_slots_frame
,
nfapi_nr_dl_tti_request_t
*
DL_req
);
void
nr_csirs_scheduling
(
int
Mod_idP
,
frame_t
frame
,
sub_frame_t
slot
,
int
n_slots_frame
,
nfapi_nr_dl_tti_request_t
*
DL_req
);
void
nr_csi_meas_reporting
(
int
Mod_idP
,
void
nr_csi_meas_reporting
(
int
Mod_idP
,
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
View file @
3804e04e
...
@@ -828,7 +828,7 @@ void positioning_measurement_request(const f1ap_measurement_req_t *req)
...
@@ -828,7 +828,7 @@ void positioning_measurement_request(const f1ap_measurement_req_t *req)
// move this to the response function
// move this to the response function
/* response has same type as request... */
/* response has same type as request... */
f1ap_measurement_resp_t
resp
=
{
/*
f1ap_measurement_resp_t resp = {
.transaction_id = req->transaction_id,
.transaction_id = req->transaction_id,
.lmf_measurement_id = req->lmf_measurement_id,
.lmf_measurement_id = req->lmf_measurement_id,
.ran_measurement_id = req->ran_measurement_id,
.ran_measurement_id = req->ran_measurement_id,
...
@@ -839,11 +839,12 @@ void positioning_measurement_request(const f1ap_measurement_req_t *req)
...
@@ -839,11 +839,12 @@ void positioning_measurement_request(const f1ap_measurement_req_t *req)
.nrppa_msg_info.ue_rnti = req->nrppa_msg_info.ue_rnti,
.nrppa_msg_info.ue_rnti = req->nrppa_msg_info.ue_rnti,
.nrppa_msg_info.routing_id_buffer = req->nrppa_msg_info.routing_id_buffer,
.nrppa_msg_info.routing_id_buffer = req->nrppa_msg_info.routing_id_buffer,
.nrppa_msg_info.routing_id_length = req->nrppa_msg_info.routing_id_length,
.nrppa_msg_info.routing_id_length = req->nrppa_msg_info.routing_id_length,
};
};
*/
// call the response handler
// call the response handler
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
req
->
nrppa_msg_info
.
instance
];
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
req
->
nrppa_msg_info
.
instance
];
mac
->
mac_rrc
.
positioning_measurement_response
(
&
resp
);
//mac->mac_rrc.positioning_measurement_response(&resp);
mac
->
f1ap_meas_req
=
req
;
}
}
void
positioning_measurement_update
(
const
f1ap_measurement_update_t
*
update
)
void
positioning_measurement_update
(
const
f1ap_measurement_update_t
*
update
)
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_ul_direct.c
View file @
3804e04e
...
@@ -703,10 +703,12 @@ static void positioning_activation_response(const f1ap_positioning_activation_re
...
@@ -703,10 +703,12 @@ static void positioning_activation_response(const f1ap_positioning_activation_re
// IE 9.2.2 CriticalityDiagnostics (O)
// IE 9.2.2 CriticalityDiagnostics (O)
// IE SystemFrameNumber (O)
// IE SystemFrameNumber (O)
// here we will send the preconfigured info as changing on fly is not possible
// here we will send the preconfigured info as changing on fly is not possible
f1ap_msg
->
system_frame_number
=
UE
->
ue_pos_info
.
frame
;
// TODO retireve the actual values and fill it
//f1ap_msg->system_frame_number=UE->ue_pos_info.frame; // TODO retireve the actual values and fill it
f1ap_msg
->
system_frame_number
=
0
;
// IE SlotNumber (O)
// IE SlotNumber (O)
// here we will send the preconfigured info as changing on fly is not possible
// here we will send the preconfigured info as changing on fly is not possible
f1ap_msg
->
slot_number
=
UE
->
ue_pos_info
.
slot
;
// TODO retireve the actual values and fill it
//f1ap_msg->slot_number=UE->ue_pos_info.slot; // TODO retireve the actual values and fill it
f1ap_msg
->
slot_number
=
0
;
}
}
}
}
itti_send_msg_to_task
(
TASK_RRC_GNB
,
0
,
msg
);
itti_send_msg_to_task
(
TASK_RRC_GNB
,
0
,
msg
);
...
@@ -880,11 +882,15 @@ static void positioning_measurement_response(const f1ap_measurement_resp_t *resp
...
@@ -880,11 +882,15 @@ static void positioning_measurement_response(const f1ap_measurement_resp_t *resp
f1ap_measured_results_value_t
*
MeasResVal
=
&
posMeasRes
->
pos_measurement_result_item
->
measuredResultsValue
;
f1ap_measured_results_value_t
*
MeasResVal
=
&
posMeasRes
->
pos_measurement_result_item
->
measuredResultsValue
;
MeasResVal
->
present
=
f1ap_measured_results_value_pr_ul_rtoa
;
MeasResVal
->
present
=
f1ap_measured_results_value_pr_ul_rtoa
;
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
present
=
f1ap_ulrtoameas_pr_k1
;
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
present
=
f1ap_ulrtoameas_pr_k1
;
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
choice
.
k1
=
0
;
if
(
mac
->
meas_pos_info
.
toa_ns
>=
0
)
//(int32_t)(((int64_t)UE->ue_pos_info.toa_ns * (int64_t)T_inv) / T_ns_inv);
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
choice
.
k1
=
(
int32_t
)(((
int64_t
)
mac
->
meas_pos_info
.
toa_ns
*
(
int64_t
)
T_inv
)
/
T_ns_inv
);
else
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
choice
.
k1
=
0
;
LOG_I
(
MAC
,
LOG_I
(
MAC
,
"Extracting uL_RTOA info of MeasurementResponse for ue rnti= %04x, k1=%d
\n
"
,
"Extracting uL_RTOA info of MeasurementResponse for ue rnti= %04x, k1=%d
\n
"
,
resp
->
nrppa_msg_info
.
ue_rnti
,
0
);
resp
->
nrppa_msg_info
.
ue_rnti
,
MeasResVal
->
choice
.
uL_RTOA
.
uL_RTOA_MeasurementItem
.
choice
.
k1
);
// TODO IE timeStamp.measurementTime
// TODO IE timeStamp.measurementTime
posMeasRes
->
pos_measurement_result_item
->
timeStamp
.
systemFrameNumber
=
mac
->
frame
;
posMeasRes
->
pos_measurement_result_item
->
timeStamp
.
systemFrameNumber
=
mac
->
frame
;
// TODO IE timeStamp.slotIndex
// TODO IE timeStamp.slotIndex
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
3804e04e
...
@@ -43,6 +43,8 @@
...
@@ -43,6 +43,8 @@
#include <string.h>
#include <string.h>
#include <pthread.h>
#include <pthread.h>
#define NON_UE_ASSOCIATED_SRS_DUMMY_RNTI 0xcafe
#define NR_SCHED_LOCK(lock) \
#define NR_SCHED_LOCK(lock) \
do { \
do { \
int rc = pthread_mutex_lock(lock); \
int rc = pthread_mutex_lock(lock); \
...
@@ -682,11 +684,11 @@ typedef struct nr_mac_rrc_ul_if_s {
...
@@ -682,11 +684,11 @@ typedef struct nr_mac_rrc_ul_if_s {
typedef
struct
{
typedef
struct
{
uint8_t
pos_report_characteristics
;
// (M) // ondemand = 0, periodic = 1
uint8_t
pos_report_characteristics
;
// (M) // ondemand = 0, periodic = 1
uint8_t
pos_measurement_periodicity
;
//(C) if report characteristics periodic ms120=0, ms240=1, ms480=2, ms640=3, ms1024=4, ms20
uint8_t
pos_measurement_periodicity
;
//(C) if report characteristics periodic ms120=0, ms240=1, ms480=2, ms640=3, ms1024=4, ms20
uint8_t
pos_report_
ondemand_pending
;
// (C) if report characteristics ondemand the request sets this to 1 and once response is sent its set back to 0
uint8_t
pos_report_
valid
;
// (C) if report characteristics ondemand the request sets this to 1 and once response is sent its set back to 0
int16_t
toa_ns
;
// for the moment we only support toa measurements, others can be added here later
int16_t
toa_ns
;
// for the moment we only support toa measurements, others can be added here later
uint32_t
frame
;
// for srs activation response
}
NR_meas_pos_t
;
uint32_t
slot
;
// for srs activation response
}
NR_UE_pos_t
;
/*! \brief UE list used by gNB to order UEs/CC for scheduling*/
/*! \brief UE list used by gNB to order UEs/CC for scheduling*/
typedef
struct
{
typedef
struct
{
...
@@ -712,7 +714,6 @@ typedef struct {
...
@@ -712,7 +714,6 @@ typedef struct {
float
ul_thr_ue
;
float
ul_thr_ue
;
float
dl_thr_ue
;
float
dl_thr_ue
;
long
pdsch_HARQ_ACK_Codebook
;
long
pdsch_HARQ_ACK_Codebook
;
NR_UE_pos_t
ue_pos_info
;
}
NR_UE_info_t
;
}
NR_UE_info_t
;
typedef
struct
{
typedef
struct
{
...
@@ -860,7 +861,10 @@ typedef struct gNB_MAC_INST_s {
...
@@ -860,7 +861,10 @@ typedef struct gNB_MAC_INST_s {
int16_t
slot
;
int16_t
slot
;
pthread_mutex_t
sched_lock
;
pthread_mutex_t
sched_lock
;
//holds the SRS config for NRPPa measurement request
f1ap_measurement_req_t
*
f1ap_meas_req
;
//holds measurement response (non-ue associated)
NR_meas_pos_t
meas_pos_info
;
}
gNB_MAC_INST
;
}
gNB_MAC_INST
;
#endif
/*__LAYER2_NR_MAC_GNB_H__ */
#endif
/*__LAYER2_NR_MAC_GNB_H__ */
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
3804e04e
...
@@ -2424,7 +2424,7 @@ static void rrc_CU_process_measurement_request(f1ap_measurement_req_t *req)
...
@@ -2424,7 +2424,7 @@ static void rrc_CU_process_measurement_request(f1ap_measurement_req_t *req)
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
gNB_RRC_UE_t *UE = &ue_context_p->ue_context;
// f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
// f1_ue_data_t ue_data = cu_get_f1_ue_data(UE->rrc_ue_id);
req->nrppa_msg_info.ue_rnti = UE->rnti;*/
req->nrppa_msg_info.ue_rnti = UE->rnti;*/
req
->
nrppa_msg_info
.
ue_rnti
=
-
1
;
req
->
nrppa_msg_info
.
ue_rnti
=
NON_UE_ASSOCIATED_SRS_DUMMY_RNTI
;
// req->gNB_DU_ue_id = ue_data.secondary_ue;
// req->gNB_DU_ue_id = ue_data.secondary_ue;
// req->gNB_CU_ue_id = UE->rrc_ue_id;
// req->gNB_CU_ue_id = UE->rrc_ue_id;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment