Commit ae21d9a9 authored by Florian Kaltenberger's avatar Florian Kaltenberger Committed by Florian Kaltenberger

storing relevant measurement request paramters properly in MAC

parent 7af01ea5
......@@ -694,11 +694,13 @@ void nr_schedule_srs(int module_id, frame_t frame, int slot)
*********************************************************************/
void nr_schedule_srs_secondary(int module_id, frame_t frame, int slot) {
if (RC.nrmac[module_id]->do_srs_meas==0)
return;
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;
......@@ -707,58 +709,30 @@ void nr_schedule_srs_secondary(int module_id, frame_t frame, int slot) {
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;
}
f1ap_srs_resource_t *srs_resource = &RC.nrmac[module_id]->srs_resource;
f1ap_srs_resource_set_t *srs_resource_set = &RC.nrmac[module_id]->srs_resource_set;
for (int srs_idx = 0; srs_idx<srs_configuration->srs_carrier_list.srs_carrier_list_length; srs_idx++) {
NR_BWP_t ubwp = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
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;
}
//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;
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;
}
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]->do_srs_meas = 0;
}
}
......@@ -1262,21 +1262,18 @@ void handle_nr_srs_measurements(const module_id_t module_id,
}
}
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,
.transaction_id = nrmac->f1ap_meas_resp_header.transaction_id,
.lmf_measurement_id = nrmac->f1ap_meas_resp_header.lmf_measurement_id,
.ran_measurement_id = nrmac->f1ap_meas_resp_header.ran_measurement_id,
.nrppa_msg_info.nrppa_transaction_id = nrmac->nrppa_msg_info.nrppa_transaction_id,
.nrppa_msg_info.instance = nrmac->nrppa_msg_info.instance,
.nrppa_msg_info.gNB_ue_ngap_id = nrmac->nrppa_msg_info.gNB_ue_ngap_id,
.nrppa_msg_info.amf_ue_ngap_id = nrmac->nrppa_msg_info.amf_ue_ngap_id,
.nrppa_msg_info.ue_rnti = nrmac->nrppa_msg_info.ue_rnti,
.nrppa_msg_info.routing_id_buffer = nrmac->nrppa_msg_info.routing_id_buffer,
.nrppa_msg_info.routing_id_length = nrmac->nrppa_msg_info.routing_id_length,
};
......
......@@ -826,13 +826,35 @@ void positioning_measurement_request(const f1ap_measurement_req_t *req)
AssertFatal(false, "Not implemented\n");
}
gNB_MAC_INST *mac = RC.nrmac[req->nrppa_msg_info.instance];
//store SRS config from measurement in MAC
f1ap_srs_configuration_t *srs_configuration = &req->srs_configuration;
if (!srs_configuration) {
LOG_I(MAC, "no srs configuration in F1AP measurement reuqest, skipping\n");
return;
}
if (srs_configuration->srs_carrier_list.srs_carrier_list_length !=1) {
LOG_I(MAC, "expecting exactly 1 item in srs carrier list, skipping\n");
}
//store the whole measurement request (incl SRS config) from measurement in MAC
//TODO: we have to copy the whole memory of this nested structure
mac->f1ap_meas_req = req;
f1ap_srs_config_t *sRSConfig = &srs_configuration->srs_carrier_list.srs_carrier_list_item[0].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;
}
gNB_MAC_INST *mac = RC.nrmac[req->nrppa_msg_info.instance];
mac->srs_resource = *sRSConfig->sRSResource_List.srs_resource;
mac->srs_resource_set = *sRSConfig->sRSResourceSet_List.srs_resource_set;
mac->f1ap_meas_resp_header.transaction_id = req->transaction_id;
mac->f1ap_meas_resp_header.lmf_measurement_id = req->lmf_measurement_id;
mac->f1ap_meas_resp_header.ran_measurement_id = req->ran_measurement_id;
mac->nrppa_msg_info = req->nrppa_msg_info;
mac->do_srs_meas = 1;
}
void positioning_measurement_update(const f1ap_measurement_update_t *update)
......
......@@ -683,6 +683,12 @@ typedef struct nr_mac_rrc_ul_if_s {
positioning_measurement_failure_indication_func_t positioning_measurement_failure_indication;
} nr_mac_rrc_ul_if_t;
typedef struct {
uint8_t transaction_id; // IE 9.3.1.23 (M)
uint16_t lmf_measurement_id; // (M)
uint16_t ran_measurement_id; // (M)
} f1ap_meas_resp_header_t;
typedef struct {
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
......@@ -863,7 +869,13 @@ typedef struct gNB_MAC_INST_s {
pthread_mutex_t sched_lock;
//holds the SRS config for NRPPa measurement request
f1ap_measurement_req_t *f1ap_meas_req;
//f1ap_measurement_req_t *f1ap_meas_req;
uint8_t do_srs_meas;
f1ap_srs_resource_t srs_resource;
f1ap_srs_resource_set_t srs_resource_set;
f1ap_meas_resp_header_t f1ap_meas_resp_header;
nrppa_f1ap_info_t nrppa_msg_info;
//holds measurement response (non-ue associated)
NR_meas_pos_t meas_pos_info;
} gNB_MAC_INST;
......
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