WIP: nrarfcn: Teach dl2ssb to take cell bandwidth into account
Joanne reports that
When we choose DL NR ARFCN 720668 with bandwidth set to 20 MHz (4800.02
MHz to 4820.02 MHz), xlte chooses SSB NR ARFCN 721824 (4827.360 MHz),
which is invalid because it is outside the channel bandwidth. With this
DL NR ARFCN, Amarisoft chooses SSB NR ARFCN 720384 (4805.760 MHz) which
is valid.
This problem is due to that in b8065120 (nrarfcn: New package to do computations with NR bands, frequencies and NR-ARFCN numbers.) I established dl2ssb() to take only dl_nr_arfcn and band as arguments without taking cell bandwidth into account at all.
-> Adjust dl2ssb to take cell bandwidth into account as well, and if the bandwidth is specified limit the search for SSB to DLfreq ± bandwidth/2.
I do not quickly see offhand how to modify search algorithm to yield that ssb=720384 and also to stay backward compatible. So I did the simplest modification of also searching for ssb in backward direction after initially searching in exactly the same way as before to preserve established behaviour to stay compatible with tests and everything else. For the 720668/20Mhz that yields 720288 (4804.32 MHz) with 30KHz max ssb_scs which is also ok in my view.
/reported-by @jhuge
/reported-on !11 (comment 248055)