Commit ef1decce authored by cig's avatar cig

Introduced RA type @ UE

- whether it is 2-step or 4-step RA
- added checks on CFRA and 2-step RA pointer members
- introduced enum and PRACH resources struct member
parent 1d2d96f3
...@@ -154,6 +154,11 @@ typedef enum { ...@@ -154,6 +154,11 @@ typedef enum {
MOD_QAM256 MOD_QAM256
}nr_mod_t; }nr_mod_t;
typedef enum {
RA_2STEP = 0,
RA_4STEP
} nr_ra_type_e;
typedef struct { typedef struct {
/// Size of first RBG /// Size of first RBG
uint8_t start_size; uint8_t start_size;
...@@ -221,6 +226,8 @@ typedef struct { ...@@ -221,6 +226,8 @@ typedef struct {
uint8_t RA_PREAMBLE_BACKOFF; uint8_t RA_PREAMBLE_BACKOFF;
/// ///
uint8_t RA_SCALING_FACTOR_BI; uint8_t RA_SCALING_FACTOR_BI;
/// Indicating whether it is 2-step or 4-step RA
uint8_t RA_TYPE;
/// ///
uint8_t RA_PCMAX; uint8_t RA_PCMAX;
/// Corresponding RA-RNTI for UL-grant /// Corresponding RA-RNTI for UL-grant
......
...@@ -106,9 +106,20 @@ void nr_get_prach_resources(module_id_t mod_id, ...@@ -106,9 +106,20 @@ void nr_get_prach_resources(module_id_t mod_id,
// - available SSB with SS-RSRP above rsrp-ThresholdSSB: SSB selection // - available SSB with SS-RSRP above rsrp-ThresholdSSB: SSB selection
// - available CSI-RS with CSI-RSRP above rsrp-ThresholdCSI-RS: CSI-RS selection // - available CSI-RS with CSI-RSRP above rsrp-ThresholdCSI-RS: CSI-RS selection
// - network controlled Mobility // - network controlled Mobility
uint8_t cfra_ssb_resource_idx = 0;
prach_resources->ra_PreambleIndex = rach_ConfigDedicated->cfra->resources.choice.ssb->ssb_ResourceList.list.array[cfra_ssb_resource_idx]->ra_PreambleIndex; if (rach_ConfigDedicated->cfra){
LOG_D(MAC, "[RAPROC] - Selected RA preamble index %d for contention-free random access procedure... \n", prach_resources->ra_PreambleIndex); uint8_t cfra_ssb_resource_idx = 0;
prach_resources->ra_PreambleIndex = rach_ConfigDedicated->cfra->resources.choice.ssb->ssb_ResourceList.list.array[cfra_ssb_resource_idx]->ra_PreambleIndex;
LOG_D(MAC, "In %s: selected RA preamble index %d for contention-free random access procedure\n", __FUNCTION__, prach_resources->ra_PreambleIndex);
}
if (rach_ConfigDedicated->ext1){
if (rach_ConfigDedicated->ext1->cfra_TwoStep_r16){
LOG_D(MAC, "In %s: 2-step RA type...\n", __FUNCTION__);
prach_resources->RA_TYPE = RA_2STEP;
}
}
} else { } else {
//////////* Contention-based RA preamble selection *////////// //////////* Contention-based RA preamble selection *//////////
// todo: // todo:
...@@ -440,6 +451,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -440,6 +451,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
prach_resources->RA_PREAMBLE_BACKOFF = 0; prach_resources->RA_PREAMBLE_BACKOFF = 0;
prach_resources->RA_SCALING_FACTOR_BI = 1; prach_resources->RA_SCALING_FACTOR_BI = 1;
prach_resources->RA_PCMAX = 0; // currently hardcoded to 0 prach_resources->RA_PCMAX = 0; // currently hardcoded to 0
prach_resources->RA_TYPE = RA_4STEP;
payload = (uint8_t*) &mac->CCCH_pdu.payload; payload = (uint8_t*) &mac->CCCH_pdu.payload;
......
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