diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 7fee692f08..095101fb89 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -302,39 +302,39 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp) } -static const eutra_band_t eutra_bands[] = { - {1, 1920000, 1980000, 2110000, 2170000, FDD}, - {2, 1850000, 1910000, 1930000, 1990000, FDD}, - {3, 1710000, 1785000, 1805000, 1880000, FDD}, - {5, 824000, 849000, 869000, 894000, FDD}, - {7, 2500000, 2570000, 2620000, 2690000, FDD}, - {8, 880000, 915000, 925000, 960000, FDD}, - {12, 698000, 716000, 728000, 746000, FDD}, - {20, 832000, 862000, 791000, 821000, FDD}, - {25, 1850000, 1915000, 1930000, 1995000, FDD}, - {28, 703000, 758000, 758000, 813000, FDD}, - {34, 2010000, 2025000, 2010000, 2025000, TDD}, - {38, 2570000, 2620000, 2570000, 2630000, TDD}, - {39, 1880000, 1920000, 1880000, 1920000, TDD}, - {40, 2300000, 2400000, 2300000, 2400000, TDD}, - {41, 2496000, 2690000, 2496000, 2690000, TDD}, - {50, 1432000, 1517000, 1432000, 1517000, TDD}, - {51, 1427000, 1432000, 1427000, 1432000, TDD}, - {66, 1710000, 1780000, 2110000, 2200000, FDD}, - {70, 1695000, 1710000, 1995000, 2020000, FDD}, - {71, 663000, 698000, 617000, 652000, FDD}, - {74, 1427000, 1470000, 1475000, 1518000, FDD}, - {75, 000, 000, 1432000, 1517000, FDD}, - {76, 000, 000, 1427000, 1432000, FDD}, - {77, 3300000, 4200000, 3300000, 4200000, TDD}, - {78, 3300000, 3800000, 3300000, 3800000, TDD}, - {79, 4400000, 5000000, 4400000, 5000000, TDD}, - {80, 1710000, 1785000, 000, 000, FDD}, - {81, 860000, 915000, 000, 000, FDD}, - {82, 832000, 862000, 000, 000, FDD}, - {83, 703000, 748000, 000, 000, FDD}, - {84, 1920000, 1980000, 000, 000, FDD}, - {86, 1710000, 1785000, 000, 000, FDD} +nr_bandentry_t nr_bandtable[] = { + {1, 1920000, 1980000, 2110000, 2170000, 20, 422000}, + {2, 1850000, 1910000, 1930000, 1990000, 20, 386000}, + {3, 1710000, 1785000, 1805000, 1880000, 20, 361000}, + {5, 824000, 849000, 869000, 894000, 20, 173800}, + {7, 2500000, 2570000, 2620000, 2690000, 20, 524000}, + {8, 880000, 915000, 925000, 960000, 20, 185000}, + {12, 698000, 716000, 728000, 746000, 20, 145800}, + {20, 832000, 862000, 791000, 821000, 20, 158200}, + {25, 1850000, 1915000, 1930000, 1995000, 20, 386000}, + {28, 703000, 758000, 758000, 813000, 20, 151600}, + {34, 2010000, 2025000, 2010000, 2025000, 20, 402000}, + {38, 2570000, 2620000, 2570000, 2630000, 20, 514000}, + {39, 1880000, 1920000, 1880000, 1920000, 20, 376000}, + {40, 2300000, 2400000, 2300000, 2400000, 20, 460000}, + {41, 2496000, 2690000, 2496000, 2690000, 3, 499200}, + {50, 1432000, 1517000, 1432000, 1517000, 20, 286400}, + {51, 1427000, 1432000, 1427000, 1432000, 20, 285400}, + {66, 1710000, 1780000, 2110000, 2200000, 20, 422000}, + {70, 1695000, 1710000, 1995000, 2020000, 20, 399000}, + {71, 663000, 698000, 617000, 652000, 20, 123400}, + {74, 1427000, 1470000, 1475000, 1518000, 20, 295000}, + {75, 000, 000, 1432000, 1517000, 20, 286400}, + {76, 000, 000, 1427000, 1432000, 20, 285400}, + {77, 3300000, 4200000, 3300000, 4200000, 1, 620000}, + {78, 3300000, 3800000, 3300000, 3800000, 1, 620000}, + {79, 4400000, 5000000, 4400000, 5000000, 2, 693334}, + {80, 1710000, 1785000, 000, 000, 20, 342000}, + {81, 860000, 915000, 000, 000, 20, 176000}, + {82, 832000, 862000, 000, 000, 20, 166400}, + {83, 703000, 748000, 000, 000, 20, 140600}, + {84, 1920000, 1980000, 000, 000, 20, 384000}, + {86, 1710000, 1785000, 000, 000, 20, 342000} }; int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type) { @@ -342,14 +342,17 @@ int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *cu int ind; int64_t dl_freq_khz = downlink_frequency/1000; for ( ind=0; - ind < sizeof(eutra_bands) / sizeof(eutra_bands[0]); + ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]); ind++) { - *current_band = eutra_bands[ind].band; - *current_type = eutra_bands[ind].frame_type; - LOG_I(PHY, "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", ind, eutra_bands[ind].dl_min,eutra_bands[ind].ul_min); + *current_band = nr_bandtable[ind].band; + LOG_I(PHY, "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", ind, nr_bandtable[ind].dl_min,nr_bandtable[ind].ul_min); - if ( eutra_bands[ind].dl_min <= dl_freq_khz && eutra_bands[ind].dl_max >= dl_freq_khz ) { - *current_offset = (eutra_bands[ind].ul_min - eutra_bands[ind].dl_min)*1000; + if ( nr_bandtable[ind].dl_min <= dl_freq_khz && nr_bandtable[ind].dl_max >= dl_freq_khz ) { + *current_offset = (nr_bandtable[ind].ul_min - nr_bandtable[ind].dl_min)*1000; + if (*current_offset == 0) + *current_type = TDD; + else + *current_type = FDD; LOG_I( PHY, "DL frequency %"PRIu32": band %d, frame_type %d, UL frequency %"PRIu32"\n", downlink_frequency, *current_band, *current_type, downlink_frequency+*current_offset); @@ -357,7 +360,7 @@ int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *cu } } - if( ind == sizeof(eutra_bands) / sizeof(eutra_bands[0])) { + if( ind == sizeof(nr_bandtable) / sizeof(nr_bandtable[0])) { LOG_E(PHY,"Can't find EUTRA band for frequency %d\n", downlink_frequency); return(-1); } diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h index c09566c67e..605ce8c4c8 100644 --- a/openair1/PHY/defs_nr_common.h +++ b/openair1/PHY/defs_nr_common.h @@ -324,18 +324,20 @@ typedef struct NR_DL_FRAME_PARMS { #define KHz (1000UL) #define MHz (1000*KHz) -typedef struct eutra_band_s { +typedef struct nr_bandentry_s { int16_t band; - uint32_t ul_min; - uint32_t ul_max; - uint32_t dl_min; - uint32_t dl_max; - lte_frame_type_t frame_type; -} eutra_band_t; + uint64_t ul_min; + uint64_t ul_max; + uint64_t dl_min; + uint64_t dl_max; + uint64_t N_OFFs_DL; + uint64_t step_size; +} nr_bandentry_t; typedef struct band_info_s { int nbands; - eutra_band_t band_info[100]; -} band_info_t; + nr_bandentry_t band_info[100]; +} nr_band_info_t; + #endif diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 12d01981d2..1e1258e089 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -49,59 +49,9 @@ extern RAN_CONTEXT_t RC; extern void mac_top_init_gNB(void); extern uint8_t nfapi_mode; -int32_t **rxdata; -int32_t **txdata; - -typedef struct nr_bandentry_s { - int16_t band; - uint64_t ul_min; - uint64_t ul_max; - uint64_t dl_min; - uint64_t dl_max; - uint64_t N_OFFs_DL; - uint64_t step_size; -} nr_bandentry_t; - -typedef struct band_info_s { - int nbands; - nr_bandentry_t band_info[100]; -} nr_band_info_t; - -static const nr_bandentry_t nr_bandtable[] = { - {1, 1920000, 1980000, 2110000, 2170000, 20, 422000}, - {2, 1850000, 1910000, 1930000, 1990000, 20, 386000}, - {3, 1710000, 1785000, 1805000, 1880000, 20, 361000}, - {5, 824000, 849000, 869000, 894000, 20, 173800}, - {7, 2500000, 2570000, 2620000, 2690000, 20, 524000}, - {8, 880000, 915000, 925000, 960000, 20, 185000}, - {12, 698000, 716000, 728000, 746000, 20, 145800}, - {20, 832000, 862000, 791000, 821000, 20, 158200}, - {25, 1850000, 1915000, 1930000, 1995000, 20, 386000}, - {28, 703000, 758000, 758000, 813000, 20, 151600}, - {34, 2010000, 2025000, 2010000, 2025000, 20, 402000}, - {38, 2570000, 2620000, 2570000, 2630000, 20, 514000}, - {39, 1880000, 1920000, 1880000, 1920000, 20, 376000}, - {40, 2300000, 2400000, 2300000, 2400000, 20, 460000}, - {41, 2496000, 2690000, 2496000, 2690000, 3, 499200}, - {50, 1432000, 1517000, 1432000, 1517000, 20, 286400}, - {51, 1427000, 1432000, 1427000, 1432000, 20, 285400}, - {66, 1710000, 1780000, 2110000, 2200000, 20, 422000}, - {70, 1695000, 1710000, 1995000, 2020000, 20, 399000}, - {71, 663000, 698000, 617000, 652000, 20, 123400}, - {74, 1427000, 1470000, 1475000, 1518000, 20, 295000}, - {75, 000, 000, 1432000, 1517000, 20, 286400}, - {76, 000, 000, 1427000, 1432000, 20, 285400}, - {77, 3300000, 4200000, 3300000, 4200000, 1, 620000}, - {78, 3300000, 3800000, 3300000, 3800000, 1, 620000}, - {79, 4400000, 5000000, 4400000, 5000000, 2, 693334}, - {80, 1710000, 1785000, 000, 000, 20, 342000}, - {81, 860000, 915000, 000, 000, 20, 176000}, - {82, 832000, 862000, 000, 000, 20, 166400}, - {83, 703000, 748000, 000, 000, 20, 140600}, - {84, 1920000, 1980000, 000, 000, 20, 384000}, - {86, 1710000, 1785000, 000, 000, 20, 342000} -}; - +//int32_t **rxdata; +//int32_t **txdata; +extern nr_bandentry_t *nr_bandtable; uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw) { diff --git a/targets/RT/USER/nr-ue.c b/targets/RT/USER/nr-ue.c index a4afdcd6b6..362300d4d7 100644 --- a/targets/RT/USER/nr-ue.c +++ b/targets/RT/USER/nr-ue.c @@ -157,43 +157,6 @@ int32_t **txdata; #endif -band_info_t bands_to_scan; - -static const eutra_band_t eutra_bands[] = { - {1, 1920000, 1980000, 2110000, 2170000, FDD}, - {2, 1850000, 1910000, 1930000, 1990000, FDD}, - {3, 1710000, 1785000, 1805000, 1880000, FDD}, - {5, 824000, 849000, 869000, 894000, FDD}, - {7, 2500000, 2570000, 2620000, 2690000, FDD}, - {8, 880000, 915000, 925000, 960000, FDD}, - {12, 698000, 716000, 728000, 746000, FDD}, - {20, 832000, 862000, 791000, 821000, FDD}, - {25, 1850000, 1915000, 1930000, 1995000, FDD}, - {28, 703000, 758000, 758000, 813000, FDD}, - {34, 2010000, 2025000, 2010000, 2025000, TDD}, - {38, 2570000, 2620000, 2570000, 2630000, TDD}, - {39, 1880000, 1920000, 1880000, 1920000, TDD}, - {40, 2300000, 2400000, 2300000, 2400000, TDD}, - {41, 2496000, 2690000, 2496000, 2690000, TDD}, - {50, 1432000, 1517000, 1432000, 1517000, TDD}, - {51, 1427000, 1432000, 1427000, 1432000, TDD}, - {66, 1710000, 1780000, 2110000, 2200000, FDD}, - {70, 1695000, 1710000, 1995000, 2020000, FDD}, - {71, 663000, 698000, 617000, 652000, FDD}, - {74, 1427000, 1470000, 1475000, 1518000, FDD}, - {75, 000, 000, 1432000, 1517000, FDD}, - {76, 000, 000, 1427000, 1432000, FDD}, - {77, 3300000, 4200000, 3300000, 4200000, TDD}, - {78, 3300000, 3800000, 3300000, 3800000, TDD}, - {79, 4400000, 5000000, 4400000, 5000000, TDD}, - {80, 1710000, 1785000, 000, 000, FDD}, - {81, 860000, 915000, 000, 000, FDD}, - {82, 832000, 862000, 000, 000, FDD}, - {83, 703000, 748000, 000, 000, FDD}, - {84, 1920000, 1980000, 000, 000, FDD}, - {86, 1710000, 1785000, 000, 000, FDD} -}; - PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag) @@ -364,7 +327,8 @@ static void *UE_thread_synch(void *arg) { sync_mode = pbch; } else { current_band=0; - + LOG_E(PHY,"Fixme!\n"); + /* for (i=0; irf_map.card].rx_num_channels; i++) { downlink_frequency[UE->rf_map.card][UE->rf_map.chain+i] = bands_to_scan.band_info[CC_id].dl_min; uplink_frequency_offset[UE->rf_map.card][UE->rf_map.chain+i] = @@ -374,6 +338,7 @@ static void *UE_thread_synch(void *arg) { downlink_frequency[CC_id][i]+uplink_frequency_offset[CC_id][i]; openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB; } + */ } // AssertFatal(UE->rfdevice.trx_start_func(&UE->rfdevice) == 0, "Could not start the device\n"); @@ -388,6 +353,7 @@ static void *UE_thread_synch(void *arg) { AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); switch (sync_mode) { + /* case pss: LOG_I(PHY,"[SCHED][UE] Scanning band %d (%d), freq %u\n",bands_to_scan.band_info[current_band].band, current_band,bands_to_scan.band_info[current_band].dl_min+current_offset); //lte_sync_timefreq(UE,current_band,bands_to_scan.band_info[current_band].dl_min+current_offset); @@ -416,7 +382,7 @@ static void *UE_thread_synch(void *arg) { } break; - + */ case pbch: #if DISABLE_LOG_X printf("[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);