Use command line option for sell search

There is already a command line option called 'ue-scan-carrier' which
seemed to blindly look for SSB by changing the center frequency by
+/-100Hz if the previous attempt failed. This is probably copied from
LTE and is not suitable for NR. This commit uses this option to either
1. Perform initial sync on one GSCN if the SSB position if known
2. Or scan the all GSCN (if the SSB postion is unknown)

Also, the following is done for re-synchronization
1. Scan all GSCN when UE comes back from IDLE state
2. Scan one GSCN when UE does re-estabishment

Removed dependency of lte-softmodem.h in nr-softmodem.c.
CONFIG_HLP_UESCAN is declared also in lte-softmodem.h.
This commit is contained in:
Sakthivel Velumani
2024-05-30 10:20:55 -04:00
parent 26aa7c2e33
commit ca93e68410
9 changed files with 51 additions and 45 deletions
+5 -2
View File
@@ -1420,6 +1420,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
NR_UE_MAC_reset_cause_t cause)
{
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
fapi_nr_synch_request_t sync_req = {.target_Nid_cell = -1, .ssb_bw_scan = true};
switch (cause) {
case GO_TO_IDLE:
reset_ra(mac, true);
@@ -1427,7 +1428,7 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
nr_ue_init_mac(mac);
nr_ue_mac_default_configs(mac);
// new sync but no target cell id -> -1
nr_ue_send_synch_request(mac, module_id, 0, -1);
nr_ue_send_synch_request(mac, module_id, 0, &sync_req);
break;
case DETACH:
LOG_A(NR_MAC, "Received detach indication\n");
@@ -1448,7 +1449,9 @@ void nr_rrc_mac_config_req_reset(module_id_t module_id,
nr_ue_reset_sync_state(mac);
release_mac_configuration(mac, cause);
// new sync with old cell ID (re-establishment on the same cell)
nr_ue_send_synch_request(mac, module_id, 0, mac->physCellId);
sync_req.target_Nid_cell = mac->physCellId;
sync_req.ssb_bw_scan = false;
nr_ue_send_synch_request(mac, module_id, 0, &sync_req);
break;
default:
AssertFatal(false, "Invalid MAC reset cause %d\n", cause);
+1 -1
View File
@@ -295,7 +295,7 @@ void prepare_msg4_feedback(NR_UE_MAC_INST_t *mac, int pid, int ack_nack);
void configure_initial_pucch(PUCCH_sched_t *pucch, int res_ind);
void release_PUCCH_SRS(NR_UE_MAC_INST_t *mac);
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac);
void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, int cell_id);
void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, const fapi_nr_synch_request_t *sync_req);
/**
* @brief Get UE sync state
+2 -2
View File
@@ -98,12 +98,12 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac)
mac->scheduling_info.prohibitPHR_Timer = NR_PHR_Config__phr_ProhibitTimer_sf10;
}
void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, int cell_id)
void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int cc_id, const fapi_nr_synch_request_t *sync_req)
{
// Sending to PHY a request to resync
mac->synch_request.Mod_id = module_id;
mac->synch_request.CC_id = cc_id;
mac->synch_request.synch_req.target_Nid_cell = cell_id;
mac->synch_request.synch_req = *sync_req;
mac->if_module->synch_request(&mac->synch_request);
}